Ubuntu – “Error found when loading /etc/profile”

17.10ibus

The following problem persists even after upgrading from 17.10 to 18.04:

After upgrading my Kubuntu 17.04 to 17.10 by running

do-release-upgrade

I get the following error message after each reboot.

Error found when loading /etc/profile:\n\n/usr/share/im-    
config/data/21_ibus.rc line 6: /usr/bin/ibus-daemon: No such     
file or directory\n\nAs a result the session will not be configured correctly.   
You should fix the problem as soon as feasible.  

IMG:

cat -n /usr/share/im-config/data/21_ibus.rc

Line 6 reads:

IBUS_ENABLE_SYNC_MODE=0 /usr/bin/ibus-daemon --daemonize --xim --address 'unix:tmpdir=/tmp/ibus'

Unfortunately I don't know what this is. Indeed there is no file /usr/bin/ibus-daemon

Also:

bruni@Inspiron-5547:~$ sudo apt purge ibus
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ibus' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

How could I fix the problem as soon as feasible?

why is there a /usr/share/im-config/data/21_ibus.rc used when ibus is not installed?

EDIT
I guess the culprit in my /etc/profile is the file /etc/profile.d/input-method-config.sh

This reads:

# /etc/profile.d/input-method-config.sh              
#                                                    
# This is a temporary measure which works around     
# https://launchpad.net/bugs/1720250                 

if [ -z "$XDG_CURRENT_DESKTOP" -o -n "$GTK_IM_MODULE" ]; then                                             
    return                                           
fi                                                   

. /etc/X11/Xsession.d/70im-config_launch             
if [ "$IM_CONFIG_PHASE" = 1 ]; then                  
    export IM_CONFIG_PHASE=2                         
    . /usr/share/im-config/xinputrc.common           
    if [ -r "$IM_CONFIG_XINPUTRC_USR" ]; then        
        . $IM_CONFIG_XINPUTRC_USR                    
    elif [ -r "$IM_CONFIG_XINPUTRC_SYS" ]; then      
        . $IM_CONFIG_XINPUTRC_SYS                    
    fi                                               
    export XMODIFIERS                                
    export GTK_IM_MODULE                             
    export QT_IM_MODULE                              
    export QT4_IM_MODULE                             
    export CLUTTER_IM_MODULE                         
fi                                    

also:

echo $XDG_CURRENT_DESKTOP                                                
KDE                               

and

echo $GTK_IM_MODULE
ibus

I guess the problem is that $GTK_IM_MODULE returns ibus, even though ibus is not installed and not used.

Installing ibus removes the problem described in the question at hand, but leads to the more severe problem described in this question, so I removed ibus again.

Best Answer

Same thing happened to my when upgrading Mate to 17.10.

I went to System -> Preferences -> Look and Feel -> Language Support.

I'd previously selected English (UK) as my menu/windows language so on first opening this up I was prompted to upgrade, which I did.

My intention, and what I went on to do, was to change the "keyboard input method system" from "XIM" to "None". Rebooted, and that seemed to clear the error message at login without any other ill effects - so far!

My logic... I don't have ibus on my machine and I didn't see the need for it if I don't need exotic fonts. My default display manager is lightdm, so that would trip the first condition in the 21_ibus.rc file, taking me to line 6, which seems to disable the IBUS_SYNC mode and force XIM. Again, not installing ibus, so can't use the ibus-deamon, therefore I can't have the XIM option - so I switched the keyboard option, as indicated above, and that seemed to work.

To do that on KDE open a terminal and type

 im-config -n none

Suspect it's a minor configuration issue, but would welcome learning if there's a more robust solution.

Related Question