Linux users install the majority of the programs from their centralized official repository listed in the sources.list file. However, if the program is not listed in the repository list, you can install it via its PPA (personal package archive). These are unofficial repositories that Launchpad made available to users. Launchpad is a collaboration platform developed by Canonical that allows developers to upload their source package on it. Launchpad then makes those packages available for users to install the application from.
In this article, we will explain how you can use the Debian command line and GUI to manage PPA repositories in your system. We will explain in detail how to add, view, and remove a PPA repository.
Please note that we have used Debian 10 for running the commands and procedures discussed in this article. However, the same commands and procedures can also be followed in other versions of Debian.
Manage PPA Repositories through the Command Line
For users who prefer the command line for performing basic administrative tasks, here is how to manage PPA repositories in their Debian system.
To open the command line Terminal, go to the Activities tab in the top left corner of your desktop. Then in the search bar, type the keyword terminal. When the search result appears, click on the Terminal icon to open it.
List Added PPA Repositories
In order to view all the available repositories on your system, execute this command in Terminal:
$ apt policy
An alternative way to view the list of repositories is by printing the contents of /etc/apt/sources.list.d. To do so, run the following command in terminal:
$ ls /etc/apt/sources.list.d
This command will list all repositories that are available on your system.
Add a PPA Repository
Only an authorized user can manage repositories on a Linux system. Use the following syntax in order to add a PPA repository in the system.
$ add-apt-repository ppa:ppa_name
Once you added 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 Jonathonf PPA repository to our system which we will later use for installing FFMpeg an audio/video player.
To add Jonathonf PPA to our system, we will use the following command in the Terminal:
$ sudo add-apt-repository ppa:jonathonf/ffmpeg-4
Once the PPA for FFMpeg is added, use the following command in order to install it:
$ sudo apt-get install ffmpeg
Remove a PPA Repository
In case you want to remove a 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 via this PPA.
For instance, to remove the PPA we added in the previous section, we will have to run the following command:
$ add-apt-repository --remove ppa:jonathonf/ffmpeg-4
Purging a Repository
Purging a repository means removing a package completely from the system including the configuration files and personalized settings. In Linux, you can purge a repository using the utility PPA Purge. To install this utility, run this command in Terminal:
$ sudo apt-get install ppa-purge
Once installed, you can then run the following command to purge a repository:
$ ppa-purge ppa:ppa_name
Incase of above example, the command would be:
$ 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 a repository from this file, use the “rm” command as follows:
$ rm /etc/apt/sources.list.d/ppa_list_file
For instance, to remove the PPA for FFMpeg, first use the following command to find the exact name of the PPA:
$ ls /etc/apt/sources.list.d/
Then use the rm command followed by the exact name of the PPA.
$ sudo rm /etc/apt/sources.list.d/jonathonf-ubuntu-ffmpeg-4-focal.list
Manage PPA Repositories through the GUI
For users who are not comfortable with the Linux command line can use the GUI for managing the repositories. A GUI based Software and Updates utility can help you achieve this purpose.
List Added PPA Repositories
To launch Software and Update utility, hit the super key on your keyboard and enter relevant keywords in the search bar as follows:
The Software and Update utility will by default open in the Debian Software tab. Switch to the Other Software tab in order to view the added repositories to your system.
Add a PPA Repository
If you want to add a new repository to your system, click on the Add button at the bottom of the Other Software tab. By doing so, a dialog box will appear. Here enter the name of the PPA repository as follows and then click the Add Source button.
ppa:PPA_REPOSITORY_NAME/PPA
For instance, to add the PPA repository for FFMpeg, the command would be:
ppa:jonathonf/ffmpeg-4
The system will ask you to provide the password for authentication as only authorized users can make changes to software repository settings. Enter the password and click Authenticate. After that, your repository will be added to the list under the Other Software tab.
Remove a PPA Repository
In order to remove a PPA repository, go to the Other Software tab in the Software and Updates utility. Then select the repository you want to remove and click the Remove button.
That is all there is to it! In this article, we have learned how to add/remove a PPA in a Debian system using the command line and the graphical way. Once you added a PPA, it’s then become very simple to install software using the apt-get command.