0

I downloaded atom-amd64.tar.gz from this page. I then moved it from Downloads to a folder I made in Documents called Atom. Then I used tar -zxvf atom-amd64.tar.gz. If I type ./atom from inside /root/Documents/Atom, the program launches. However, I want to be able to launch it from anywhere by simply typing atom, like I can with gedit. Ex: gedit test.c would open a document called test.c with gedit. I've tried looking this up, but can't figure out what is going wrong. I read that I may need to add it to a/my/the PATH, but when I did whereis atom, all I got was "atom:" with no path following. I don't want to start messing with adding stuff to PATH unless I know for sure that's what I need to do, and if there's no better way (such as placing atom in a different directory)

Apologies for the terrible formatting.

2

It would help to know which GNU/Linux distribution you are actually using. It also sounds like you are trying to use root as your everyday user, this is a bad idea! Furthermore, it is better to install atom through your package manager. This will allow you to automatically keep your copy of atom up to date. It will also automatically put the program in the right place saving you having to always manually update your path. Good practices aside lets fix your issue.

The PATH variable is exactly what you need to edit. You simply need to add the following to the end of your .bashrc (assuming you're using bash).

PATH="/root/Documents/Atom:$PATH"

This simply adds /root/Documents/Atom to the start of your current path. Now whenever you type a command (after opening a new terminal or running source ~/.bashrc) the shell will look in the Atom folder for a matching program.

If you really don't want to alter your path, you could instead place a symlink to atom in a directory already in your path. One such place is /usr/local/bin. It's definitely better to let your package manager handle this rather than doing it manually though.

  • Thanks for this answer. I can't seem to find Atom on Synaptic, though. :/ – Bunyip Jun 18 '17 at 20:50
  • Sounds like you're probably using Ubuntu or at least something Debian based. I would install the package gdebi. You can then download the most recent .deb file from github.com/atom/atom/releases. You can then simply run gdebi atom-amd64.deb. This will resolve dependencies and install in correct location automatically. You may still have to do updates from within atom. – rlf Jun 19 '17 at 6:51

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.