How to remove/delete a PPA repository in Ubuntu 22.04

PPA (Personal Package Archive) contains a set of packages hosted by the Launchpad server, also known as unofficial repositories. There are a lot of packages that do not come in the default repository of Ubuntu, and to install them, we have to add their PPA repositories to the Ubuntu sources.list. However, having unnecessary and unwanted PPA can slow down the system update process and consume storage, and in such a scenario, it is better to remove or delete such repositories.

This blog will explore the method of removing and deleting the PPA repository in Ubuntu 22.04.

How to Remove/Delete a PPA repository in Ubuntu 22.04?

There are two important methods to remove a PPA repository:

Below-given section will discuss both methods in detail.

Method 1: Remove/delete a PPA Repository in Ubuntu Using Terminal

how to handle linux files and direc...

Firstly, we will list down all the added PPA repositories in Ubuntu:

$ apt policy

As you can see in the given output, some PPA repositories have been added. Now, to delete these repositories through the terminal, we have three possible methods:

  • Use the add-apt-repository command
  • Remove it from sources.list
  • Use the ppa-purge command

Check out each of them one by one!

Example 1: Use add-apt-repository Command to Remove a PPA repository

In Ubuntu, the utility of the add-apt-repository has been pre-installed to manage the PPA repositories, if you want to use this utility to remove the PPA repository, then the general syntax will be:

$ sudo add-apt-repository --remove [ppa:ppa-file]

Here, the add-apt-utility runs with its “–remove” option and type the PPA repository name instead of [ppa:ppa-file].

For example, we will remove the “webupd8team” repository by following the above general syntax:

$ sudo add-apt-repository --remove ppa:webupd8team/y-ppa-manager

Note: You can also use the “-r” option instead of “–remove” in the above command.

Example 2: Removing a PPA repository from sources.list

You may know that all the packages and added repositories are stored in the /etc/apt/sources.list.d/. So, we can also remove the PPA repository directly from the sources list with the rm command.

For example, we will remove the PHP repository from the sources.list:

$ sudo rm /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list

The execution of the above command indicates that the repository has been removed successfully.

Example 3: Use ppa-purge Command to Remove a PPA repository

To use the ppa-purge command firstly, install it with the help of apt:

$ sudo apt install ppa-purge -y

After doing so, execute the ppa-purge command and specify the repository name you want to remove. For example, to remove the light table PPA repository, we will execute the command:

$ sudo ppa-purge ppa:dr-akulavich/lighttable

Now, let’s check out the GUI method to perform the same operation.

Method 2: Remove/Delete a PPA Repository in Ubuntu Using GUI

To remove the PPA repository using GUI, we will search and open the “Software & Updates” app in the Application’s search bar:

Then, navigate to the “Other Software” tab:

Mark the PPA repositories checkboxes, which you want to remove and click on the “Remove” button:

As a result, the selected PPA repositories will be removed from your Ubuntu 22.04 system:

We have provided different methods related to removing PPA repositories in Ubuntu 22.04.

Conclusion

To remove or delete a PPA repository in Ubuntu 22.04, you can use the “add-apt-repository” command with the “–remove” option, “ppa-purge” command, or directly remove it from the sources.list. Moreover, the selected PPA repository can also be removed through GUI using the “Software & Updates” app. This guide demonstrated the procedure of removing a PPA repository in Ubuntu 22.04.