This article is a detailed guide to remove PPA repository from the command line in Debian.
Remove PPA Repository from Command Line on Debian?
There are multiple methods to remove PPA repository from the command line on Debian. However, before getting into that it is better to know the ways to list the installed PPA repositories in your Debian.
List Installed PPA Repository on Debian
To list the installed PPA repository in your Debian system, run the below-written command and as an output, it will display a list of all installed PPA repositories:
You can also use the following command to display the PPA repository list from the apt/sources directory:
Another useful way to find the names of installed repositories is by listing the content of /etc/apt/sources.list.d directory:
Then use the ls command to view the installed repositories on Debian:
Remove PPA Repository from Command Line
To remove any repository, you must know its exact name of it and you can find the repository name from any of the above-mentioned methods.
Now to remove the desired repository, you can use any of the below-mentioned methods:
Method 1
First run the following command to get the root access:
This method to remove PPA repository is by using the “–remove ppa” command along with the name of PPA repository. The syntax to use the command is shown below:
For example:
Method 2
Another method to remove PPA repository from the command line on Debian is by using the below-written rm command that manually removes the PPA repository from the /etc/apt/sources.list.d location on Debian, where usually all the PPA repositories are present:
But to run the above command, it is mandatory to use the exact name of the PPA repository, so for that, you can list the names of PPA repositories by using the below-mentioned command:
After that, you can remove any PPA repository from the following command:
And to verify, that the repository has been removed, run the below-mentioned list command again, and you will see that the desired repository is being removed:
Conclusion
PPA repositories allow Debian users to install packages that are not present in the official system repository. However, if a repository is causing trouble in updating the packages, it’s better to remove it using either “add-apt-repository –remove” command or through the “rm” command along with the name of the PPA file.