# apt install sudo
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package sudo
You might get unable to locate package error when executing apt package installer command on Ubuntu command line if either you are looking for package that does not exists or your apt is not up to date.
Solution:All you need to do is just run the command: apt update, this will get details of all available packages on your system and you should be able to install the package you were looking for.
root@8d376ec5427e:/# apt update
Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports focal/multiverse arm64 Packages [139 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports focal/restricted arm64 Packages [1317 B]
Get:7 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages [1234 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 Packages [11.1 MB]
Get:9 http://ports.ubuntu.com/ubuntu-ports focal-updates/multiverse arm64 Packages [9095 B]
Get:10 http://ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 Packages [1078 kB]
Get:11 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 Packages [1430 kB]
Get:12 http://ports.ubuntu.com/ubuntu-ports focal-updates/restricted arm64 Packages [3933 B]
Get:13 http://ports.ubuntu.com/ubuntu-ports focal-backports/universe arm64 Packages [26.0 kB]
Get:14 http://ports.ubuntu.com/ubuntu-ports focal-backports/main arm64 Packages [51.1 kB]
Get:15 http://ports.ubuntu.com/ubuntu-ports focal-security/restricted arm64 Packages [3694 B]
Get:16 http://ports.ubuntu.com/ubuntu-ports focal-security/universe arm64 Packages [783 kB]
Get:17 http://ports.ubuntu.com/ubuntu-ports focal-security/multiverse arm64 Packages [3254 B]
Get:18 http://ports.ubuntu.com/ubuntu-ports focal-security/main arm64 Packages [1066 kB]
Fetched 17.6 MB in 12s (1506 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
15 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@8d376ec5427e:/#
More Posts related to Ubuntu,
- Fix: Ubuntu (Linux) - bash: sudo: command not found error
- Quick steps to install Nginx on Ubuntu Linux
- Add new user in Ubuntu Linux using Terminal Command
- How to know current Ubuntu Linux version via terminal command
- How to stop/start/restart apache server using command [Ubuntu]
- Fix - sudo: systemctl: command not found
- How to install zsh shell on Ubuntu
- [Fix] Ubuntu E: Unable to locate package sudo error
- Quickly install Apache Server on Ubuntu Linux
- Install specific JRE on Ubuntu using apt
- Fix Ubuntu /bin/sh: 1: zsh: not found error
More Posts:
- Notepad++ select all above or below lines - NotepadPlusPlus
- Python Program To Calculate Simple Interest (SimpleInterest.py) - Python
- How to save IntelliJ IDE Console logs to external log file - Android-Studio
- How to Identify installed PowerShell version - Powershell
- [Error] Microsoft Teams: We're sorryβwe've run into an issue. - Microsoft