Home » Questions » Computers [ Ask a new question ]

How can I undo or rollback an "apt-get upgrade" command on Ubuntu?

How can I undo or rollback an "apt-get upgrade" command on Ubuntu?

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

Asked by: Guest | Views: 81
Total answers/comments: 4
Guest [Entry]

"I came across Hartman's Blogstatic Blog: How to Undo an Update in Ubuntu Lucid

The first step to undoing the offending update was to find out what
updates it was exactly. After searching some forums I came across a
way to see my update history: Open synaptic package manager (""sudo
synaptic"" in the terminal). From the menu bar, click File -> History
and you will see all your updates sorted by date.

Unfortunately I had installed about 20 updates today, and I didn't
know which one had caused the problem. By searching through each of
the packages named in the History list, I was able to downgrade a few
at a time until the problem was solved and I had identified the
offending update. To do this:

Use the search bar to find the package you want to downgrade. Once
you've found what you're looking for, click on the package to select
it. From the menu bar, click Package -> Force Version and select the
previous version of the package from the drop down menu. Click the
""Apply"" button to apply the downgrade."
Guest [Entry]

"I run my linux servers in a virtualized environment and run a shapshot just before an apt-get upgrade, or any major 3rd party updates/upgrades for that matter.

Then if something goes wrong, I simply revert and life goes on until I can find out more information.

This came in very handle when I upgraded my Ubuntu box to 12.04, and somehow MySQL was completely non-functional after the upgrade. I rolled back, found the answer later, reran the upgrade, fixed MySQL, and life was good."
Guest [Entry]

"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."
Guest [Entry]

"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.nexentadotorg/os/TransactionalZFSUpgrades

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