2023-06-11 Upgrading Debian Bullseye (11) to Bookworm (12)

Between a run and a shower…

That feeling when you think about upgrading the operating system.

I’m reading the release notes, and following the instructions. I started reading at 14:20, and I logged into the server at 14:34. – 2021-08-30 Upgrading Debian Buster (10) to Bullseye (11)

2021-08-30 Upgrading Debian Buster (10) to Bullseye (11)

I’m feeling hopeful!

# My selections
dpkg --get-selections '*'>debian.selections
# Update bullseye
apt update
apt upgrade
# Listing obsolete stuff
apt list '~o'
# libmojo-useragent-role-queued-perl/now 1.15-1
# libtext-spanningtable-perl/now 1.000000-1
# thelounge/now 4.4.0
# Try again, different command
apt list '?narrow(?installed, ?not(?origin(Debian)))'
# libmojo-useragent-role-queued-perl/now 1.15-1
# libtext-spanningtable-perl/now 1.000000-1
# nodejs/unknown,now 19.9.0-deb-1nodesource1
# thelounge/now 4.4.0
# Don't know what to do about them, so not doing anything
# Checking for old upgrade related files
find /etc -name '*.dpkg-*' -o -name '*.ucf-*' -o -name '*.merge-error'
# Deleting old upgrade related files
find /etc '(' -name '*.dpkg-*' -o -name '*.ucf-*' -o -name '*.merge-error' ')' -exec rm '{}' ';'
# Removing old stuff and making space
apt autoremove
apt clean
# Replace bullseye with bookworm
emacs /etc/apt/sources.list
# Start recording
script -t 2>~/upgrade-bookworm-step1.time -a ~/upgrade-bookworm-step1.script
# Update the system
apt update
# Simple upgrade first
apt upgrade --without-new-pkgs
# Resolve conflicts in /etc/radicale/config
# Full upgrade next
apt full-upgrade
# Resolve conflicts in /etc/news/inn.conf
# Resolve conflicts in /etc/monit/monitrc
# Resolve conflicts in /etc/prosody/migrator.cfg.lua
# Resolve conflicts in /etc/ssh/moduli
# Resolve conflicts in /etc/ssh/sshd_config
# Resolve conflicts in /etc/apache2/conf-available/security.conf
# Resolve conflicts in /etc/logrotate.d/apache2
# Resolve conflicts in /etc/news/expire.ctl
# Resolve conflicts in /etc/news/incoming.conf
# Resolve conflicts in /etc/news/innfeed.conf
# Resolve conflicts in /etc/news/newsfeeds
# Resolve conflicts in /etc/news/nntpsend.ctl
# Resolve conflicts in /etc/news/readers.conf
# Resolve conflicts in /etc/systemd/journald.conf
# I hate the number of conflicts! INN2 in particular. Oooof!

Aaaand… the host is offline.

Let’s just wait because we have guests coming… and we’re back online!

Everything seems to be working. 😅

# remove packages that are no longer required
apt auto-remove
# purge configs of packages that have been removed
apt purge $(dpkg -l | awk '/^rc/ { print $2 }')

In order to prevent apt from reminding me about the non-free-firmware split, I created the file “/etc/apt/apt.conf.d/no-bookworm-firmware.conf” with this line:

APT::Get::Update::SourceListWarnings::NonFreeFirmware "false";

See note.

note

Later stuff

Had to change some service definitions and add PERL5LIB for some systemd services I’m running. I think previously I had just set the full path to the Perl binary which resulted in the execution environment containing system Perl libraries. It’s a miracle it worked!

Environment="NNTPSERVER=localhost"
Environment="NEWS_INTRO_ID=<4e48.646df737.6224c@melanobombus.fritz.box>"
Environment="PERL5LIB=/home/alex/perl5/perlbrew/perls/perl-5.32.0/lib"
ExecStart=/home/alex/perl5/perlbrew/perls/perl-5.32.0/bin/perl /home/alex/perl5/perlbrew/perls/perl-5.32.0/bin/news daemon --mode=production --listen='http://*:4026'

Environment="PERL5LIB=/home/alex/perl5/perlbrew/perls/perl-5.32.0/lib"
ExecStart=/home/alex/perl5/perlbrew/perls/perl-5.32.0/bin/perl \
 /home/alex/perl5/perlbrew/perls/perl-5.32.0/bin/phoebe \
 …

This was not enough, Phoebe still didn’t start.

cpanm --notest Net::SSLeay
cpanm IO::Socket::SSL

Something is still wrong. When Phoebe wants to access SSL client cert fingerprints, it crashes.

phoebe.service: Main process exited, code=killed, status=11/SEGV

I think I managed to isolate the problem: `$stream->handle->get_fingerprint()` didn’t crash in the past if there was no client certificate. It seems that Phoebe works fine if I test for `$stream->handle->peer_certificates` before getting the fingerprint. (Reported as Issue ​#136.)

Issue ​#136

I noticed that my Mastodon bots no longer work. They use a Python library.

Traceback (most recent call last):
  File "/home/alex/src/rss-bot/./bot.py", line 16, in <module>
    from mastodon import Mastodon
ModuleNotFoundError: No module named 'mastodon'

When I try to install it via pip:

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

Wow, didn’t see that coming.

But, lucky me! This works:

apt install python3-mastodon python3-html2text

I think this is also weird? I found Monit not running twice. So:

systemctl enable monit
systemctl start monit

​#Debian ​#Administration ​#Perl ​#Phoebe ​#Python