Is there a way with Ubuntu to rollback or undo the last upgrade after doing an "apt-get upgrade" if you don't like the results?

link|improve this question
Unless you did dist-upgrade, I don't see what results there are not to like, since those are most likely security updates. – LiraNuna Sep 9 '09 at 22:48
1  
If it's a server, try a dev server before upgrading the production one – carlosz Oct 3 '09 at 2:27
feedback

6 Answers

aptitude gives you access to all versions of a package if available according to http://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_aptitude_advantages

link|improve this answer
2.7.3 might help you downgrade to stable. 2.7.13 explains saving and restoring dpkg state. dpkg-repack allows you to "compress" a single package. – joeytwiddle Oct 20 '10 at 6:32
feedback

I believe not, aside from taking a full backup of the relevant filesystems (those that contain /, /bin, /lib, /sbin, /usr, /var, /etc and /boot (which may all be on on filesystem) and your boot record) so you can roll the machine back afterwards.

link|improve this answer
I could (and probably will) take a bare metal backup, but I wanted a software option that would let me undo the upgrade in a faster time frame. Restoring from the bare metal backup could take several hours. – jjclarkson Sep 9 '09 at 22:47
You could make sure you have copies of all the packages you are about to upgrade in their previous versions (they are probably still sat in your apt cache somewhere in /var) and any relevant config files stored away. You could then try force a roll back by explicitly telling dpkg to install those versions. You might have some work to do afterwards when you want the normal upgrades to happen, so it isn't something I'd recommend. – David Spillett Sep 9 '09 at 23:20
feedback

Even rolling back a package version can be a pain (look at pining it to a specific version).

Baring a snapshot that you can roll back to, no reasonable way to.

link|improve this answer
This is unusual help.ubuntu.com/community/PinningHowto for anyone interested. Looks like that may cause problems over the long haul if you're keeping upgrades back on a certain package. – jjclarkson Sep 9 '09 at 23:07
feedback

Not with out a lot of work, that wouldn't be worth it. Can you save your /home and start over? What didn't you like?

link|improve this answer
I haven't done it yet, but this is a production server and I need to be sure there's no incompatibilities with our custom PHP/MySQL/Apache2 setup, and get back quickly if there is. I'd like to upgrade because I think it will fix another problem I'm having. – jjclarkson Sep 9 '09 at 22:45
If you have a custom install, it's your responsibility to save patches and apply them against the current version. – LiraNuna Sep 9 '09 at 22:51
1  
I would run it in dev first especially if it's an important server. You can take a few precautions but an exact replica of your production environment would be best. – user10547 Sep 9 '09 at 22:54
I think that is what we will end up doing test our software on a dev machine. The possible issue we have is that our test hardware won't be completely homogeneous. – jjclarkson Sep 9 '09 at 22:58
feedback

You could try checkinstall

After you ./configure; make your program, CheckInstall will run make install (or whatever you tell it to run) and keep track of every file modified by this installation, using the excelent installwatch ...

So maybe you could tell it to run aptitude safe-upgrade and it would keep track of every modification made by the upgrade.

link|improve this answer
feedback

There's a project called Nexenta that combines the OpenSolaris kernel with the Ubuntu userspace. It provides a tool to integrate Solaris's ZFS and Debian's apt in order to provide an undo button for upgrades. See here: http://www.nexenta.org/os/TransactionalZFSUpgrades

More generally, what you need is a versioning file system. Btrfs for Linux is in development.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.