Page MenuHomeSolus

/snap/bin appears twice in the PATH
Closed, ResolvedPublic

Description

I know Solus loves snaps now, but don't give them too much love, heh ?

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/snap/bin:/snap/bin

Event Timeline

$ echo $PATH
/bin:/usr/bin:/usr/local/bin:/snap/bin:/snap/bin:/snap/bin

Not as much as I do...and mine are in the wrong order as well :/

I was not sure if /usr/share/defaults/etc/profile.d/70-snapd.sh is always run with bash, so I replaced the first export line in that script with:

if [ -n "$BASH_VERSION" ]; then
    if [[ ":$PATH:" != *":/snap/bin:"* ]] ; then
        export PATH="$PATH:/snap/bin"
    fi
else
    export PATH="$PATH:/snap/bin"
fi

The extra : in the test are to make sure things match if at the beginning/end position of $PATH as well.

Seems fine now:

$ echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/snap/bin
DataDrake claimed this task.