Ubuntu: I can't use snap packages, even if installed



Question:

I installed Spotify, VS Code and Atom snap packages. I used them a couple of days. Today, I can't use them. There are two different problems:

  1. They aren't in Gnome Launcher with all other programs.

  2. I can't use them starting them via cli because "command not found". I'm using zsh.


Solution:1

[SOLUTION to QUESTION1]

There is some kind of bug in I-do-not-know-where. To temporally solve this, I had to copy programname.desktop from /snap/programname/current/programname.desktop to /usr/share/applications (with sudo) and then all was fixed: programname shows in the gnome menus.

See more here

[SOLUTION to QUESTION2]

The snap binary and desktop directories will not automatically be added to your environment variables. In order to solve this, I added the following line to /etc/zsh/zprofile:

emulate sh -c 'source /etc/profile'  

See more here


Solution:2

use this to remove the package:

sudo snap remove name-package  

use this to completely remove the directory where the packages are built (i.e, for example to remove the directory in which atom is built use : sudo rm -rf ~/snap/name-package; this will remove the directory and its child directories) and build them again:

sudo snap install name-package  


Solution:3

an alias could be added to .bash_aliases

  • echo 'alias foosnap="/snap/bin/foo"' >> /root/.bash_aliases
  • exec bash

or a symlink could be added to /usr/bin

  • ln -s /snap/bin/foo /usr/bin/foosnap

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »