cat /etc/os-release
cat /etc/debian_version
uname -r
mkdir -p /root/backup-debian11-to-12
cp -a /etc /root/backup-debian11-to-12/
cp -a /var/lib/dpkg /root/backup-debian11-to-12/
cp -a /var/lib/apt/extended_states /root/backup-debian11-to-12/
dpkg --get-selections '*' > /root/backup-debian11-to-12/dpkg-selections.txt
apt-mark showmanual > /root/backup-debian11-to-12/apt-manual.txt
apt update
apt upgrade -y
apt full-upgrade -y
apt autoremove -y
apt autoclean
grep -Rhv '^\s*#' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null
apt-cache policy
cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
mkdir -p /root/backup-debian11-to-12/sources.list.d
cp -a /etc/apt/sources.list.d /root/backup-debian11-to-12/
cat > /etc/apt/sources.list <<'EOF'
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
EOF
apt upgrade --without-new-pkgs -y
cat /etc/os-release
cat /etc/debian_version
uname -r
apt update
apt full-upgrade -y
dpkg --audit
apt --fix-broken install
systemctl --failed
journalctl -p err -b
apt autoremove --purge -y
apt autoclean
dpkg -l | awk '/^rc/ {print $2}'
dpkg -l | awk '/^rc/ {print $2}' | xargs -r dpkg --purge