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 commandroot@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
More Posts related to Ubuntu,
- Fix - sudo: systemctl: command not found
- How to know the version of Ubuntu
- [Fix] Ubuntu E: Unable to locate package sudo error
- How to install Apache Maven on Ubuntu
- Steps to Kill a Running Process in Ubuntu Linux
- How to know current Ubuntu Linux version via terminal command
- How to stop/start/restart apache server using command [Ubuntu]
- Fix: Ubuntu (Linux) - bash: sudo: command not found error
- Ubuntu: How to search for a package to install using apt in Terminal
- Fix: E: Command line option --installed is not understood in combination with the other options
- How to install Python on Ubuntu
- Ubuntu Linux: How to Login as root User
- Access Windows share folder in Ubuntu Device in Network
- Add a User as a Sudoer Using Ubuntu Linux Command Line Terminal
- Install Oh My Zsh on Ubuntu Docker complete steps
- Fix: Make makefile:31 Error 127 (GCC)
- [fix] openssl No such file or directory error C++
- How to install zsh shell on Ubuntu
- Install Golang (Go) on Ubuntu
- Ubuntu Linux: Unzip a zip file using Terminal
- Where are Environment Variables stored in Ubuntu
- apt-get list --installed packages in Ubuntu Linux
- Ubuntu: List all Installed Packages using apt
- Quick steps to install Nginx on Ubuntu Linux
- How to kill service running on a port on Ubuntu Linux
More Posts:
- How to install Packages in Sublime Text Editor - Sublime-Text
- How to serialize-deserialize an object in java - Java
- Java 8 Predicate Functional Interface isEqual() Method Example - Java
- [Error] zsh: command not found: mvn - HowTos
- Skip Test Maven while creating package command - Java
- Open New tab using keyboard shortcut in Mac Terminal - Mac-OS-X
- How to Setup Microsoft OneDrive on Mac Sonoma 14 - Microsoft
- Working with Multiple Files in Sessions in Notepad++ - NotepadPlusPlus