3

Previously I installed sumo and set environment variable SUMO_HOME by adding SUMO_HOME='/usr/share/sumo' in /etc/environment.

Now I have uninstalled sumo and want to unset env var SUMO_HOME, I tried this:

  1. $ unset SUMO_HOME
  2. https://askubuntu.com/a/624958/645099

As in 2nd point I opened these files:

/etc/environment
/etc/profile
~/.profile
~/.bashrc

I searched for SUMO_HOME in these files. I found it in /etc/environment as I added previously, I removed that line, restarted the system.

But again if I type: $ echo $SUMO_HOME

I get output: /usr/share/sumo

How can I permanently unset it's value ?

My commands and outputs:

  1. check sumo path and SUMO_HOME env. variable
$ whereis sumo
sumo: /usr/bin/sumo /usr/share/sumo /usr/share/man/man1/sumo.1.gz

$ echo $SUMO_HOME
/usr/share/sumo

  1. removing sumo
$sudo apt-get remove sumo

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libmono-addins-gui0.2-cil libmono-addins0.2-cil libmono-posix4.0-cil
  libmono-sharpzip4.84-cil libmono-system-core4.0-cil
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  sumo
0 upgraded, 0 newly installed, 1 to remove and 390 not upgraded.
After this operation, 53.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 233311 files and directories currently installed.)
Removing sumo (1.3.1+dfsg1-7) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.1) ...
Processing triggers for man-db (2.8.3-2) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1) ...

  1. again check sumo path and SUMO_HOME env. variable
$ whereis sumo
sumo: /usr/share/sumo

$echo $SUMO_HOME 
/usr/share/sumo
  1. unset SUMO_HOME
$ unset SUMO_HOME

$ echo $SUMO_HOME 
No outpout


  1. restart system

  2. again check sumo path and SUMO_HOME env. variable

$ whereis sumo
sumo: /usr/share/sumo

$echo $SUMO_HOME 
/usr/share/sumo

Why it's still showing same ?

  • rm /etc/profile.d/sumo.*sh – bac0n Nov 5 '19 at 8:18
1

To completely remove sumo package you need to purge it.

$ apt-get purge sumo
# Or
$ apt-get --purge remove sumo

if you only use apt-get remove, some files will still remain on your system, such as configuration files. You can find those files under /var/lib/dpkg/info.

$ cd /var/lib/dpkg/info && cat sumo.list
/etc
/etc/profile.d
/etc/profile.d/sumo.csh
/etc/profile.d/sumo.sh

( && is used to make a sequence of commands; if first command runs successful, next command will run and so on or abort the sequence if one the commands fails)

If you already purged your package, you could try to reinstall the package and purge it again, if the problem still persist you may end up dealing with the problem manually. Downloading the package allows you to check its content or extract it if needed.

$ mkdir sumo && \
     cd sumo && apt-get download sumo

$ dpkg-deb --contents sumo_1.3.1-4_amd64.deb

Or extract:

$ dpkg-deb --extract \
    sumo_1.3.1-4_amd64.deb content && ls content
etc usr

$ grep -IRni 'export SUMO'
etc/profile.d/sumo.sh:2:export SUMO_HOME=/usr/share/sumo

(\ is used to wrap long lines; purely cosmetic).

If you still do not manage to solve your problem, you will need to download the source package. (make sure you have deb-src added to your /etc/apt/sources.list).

$ mkdir sumo && \
     cd sumo && apt-get source sumo && cd sumo-*

$ grep -IRni 'export SUMO'
build/package/sumo.sh:2:export SUMO_HOME=/usr/share/sumo

$ grep -IRni 'build/package/sumo'
debian/sumo.install:1:build/package/sumo.*sh etc/profile.d

So, the file(s) causing your problem is in /etc/profile.d

$ cd /etc/profile.d && \
  rm sumo.*sh

grep options:

  • -I Process a binary file as if it did not contain matching data.
  • -R Read all files under each directory, recursively.
  • -n Prefix each line of output with the 1-based line number.
  • -i Ignore case distinctions.
| improve this answer | |
0

Before grabbing a coffee, run this command:

sudo time grep -rnw --exclude-dir={media,mnt,proc,root,run,sys,/tmp,tmpfs,var} '/' -e "SUMO_HOME"

It will search your entire partition for all occurrences of SUMO_HOME in all files. It omits files on other drives/partitions (mnt) and in temporary system directories.

On a HDD the command will take the longest time but on an SSD it with 20 GB of files it takes 3 minutes:

$ sudo time grep -rnw --exclude-dir={media,mnt,proc,root,run,sys,/tmp,tmpfs,var} '/' -e "SUMO_HOME"
[sudo] password for rick:          
Binary file /home/rick/.mozilla/firefox/9fu0cuql.default/places.sqlite matches
Binary file /home/rick/.mozilla/firefox/9fu0cuql.default/sessionstore-backups/recovery.jsonlz4 matches
Binary file /home/rick/.mozilla/firefox/9fu0cuql.default/sessionstore-backups/recovery.baklz4 matches
Binary file /home/rick/.mozilla/firefox/9fu0cuql.default/places.sqlite-wal matches
Binary file /home/rick/.cache/mozilla/firefox/9fu0cuql.default/cache2/entries/E883FF0A3B2BE2423996DA9A152C6B85AD52385C matches
53.23user 19.36system 2:09.36elapsed 56%CPU (0avgtext+0avgdata 19632maxresident)k
46678523inputs+0outputs (0major+7578minor)pagefaults 0swaps

Ignore the entries that appear from your browser as these were typed into this question and answer thread. The above single entry in .cache is unimportant but you might have other important ones.

| improve this answer | |
  • Tried this command and restarted system but again: echo $SUMO_HOME giving me : /usr/share/sumo – chunky Nov 4 '19 at 10:04
  • 1
    Can you update your question with the command and output lines? Perhaps others will spot something you missed. – WinEunuuchs2Unix Nov 4 '19 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.