[linux] Upgrading Debian Lenny to Testing halts on udev package

Few days ago I wanted to create VirtualBox image of Debian Squeeze (current testing release). I already had Debian Lenny (stable) image, so the whole process seemed relatively easy – dist-upgrade Lenny, switch to “testing” apt sources, then dist-upgrade. It appeared easy, but in fact there were some bumps on the road. Dist-upgrade broke on “udev” package. From what I’ve understood, udev didn’t want to be upgraded while working with old kernel, and kernel wouldn’t be upgraded because of some unmet dependencies. At first it seemed that the upgrade upgrade process broke down the dependency system and the easiest way was to install the system from scratch. But udev package has an “emergency rope”. When you pull it, you promise udev that before the next reboot you will upgrade kernel – and udev will believe you and install. To use that rope, create an empty file /etc/udev/kernel-upgrade and then manually install the udev package, which already resides in /var/cache/apt/archives directory. After this you can continue dist-upgrade, using -f switch. So the whole set of commands to upgrade the distribution is:

apt-get update
apt-get dist-upgrade
cat > /etc/apt/sources.list << ENDF
deb http://ftp.us.debian.org/debian/ testing main
deb-src http://ftp.us.debian.org/debian/ testing main

deb http://security.debian.org/ testing/updates main contrib
deb-src http://security.debian.org/ testing/updates main contrib
ENDF

apt-get update
apt-get dist-upgrade
touch /etc/udev/kernel-upgrade
dpkg -i  /var/cache/apt/archives/udev_151-3_i386.deb
apt-get dist-upgrade -f

After that upgrade should finish. But be warned – after switching from lenny to squeeze I’ve experienced some problems like kernel not booting (I run previous version and regenerated initrd – it, or something else, helped), problems with VirtualBox guest additions (had to install kernel sources for guest additions to build themselves, then reinstalled virtualbox-ose-dkms package, and then reinstalled guest additions from the CD image attached to VirtualBox).

Upgraded system needs a few touches, but that’s not unusual. Don’t worry about “udevd : SYSFS{}= will be removed in a future udev version, please use ATTR{}= to match the event device” and similar messages while booting – it will be silenced in future versions of some packages. You can fix it if you want by replacing SYSFS with ATTR in /etc/udev/rules.d/* files, but other similar warnings will appear. You can also run upgrade-from-grub-legacy script, if you chose to chainload new grub from the old one during the upgrade. There is also significant amount of files in /var/cache/apt/archives, which can be safely deleted after successful upgrade (in my case it was 2.5GB of data).

Phew, now everything works and I have a proper VirtualBox image of Debian Squeeze.

16 thoughts on “[linux] Upgrading Debian Lenny to Testing halts on udev package”

  1. I hit the exact same problem this morning, and after a lot of messing about with aptitude and dpkg a search led me here and the ‘touch /etc/udev/kernel-upgrade’ fixed it. Thanks for sharing.

  2. this fault has been in testing for at least 2 months now. I’ve tried several times and several reinstalls to sort it out. Finally someone finds a solution. Thanks. You’d think the fault would have been sorted by now.

  3. Confirmation that the workaround works. Thank you for your excellent explanation and help! i was not far away from reinstalling my system, but you helped me out. Brilliant job, all the best and greetings from Germany.

Leave a Reply

Your email address will not be published. Required fields are marked *