[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 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:/# 
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