Recently I decided to move a Linux VM I have for running some servers to a recently replaced box that used to be my gaming rig. I decided to run Debian Squeeze (Stable) since, well, it’s stable.
After a week or so though I started thinking that it would be nice to have some newer packages, particularly Python 2.7 since I’ve been doing a bunch of programming in Python recently. Some quick research showed that while it would be technically possible to have Python 2.6 and 2.7 side-by-side, it would probably be a bad idea.
So I decided to do what any self-respecting geek would do and upgrade from Stable to Testing.
The process is designed to be pretty simple. Update /etc/apt/sources.list by replacing Squeeze/Stable with Wheezy/Testing then run:
apt-get update apt-get upgrade apt-get dist-upgrade
The first two steps which upgrade the local list of packages/versions and then do the “safe” dependency-less upgrades went off without a hitch. I rebooted not out of necessity but because if something went wrong it’d be easier to fix with only a handful of updates than all of them.
I breathed a sigh of relief when I was able to SSH back into the machine which saved me having to get up and walk to the machine in the next room!
The dist-upgrade didn’t go over quite as well. Unfortunately I wasn’t writing this as I was working so I don’t have the exact console readouts but I will do my best to re-assemble them based on my search history.
E: Could not perform immediate configuration on 'default-jre'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)
My searches turned up a bunch of threads with possible solutions, archived here for your benefit since if you’re reading this beyond the next two days you’re probably not one of my friends or family and are actually having this problem and searching for a solution.
None of what I tried in there worked for me. I hadn’t tried turning Immediate-Configure off and running the full dist-upgrade but that sounds like a really bad idea and is just asking for trouble. I ended up going into /var/cache/apt/archives/ and tried to manually dpkg -i a few of the packages and manually follow the dependencies figuring I could outsmart apt-get.
As it turns out, I can’t.
After I completely hosed my packages to the point that apt-get -f install couldn’t fix things, I decided to just start deleting packages because at this point I was going to have to spend my Saturday reinstalling this machine from scratch. I removed OpenOffice because I didn’t care to have it anyway and since that was what was pulling in Java, that went away as well with the autoremove. After that, I was actually in a good enough state to do the dist-upgrade successfully and then I was able to re-install the removed packages!
aptitude purge openoffice.org-common openoffice.org apt-get install apt-get autoremove apt-get dist-upgrade aptitude install openoffice-org-common openoffice.org
Testing upgraded from the 2.x version of the Linux kernel to 3.x so I decided to reboot to switch over and I also wanted to make sure the machine still rebooted. So I kicked off the reboot and took a YouTube victory break.