How to add / remove PPA repositories in Debian

Linux users install most of the software from a centralized official repository listed in the sources.list file. However, if the program is not in the list of repositories, you can install it via PPA (personal package archive). These are unofficial repositories that Launchpad has made available to users. Launchpad is a collaboration platform developed by Canonical that allows developers to upload their source packages to it. Launchpad then makes these packages available to users, from which they can install the application.

In this article, we will explain how you can use the Debian command line and GUI to manage PPA repositories on your system. We will explain in detail how to add, view and remove a PPA repository on the system.

Please note that we used Debian 10 to execute the commands and procedures discussed in this article. However, the same commands and procedures can be used in other versions of Debian.

Managing PPA Repositories from the Command Line

For users who prefer the command line for basic administrative tasks, here’s how to manage PPA repositories on their Debian system.

To open a command line terminal, go to the Actions tab in the upper left corner of your desktop. Then enter the keyword terminal in the search bar. When the search result appears, click the terminal icon to open it.

List of added PPA repositories

To view all available repositories on your system, run this command in Terminal:

$ apt policy

An alternative way to view the list of repositories is to print the contents /etc/apt/sources.list.d… To do this, run the following command in the terminal:

$ ls /etc/apt/sources.list.d

This command will list all the repositories available on your system.

Debian repository include files list

Add PPA repository

Only an authorized user can manage the repositories on a Linux system. Use the following syntax to add the PPA repository to the system.

$ add-apt-repository ppa:ppa_name

After adding the PPA repository, update the repository list and install the package using the following command:

$ sudo apt-get update
$ apt install package_name

Let’s take an example of adding the Jonathonf PPA repository to our system, which we will later use to install the FFMpeg audio / video player.

To add the Jonathonf PPA to our system, we will use the following command in Terminal:

$ sudo add-apt-repository ppa:jonathonf/ffmpeg-4

Add PPA repository to Debian

After adding PPA for FFMpeg, use the following command to install it:

$ sudo apt-get install ffmpeg

Install software from PPA repository in Debian

Delete PPA repository

If you want to remove the PPA repository for your system, use the following syntax:

$ add-apt-repository –remove ppa:ppa_name

This command will only remove the PPA from your system, not the package installed through that PPA.

For example, to remove the PPA that we added in the previous section, we will need to run the following command:

$ add-apt-repository --remove ppa:jonathonf/ffmpeg-4

Delete PPA repository

Cleaning up the repository

Cleaning the repository means completely removing a package from the system, including configuration files and personal settings. On Linux, you can clean up the repository using the PPA Purge utility. To install this utility, run this command in Terminal:

$ sudo apt-get install ppa-purge

After installation, you can run the following command to clean up the repository:

$ ppa-purge ppa:ppa_name

In the above example, the command would look like this:

$ ppa-purge ppa:jonathonf/ffmpeg-4

Removing a repository Manually

As discussed earlier in this article, the added repositories are saved in a file located at /etc/apt/sources.list.d… To manually remove the repository from this file, use the “rm” command as follows:

$ rm /etc/apt/sources.list.d/ppa_list_file

For example, to remove the PPA for FFMpeg, first use the following command to find the exact PPA name:

$ ls /etc/apt/sources.list.d/

Then use the rm command with the exact PPA name.

$ sudo rm /etc/apt/sources.list.d/jonathonf-ubuntu-ffmpeg-4-focal.list

Managing PPA Repositories Using a GUI

Users who are not familiar with the Linux command line can use a graphical interface to manage repositories. GUI based Software and updates the utility can help you achieve this goal.

List of added PPA repositories

To launch the Software & Updates utility, press the superkey on your keyboard and enter the relevant keywords into the search bar as follows:

Software installer

The Software & Updates utility opens by default in Debian software tab. Switch to Other software Tab to view the added repositories to your system.

List of active software repositories

Add PPA repository

If you want to add a new repository to your system, click the icon add button at the bottom Other software tab. A dialog box will appear. Here enter the PPA repository name as shown below and then click the button Add source button.

ppa:PPA_REPOSITORY_NAME/PPA

For example, to add a PPA repository for FFMpeg, the command would look like this:

ppa:jonathonf/ffmpeg-4

The system will ask you to enter a password for authentication, since only authorized users can make changes to the software repository settings. Enter your password and click Authenticate. After that, your repository will be added to the list on the Other Software tab.

Delete PPA repository

To remove PPA repository go to Other software in the Software & Updates utility. Then select the repository you want to delete and click the button Delete button.

Add or remove PPA using the GUI

That’s all! In this article, we have learned how to add / remove PPAs on Debian system using command line and graphically. Once the PPA is added, it becomes very easy to install the software using the apt-get command.

How to add / remove PPA repositories in Debian

Sidebar