Ubuntu's terminal no longer starts, xterm doesn't start either (Could not exec/bin/sh There are no such files or directories)

Asked 1 years ago, Updated 1 years ago, 136 views

When I was building the environment, I accidentally deleted /bin/ and had no choice but to obtain the same coreutils as the installed version, and copied the bin folder and below to /bin/.

Until now, the terminal was started, but when I tried to start the terminal, it didn't start, and when I selected xterm, it said, "Could not exec/bin/sh There are no such files or directories" and it stopped starting.

The environment was built in Ubuntu 18.04, and prior to removing /bin as an associated operation:

 $sudodpkg-reconfigure dash [select no]
$ sudorm/bin/sh
$ sudorn-s/bin/bash/bin/sh

I apologize for the lack of study, but could you tell me how to solve this problem or the reference site?

ubuntu bash terminal dash

2022-09-29 22:22

2 Answers

What's in the Ubuntu packageThe results are as follows

  • (in Ubuntu/Debian) for normal shell scripts…dash
  • Shells that are often used in terminals...bash

coreutils contains some /bin/ commands, but bash requires the bash package to work.(Other shell packages)
You will get it and deploy it below /bin/ (like coreutils).


2022-09-29 22:22

"It has not been verified, but when I searched ""ubuntu repair"" and so on, I found the following steps."

How To Fix Broken Ubuntu OS Without Reinstalling It

$sudorm/var/lib/apt/lists/lock
$ sudorm/var/lib/dpkg/lock
$ sudorm/var/lib/dpkg/lock-frontend
$ sudo dpkg --configure-a
$ sudo apt clean
$ sudo apt update --fix-missing
$ sudo apt install-f
$ sudo dpkg --configure-a
$ sudo apt upgrade
$ sudo apt dist-upgrade
$ sudo reboot


2022-09-29 22:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.