Forgot To Run aptupgrade? Don't Panic!


by AndrzejL

Several months ago, there was a “demand” from PCLinuxOS devs to install and run the aptupgrade package. This was a crucial package. Everywhere on the forum, there were reminders about doing this. Why was it so important? Because it was upgrading apt, rpm and their libraries. Also, Synaptic Package Manager was upgraded.

Whoever did not upgrade it in time (they had a few months’ window) should reinstall with a fresh copy of the latest iso after creating a list of all the installed apps and backing up their /home folder. Why? Because the packages created using the latest rpm would not be compatible with the systems that were not upgraded.

That was the suggested solution. Reinstall. BUT what if you do not want to or cannot install from scratch due to many personal tweaks and/or for any other valid reasons?

If you are desperate/brave/crazy enough (like me) and you are willing to take some risks (like me) – please continue reading. I don’t have to tell you that I won’t take any responsibility for a borked system right? Right.

Recently, I visited a friend who is dual-booting Windows XP and PCLinuxOS. I tried to install gparted, and noticed he had not upgraded his lappy for 10 months or so. I tried to upgrade it, but all I got was librpm dependency problems – no matter what I did. So, I said right – aptupgrade was not done.

So here is (more or less) what I did to fix it. (I am skipping all the investigation steps).

Open a terminal and run:

su

followed by

root's password

and then…

cd /root/

wget -c http://andrzejl.cyryl.net/WoTW/WoTW_files/aptupgrade/aptupgrade-1.0-7pclos2011.src.rpm

rpm -ivh /root/aptupgrade-1.0-7pclos2011.src.rpm

unxz /root/rpmbuild/SOURCES/aptupgrade-1.0.tar.xz

cd /root/rpmbuild/SOURCES

tar xvf ./aptupgrade-1.0.tar

cd ./aptupgrade-1.0

rpm -ivh --nodeps --force --ignorearch --ignoresize --ignoreos ./*.rpm

rm -f /root/aptupgrade-1.0-7pclos2011.src.rpm

rm -Rf /root/rpmbuild/

BE CAREFUL WHILE USING THE RPM COMMANDS!

Now, leave this terminal window open and follow this very important step.

Open Synaptic. When it reloads, you will get three or four errors (in one error window) about multiple versions of packages (like apt, libapt and synaptic) being installed. Write down the names of these packages and click on OK to clear the message from your screen. Now search for those packages in Synaptic. You will find that indeed there are multiple versions installed. Compare their version numbers and “Mark for complete removal” the older versions. Apply the changes. Wait for the packages to be removed and Synaptic to reload. Close and reopen Synaptic. There may be another message about duplicate packages. Write down their names, find them, mark the older versions for complete removal, apply, wait till finished, close and reopen Synaptic. Repeat till there are no duplicate packages error messages when starting Synaptic. I guess this could be done by using dupeclean package but I did it by hand just to make sure nothing really important would get removed when dealing with duplicates. When this is done close Synaptic.

Now go back to that terminal window that you had open and type in:

apt-get update

and when done

apt-get dist-upgrade

Wait for the question about installing/upgrading/removing etc., etc., etc. Read, understand and if all is ok – confirm by pressing y, followed by Enter.

Wait until it finishes and reboot. Why not use Synaptic to do the upgrade? Because I was afraid that replacing/upgrading so many crucial system libraries after such a long time of not upgrading the system at all could crash synaptic in the middle of the upgrade and could cause system-wide corruptions and multiple problems.

On a side note, at my friends house I recently got 937 packages to be upgraded, 36 new to be installed and 33 to be removed. Over 1080 MB of upgrades. After upgrading and rebooting, the system worked perfectly without the tiniest issue. Even funnier was that I forgot that I had testing section enabled and upgraded fully with it enabled. I said to myself to bite the bullet and  upgraded his kernel to the testing version as well. Kernel 3.2.16-bfs was installed without the tiniest hiccup.

So did you fully reboot? Check for updates using Synaptic as you normally would. In the future, don’t forget to upgrade at least every 2 weeks and periodically check the forum for any important announcements for your distro.