How to Configure Repositories on Ubuntu 20.04
Installing software on Linux systems typically relies on repositories, which by default offer a wide selection of packages. However, there are cases when a required application is missing or only an outdated version is available. In such situations, you can add an additional repository and install the desired software from there.
How to configure repositories on Ubuntu 20.04:
- How to list all repositories in Ubuntu
- How to add a new repository
- How to remove a repository
- Working with PPA repositories
In this guide, we’ll walk through configuring repositories on Ubuntu Server 20.04.
Viewing repositories in Ubuntu
To see all currently active repositories on your system:
Repositories may also be listed in individual files located within the /etc/apt/sources.list.d/ directory.
To disable a specific repository, simply comment out its line.
Adding a repository in Ubuntu
To add a new repository, obtain the address from the software provider and use the apt-add-repository command with this syntax:
Some repositories require a GPG key to be installed first. Let’s take MariaDB as an example.
(https://mariadb.org/mariadb_release_signing_key.asc'[/code)]
Now add the repository:
Removing repositories
To remove a previously added repository, run the following command:
Working with PPA repositories
When adding a PPA repository, the system automatically detects it and fetches the necessary security keys.
To remove a PPA repository:
After modifying the list of repositories, don’t forget to update the package index:
Conclusion
Properly managing repositories in Ubuntu 20.04 is essential for maintaining a secure and up-to-date system. Whether you’re adding official sources, third-party repositories, or PPAs, understanding how to list, add, and remove them gives you full control over your software environment. Always verify the trustworthiness of external repositories to avoid introducing unstable packages. By following the steps outlined in this guide, you can ensure reliable software installation and smooth system performance.