# 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 the apt package installer command on the Ubuntu command line if either you are looking for a package that does not exists or your apt is not up to date.
Solution/Fix
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: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:/#

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!