Freebsd revert a package to a previous version

I am running Freebsd Current on my personal computer because I am interested in the development of the OS. Naturally, this brings its share of worries sometimes.

One day, my X server refuses to start following an upgrade of the AMD graphics kernel module. So I decided to rollback on the previous version which worked very well. This article describe how to revert a package, or here in this specific case a set of package to a previous version

identify problematic pkg

pkg info | grep kmo | less
pkg info | grep kmod | grep gpu-firmware-amd | grep 202212 | less

Remove them:

pkg remove drm-510-kmod-5.10.113_8
pkg info | grep kmod | grep gpu-firmware-amd | grep 202212 | cut -d' ' -f1 | xargs pkg remove


then go in /var/cache/pkg/ you’ll find a cache of local previously installed packages

reinstall the previous version

pkg install ./drm-510-kmod-5.10.113_7.pkg
ls | grep gpu-firmware-amd | grep 202210 | grep -v ‘~’ | while read I; do pkg install ./$i ; done

After that, packages are rollbacked to version N-1 (here 202210).

If you simulate now a pkg upgrade it will show that new versions are available and need to be installed for these 34 packages. Dont do it this time of course, let’s wait for next version and don’t forget to open a bug with all details on https://bugs.freebsd.org/bugzilla/


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *