I have recently built up a new computer and loaded it with a Canonical disc of Ubuntu 8.10, so far, so good. I like the OS and the upgrade from 7.10 was worth it. Until this morning.... I got the lit icon, checked the list of updates, shut down all other open programs and started the process. Downloaded 23 or 26 updates, among them a new linux kernel and its associated stuff, download proceeded smoothly and, at the end, required a system restart. I did so and that's when my troubles began. The list of weirdness is long and convoluted so let's just say it essentially crippled my computer. After some roundabout troubleshooting with Oren, I got it to run (sort of).
What I want to know: is there a way I can undo/delete that specific update (all 20some of them) and restore my OS to where it was and, if so, how? Command line stuff is still a bit intimidating for me but I am always interested in learning so if the answer goes that direction, I'll learn!
Thanks, Craig
I don't see how you could get back to what you had. At least not without a lot of PAIN.
You might try this: Open the Synaptic package manager from System->Administration->Synaptic Package Manager. Then, select File->History from the menu to see a log of all updates for the past month. You can then search for 26 packages that you think might be causing trouble. Finally, after selecting an offending package you can choose Package->Force Version from the menu and make it roll back to the previous version if available.
Here is my reasoning, on why this might not work. When you updated, the update utility ran the command "apt-get update", either directly or indirectly or effectively doing so. This altered the list of what versions of software are available for updating. This of course destroyed the previous list of software packages. The only way to undo an update would be for Ubuntu, or any other debian based distro, to save the previous list prior to updating. You could, create your own utility to do this, but that would entail the command line and a shell script most likely. With this list in hand you ought to be able to restore it to it's proper location and run apt-get upgrade from the commandline to restore you system to it's previous setting. Although you'd probably have to remove any "new" packages, such as the new kernel, by doing an "apt-get remove <application to remove>" from the commandline. You should not be afraid of the commandline. It makes sense to learn at least some basic commands. Take it slow and easy and eventually you may find the commandline to be comfortable.
Brian
--- On Wed, 1/28/09, Craig Aldinger gonzogone@gmail.com wrote:
From: Craig Aldinger gonzogone@gmail.com Subject: Re Undoing an update ...
What I want to know: is there a way I can undo/delete that specific update (all 20some of them) and restore my OS to where it was and, if so, how? Command line stuff is still a bit intimidating for me but I am always interested in learning so if the answer goes that direction, I'll learn!
Thanks, Craig
I forgot to tell you how to save and restore for future reference.
Here they are.
------------------------------------------------------------ To save your installed list do this:
dpkg --get selections | grep -v deinstall > packagestateXXXXXXXX.txt
where XXXXXXXX is the current date. Or use your own convention. The grep -v deinstall removes entries of packages that are marked for removal.
===============================================================
To later restore them do this:
dpkg --clear-selections dpkg --set-selections < packagestateXXXXXXXX.txt apt-get -u dselect-upgrade --purge
----------------------------------------------------------------
Note this is all commandline stuff and assumes you are logged in as root. Simply prepend "sudo" to each line if you are not root. Note, also this is destructive. I believe it might remove and purge some software not on this list. I've never tried this so proceed at your own risk. Alternatively you could remove the --purge option to not purge any config files on anything it might remove.
There might be a utility out there to do this for you, but I dn't know of it.
Brian J
Craig wants to roll back updates, not restore a list of package selections. He wants to go back to the versions of software that were on his system previous to the update. A list of package selections will not do this.
ie;
I have foo-3.0.1 installed on my system. I upgrade to foo-3.0.2. Restoring a selections list will not downgrade the package because only the package name, 'foo', is represented.
On Fri, Jan 30, 2009 at 2:27 PM, Jack quiet_celt@yahoo.com wrote:
I forgot to tell you how to save and restore for future reference.
Here they are.
To save your installed list do this:
dpkg --get selections | grep -v deinstall > packagestateXXXXXXXX.txt
where XXXXXXXX is the current date. Or use your own convention. The grep -v deinstall removes entries of packages that are marked for removal.
===============================================================
To later restore them do this:
dpkg --clear-selections dpkg --set-selections < packagestateXXXXXXXX.txt apt-get -u dselect-upgrade --purge
Note this is all commandline stuff and assumes you are logged in as root. Simply prepend "sudo" to each line if you are not root. Note, also this is destructive. I believe it might remove and purge some software not on this list. I've never tried this so proceed at your own risk. Alternatively you could remove the --purge option to not purge any config files on anything it might remove.
There might be a utility out there to do this for you, but I dn't know of it.
Brian J
Kclug mailing list Kclug@kclug.org http://kclug.org/mailman/listinfo/kclug
--- On Fri, 1/30/09, Christofer C. Bell christofer.c.bell@gmail.com wrote:
From: Christofer C. Bell christofer.c.bell@gmail.com
Craig wants to roll back updates, not restore a list of package selections. He wants to go back to the versions of software that were on his system previous to the update. A list of package selections will not do this.
Right, my bad. I was missing a step. Here's a corrected version.
------------------------------------------------------------ To save your installed list do this:
dpkg --get selections | grep -v deinstall > packagestateXXXXXXXX.txt cp /var/lib/dpkg/available > availableXXXXXXXX.bak
where XXXXXXXX is the current date. Or use your own convention. The grep -v deinstall removes entries of packages that are marked for removal.
===============================================================
To later restore them do this:
dpkg --clear-selections dpkg --set-selections < packagestateXXXXXXXX.txt cp availableXXXXXXXX.bak > /var/lib/dpkg/available
apt-get -u dselect-upgrade --purge
----------------------------------------------------------------
I'm not sure this will even work, because what really needs to be done here is a "dpkg --force-downgrade <package>" for each package that needs to be downgraded. Not to mention that the /var/lib/dpkg/status file lists the current state. Another possibility is to copy the status file also, and then use the grandparent version of that to try to fool dpkg into thinking that an even earlier version is installed than really is. I didn't include this trick, because it's inherently extremely dangerous to the state of your system. here are some other tricks that could be pulled, but it only gets more dangerous from here. Here there be monsters.
Of course, the truly correct way to do this is to record which packages are being upgraded every time and then feed this list into a "dpkg --force-downgrade <package>" command. However, the problem here is that dpkg performs NO dependency checking when doing this. So unless you know what packages were actually upgraded and make sure to downgrade them all, you could really hose your system. This is debian's Achilles heel. There is simply no safe route to a downgrade. What debian needs is a "state history" and a "restore state" feature.
So, assuming you have the list of the packages you need to downgrade, and you feel comfortable doing dangerous things to your OS and you have a really good and recent backup, here's one primitive way that I know WILL do it.
Copy and paste the lines between the dashes and save into a file dpkgundo.sh, and make it executable (chmod 700 dpkgundo.sh). --------------------------------------------------------------------- #/bin/bash
# minimal sanity check for both arguments. if [ $# <> 2 ] then echo "Usage :$0 <dpkg available list to restore> <file with list of packages to restore>" exit 1 fi
# First restore the available versions list. # WARNING: Assumes the /etc/apt/sources.list has not been updated since the last update cp $1 > /var/lib/dpkg/available
# Next let's restore the packages cat $2 | xargs dpkg --force-downgrade # for interactive processing comment out the above line and uncomment the following line #cat $2 | xargs -p dpkg --force-downgrade ----------------------------------------------------------------
To execute type on the commandline "./dpkgundo.sh /path/to/availableXXXXXXXX.bak /path/to/downgradelist.txt"
This only works if you have a history of the debian available packages file. This won't help Craig.
But this will:
Copy and paste the lines between the dashes and save into a file dpkgdowngrade.sh, and make it executable (chmod 700 dpkgdowngrade.sh). --------------------------------------------------------------------- #/bin/bash
# minimal sanity check for both arguments. if [ $# <> 2 ] then echo "Usage :$0 <directory with packages to restore> <file with list of packages to restore>" exit 1 fi
#Let's go to the directory with the packages to restore cd $1
# Next let's restore the packages cat $2 | xargs dpkg --force-downgrade # for interactive processing comment out the above line and uncomment the following line #cat $2 | xargs -p dpkg --force-downgrade ----------------------------------------------------------------
To use this script, first build the list of packages you want to restore and save it to a file. You will need the actual names of the packages for this (ex: zenity_2.22.1-1_i386.deb). Then you will need to find and download them to a directory. Finally run the script like this: ./dpkgdowngrade.sh <directory with packages to restore> <file with list of packages to restore>
Remember, I consider this to be very dangerous stuff and it could potentially frak your system. No guarantee is provided and if your computer explodes in a cataclysmic supernova as a result I take no responsibility for it. Debian simply doesn't support downgrading. Why would you ever downgrade, debian package maintainers are perfect and never make mistakes?
Brian J