My system, which runs oneElementary OS, was acting up (package manager wouldn't open, system wouldn't restart, etc.) so I did a hard reset on it. Now when I boot it up and try to log in I get the error unable to launch "gnome-session --session=pantheon" X session --- "gnome-session --session=pantheon" not found; falling pack to default session.

It then brings me back to the log in screen. I can still boot into terminal, but I can't get X to open at all.. Any ideas? I really need back in

  • What means "hard reset"? Do you have internet connection?
    – bitseater
    Feb 17, 2016 at 21:44
  • By hard reset i mean holding down the power button until the computer turns off and then turning it back on. And yes. I ended up reinstalling my OS though
    – watzon
    Feb 17, 2016 at 22:20

2 Answers 2


Check if you have broken soft links in /usr/bin:

cd /usr/bin
for x in * .[!.]* ..?*; do if [ -L "$x" ] && ! [ -e "$x" ]; then echo "$x"; fi; done

This will list all broken soft links. If you have any, specially the which command, there's your answer. Just remove the broken link and relink again:

cd /usr/bin
sudo rm which
sudo ln -s /bin/which which

In my case, I had installed some Node.js packages globally (entries added to /usr/bin), and one of them was replacing the default which command with a Node.js custom one.

Then, at some point I switched the Node.js --global installations from /usr/local/... to my $HOME (to solve a problem with node-gyp), after which I ended up with plenty of broken links on /usr/bin.

If you want you can remove all broken links (at your own risk) using:

sudo su -
cd /usr/bin
for x in * .[!.]* ..?*; do if [ -L "$x" ] && ! [ -e "$x" ]; then rm "$x"; fi; done
  • Excellent first post, thank you for your contribution!
    – user3
    Dec 3, 2017 at 0:12

First get to a TTY terminal/command prompt with Ctrl+Alt+F1. (If it won't open, boot the computer into safe mode.)

Then edit this file: gksudo gedit /usr/share/xsessions/pantheon.desktop

and remove the line Exec=gnome-session --session=pantheon to kill your old session.

(There is a gnome.desktop file too with a similar line to remove, if for some reason you're using GNOME instead of Pantheon.)

Some potentially helpful links: 1, 2,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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