How to reinstall packages to default

My Manjaro system is 2 months out of date because I had to backup old backup and now I can’t update my system anymore, I’ve tried removing packages and stuff to get it working but many many errors. Is it possible to delete all the packages and install default packages. I had a look online for other solutions like reinstalling Manjaro without it touching the home folder but no simple solutions unfortunately.
Thanks for any help!

There is no such thing like reinstall packages to default. You can reset all of them to default by removing cache and config files – usually stored in ~/.local, ~/.cache and ~/.config directories or in your home directory. But that definitely will not solve your problem with update.

Post what errors you receive when trying update, we’ll manage with it. That’s only way to solve it :wink:


There is no off-the-shelf solution - other than restoring from backup.

Usually you will have two files in the filesystem root listing the packages contained in the default installation and you can sanitize those and feed them to pacman.

  • desktopfs-pkgs.txt
  • rootfs-pkgs.txt

The steps to do so

  1. Boot the system on a live USB.
  2. Mount the system partitions
  3. Create a sanitized packagelist
  4. Feed the package list to pacman while using the root argument to point the system mountpoint.

Technically you can sneak in a step to rename folders like /mnt/var and /mnt/usr adding a .bak in the process - you can then remove them entirely if your rescue mission succeeds or copy them back in case it don’t.

I have left out - on purpose - sudo - as I want you to rethink the commands and consider their implications - instead of a copy-paste guide.

Mount your system partitions

mount /dev/sdy2 /mnt

In this case there is no need to mount the EFI partition but in case you need it

mount /dev/sdy1 /mnt/boot/efi

Creating a sanitized package list from your mounted root

cat /mnt/desktopfs-pkgs.txt | awk '{print $1;}' > ~/pkglist.txt

Feed the package list to pacman - installing to the mounted root

pacman -Syy --root /mnt - < ~/pkglist.txt

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.