9

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.

Cirelli94
  • 616
  • What does the output of snap version say? – popey Dec 27 '17 at 12:02
  • @popey snap 2.29.4.2+17.10 snapd 2.29.4.2+17.10 series 16 ubuntu 17.10 kernel 4.13.0-22-generic, thanks for your help – Cirelli94 Dec 27 '17 at 12:45
  • 1
    Look inside the /snap/ folder. Various commands should be available there, is that true? What happens if you run one directly? – kyrofa Dec 27 '17 at 23:38
  • inside /snap/ I have atom, bin, core, vscode. Inside bin, there are all executables. If I run /snap/bin/atom, atom start! Nice! Thanks! Now, why it doesn't work from my terminal, neither are there .desktop launchers in gnome? Thanks for now – Cirelli94 Dec 29 '17 at 10:04
  • also ll /snap/bin lists installed snaps. – noobninja Jan 08 '18 at 12:24

4 Answers4

9

[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

Cirelli94
  • 616
0

this simple solution worked for me.

  1. open your shell profile file ~/.bashrc or ~/.zshrc
  2. append export PATH=$PATH:/snap/bin
  3. refresh profile changes source ~/.bashrc or source ~/.zshrc

enjoy your snaps !

0

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
Cirelli94
  • 616
Nissaar
  • 71
  • 1
    Welcome to Ask Ubuntu! :-) The last command is dangerous when run from the root directory! Could you [edit] and expand and provide exact details for the packages the OP is referring to? – Fabby Dec 27 '17 at 13:40
  • @Fabby is this okay ? – Nissaar Dec 27 '17 at 13:48
  • Ok, i removed atom folder from ~/snap/atom . Sadly this doesn't solve my problem :( – Cirelli94 Dec 27 '17 at 14:14
  • build it again if it still fails use 'mkdir name' to make a new directory and build atom there. Then use 'cd name' to access the directory and run atom from there. – Nissaar Dec 27 '17 at 14:18
  • @Nissaar Why do you use the term 'build'? I'm just installing it with snap install... I do not choose any folder! – Cirelli94 Dec 27 '17 at 14:21
  • in every snap tutorial ive seen 'build the snap.' And not 'install snap'. Ive seen that for travis, offlineimap etc... maybe im wrongly using the word. Did it work ? – Nissaar Dec 27 '17 at 14:44
  • I can't 'build' any snap in any folder. I just snap install atom. If I do mkdir atom & cd atom & snap install atom it makes no sense to me to do something like this..... – Cirelli94 Dec 29 '17 at 09:58
  • To have an idea where snaps are installed etcetera https://askubuntu.com/a/976039/396145 – Cirelli94 Dec 29 '17 at 10:51
0

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
noobninja
  • 548