[Fix] Ubuntu E: Unable to locate package sudo error


Error:
# 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:/# 
Fix E- Unable to locate package in Ubuntu

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org



















Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap