I installed many packages from many PPAs on my system. I want to list all the installed packages which are installed from launchpad PPAs, not repositories.
Is this possible through command-line?
I installed many packages from many PPAs on my system. I want to list all the installed packages which are installed from launchpad PPAs, not repositories.
Is this possible through command-line?
The following command returns the package name and its ppa (if installed from a ppa):
Details:
dpkg --get-selections
gives only the installed packages aftergrep -v deinstall$
awk '{ print $1 }'
returns only the package nameperl -e '@a = <>; $a=join("", @a)'
concatenates all the lines returned byapt-cache policy
$a =~ s/\n(\S)/\n\n$1/g;
adds a newline between each package section@packages = split("\n\n", $a);
is a perl array containing all the packages infos, one package per item.foreach $p (@packages) {print "$1: $2\n" if $p =~ /^(.*?):.*?500 http:\/\/ppa\.launchpad\.net\/(.*?)\s/s}
is a loop where the package and the ppa are printed if a ppa with prio 500 is found in the policy.aptitude
command below shows list of installed packages for active PPA's insources.list
.~Oppa
means Origin contains 'ppa'Reference: aptitude - Search term reference
In case PPA repository was removed, packages become obsolete. Alternatively use this filter instead
~Oppa | -o
reference:How to get a list of all packages installed from PPAs even for PPA repositories that may have been removed
The source of an installed package can be checked using
apt-cache
, for example$ apt-cache policy oracle-java7-installer
The output of
apt-cache policy <package_name>
contains the source.One can use the following script to obtain the list of packages installed from PPAs.
In accordance with this answer and this post, you can get a list of all packages from all the PPAs installed on your system using the following bash code:
And in accordance with this answer, you can get a list of all installed packages in your system using:
Now, let's join these two ideas to get a list of all the packages which are installed from PPAs:
Install synaptic. You can then browse packages by "origin" or even any other custom filter.
I wanted to know how many packages I had from each ppa, so I slightly modified Sylvain's awesome answer:
by printing ppa first and using only first 40 characters to count & deduplicate with
uniq
, I can get this kind of output: