Search path not updated after snap install

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

Bug Description

Search paths are for snaps are not in effect after snap installation. Observed on
http://cdimage.ubuntu.com/ubuntu-server/focal/daily-preinstalled/20220829.1/focal-preinstalled-server-riscv64+unmatched.img.xz and
http://cdimage.ubuntu.com/ubuntu-server/focal/daily-preinstalled/20220829.1/focal-preinstalled-server-riscv64+unleashed.img.xz

$ sudo apt-get install hello
$ hello
Hello, world!
$ sudo snap install hello
hello 2.12 from Canonical✓ installed
$ hello
Hello, world!
$ which hello
/usr/bin/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:
https://iso.qa.ubuntu.com/qatracker/reports/bugs/1988131

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

This is just how bash works https://unix.stackexchange.com/questions/5609/how-do-i-clear-bashs-cache-of-paths-to-executables (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.