Atom on Raspbian?

10,568

As of today you can't install the official package provided for Debian for its mismatching the hardware platform. Provided binary is for running on x86 hardware, but RPi doesn't come with an Intel/AMD processor, but ARM. So, you most probably need to build it from source yourself.

Primer

So, if you really want to build this from source, you should be aware of the waste of disk space caused by the IMHO poorly implemented build tool which is downloading tons of deps and copying and transpiling code around so you'll end up with 2GB+ of files with 80% accounting to dependencies, only. Since my RPi works with 8GB smartcard, only, I couldn't ever meet the need for disk space even though I was bleeding out Linux by manually removing docs, manpages, locales, ton's of outdated and mostly unused apps etc. The build also requires a whole build tooling chain, tons of dev packages for libraries, so there is a limit to milk the system ... 8GB disk drive simply isn't enough for this.

Eventually I tried moving all the files to a USB pen drive. But that drive must be formatted using a filesystem capable of symlinking. So you can't use vfat or FAT32. I didn't succeed to get a 16GB stick formatted with either version of extfs. The mkfs always ended up in a deadlock on trying to write its superblocks. Astonishingly, I couldn't even kill the mkfs with -KILL, but unplugging the drive did help in that case.

So, as a conclusion: here is a short list of steps I passed in expectation to get this working, but in the end I didn't finish due to the memory issues above. And frankly, I stopped caring ... I'd rather work with nano/vi in a terminal than using this ridiculous lego-like built software. I guess, atom is today's version of emacs with regards to the latter's acronym. Maybe you succeed with this, but I won't ...

Build from Source

Inspired by https://discuss.atom.io/t/atom-on-the-raspberry-pi/33332

Install toolchain for building native stuff

sudo apt-get install build-essential git libgnome-keyring-dev fakeroot gconf2 gconf-service libgtk2.0-0 libudev1 libgcrypt20 python rpm libsecret-1-dev xorg-dev

This set of tools was sufficient to build core files without error. Since I didn't start with a fresh installation of Raspbian there might have been some tool I have been using before, so maybe in your case there are more tools to be installed here. Look out for error messages in early stage of building and try to see if some library or header file isn't found. This mostly indicates lack of some package with name ending in -dev to be installed, too. Start by searching for the package using apt search <name-of-mentioned-library> and look for a package combining the missing library's name with suffix -dev. Then install it the usual way by invoking sudo apt-get install <package-name>.

Install up-to-date nodejs

Raspbian Stretch comes with support for NodeJS 8.11 which is basically okay. Install it and its package manager npm using this command:

sudo apt-get install node-js npm

Check installed versions with

node -v
npm -v

This should display 8.x.x on behalf of NodeJs. Use n afterwards if you want to step up:

sudo npm i -g n
sudo n lts

This will switch NodeJS to latest LTS release, which is 10.x as of now. Upgrading NodeJS is optional, but feel advised to always use latest version of npm:

sudo npm i -g npm

Check if upgrades succeeded:

node -v
npm -v

Adjust configuration of npm and install some essential dep:

sudo npm config set -g python /usr/bin/python2
sudo npm i -g node-gyp

Build Atom

Get the source. One option is to pull latest code from its repository:

git clone https://github.com/atom/atom.git

This is creating subfolder atom containing all source files. You might want to download sources of a recent release instead. But this tutorial was made with the sources fetched from Github. So make sure there is subfolder called atom containing sources similar to the ones fetched above.

It's time to start the beast:

cd atom
./script/build

This process will take a while. And it is the culprit that never finished on success in my case due to eating up all disk space over and over again.

Whenever the script fails on error, try to analyze the error, find the cause, fix it, then start the script by repeating the last command above again. If you don't remove any file in subfolder atom in between, the build script keeps passing steps of building atom it has passed successfully before.

Install atom

According to the original tutorial linked before the script should finish on success eventually. Then it's time to install with:

./script/grunt install

I guess this is causing atom to be available as a command from CLI. So, try it out. If everything looks fine you are finally ready to remove the waste of files in subfolder atom.

Feel free to report if this was working in your case.

Share:
10,568
snaldi
Author by

snaldi

Updated on December 04, 2022

Comments

  • snaldi
    snaldi over 1 year

    Very nooby question, but I'm trying to install Atom text editor on Raspbian Stretch. Is it possible? I've heard because it runs on Electron, it's quite slow for Raspbian. I keep getting an error saying:

    E: Unable to locate package atom
    

    I'm following the official instructions for Debian. How can I fix this?

  • sdive
    sdive over 5 years
    Downvoted because this command tries to install the amd64 package. Raspberry pi requires the armhf architecture. And "sudo" is needed.
  • JosephWorks
    JosephWorks over 5 years
    Not worth a downvote. You should ask for help and that you needed a different architecture and then maybe someone might help you...
  • Thomas Urban
    Thomas Urban over 5 years
    The provided method isn't delivering any solution to the initial topic regarding installation of Atom text editor on a Raspberry Pi which definitely doesn't handle amd64 executables. The used link is providing amd64 packages, only. Fighting downvotes by referring to hypothetical option for asking linked site's community for adding another architecture won't change this fact by now. It's just shifting the issue to a different community.
  • Naohiro Tsuji
    Naohiro Tsuji about 5 years
    I've just tried and end up with the error after successful installation of modules. Error: Unsupported arch arm; must be one of: ia32, x64 at packager (/home/pi/atom/script/node_modules/electron-packager/index.j‌​s:193:40) at Promise (/home/pi/atom/script/lib/package-application.js:139:5) at new Promise (<anonymous>:null:null) at runPackager (/home/pi/atom/script/lib/package-application.js:138:10) at module.exports (/home/pi/atom/script/lib/package-application.js:17:10)