Search path not updated after snap install

Bug #1988131 reported by Heinrich Schuchardt
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)

Bug Description

Search paths are for snaps are not in effect after snap installation. Observed on and

$ sudo apt-get install hello
$ hello
Hello, world!
$ sudo snap install hello
hello 2.12 from Canonical✓ installed
$ hello
Hello, world!
$ which hello
$ /snap/bin/hello
Hello, world!
$ sudo apt-get purge hello
$ hello
-bash: /usr/bin/hello: No such file or directory

After logout and login

$ hello
Hello, world!
$ snap --version
snap 2.56-dirty
snapd 2.56-dirty
series 16
ubuntu 20.04
kernel 5.15.0-1018-generic

My expectation is that after uninstall /usr/bin/hello /snap/bin/hello is in the search path.

Tags: iso-testing
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:

tags: added: iso-testing
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This is just how bash works (I do wonder if this optimization makes any sense in 2022 but well).

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Could it be that because the snapd package is not preinstalled on Focal /snap/bin is missing in the $PATH until next login? Then the solution would be to add snapd to the distribution image like we did on Jammy.

Changed in snapd (Ubuntu):
status: New → Invalid
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Thanks for pointing at the hashing in bash. Closing as invalid.

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.