apt
Table of Contents
- 1. Remove packages configuration files leftovers
~c - 2. Remove obsolete packages
~o - 3. List installed packages
~i - 4. List upgradable packages
~U - 5. List packages filtered by
Origin - 6. Install
packagefrom Debianstable - 7. Install
packagefrom Debianbackports - 8. Configure periodic updates
- 9. Related nodes
- 10. References
1. Remove packages configuration files leftovers ~c
Quote from notes:aptitude README.
?config-files, ~c
Matches packages which have been removed, but whose configuration files remain on the system (ie, they were removed but not purged).
See notes:aptitude#search-terms for the search term reference.
apt list '~c' apt purge '~c'
2. Remove obsolete packages ~o
Quote from notes:aptitude README.
?obsolete, ~o
This term matches any installed package which is not available in any version from any archive. These packages appear as “Obsolete or Locally Installed” in the visual interface.
See notes:aptitude#search-terms for the search term reference.
apt list '~o' apt purge '~o'
3. List installed packages ~i
See notes:aptitude#search-terms for the search term reference.
apt list '~i'
apt list [-i,--installed]
4. List upgradable packages ~U
See notes:aptitude#search-terms for the search term reference.
apt list '~U'
apt [-qq] list [-u,--upgradeable]
5. List packages filtered by Origin
See notes:apt-cache to find Origin.
5.1. List installed packages whose Origin is Raspberry Pi Foundation
apt list '?origin(Raspberry Pi Foundation) ?installed'
5.2. List installed packages whose Origin is not Debian
Long and short form of the same command, see notes:aptitude#search-terms.
apt list '?narrow(?installed, ?not(?origin(Debian)))' apt list '~S ~i !~ODebian'
6. Install package from Debian stable
apt install linux-image-amd64/stable
7. Install package from Debian backports
apt install linux-image-amd64/trixie-backports
8. Configure periodic updates
See the apt.systemd.daily file for documentation.
- https://salsa.debian.org/apt-team/apt/-/blob/main/debian/apt.systemd.daily
- file:///usr/lib/apt/apt.systemd.daily
Create this file /etc/apt/apt.conf.d/10periodic to update the
package lists every 2 days.
# See /usr/lib/apt/apt.systemd.daily for documentation. APT::Periodic::Enable "1"; APT::Periodic::Update-Package-Lists "2"; APT::Periodic::Download-Upgradeable-Packages "0"; APT::Periodic::Unattended-Upgrade "0";
APT::Periodic::Enable "1";Enable the update/upgrade script (0to disable).APT::Periodic::Update-Package-Lists "2";Do “apt-get update” everyNdays (0to disable).APT::Periodic::Download-Upgradeable-Packages "0";Do “apt-get upgrade –download-only” everyNdays (0to disable).APT::Periodic::Unattended-Upgrade "0";Upgrade packages with theunattended-upgradescript everyNdays (0to disable), see notes:unattended-upgrades.
You can check the current configuration with apt-config (see
notes:apt-config).
apt-config dump "APT::PERIODIC"
See notes:unattended-upgrades for installing updates automatically.