Skip to content

A simple script to safely, completely "undo" the last pacman system update.

Notifications You must be signed in to change notification settings

Cody-Learner/downgrade-ud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

downgrade-ud

Screenshot-Downgrade-ud
A simple bash script to undo the last pacman system update.
Effort was focused on performing a system downgrade to Arch wiki described standards.
See: https://wiki.archlinux.org/index.php/downgrading_packages.

Warning: Running an Arch linux system holding packages back from update is not recommended.
See: https://wiki.archlinux.org/index.php/System_maintenance#Upgrading_the_system
And: https://wiki.archlinux.org/index.php/System_maintenance#Partial_upgrades_are_unsupported

Downgrade-ud reinstalls packages available in the pacman package cache only. Does not use ALA.
Primairly intended for use within a short time after an update leaves the system in a bootable,
but otherwise undesireable state, and is presumed correctable by reversing the update.

Dependencies: sudo pacutils

USAGE: downgrade-ud [operation]

operations:	-rl  --readable_list    print detailed downgrade list (packages-new-old-versions)
		-dl  --downgrade_list   print downgrade list in pacman useable format
		-dt  --downgrade_test   pacman simulated downgrade (prints only)
		-dg  --downgrade        pacman downgrades packages-versions from list
		-h   --help             print this help info

Downgrade-ud gets the last update package list with versions from /var/log/pacman.log.
The script verifies the packages prior to the last update are present in /var/cache/pacman/pkg/,
and will skip any packages not available.
The downgrade operation uses command sudo pacman -U "${DowngradeList[@]}".

Downgrade-ud provides various levels of information gathering operations before downgrading.
The first two operations, '-rl, -dl' are provided for easy evaluation of what the downgrade entails.
The '-dt --downgrade_test' runs sudo pacman -Up "${DowngradeList[@]}", on the downgrade package list,
which is essentially a non transactional "dry run" with pacman providing output.


NEWS/UPDATE INFO:

UPDATE: Mar 23, 2021:
Added check function to exit if no updates were made today.
Reworded help info for clarity.
Changed "parse for no options" from calling the help function, to print a message.
Implemented shellcheck.


REPORT: initial release, Feb 12, 2021:
I've used and tested downgrade-ud on my system, including downgrading the kernel and nvidia packages.
Have not encountered issues, but be aware this has minimal usage and testing on one system only.
Use at your own risk and before considering using it, please be advised to:

  1. Know enough shell scripting to be able to read and understand what the script is doing.
  2. Are able to handle a system downgrade manually, possibly using the script more for convenience.
  3. Are capable of troubleshooting and fixing a borked system from an update/downgrade issue.

About

A simple script to safely, completely "undo" the last pacman system update.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages