Apt package manager¶
Upgrading¶
full-upgrade¶
sudo apt clean
sudo apt --fix-broken install
sudo apt update -m
sudo dpkg --configure -a
sudo apt install -f
sudo apt full-upgrade
Upgrade to next Debian release¶
Purge¶
Add apt repo in secure manner¶
https://wiki.debian.org/DebianRepository/UseThirdParty
Don't install recommended packages¶
Add next release to apt sources¶
export next_release="bookworm"
sudo cat << EOF > /etc/apt/sources.list.d/${next_release}.list
deb http://deb.debian.org/debian ${next_release} main
deb http://deb.debian.org/debian ${next_release}-updates main
EOF
sudo cat << EOF > /etc/apt/preferences.d/${next_release}
Explanation: Debian testing
Package: *
Pin: release o=Debian,n=${next_release}
Pin-Priority: 2
EOF
sudo apt update
Add debian testing to apt sources¶
Warning: testing doesn't provide security updates, so better use codenames
like buster !!!
sudo cat << EOF > /etc/apt/sources.list.d/buster.list
deb http://deb.debian.org/debian/ testing main
deb http://deb.debian.org/debian/ testing-updates main
EOF
sudo cat << EOF > /etc/apt/preferences.d/testing
Explanation: Debian testing
Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 2
EOF
sudo apt update
Extract a .deb file without opening it on Debian or Ubuntu Linux¶
Backports¶
https://backports.debian.org/Instructions/
- there is the NEW queue: http://ftp-master.debian.org/backports-new.html
- there is the IRC channel where you might see discussion, and a bot announcing uploads/acceptance by NEW
- there is a mailing list where you can see uploads and acceptances announced automatically: http://backports.debian.org/Mailinglists/
Setup backports:
echo "deb http://deb.debian.org/debian $(lsb_release -cs)-backports main" > /etc/apt/sources.list.d/backports.list
apt update
List manually installed packages¶
List installed packages with their source¶
apt-forktracer a utility for managing Debian package versions It lets you find out which packages in the system are installed in non-official versions
List non-free packages¶
Add 3rd party repo signing key¶
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/microsoft.gpg
List installed debs¶
apt-mark showmanual > ~/home/varac/ubuntu-migration.20121205.txt
apt-mark showmanual > ~/ubuntu-migration.now.txt
diff ~/ubuntu-migration.20121205.txt ~/ubuntu-migration.now.txt
Purge residual packages (config leftovers from uninstalled packages)¶
dpkg¶
Pinning¶
Pin version:
Add Debian testing repo:
$ cat <<EOF > /etc/apt/preferences.d/testing.pref
Package: *
Pin: release a=testing
Pin-Priority: 1
EOF
echo "deb http://deb.debian.org/debian testing main" > /etc/apt/sources.list.d/testing.list
apt update