apt repos¶
List installed packages¶
Find package by name: apt search "qt.*5.*-dev"¶
For example find all qt5 dev packages needed for development:
or find all corresponding packages with debug symbols:
Find package by name: apt search --names-only¶
Another alternative, to search only in package names:
Find package by file: apt-file find or dpkg -S¶
Find files by package: apt-file list or dpkg -L¶
Add a repo¶
List all active repositories¶
Remove a repo¶
Remove both — packages installed from a repo and repo itself:
Securely add repo keys¶
Source articles: Ubuntu.SecureApt, Debian.SecureApt.
Checking trust path:
$ GET https://download.owncloud.org/download/repositories/8.2/Ubuntu_15.10/Release.key | gpg --import
$ gpg --check-sigs --fingerprint 5180350A
pub   2048R/5180350A 2015-10-08 [expires: 2017-12-16]
      Key fingerprint = BCEC A903 25B0 72AB 1245  F739 AB7C 32C3 5180 350A
uid                  ce OBS Project <ce@s2.owncloud.com>
sig!3        5180350A 2015-10-08  ce OBS Project <ce@s2.owncloud.com>
1 signature not checked due to a missing key
Now you can verify and check imported key info, download other keys, for example:
$ gpg --list-sigs --fingerprint 5180350A
pub   2048R/5180350A 2015-10-08 [expires: 2017-12-16]
      Key fingerprint = BCEC A903 25B0 72AB 1245  F739 AB7C 32C3 5180 350A
uid                  ce OBS Project <ce@s2.owncloud.com>
sig 3        5180350A 2015-10-08  ce OBS Project <ce@s2.owncloud.com>
sig 3        479BC94B 2015-10-08  [User ID not found]
$ gpg --recv-keys 479BC94B
gpg: requesting key 479BC94B from hkp server keys.gnupg.net
gpg: key 479BC94B: public key "ownCloud build service <obsrun@localhost>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
$ gpg --check-sigs --fingerprint 5180350A
pub   2048R/5180350A 2015-10-08 [expires: 2017-12-16]
      Key fingerprint = BCEC A903 25B0 72AB 1245  F739 AB7C 32C3 5180 350A
uid                  ce OBS Project <ce@s2.owncloud.com>
sig!3        5180350A 2015-10-08  ce OBS Project <ce@s2.owncloud.com>
sig!3        479BC94B 2015-10-08  ownCloud build service <obsrun@localhost>
and then I check the trust path from my key to at least one of the keys used to sign the archive key. Only if I find an acceptable path will I then tell APT to trust the key: