Hi,
to get sure that you have an resonable large pacman package cache for downgrades you need an automatic pacman cache management.
I made an automatic pacman cache management that uses just about 3-4 GB for an 60 days rolling cache.
sudo pacman -S pacman-contrib
sudo mkdir -p /etc/pacman.d/scripts
sudo mkdir -p /etc/pacman.d/hooks
Make /etc/pacman.d/scripts/cleancache.sh with the editor of your choice.
#!/bin/bash
#
# Days in cache
DAYSIC=60
# Package versions
PACVERS=2
#
FILECOUNT1=0
FILECOUNT2=0
CANDIPAC=""
#
# Count packages to delete
let FILECOUNT1=$(/usr/bin/find /var/cache/pacman/pkg/ -mindepth 1 -name '*' -mtime +$DAYSIC | wc -l)
if [ $FILECOUNT1 -gt 0 ]; then
echo -n "Delete $FILECOUNT1 files older than $DAYSIC days "
fi
#
CANDIPAC=$( /usr/bin/paccache -d -k $PACVERS )
if !(`echo $CANDIPAC | grep -sqie 'no candidate packages found'`); then
let FILECOUNT2=$(echo $CANDIPAC | grep -sie 'run.*candidates' | cut -f2 -d ':' | cut -f2 -d ' ' | sed 's/^[\t ]*//g')
if [ $FILECOUNT1 -gt 0 ]; then
echo "and $FILECOUNT2 files more than $PACVERS versions from the cache directory "
else
echo "Delete $FILECOUNT2 files more than $PACVERS versions from the cache directory "
fi
fi
#
# Delete files older than $DAYSIC days from the cache dir
/usr/bin/find /var/cache/pacman/pkg/ -mindepth 1 -name '*' -mtime +$DAYSIC -delete
# Delete more than $PACVERS versions of a package
/usr/bin/paccache -r -q -k $PACVERS
/usr/bin/du -smh /var/cache/pacman/pkg
Make /etc/pacman.d/hooks/cleancache.hook with the editor of your choice.
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Operation = Remove
Target = *
[Action]
When = PostTransaction
Exec = /etc/pacman.d/scripts/cleancache.sh
sudo chmod +x /etc/pacman.d/scripts/cleancache.sh
Now every time you update your system your cache gets automatic managed.
Have fun.