You are not logged in.

#1 2022-02-27 17:08:13

candy_pebbles
Member
Registered: 2021-02-15
Posts: 9

[SOLVED] Restoring pacman packages from lost+found

My SSD partially died on me, I got some of it recovered to lost+found. A lot of things stayed intact, but it doesn't look like all of it survived, for example my home directory is untouched, ~~but I don't see the contents of /bin anywhere~~. I reinstalled the system to a different SSD, and now I want to reinstall all of my previous packages, does pacman store the active package list or .tar.xzs somewhere that I can use to recover them?
Edit: I think I found the /bin directory, is there a way to download all the packages and the proper setup for them through pacman with this information as a baseline?

Last edited by candy_pebbles (2022-02-27 18:55:37)

Offline

#2 2022-02-27 17:18:41

loqs
Member
Registered: 2014-03-06
Posts: 18,983

Re: [SOLVED] Restoring pacman packages from lost+found

If pacman's database is intact see Tips_and_tricks#Reinstalling_all_packages.  If it is not see the section after it entitled "Restore pacman's local database".

Offline

#3 2022-02-27 17:49:31

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Restoring pacman packages from lost+found

Or if /var/cache/pacman/pkg still exists then that should contain all of your previousley installed packages unless you configured it otherwise.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2022-02-27 18:53:12

candy_pebbles
Member
Registered: 2021-02-15
Posts: 9

Re: [SOLVED] Restoring pacman packages from lost+found

Fortunatelly I had both the log file and the cached pkgs. I recovered it by doing this:

  sudo pacman -S pacutils

  LOGFILE=/mnt/disk/backup/lost+found/#8719572/log/pacman.log

  paclog --pkglist --logfile=$LOGFILE  | awk -F " " '{print $1}' > /tmp/old.list
  pacman -Q | awk -F " " '{print $1}' > /tmp/curr.list
  cd /tmp
  cat old.list curr.list > uniq.list
  sort uniq.list | uniq -u > install.list
  paru -S $(cat /tmp/install.list)

Last edited by candy_pebbles (2022-02-27 18:57:08)

Offline

Board footer

Powered by FluxBB