How to Update Repository List in Ubuntu? [3 Cases]

One key attribute that makes Ubuntu so easy to use is its package management system, APT. APT works on top of repositories coming with lists of files that include the details of the software items they hold. However, for the package manager to function properly and offer the latest packages, you must keep your repository list up-to-date. Therefore, having expertise in how to update the repository list in Ubuntu is a handy feature to have in your Linux toolkit and I will cover that for you in this article.

Key Takeaways

  • Learning about Updating the Repository List in Ubuntu.
  • Getting Acquainted with the Importance of Repository List Updation in Ubuntu.

Requirements

The Necessity of Updating the Repository List in Ubuntu

The functionality, security, and smooth user experience regarding software packages in the system are all significantly impacted by updating the Ubuntu repository list which, as a result, is a crucial maintenance task. Some core necessities of the repository updation are mentioned as follows:

  1. Access to the Newest Software Releases: The updation of the repository list ensures access to the latest software packages and tools that the repositories are storages of. In addition, this also omits the risk of using out-of-date software by resolving compatibility and vulnerability issues.
  2. Software Feature Improvements: The repository updation lets users take advantage of the enhanced features and functionalities introduced by the community of developers.
  3. Security Upgrades: Attaining security upgrades is another prime reason for repository list updation since this attribute strengthens the system’s protection against security threats.
  4. Bug Fixes: The developers continually execute software debugging and settle software refinements. Thus, the repository list updation, in turn, lets users utilize the packages with the latest bug fixes.
  5. Stability and Reliability: The updated repository list also elevates the stability and reliability of the software components. This, in consequence, provides the practitioners with a robust computing environment with less number of glitches and system crashes.

3 Cases to Update the Repository List in Ubuntu

In this feature, I will enlighten you about 3 cases of repository list updation which are the most frequent as well as the most quintessential ones. In addition, I will display hands-on illustrations of  2 viewpoints centering around the CLI (Command Line Interface) and GUI (Graphical User Interface) based methods for updation.

Case 01: Updating the Repository List in Ubuntu as a Routine Maintenance

The primary objective of updating the repository list is to harmonize the package database with the most recent data available in the repositories. Therefore, it is essential to maintain the repository through list updating on a regular basis irrespective of adding or deleting repositories.

You can read our Comparative Analysis of Methods to distinguish between these two methods and best pick one for your need.

A. Using CLI to Update the Repository List in Ubuntu

The CLI lets you go through a less exacting process requiring simple commands for updating the Ubuntu repository list.

Steps to Follow >

➊  First, open the Ubuntu terminal.

➋ Then, run the command mentioned below:

sudo apt update
EXPLANATION
  • sudo: Grants root privileges.
  • apt: The package management tool.
  • update: Action updating the system repository index.
ubuntu repoitory general updateIn the aforestated snapshot, you notice that I have updated the system by integrating the newest package information.

B. Use GUI to Update the Repository List in Ubuntu

Likewise, you can take the GUI-based approach for repository list updation if the visual perspective appeals to you more.

Steps to Follow >

➊ At first, go to the Software Updater application from the menu. software updater select to update ubuntu repository list The Software Updater application automatically starts to look for any available updates.checking updates via GUi to update ubuntu repository listIn the above image, you see that Software Updater is checking for updates in my system. If there’s any update on software packages, it will list that down and ask for installation in the following manner.select install now to update ubuntu repository list➋  After that select Install Now to get updates immediately, or click Remind Me Later as per your preference.

➌ Now, if you select the Install Now option, it will start fetching the updates for your list of repositories. However, the system will ask for authentication. Provide the user password here like the following:enter user password to athenticate and update repo list In the above image, you notice that I have entered my user password for authentication prior to the fetching of updates.updates are being downloaded So, my system has already started downloading updates after a successful authentication.

➍ Finally, the system will give you a notification of the updation of the repository list and ask permission to install the software application with the latest package. The rest is left to your personal choice.install now to update the ubuntu repository list via GUIIn the screenshot above, you see the updates for my system repository list have been downloaded and are ready for installation.

Case 02: Updating Repository List in Ubuntu After Adding a New Repository

Apart from the scheduled maintenance, you must update the repository list after the attachment of a new repository to the Ubuntu system. This is recommended by the developer community to make the system aware of the additional repository metadata that was not available by default. For example, I will add a new repository and subsequently show the updating procedure by using both the CLI and GUI-based methods.

You can read our Comparative Analysis of Methods to distinguish between these two methods and best pick one for your need.

A. Using CLI to Update the Repository List in Ubuntu After Adding a Repository

You can add and then update the system repository log using simple commands in the following manner.

Steps to Follow >

➊ First, go to the terminal.

➋ Secondly, type the following command and hit ENTER.

sudo apt-add-repository deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ jammy main
EXPLANATION
  • sudo: Grants root privileges.
  • apt-add-repository: Adds a new repository to the system.
  • deb: Points out repository type in Debian-based distros such as Ubuntu.
  • https ://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/: Repository web address.
  • jammy: Codename for Ubuntu 22.04.
  • main: Indicates that the software packages are within the main repository.
adding repository using command in terminalIn this screenshot, you spot that I have added the Mozilla Firefox repository to my Ubuntu system. To get the sudo advantages, I have entered my user password. In your distribution, don’t forget to enter your password.

➌ At this point, run the below command to update the system repository list.

sudo apt update

updating the ubuntu repos list after new repository addition

So, I have updated the repository log and fetched information about the new repository to my system through this step.

➍ Finally, type the following command and press the ENTER button to see your added repository.

apt-add-repository --list
EXPLANATION
  • apt-add-repository: Adds/deletes a repository.
  • –list: Enlists all the available system repositories.
repository list after the addition For instance, this image exemplifies that I have added a repository to my system.

B. Use GUI to Update the Repository List in Ubuntu After Adding a Repository

Alternatively, you can make use of the GUI-centric approach to achieve repository list updation just after the insertion of a new repository.

 Steps to Follow >

➊ First, Go to Software & Updates.select software & updates to update ubuntu repository list➋ Now, redirect to Other Software, click Add, provide the repository URL, and click Add Source.adding repsitory url in the apt line to add repository in the list

Note: For instance, I added the repository URL deb http://repo.tld/ubuntu distro component in the APT line for addition.

➌  At this point, enter the user password for authentication.enter password for authentication to update the repository list➍ Finally, click Reload for software cache updation.clicking reload to update ubuntu repository list Here, the aforestated screenshot is the exemplar of the repository list updating process that incorporates the package database with the newest package versions.

Case 03: Updating Repository List in Ubuntu After Repository Deletion

Likewise, the repository log updation is cardinal after a user removes a repository from the system. It warrants the package management system that a certain package along with its metadata no longer present to avail. Therefore, walk with me to get acquainted with the updation procedure revolving around CLI & GUI after repository deletion.

You can read our Comparative Analysis of Methods to distinguish between these two methods and best pick one for your need.

A. Use CLI to Update the Repository List in Ubuntu After Removing a Repository

Utilize the CLI with super simple commands to update the repository list on your Ubuntu system.

Steps to Follow >

➊ First, Press CTRL+ALT+T to open the terminal.

➋ Then, run the following command.

apt-add-repository --list

repository listing before delete using command

The above snap shows the repositories currently extant on my system. Now, I will remove the repository namely deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ jammy main.

➌ Now, type the below command and press ENTER.

sudo apt-add-repository --remove debhttps://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ jammy main
EXPLANATION
  • apt-add-repository: Adds/removes repositories.
  • –remove: Deletes the specified repository.
  • deb: Points out repository type in Debian-based distro such as Ubuntu.
  • https ://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/: Repository web address.
  • jammy: Codename for Ubuntu 22.04.
  • main: Indicates that the software packages are within the main
repository deleted using command in CLIHere, in the aforementioned image, you spot that I have removed the Firefox repository from my system.

➍ After that, run the following command to get your system the necessary updates.

sudo apt update

ubuntu repository list updation after repos removal

➎ On an end note, type the below-mentioned command and hit the ENTER button.

apt-add-repository --list

list showing after deletion to display update ubuntu repos list


In this snapshot, I have shown that I have deleted the intended repository and displayed the latest repository log information with success.

B. Use GUI to Update the repository List in Ubuntu After Removing a Repository

If you are attracted to the visual interface of Ubuntu, then you can utilize GUI for repository deletion and the actual goal of updating the index afterward.

Steps to Follow >

➊ First, Go to Software & Updates.select software & updates to delete repository➋ Secondly, go to the Other Software tab, click on the repository name to select, click Remove, and lastly, click Close.repository checked and deleted clicking the remove button So, here, in the above image, I have shown the deletion of the repository named http://archive.getdeb.net/ubuntu wiley-getdeb games with the assistance of GUI.

➌ Thirdly, enter the user password for authentication.enter password for deletion authentication➍ Finally, clicking the Reload button will update the repository cache.reload to update the repository list in ubuntu

The above-captured image shows the updation process by clicking Reload. It gives an alert to the system index that the selected repository has been removed and is no longer available.

Comparative Analysis of Methods

As of now, I have introduced you to 2 effective methods for updating the repository list in 3 different situations. In this scope, I will feature some advantages and disadvantages of both methods. 

Methods Pros Cons
Using CLI
  • Faster approach.
  • Involves simple commands.
  • Overwhelming for Beginners.
  • Mistakes in writing commands lead to unwanted results.
Using GUI
  • User-friendly Method.
  • Prone to less error.
  • Manual process.
  • Less efficient.
  • Slower than CLI-based methods. 

preference. For example, if you are comfortable using the command line or working on a server, then the first method (Using CLI) is for you. However, you can exercise the use of the latter method (Using GUI) if you like the vision-based interface.

Conclusion

In this article, I have discussed the repository list updation in Ubuntu. Moreover, I have shed light on 3 practical cases of updating the repository index along with mentioning the necessities. I hope that the hands-on experience will aid your learning of repository management and take you one step further in becoming a Linux power user.

People Also Ask

What is the purpose of the sudo apt upgrade command?
The sudo apt upgrade command is primarily responsible for fetching and installing the software packages with their latest versions through the upgradation of dependencies.
What is the apt command in Linux?
The apt command is a powerful command line tool for package management using APT (Advanced Packaging Tool). It is used for installing, upgrading, and deleting any intended software package in Debian-based Linux distros such as Ubuntu.
What is apt-add-repository in Linux?
The apt-add-repository is essentially a script that adds a new repository to the sources.list file located in the /etc/apt/sources.list.d/ directory. It also removes an existing repository from the location. 
How to update a package in Ubuntu?
Use the “apt update” command to update your system packages. It downloads the latest information from the configured sources. However, you need to be the root user or prefix sudo with the command for successful updation of software packages.

Related Articles


<< Go Back to Repository Configuration in Linux | Package Management in Linux | Learn Linux Basics

5/5 - (6 votes)
LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now
Md Masrur Ul Alam

Assalamu Alaikum, I’m Md Masrur Ul Alam, currently working as a Linux OS Content Developer Executive at SOFTEKO. I completed my Bachelor's degree in Electronics and Communication Engineering (ECE)from Khulna University of Engineering & Technology (KUET). With an inquisitive mind, I have always had a keen eye for Science and Technolgy based research and education. I strongly hope this entity leverages the success of my effort in developing engaging yet seasoned content on Linux and contributing to the wealth of technical knowledge. Read Full Bio

Leave a Comment