Tech/OSS/APT

From lathama
< Tech‎ | OSS
Jump to navigation Jump to search

What packages requires a package?

apt-cache rdepends package_name


What package does a file belong to?

apt-file search /path/filename

May need to install apt-file and update the database

apt install apt-file
apt-file update


Purging Packages

Remove a package and any configuration files

apt purge packagename

List files removed but with remaining configuration files

apt list '~c'

Remove any lingering configuration files

apt purge '~c'


Distribution Upgrade

Confirm things
uname -a ; lsb_release -a
Linux hostname 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm
Ensure good starting state
apt update
apt upgrade
apt full-upgrade
Edit sources
13	Trixie
12	Bookworm
11	Bullseye
10	Buster
9	Stretch
8	Jessie
cat /etc/apt/sources.list
deb http://deb.debian.org/debian/ bullseye main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye main contrib non-free
deb http://security.debian.org/ bullseye-security main contrib non-free
deb-src http://security.debian.org/ bullseye-security main contrib non-free
cat /etc/apt/sources.list
deb http://deb.debian.org/debian/ bookworm main non-free-firmware contrib
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware contrib
deb http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib
deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib
Clean and update package database
apt clean
apt update
do the upgrade
apt upgrade
apt full-upgrade
Optional
apt autoremove
Reboot
systemctl reboot