Upgrading Crunchbang Linux to jessie/systemd

by panglott

So, my foray into system recovery after a borked install gave me some more time to better check out the current state of Linux. Since I’m happy with a Mac OS X notebook as a main computer, and for me Linux servers an occasional fun home project, I tend to be more interested in minimalism and stability than desktop usability and completeness. I had been thinking about a plain headless Debian net install, but CrunchBang Linux (a Debian flavor) is such a cool project, once I actually used it: the system and interface are a simple, clean, and coherent design.

However, for the little period I used the Debian-based Ubuntu Studio, I found it a little staid, since much of the software was old and lacked lots of newer features (especially on a machine not regularly connected to the network for updates). ArchBang is a similar project, building the same basic design on Arch Linux. There’s a lot I like about Arch: rolling releases, minimalism, configurability, and systemd . I was spending too much time getting familiar with pacman, though, and at the time that I actually got my USB-ZIP install disk working, I was leaning more towards CrunchBang (waldorf).

Some of the advantages of other distributions can be had in Debian by updating from testing repository rather than stable, and now it seems future releases will use systemd rather than init, along with Arch and Fedora. As an only-occasional user of Linux, systemd is much friendlier than init scripts, but simply upgrading wheezy to jessie doesn’t yet make systemd the default. However, it’s not terribly hard to upgrade a fresh CrunchBang install from wheezy to jessie with systemd.

First, as james0610 describes, the preferences need to be modified to the jessie (testing) repositories. At a terminal window, type:

sudo nano /etc/apt/preferences

to edit the file (vi can be puzzling to the vim-trained). It should read something like:

    Package: *
    Pin: release a=waldorf
    Pin-Priority: 1001

    Package: *
    Pin: release a=jessie
    Pin-Priority: 500

Then update the list of sources:

sudo nano /etc/apt/sources.list

…to point to jessie rather than wheezy:

    ## CRUNCHBANG
    ## Compatible with Debian Wheezy, but use at your own risk.
    deb http://packages.crunchbang.org/waldorf waldorf main
    #deb-src http://packages.crunchbang.org/waldorf waldorf main

    ## DEBIAN
    deb http://http.debian.org/debian/ jessie main contrib non-free
    #deb-src http://http.debian.org/debian jessie main contrib non-free

    ## DEBIAN SECURITY
    deb http://security.debian.org/ jessie/updates main
    #deb-src http://security.debian.org/ jessie/updates main

Now you can configure systemd as default:

sudo apt-get install systemd-sysv

Then upgrade the rest of the installation to jessie:

sudo apt-get update && sudo apt-get dist-upgrade

This will take a while. Afterwards, clean up unused packages to free up disk space:

sudo apt-get autoremove

After a reboot, GRUB might still be set to boot the old kernel by default. To change that, enter:

sudo cp /etc/default/grub /etc/default/grub.bak
sudo vim /etc/default/grub 

and edit the file to read GRUB_DEFAULT=saved. Then enter

sudo grub-set-default 2
sudo update-grub

This will boot the third item in the ( zero-indexed ) GRUB menu (correct given a fresh install of CrunchBang). Finally, reboot. To check systemd, just reboot and enter top in the terminal: systemd should be PID 1.

This worked for me. At the time of writing, systemd may have a few quirks still. Attempting to enable ssh with:

systemctl enable sshd.service

frequently gives an error, but in fact seems to work: after a reboot the daemon is running.

EDIT 2014-09-18
Easy to keep this upgraded with the command above, though it may take a while.

sudo apt-get update && sudo apt-get dist-upgrade

See the Apt-get Howto

Advertisements