• 0 Posts
  • 2 Comments
Joined 2 years ago
cake
Cake day: August 4th, 2023

help-circle

  • Yeah and on Arch-based systems:

    Backup Packages

    Back up explicitly installed package list:

    pacman -Qqe > ~/packages.txt
    

    Back up explicitly installed foreign packages list (i.e. the AUR):

    pacman -Qqm > ~/foreign_packages.txt
    

    Backup the pacman config/mirrors:

    cp /etc/pacman.conf ~/pacman.conf.backup
    cp -r /etc/pacman.d/ ~/pacman.d.backup
    

    Restore Packages

    Restore the pacman config/mirrors:

    sudo cp ~/pacman.conf.backup /etc/pacman.conf
    sudo cp -r ~/pacman.d.backup/* /etc/pacman.d/
    

    Sync the system and update packages:

    sudo pacman -Syu
    

    Reinstall packages:

    sudo pacman -S --needed - < ~/packages.txt
    

    Reinstall foreign packages:

    yay -S --needed - < ~/foreign_packages.txt