Fix: Ubuntu (Linux) - bash: sudo: command not found error


bash: sudo: command not found
Ubuntu Error:
c2c@d12f83dc01b5:/# sudo apt-get install nano
bash: sudo: command not found

You might get bash sudo command not found error if you do not have sudo package installed. I faced the same issue when I installed Ubuntu image on Docker container.

Fix for "bash: sudo: command not found" using apt command
root@d12f83dc01b5:~# apt install sudo

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed: sudo
0 upgraded, 1 newly installed, 0 to remove and 15 not upgraded.
Need to get 473 kB of archives.
After this operation, 2175 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 sudo arm64 1.8.31-1ubuntu1.2 [473 kB]
Fetched 473 kB in 2s (307 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package sudo.
(Reading database ... 4120 files and directories currently installed.)
Preparing to unpack .../sudo_1.8.31-1ubuntu1.2_arm64.deb ...
Unpacking sudo (1.8.31-1ubuntu1.2) ...
Setting up sudo (1.8.31-1ubuntu1.2) ...

Make sure you are logged into as root user, else switch to root user using su root

Advertisements
Try Out Code2care Dev Tools:

Advertisements



#Android #Java #Linux #Microsoft #Google #Python #MacOS #Notepad++ #Microsoft Teams #CSS #PHP #SharePoint #Html #Linux #C-Program #Bootstrap #jQuery #Sublime #Android-Studio #Facebook #Eclipse #WhatsApp #News #MySQL #Json #HowTos #JavaScript #FTP #S3


Advertisements


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Tutorials, Trouble-Shooting steps, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.
🎉 We are celebrating the 10th years of Code2care! Thank you for all your support! We hope we made a difference.
We strong support Gender Equality & Diversity.

We stand in solidarity with Ukraine - Make a donation to UNHCR - https://donate.unhcr.org/in/en-in/ukraine-emergency