32

I have read some tutorials about Snapcraft and snappy and I am really excited about it.

I am using 16.04 and used snap find to find and install the ubuntu-calculator-app snap. But I don't know how to start it.

It is neither in my Dash (Unity 7) nor in my path (using zsh)

Also, I followed the instructions in this blog post

To create a links snap and install it. But, again, I don't know how to start the app.

4 Answers 4

34

Just log out and log back in. If you are upgrading from an earlier version of 16.04 development release you will not have /snap/bin in your PATH environment variable.

4
  • Great. If you can point me where in the documentation is that path it would be great. Apr 20, 2016 at 16:51
  • 3
    append PATH=$PATH:/snap/bin to end of ~/.bashrc file.
    – noobninja
    Nov 5, 2016 at 6:00
  • Logging out and in didn't do it for me. I had to manually add /snap/bin to my PATH in my .bashrc file. Sep 14, 2017 at 20:17
  • 2
    @MarnixA.vanAmmers You should modify $PATH in .profile or .bash_profile, not in .bashrc; see How to correctly add a path to PATH?. Mar 8, 2019 at 15:05
9

Snaps can be run with snap run, so for the example in the question snap run ubuntu-calculator-app. But that is annoying so it is better to add snaps to your path. If the app is a gui, once you open it you can right-click on the launcher icon and select add to dash.

Snaps are not in your path by default on 16.04. They are stored in /snap/bin. Since snaps are a system-wide installation it would probably be best to add this directory to your system-wide path. This is done via the file /etc/environment. The following can break stuff, so you should backup the file before editing it sudo cp /etc/environment /etc/environment.bak. Use an editor with sudo to open /etc/environment, and add :/snap/bin to the end of the PATH entry. Make sure you restart your terminal or source /etc/environment

If that still doesn't work, you need to make sure your user .bashrc file has added /etc/environment to its sources. grep "source /etc/environment" ~/.bashrc will echo that line if it exists. If it doesn't echo "source /etc/environment" >> ~/.bashrc will add it.

3

Just including the path to the /snap/bin in the local ~/.bashrc works for me.

Run the following

  • echo "export PATH=$PATH:/snap/bin" >> ~/.bashrc
  • source ~/.bashrc
2

Essentially, as Zygmunt was saying. For completeness, the other alternative is to run the app from the command line:

ubuntu-calculator-app.calculator

Check out the documentation on how to get started with snaps on classic Ubuntu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.