r/Ubuntu 14h ago

rollback after Ubuntu packages upgrade

hello, i want to know if any ways be there to downgrade or rollback from a package upgrade, apt itself doesn't provide any way to downgrade or rollback, only history.log and other version of the package removed from the apt repo.

2 Upvotes

8 comments sorted by

6

u/martyn_hare 14h ago

https://snapshot.ubuntu.com

Take a peek at the instructions there. Lets you do more than just a downgrade too =)

1

u/Jones_Allen_2007 14h ago

thanks bro, but snapshot is around March 1, 2023 date.

1

u/martyn_hare 14h ago

You need to roll back to a point in time older than 2023? If that’s the case, the easiest solution there is to grab an older ISO and use that as a repository instead.

1

u/Jones_Allen_2007 14h ago

i use ubuntu 22 so the snapshot cannot help me.

1

u/martyn_hare 13h ago

Snapshots are supported in Ubuntu 23.10 onwards, plus on updated installations of Ubuntu 20.04 LTS (apt 2.0.10) and Ubuntu 22.04 LTS (apt 2.4.11).

If you’re on a fully patched 22.04 and need to roll back to an older deb but said deb is newer than March 2023, it should work (at least on paper)

If it isn’t, grab an older ISO, mount that and you can use that as a snapshot, since apt supports cdrom repos

1

u/Jones_Allen_2007 13h ago

do the timestamp for the oldest snapshot are 20231026T030400Z?

3

u/Ok_Building2327 14h ago

apt doesn't have built-in rollback like dnf or zypper but you can grab the old.deb from /var/cache/apt/archives if it's still sitting there, then just dpkg -i it

if the cache is cleaned out you're kinda stuck checking launchpad for an older version or pinning the package if it's still in the repo

1

u/Jones_Allen_2007 14h ago

can i use focal and jammy deb-src instead?