You are not logged in.

#1 2024-05-12 02:23:44

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,553
Website

Upgrade from Beryllium to Boron

Upgrading to Bunsenlabs Boron

Bunsenlabs is built on Debian Stable. Boron is based on Debian 12, Bookworm.
You can upgrade from the old version to the new by changing the sources for packages, and then do an update/upgrade/full-upgrade.

There is no guarantee that the upgrade can be carried out completely error-free. Some precautions are advisable.
Following this tutorial, and the references linked below, will minimize the risk.

NOTE: if you are still using BunsenLabs Lithium then you should first upgrade from Lithium to Beryllium. Do not try to jump over two releases - something will almost certainly break. If your system is older than BunsenLabs Lithium you should back up all your data and do a fresh install of BunsenLabs Boron.

When considering how much time and effort to devote to making sure the upgrade goes perfectly, you might want to compare that with the trouble you will have if your system is damaged. If you are working on a "play" machine where you can just reinstall from scratch then there's less need to worry than if the computer is your main working machine.

1 Prepararations

1.1  Back up any data or configuration information
Before upgrading your system, it is strongly recommended that you make a full backup, or at least back up any data or configuration information you can't afford to lose. The upgrade tools and process are quite reliable, but a hardware failure in the middle of an upgrade could result in a severely damaged system.

Probably the most irreplaceable thing is your personal data. If you know where it came from and can download it again then no problem, but things you have created - photos, scripts, email messages, etc etc must be backed up in at least one other place. Of course this applies whether or not you're just about to do a system upgrade! A backup policy is a topic in itself and well worth spending some time on.

Some things you'll want to back up are the contents of /etc, /var/lib/dpkg, /var/lib/apt/extended_states and the output of dpkg --get-selections "*" (the quotes are important). If you use aptitude to manage packages on your system, you will also want to back up /var/lib/aptitude/pkgstates.
You may want to make a backup of the hidden files and directories (“dotfiles”) in users' home directories. This backup may help to restore or recreate the old settings.

After making a backup, check that you are able to restore your system from it!

1.2  Update all packages to latest version

$ sudo apt update
$ sudo apt upgrade

1.3 Make sure you have enough free disk space: ~5GB    
A lot of data is downloaded during the upgrade and you must have enough free disk space to store it or the upgrade will fail.
After you edit the sources lists apt can show you an estimate of the disk space needed for the installation. See step 2.5 below.
After the upgrade is finished there will likely be a lot of downloaded packages in the apt cache, which you might then consider cleaning out. See Section 4 below.

1.4 Clean
1.4.1 Remove unnecessary auto installed packages

$ sudo apt autoremove

1.4.2 Check for unused large packages
You may have large packages on your system that you no longer use but which are taking up a lot of space, and would also slow down the upgrade.

You can use synaptic to check for big packages:
Settings>Preferences>Columns and Fonts: make sure "size" column is displayed, move it near the top.
Then in main display on the left choose Status>Installed, click on the Size column to get the biggest ones at the top.

If you know your hardware - and what firmware it needs - well, some of the firmware packages are pretty big and might possibly be candidates for removal.

If you have manually added other packages or files, like fonts, then you should remove them before starting the upgrade. They can be the cause of mysterious errors.
You can re-add such software after the upgrade if you still need it.

1.4.3  Remove obsolete packages
Obsolete packages (not in any repository on your list anymore) are a security risk (they don't get any (security-)updates)). They can also complicate the upgrade.

You can list obsolete and locally installed packages with the command:

$ apt list  '~o'
# or
$ aptitude search ?obsolete

You can filter them out in synaptic:
Menu > System > Synaptic Package Manager > Status > Installed (local or obsolete)

But be careful! Packages which you have downloaded or compiled yourself will appear in the "obsolete" list, along with packages which are automatically compiled and installed by other packages (an example is libdvd-pkg which when installed will compile libdvdcss2 and libdvdcss-dev).

Before removing "obsolete" packages, make sure you really don't need them!

2 Edit Bunsenlabs and Debian sources list
  • Debian repositories are listed in /etc/apt/sources.list and /etc/apt/sources.list.d

  • The default file for the Bunsenlabs repo is /etc/apt/sources.list.d/bunsen.list

  • Backport sources are in /etc/apt/sources.list.d/debian-[named.version]-backports.list and /etc/apt/sources.list.d/bunsen-[named.version]-backports.list

Editing sources lists, requires root privileges. Thunar file-manager has an option: "open as root".

2.1 Disable Backports
By definition, backported packages are supposed to upgrade smoothly to the next stable version (ie bullseye-backports > bookworm), so backported packages may no longer be necessary. Disable your backports sources before a dist-upgrade (disable by commenting out the lines with "#"). After the dist-upgrade, see if the packages are still required  (or even available) - just because a package was available in bullseye-backports doesn't always mean there's a bookworm-backports version. In any case, do not install a backported package unless you are sure you need it.

  Also disable Debian proposed-updates if they are enabled.

2.2 Disable third-party repositories
We recommend that these are disabled before trying a dist-upgrade.You can then research again to see if they're still necessary, and if so put them back in. We don't count BunsenLabs (BL) repos as third-party repositories.
To see all your currently enabled repositories:

inxi --repos

2.3 Other preparation
Power Users might want to check these over:

2.3.1 Disable any APT pinning
See the Debian upgrade guide.

2.3.2 Check packages status
The following command will show any packages which have a status of Half-Installed or Failed-Config, and those with any error status:

sudo dpkg --audit

2.3.3 Remove any package holds
If any package that is essential for the upgrade is on hold, the upgrade will fail:

apt-mark showhold

OTOH if you changed and recompiled a package locally, and didn't rename it or put an epoch in the version, you must put it on hold to prevent it from being upgraded. The “hold” package state for apt can be changed using:

sudo apt-mark hold <package_name>

Replace hold with unhold to unset the “hold” state.

2.4 Change to the new apt sources

For updating from Beryllium to Boron, change /etc/apt/sources.list.d/bunsen.list from:

deb https://pkg.bunsenlabs.org/debian beryllium main

to

deb https://pkg.bunsenlabs.org/debian boron main

To edit the Debian repos, edit /etc/apt/sources.list. Depending on which mirror (https://www.debian.org/mirror/list) you use, change the sources from:

deb https://deb.debian.org/debian bullseye main contrib non-free
deb https://deb.debian.org/debian bullseye-updates main contrib non-free
deb https://deb.debian.org/debian-security bullseye-security main contrib non-free

to

deb https://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb https://deb.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

NOTE:
1) There is a new component "non-free-firmware" in the apt archives from Debian Bookworm.
2) The official repos now support https:, which is recomended, so sources urls should begin with "https:"

2.5 Check disk space needed by upgrade

Before executing the upgrade, you can see an estimate of the needed disk space by running: 

$ sudo apt update
$ sudo apt -o APT::Get::Trivial-Only=true full-upgrade 

Make sure you have enough before starting the upgrade.
One way to check your current free disk space is:

df -h /
3: Run the upgrade process

The recommended way to upgrade from previous Debian releases is to use the package management tool apt.
It is safer to run the upgrade in a console tty (Ctrl+Alt+F[1-6]). The upgrade should be done on a text console, because your desktop environment could freeze during post-install/service restarts, leaving the system in a broken state.
If you are upgrading remotely, in an ssh-connection, run the upgrade in a virtual console like screen or tmux. Then the process wont be interrupted if the connection goes down.

To upgrade, run the following commands in sequence:

3.1 Apt update
(The update is needed if it wasn't run at step 2.5.)

$ sudo apt update

3.2 Minimal upgrade
In some cases, doing the full upgrade directly might remove large numbers of packages that you will want to keep. The safer way is to do a minimal upgrade first:

$ sudo apt upgrade  --without-new-pkgs

Even the minimal upgrade will install a lot of packages.

3.3 Reboot
It's probably a good idea to reboot at this point so that the latest kernel gets loaded before continuing.

3.4 Full upgrade
Finally, bring in the rest of the upgrade:

$ sudo apt full-upgrade

3.3 Reboot again
Reboot, when upgrade is complete.

4 Post-Upgrade configuration

NOTE Be sure to reboot so you know the machine will boot from the current kernel before cleaning out any old packages. See this user's comment.

When logged in, the bl-user-setup script will check for changed user config files, and offer the choice to update them to new default versions. From 'man bl-user-setup':

...
This script is run non-interactively on a user's first login, and on  subsequent  logins
       to  check  for  new  default configurations in /usr/share/bunsen/skel that may have come
       from a package upgrade.  User set configurations will not be  modified  without  permission.

       It  can also be run manually with custom options....

4.1  Cleanup

4.1.1 Again, remove unnecessary packages.

sudo apt autoremove

4.1.1 Again, check for obsolete packages.

4.1.2 Check the apt cache.
You might consider cleaning the apt cache of downloaded packages which have been installed during the upgrade. If disk space is no problem on your machine, the apt cache will save unnecessary downloads if for some reason you're running install and uninstall of a certain package repeatedly. But if disk space is short, you can run

sudo apt autoclean

or

sudo apt clean

to clear it out (see 'man apt-get').

4.2 Check for new functions in BL (new packages).
The packages "bunsen-configs" and "bunsen-configs-lite", will also install new BL packages.
You can search for uninstalled BL packages in synaptic. Search for "bunsen-".

4.2.1 Install optional new packages.
The default Boron menu uses icons - you will want to install the icon theme to see them.

sudo apt install material-solarized-suruplusplus-icon-theme

Also, read the Boron Release notes.

Check Debian for help with upgrade issues:
https://www.debian.org/releases/bookwor … ml#trouble

This tutorial is a rewrite of the posts Upgrade from Lithium to Beryllium by @rbh and Upgrading from Helium to Lithium by @damo

Last edited by johnraff (2024-05-12 08:25:42)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

Board footer

Powered by FluxBB