1

My Ubuntu 16.04 is suddenly started booting in to the tty1 mode. I'm not able to use gui by pressing ctrl+alt+f7. When I login in tty mode it says

-bash: /usr/bin/lesspipe: /bin/sh: bad interpreter: No such file or directory

I also tried startx and got this error

-bash: /usr/bin/startx: /bin/sh: bad interpreter: No such file or directory

How could I solve this problem and Why this happened suddenly?

01000110
  • 183
  • 2
  • 9

1 Answers1

1

It sounds very much like your /bin/sh and/or your /bin/dash executable got borked somehow.

First, let's try to reinstall dash:

sudo apt update
sudo apt install --reinstall dash

Then, reboot. If your system still doesn't work, we just need to relink it to /bin/dash using this command:

sudo ln -fs /bin/dash /bin/sh

Give your machine a reboot just to ensure everything is cleared out of memory, and then try logging in.

The -f option on ln will force the system to build a link, even though the file already exists.


If your system complains that dash can not be downloaded, run this command to install the latest version from the Xenial repos directly.

If you have a 64-bit system (the majority of people):

wget http://us.archive.ubuntu.com/ubuntu/pool/main/d/dash/dash_0.5.8-2.1ubuntu2_amd64.deb -qO dash.deb && sudo dpkg -i dash.deb && rm dash.deb

If you have a 32-bit system:

wget http://archive.ubuntu.com/ubuntu/pool/main/d/dash/dash_0.5.8-2.1ubuntu2_i386.deb -qO dash.deb && sudo dpkg -i dash.deb && rm dash.deb

You can check your architecture by running arch. If it returns x86_64, you have a 64-bit system. Otherwise, you have a 32-bit system or some weird system.

Kaz Wolfe
  • 34,680