SNAP error, SNAP packages not showing in menu

Kernels, Network, and Services configuration
Post Reply
Message
Author
nociveboy
Posts: 12
Joined: 2020-03-04 15:19

SNAP error, SNAP packages not showing in menu

#1 Post by nociveboy »

Hi people,
I need help, I'm trying to install SNAP packages on my Debian 10 Buster, but after installation, the packages do not appear in the menu, and there is also a message when installing some snaps, the message is this:
/ snap / bin was not found in your PATH
I believe this is the reason why SNAPs do not appear to me.
How do I add this information to my PATH?
Thank you

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SNAP error, SNAP packages not showing in menu

#2 Post by Head_on_a_Stick »

nociveboy wrote:How do I add this information to my PATH?
Add these lines to the end of the file at ~/.profile:

Code: Select all

# Expand $PATH to include the directory where snappy applications go.
snap_bin_path="/snap/bin"
if [ -n "${PATH##*${snap_bin_path}}" -a -n "${PATH##*${snap_bin_path}:*}" ]; then
    export PATH=$PATH:${snap_bin_path}
fi

# Ensure base distro defaults xdg path are set if nothing filed up some
# defaults yet.
if [ -z "$XDG_DATA_DIRS" ]; then
    export XDG_DATA_DIRS="/usr/local/share:/usr/share"
fi

# Desktop files (used by desktop environments within both X11 and Wayland) are
# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for
# snappy applications' desktop files.
snap_xdg_path="/var/lib/snapd/desktop"
if [ -n "${XDG_DATA_DIRS##*${snap_xdg_path}}" -a -n "${XDG_DATA_DIRS##*${snap_xdg_path}:*}" ]; then
    export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${snap_xdg_path}"
fi
But that should already be on your system at /etc/profile.d/apps-bin-path.sh — do you not have that file?

How did you install your snap packages, exactly?
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

nociveboy
Posts: 12
Joined: 2020-03-04 15:19

Re: SNAP error, SNAP packages not showing in menu

#3 Post by nociveboy »

hi, i found this file on /etc/profile.d/apps-bin-path.sh
and already have same lines, but apps installed via snap still don't appear in the menu.
i try install wps office, vlc, spotify etc...
I installed snapd and then ran the command
also occurs, when i try install yaru theme with
$ sudo snap install communitheme
and appear this message:
/snap/bin was not found in your PATH

thanks

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SNAP error, SNAP packages not showing in menu

#4 Post by Head_on_a_Stick »

So is PATH being over-ridden in ~/.bashrc or ~/.profile (or ~/.bash_profile)? Note that ~/.bash_profile probably shouldn't be used at all.

Code: Select all

echo $PATH
What if you add my posted code block to the end of ~/.profile?

Or run

Code: Select all

export PATH="${PATH}:/snap/bin"
Then try to launch a snap package from the same shell.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

nociveboy
Posts: 12
Joined: 2020-03-04 15:19

Re: SNAP error, SNAP packages not showing in menu

#5 Post by nociveboy »

Hi i not found /.profile or /.bashrc on my system,
i found /etc/bash.bashrc and added your posted code to the end of line in file,
rebooted and i tried again, but receive same error:

/snap/bin was not found in your $PATH. If you've not restarted your
session since you installed snapd, try doing that. Please see
https://forum.snapcraft.io/t/9469 for more details.

this is the result of:
rafael@rafael-pc:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:/snap/bin
rafael@rafael-pc:~$

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SNAP error, SNAP packages not showing in menu

#6 Post by Head_on_a_Stick »

nociveboy wrote:Hi i not found /.profile or /.bashrc on my system
Read my post again, carefully this time. I didn't write "/.profile" or "/.bashrc".

I probably should have written "${HOME}/.profile" and "${HOME}/.bashrc", does that make it clearer?

Anyway it doesn't matter because
nociveboy wrote:

Code: Select all

rafael@rafael-pc:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:/snap/bin
rafael@rafael-pc:~$
Your normal user appears to have /snap/bin in PATH. Twice.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

nociveboy
Posts: 12
Joined: 2020-03-04 15:19

Re: SNAP error, SNAP packages not showing in menu

#7 Post by nociveboy »

hello, I'm sorry
I didn't find any files like this in / home / user
there is no file called ./bashrc or ./profile on my machine, I searched for all folders,
are these files created automatically?
is there any way to find out which file I'm using as the default for my PATH?

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SNAP error, SNAP packages not showing in menu

#8 Post by Head_on_a_Stick »

nociveboy wrote:I didn't find any files like this in / home / user
there is no file called ./bashrc or ./profile on my machine, I searched for all folders
Are you winding me up?

Code: Select all

ls ${HOME}/.{profile,bashrc}
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

nociveboy
Posts: 12
Joined: 2020-03-04 15:19

Re: SNAP error, SNAP packages not showing in menu

#9 Post by nociveboy »

these files don't really exist on my machine, I executed the command you said, this is the result, my system is Portuguese-BR

rafael@rafael-pc:~$ ls ${HOME}/.{profile,bashrc}
ls: não foi possível acessar '/home/rafael/.profile': Arquivo ou diretório inexistente
ls: não foi possível acessar '/home/rafael/.bashrc': Arquivo ou diretório inexistente
rafael@rafael-pc:~$

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SNAP error, SNAP packages not showing in menu

#10 Post by Head_on_a_Stick »

Well that's not right. How did you install your system?
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

nociveboy
Posts: 12
Joined: 2020-03-04 15:19

Re: SNAP error, SNAP packages not showing in menu

#11 Post by nociveboy »

I downloaded an ISO of debian cinnamon, and installed it normally via graphical mode, then started the system and applied the updates, installed some common packages, like chrome etc ...

nociveboy
Posts: 12
Joined: 2020-03-04 15:19

Re: SNAP error, SNAP packages not showing in menu

#12 Post by nociveboy »

I believe its partial resolved, i have created .bashrc file and .profile on my home, added path with this command:
echo "export PATH=$PATH:/snap/bin" >> ~/.bashrc
and now i run snap programs from terminal, but icons dont appear on menu yet.

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: SNAP error, SNAP packages not showing in menu

#13 Post by Head_on_a_Stick »

But your user already had /snap/bin in their PATH (twice). Does it now appear three times? :?
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

nociveboy
Posts: 12
Joined: 2020-03-04 15:19

SNAP error, SNAP packages not showing in menu

#14 Post by nociveboy »

in fact I used timeshift to recover the system to a point before all this configuration, created the .bash and .profile files, installed the snapd etc ...

Enviado de meu moto z4 usando o Tapatalk

nociveboy
Posts: 12
Joined: 2020-03-04 15:19

Re: SNAP error, SNAP packages not showing in menu

#15 Post by nociveboy »

after many mistakes it worked

this is the step to install snap on Debian Buster:

$ sudo apt install snapd
$ sudo snap install core
$ snap install core20

$ sudo ln -s /etc/profile.d/apps-bin-path.sh /etc/X11/Xsession.d/99snap

open file /etc/login.defs

add in line ENV_PATH PATH=

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

it should be:

ENV_PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

Logout and login again, try to install some snap app

if you want add snap on gnome store

$ sudo apt install gnome-software-plugin-snap

Post Reply