Table of Contents

Apt

Update

## update /etc/apt/sources.list
sudo apt-get update
sudo apt-get check
sudo apt-get upgrade
sudo apt-get -s upgrade
sudo apt-get -u upgrade
sudo apt-get dist-upgrade
sudo apt-get -s dist-upgrade
sudo apt-get -u dist-upgrade
sudo apt-get clean
sudo apt-file update
apt-cache search foo
apt-file update
apt-file search tcl.h

Recovery

apt-get install -f
dpkg --configure -a

Debian Upgrade: Bookworm(12) to Trixie(13)

https://wiki.debian.org/DebianReleases
https://www.debian.org/releases/trixie/release-notes/upgrading.html

Debian Upgrade: Bullseye(11) to Bookworm(12)

https://wiki.debian.org/DebianReleases
https://www.debian.org/releases/bookworm/amd64/release-notes/ch-upgrading.html
https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html

## Preparation
sudo apt install zstd
## Start from pure Debian
cat /etc/debian_version
lsb_release -a
apt-forktracer
sudo apt install gpgv
dpkg --audit
#dpkg --get-selections | grep 'hold$'
apt-mark showhold
## Preparing Source List
cd /etc/apt
cat sources.list | sed 's/^/#/g' | sudo tee sources_bullseye.list
cat sources.list | sed 's/^/#/g' | sed 's/bullseye/bookworm/g' | sudo tee sources_bookworm.list
cat sources_bookworm.list | sed 's/^#//g' | sudo tee sources.list
cd /etc/apt/sources.list.d
sudo mkdir -p .archive
for i in *.list ; do
    cat ${i} | sed 's/^/#/g' | sudo tee .archive/${i%.list}_bullseye.list
    cat ${i} | sed 's/^/#/g' | sed 's/bullseye/bookworm/g' | sudo tee .archive/${i%.list}_bookworm.list
    cat .archive/${i%.list}_bookworm.list | sed 's/^#//g' | sudo tee ${i}
done
## Upgrading Packages
sudo apt update
sudo apt -o APT::Get::Trivial-Only=true full-upgrade
sudo apt upgrade --without-new-pkgs
sudo apt full-upgrade

Available Options for Configuration Files:

  1. Install the Package Maintainer's Version
    • Original configuration file is copied with post-fix '.ucf-old' to the same location
  2. Keep the Local Version Currently Installed (Default)
    • Possible safest way
## Preparing for the Next Release
sudo apt list '~c'
sudo apt purge '~c'

Troubleshooting - Google Cloud

https://www.reddit.com/r/debian/comments/1ck52xg/conflicting_distribution_for_google_cloud_compute/

## W: Conflicting distribution: http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-bookworm
##  InRelease (expected google-cloud-packages-archive-keyring-bookworm but got google-cloud-packages-archive-keyring-bookworm-stable)
## N: Skipping acquire of configured file 'main/binary-amd64/Packages' as repository
##  'http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-bookworm InRelease' doesn't support architecture 'amd64'

Comment out the specified line in /etc/apt/sources.list.d/gce_sdk.list

Troubleshooting - Trivial Only

## E: Trivial Only specified but this is not a trivial operation.

This is expected behavior with 'APT::Get::Trivial-Only' enabled and does not indicate a problem
Just check the required disk space at this point

Debian Upgrade: Buster(10) to Bullseye(11)

https://wiki.debian.org/DebianReleases
https://www.debian.org/releases/bullseye/amd64/release-notes/ch-upgrading.html
https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.html

## Start from pure Debian
cat /etc/debian_version
lsb_release -a
apt-forktracer
dpkg --audit
dpkg --get-selections | grep 'hold$'
## Preparing Source List
cd /etc/apt
cat sources.list | sed 's/^/#/g' | sudo tee sources_buster.list
cat sources.list | sed 's/^/#/g' | sed 's/buster/bullseye/g' | sed 's/\/updates/-security/g' | sudo tee sources_bullseye.list
cat sources_bullseye.list | sed 's/^#//g' | sudo tee sources.list
cd /etc/apt/sources.list.d
sudo mkdir -p .archive
for i in *.list ; do
    cat ${i} | sed 's/^/#/g' | sudo tee .archive/${i%.list}_buster.list
    cat ${i} | sed 's/^/#/g' | sed 's/buster/bullseye/g' | sudo tee .archive/${i%.list}_bullseye.list
    cat .archive/${i%.list}_bullseye.list | sed 's/^#//g' | sudo tee ${i}
done
## Upgrading Packages
sudo apt update
sudo apt -o APT::Get::Trivial-Only=true full-upgrade
sudo apt upgrade --without-new-pkgs
sudo apt full-upgrade

Available Options for Configuration Files:

  1. Install the Package Maintainer's Version
    • Original configuration file is copied with post-fix '.ucf-old' to the same location
  2. Keep the Local Version Currently Installed (Default)
    • Possible safest way
    • New configuration file is stored with post-fix '.ucf-dist' to the same location
## Preparing for the Next Release
dpkg -l | awk '/^rc/ {print $2}'
sudo apt purge $(dpkg -l | awk '/^rc/ {print $2}')

https://unix.stackexchange.com/questions/758100/in-debian-bullseye-does-systemd-timesyncd-check-for-other-ntp-daemons
https://tracker.debian.org/news/1115332/accepted-systemd-2454-2-source-amd64-into-unstable-unstable/
https://wiki.archlinux.org/title/systemd-timesyncd

systemctl list-unit-files
## UNIT FILE                              STATE           VENDOR PRESET
## dbus-org.freedesktop.timesync1.service bad             enabled
#sudo apt purge systemd-timesyncd
sudo rm -f /etc/systemd/system/dbus-org.freedesktop.timesync1.service
#sudo rm -f /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service

References

https://www.debian.org/releases/