Since the installation, I have added not too few PPAs to my 15.04 system because I wanted a specific application. But sometimes I have removed that package later again, because it did not work, was not what I really wanted, or just because I don't need it any more. I don't know if that makes a difference, but some repositories were installed with add-apt-repository
while others just came by a command that just created the file in /etc/apt/sources.list.d/
manually.
Now how can I check whether I have any packages from a PPA installed and if not, remove it from my software sources? This procedure should automatically work through all PPAs.
Here is a script. Without a parameter, the script lists some infos. With
--delete
, thelist
files will be removed, if no packages are installed.Copy the code above in a new file, e.g.:
Make the script executable
And run it with
to list all repositories and the number of installed packages.
Start the script with
to remove the
list
files.Sample output on my system
I don't know of an automatic way, but this method is fairly quick:
Start synaptic package manager and input your password when prompted
In the left column toward the bottom, click on Origin
All the ppas on your system will now be listed at the top of the left column. You can click down the list and see if any software is installed from each. (if there is, there will be a green box by the package name in the right column). If there are many packages from the ppa (too many to see on the screen at once), you can click on the S at the top of the right column to sort them by status.
NOTE: If you have any unused ppas: