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.

5
  • What does the output of snap version say?
    – popey
    Dec 27, 2017 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, 2017 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, 2017 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, 2017 at 10:04
  • also ll /snap/bin lists installed snaps.
    – noobninja
    Jan 8, 2018 at 12:24

4 Answers 4

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

3
  • Related snapd bug: bugs.launchpad.net/snapd/+bug/1775340
    – m93a
    Jun 21, 2019 at 12:35
  • emulate sh -c 'source /etc/profile' breaks oh-my-zsh themes for me
    – m93a
    Jun 21, 2019 at 12:37
  • try emulate sh -c 'source /etc/profile.d/apps-bin-path.sh' as in the linked question
    – Cirelli94
    Jul 1, 2019 at 9:23
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
8
  • 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, 2017 at 13:40
  • @Fabby is this okay ?
    – Nissaar
    Dec 27, 2017 at 13:48
  • Ok, i removed atom folder from ~/snap/atom . Sadly this doesn't solve my problem :(
    – Cirelli94
    Dec 27, 2017 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, 2017 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, 2017 at 14:21
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
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 !

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .