How to configure repositories in Ubuntu 20.04

0 Shares
0
0
0
0

Introduction

Installing software on Linux systems is done from repositories, which by default contain a large number of packages. But sometimes there are situations where the necessary software is not included, or the version is too old. In this case, you can add the necessary repository and install from it.

Be careful when doing this, as sometimes such builds contain experimental versions of system software and even the Linux kernel. Therefore, you should carefully read the information about the third-party repository in its description and update manager.

List of repositories in Ubuntu

To view all repositories in the system:

nano /etc/apt/sources.list

They can also be in one of the files in the folder /etc/apt/sources.list.d/ To disable one of the repositories, just comment out its line.

# deb http://archive.ubuntu.com/ubuntu focal multiverse

Adding repositories in Ubuntu

To add a repository, you need to find its address from the software developer and use the command apt-add-repository Use with the following syntax:

apt-add-repository ‘deb http://repository_address version branch’

Sometimes it is necessary to install the GPG security key first. Let's take MariaDB as an example.

apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'

Add a repository:

add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.mephi.ru/mariadb/repo/10.5/ubuntu focal main'

Removing tanks

To remove a repository, use this command:

add-apt-repository --remove 'deb [arch=amd64,arm64,ppc64el] http://mirror.mephi.ru/mariadb/repo/10.5/ubuntu focal main'

PPA repository in Ubuntu

While installing the PPA repository, the system will automatically detect the repository and download the necessary keys.

apt-add-repository ppa:repository/ppa

To remove the PPA repository:

apt-add-repository --remove ppa:repository/ppa

After editing the repository list, don't forget to update the list of packages available on the system.

apt update

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like