Find what packages are installed from a repository

Solution 1:

In brackets, you should use only the name of the repository, not the URI or something else. For example in your case:

aptitude search "?origin (ubuntu-wine) ?installed"

Run apt-cache policy to see the repositories and the names (aka origin, o) of those:

$ apt-cache policy | grep wine
 500 http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu xenial/main i386 Packages
     release v=16.04,o=LP-PPA-ubuntu-wine,a=xenial,n=xenial,l=Wine Team PPA,c=main,b=i386
 500 http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu xenial/main amd64 Packages
     release v=16.04,o=LP-PPA-ubuntu-wine,a=xenial,n=xenial,l=Wine Team PPA,c=main,b=amd64

Since the search string is a regex pattern matched anywhere in the string, you can use a convenient substring like ubuntu-wine, or even just wine.

See also: How can I get a list of all repositories and PPAs from the command line into an install script?

Solution 2:

Here is a shell script I wrote to display packages installed from different origins excluding Ubuntu. It uses common dpkg -l output format. It works faster than aptitude solutions.

#!/bin/sh

# Print packages installed from different origins.
# Exclude standard Ubuntu repositories.

grep -H '^Origin:' /var/lib/apt/lists/*Release | grep -v ' Ubuntu$' | sort -u \
| while read -r line; do
    origin=${line#* }    
    echo $origin:
    
    list=${line%%:*}
    sed -rn 's/^Package: (.*)$/\1/p' ${list%_*Release}*Packages | sort -u \
    | xargs -r dpkg -l 2>/dev/null | grep '^.i '
    echo
 done

Note that there may also be installed packages that have no such origin available, see this to find them.

Solution 3:

Origin is not URL of repository. To find Origin of repository look for file in /var/lib/apt/lists/ ending with Release.

For example

grep "Origin" /var/lib/apt/lists/linux.dropbox.com_debian_dists_wheezy_Release

Will show:

Origin: Dropbox.com

So aptitude search "?origin(dropbox.com) ?installed" will show me installed package from dropbox repository.

Solution 4:

From the command line If you like to do means

awk '$1 == "Package:" { if (a[$2]++ == 0) print $2; }' /var/lib/apt/lists/*PPA-FIRST-PART*PPA-SECOND-PART*Packages

for example : All there are packages from noobslab

 jai@frank-Jai:~$ awk '$1 == "Package:" { if (a[$2]++ == 0) print $2; }' /var/lib/apt/lists/*noobslab*Packages

python-logilab-common
synapse
ubuntuone-client
python-ubuntuone-storageprotocol
ubuntuone-client-gnome
python-ubuntuone-client
lives
libweed0
libweed-dev
lives-data
converseen
minitube
libsyncdaemon-1.0-1
libsyncdaemon-1.0-dev
ubuntu-sso-client
python-ubuntuone-devtools
ubuntuone-dev-tools
ubuntuone-control-panel
python-ubuntuone-control-panel
synapse-dbg
gir1.2-syncdaemon-1.0
libweed-dbg
lives-dbg
umplayer
umplayer-translations
libgranite-dev
deepin-software-center
ubuntuone-control-panel-qt
python-dirspec
rhythmbox-ubuntuone
python-ubuntu-sso-client
ubuntu-sso-client-qt
python-ubuntu-sso-client.tests
granite-demo
ubuntuone-client-proxy
python-oauthlib
slidewall
python3-dirspec
python3-oauthlib
ubuntuone-client-data
libgranite1
libgranite1-dbg
gir1.2-granite-1.0
libgranite-common
curlew
fbmessenger
open-as-administrator
indicator-synapse
indicator-synapse-dbg
wallpaper-manager
awoken-icon-theme
malys-uniblack
malys-uniblue
malys-ex
acyl-icons
nitrux-icons
piratunbu-icons
azenis-green-icons
nouvegnome-color
nouvegnome-gray
hi-lights-icons
matrilineare
zoncolor-icons
royal-linux-icons
elementary-icons
myhumanity
myelementary
glass-icons
osx-nostalgie
sky-blue-cinnamon
sky-blue-gnome
sky-blue-unity
wine-blue-remix
lubuntubox
windows7-icons
appleart-icons
magical-lights-icons
colored-plastic-icons
numix-utouch-icon-theme
ubudao-style
artnet-icons
high-delight-icons
snow-sabre-icons
trevilla-icons
aery-icons
ambiance-blue
zukitwo
gnomishbeige-theme
salience-theme
zukiwi
gnomishgray
delorean-dark
smoothly-theme
ambiance-ds-blue
ambiance-lime
gnomishdark
zukitwo-cupertino-gs
mediterranean-theme
elementaryish
borderline
boje
wow-2
zoncolor-themes
omg-suite
simplex
leopard-steel
dorian-theme
daylight
adwaita-elements
uncomplicated
trevilla-jmhzonedark
trevilla-dark
trevilla-white
trevilla-whiteblue
trevilla-whiteorange
trevilla-white2
ambiancep-set
ambiance-crunchy
trevilla-gray
siva-series-gtk
cobibird
elegant-brit
mac-ithemes-noobslab
mac-icons-noobslab
ubuntu-touch-themes
windows8-theme
bigfootblue-cinnamon
windows8-cinnamon
eliza1-cinnamon
bigfootred-cinnamon
plus1-theme
futura
blo-theme
darkair-theme
plane-gtk3
deepin-gtk-theme
nokto-theme
numix-theme
neptune-theme
trevilla-themes
jai@frank-Jai:~$ 

Credit goes here

Solution 5:

Then you can use Y-PPA manager. Open your terminal and type:

sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager

Then open your Unity dash and search with Y -PPA and then open the Icon.

enter image description here

Click at manage PPAs as shown in the image and then select one PPA and it will give you the details of the PPA and Its packages.