Removing a snap with `snap remove <app>` doesn't remove everything

Bug #1662723 reported by Josh Arenson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snappy
Invalid
Undecided
Unassigned

Bug Description

Example

1. Verify that the app isn't installed
josh@blackbox:~$ kcalc
The program 'kcalc' is currently not installed. You can install it by typing:
sudo apt install kcalc

2. Install the snap
josh@blackbox:~$ sudo snap install kcalc

// Ignore the fact that the kcalc snap is broken :-) (this occurs with all snaps)

3. Remove the snap
josh@blackbox:~$ sudo snap remove kcalc
kcalc removed

4. Verify the app isn't installed
josh@blackbox:~$ kcalc
bash: /snap/bin/kcalc: No such file or directory

Notice the behavior is inconsistent with step #1...

FURTHERMORE, installing kcalc via apt and then running it via the cli results in the same error as step #4 and the app fails to run.

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

$ mkdir foo
$ touch foo/bar.sh
$ chmod a+x foo/bar.sh
$ export PATH=$PATH:$(pwd)/foo
$ bar.sh
$ rm foo/bar.sh
$ bar.sh
-bash: /tmp/foo/bar.sh: No such file or directory

This seems to be normal behavior to me. One's shell doesn't walk the $PATH every time if it already knows where the binary is. If you start a new session you'll be back to step #1.

Revision history for this message
Seth Arnold (seth-arnold) wrote :

This is a feature of your shell. You can run `hash -r` in bash to remove all saved command locations. Other shells may vary.

Thanks

Kyle Fazzari (kyrofa)
Changed in snappy:
status: New → Invalid
Revision history for this message
Carl Patenaude Poulin (carlpaten) wrote :

Maybe the snap uninstaller could detect bash shells and run `hash $bin` for every binary associated with a package? It would be very convenient. Thanks in advance for your consideration.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Hash is a built-in shell function. It cannot be invoked in one spot to take effect in existing shell processes.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.