Two versions of Atom editor, often the bad one get launched

0

On my Ubuntu machine I've 2 version of Atom editor.

  • Atom 0.2
  • Atom 1.0.19

If I remember well, I installed Atom 0.2 from sources. And Recently I installed Atom 1.0.19 with .deb package.

The issue is the unity launcher keep running Atom 0.2.

So I tried:

$ which atom
/usr/local/bin/atom

$ ls -la /usr/local/bin/atom
lrwxrwxrwx 1 root root 13 okt  8 15:12 /usr/local/bin/atom -> /usr/bin/atom

$ /usr/bin/atom --version
1.0.19

$ cat /usr/share/applications/atom.desktop 
[Desktop Entry]
Name=Atom
Comment=A hackable text editor for the 21st Century.
GenericName=Text Editor
Exec=/usr/share/atom/atom %U
Icon=atom
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;TextEditor;Development;
MimeType=text/plain;

$ /usr/share/atom/atom --version
[5591:1009/095329:ERROR:browser_main_loop.cc(173)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
1.0.19

So I m a bit lost. Everything point to Atom 1.0.19 but the unity icon still pointing to Atom 0.2.

Sounds I've several versions of Atom installed.

Solution should be around:

  • How to keep only one version of Atom ?
  • How to remove at least Atom 0.2 ?

mickro

Posted 2015-10-09T08:07:10.610

Reputation: 131

did you "make install" it? sometimes "make uninstall" from the same packages uninstalls it. Would nuking the unity icon and readding it be an option? – Journeyman Geek – 2015-10-09T08:53:40.567

nop I used ./script/grunt install because it is a Node.js app. And they do not provide an uninstall command. – mickro – 2015-10-09T09:33:49.667

Answers

1

Solution I applied:

  1. remove atom 1.0.19 installed via .deb package: $ sudo apt-get remove atom Reading package lists... Done Building dependency tree
    Reading state information... Done The following packages will be REMOVED: atom 0 upgraded, 0 newly installed, 1 to remove and 11 not upgraded. After this operation, 203 MB disk space will be freed. Do you want to continue? [Y/n] (Reading database ... 452421 files and directories currently installed.) Removing atom (1.0.19) ... Processing triggers for mime-support (3.54ubuntu1.1) ... Processing triggers for gnome-menus (3.10.1-0ubuntu2) ... Processing triggers for desktop-file-utils (0.22-1ubuntu1) ... Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index...

  2. update and compile atom from sources: $ git pull $ git checkout v1.0.19 $ ./script/clean $ ./script/build $ sudo ./script/grunt install

That's updated my version of Atom to the one I wished.

mickro

Posted 2015-10-09T08:07:10.610

Reputation: 131

1

And while posting a comment... I think i got it.

The version of atom being launched by unity is at /usr/share/atom/atom. The 'correct' version is at /usr/local/bin/atom

So this is what I'd likely do (and I'm being paranoidly cautious here)

cp /usr/share/applications/atom.desktop /usr/share/applications/atom.desktop.old (backup the desktop entry)

Edit the desktop entry to replace the line that reads Exec=/usr/share/atom/atom %U with Exec=/usr/bin/atom %U I have no clue what the %U does but it seems important. Remove it if things break. You may need to log in and out for unity to refresh the desktop entry.

That should make unity launch the correct version.

Now, deletion, playing it safe we don't actually delete first...
mv /usr/share/atom/atom /usr/share/atom/atom.old That moves away the old copy of atom. We might be able to move /usr/share/atom/ but that depends on what's there.

Test for a bit. Delete /usr/share/atom/atom.old once you're sure atom isn't broken. Likewise, you can delete the unity launcher backup.

Journeyman Geek

Posted 2015-10-09T08:07:10.610

Reputation: 119 122

Thanks but /usr/share/atom/atom is already pointing to an Atom 1.0.19. (See last line of my tries). That's why I do not understand how to fix. – mickro – 2015-10-09T10:33:12.027

There's still something odd with the second install. Since we know the /usr/local/bin/atom is the good one, and that the unity link is firing up the wrong version, it makes a lot of sense to try disabling that version, pointing at the known good one, and seeing what happens. Note with my method, all you need to do is mv the backups back in place and its like nothing happened. – Journeyman Geek – 2015-10-09T10:38:20.183

1Unless unity handles it desktop icons another way.... – Journeyman Geek – 2015-10-09T10:38:45.290

Thanks Journeyman Geek♦ to attempt to help me/ Finally I went for remove .deb installation and recompile again from source the version I wanted. – mickro – 2015-10-12T09:31:46.600

also to clear your last remark. locate atom.desktop didn't gave any interesting result. – mickro – 2015-10-12T09:37:35.630

Post what you did as an answer and pick it as the right one then. I think I might have just misparsed your question. – Journeyman Geek – 2015-10-12T10:21:05.760