Create List of Packages from another drive's endeavouros partition?

How could I generate a list of installed packages on another (former) install? My install porked itself during startup and I’ve about given up trying to get it to boot, and there was another drive id rather have an install on anyways and the endeavouros partition from the old install is still intact, so I figured Id just make a new installation, install the packages I had on the old install then rsync /home. I tried mounting the old partition, then running

sed -n '/%NAME%/{n;h;}'

in the /var/lib/pacman/local directory of the old endeavouros partition, but the terminal just hung with zero output. Is it simply an issue of my (admittedly rudimentary) understanding of sed or is there something else at play? Additionally, would acquiring the list from there include AUR packages? Would there be anything else I would need to do to copy my programs/ configurations over? Would it be possible to just rsync the entire endeavouros partition over to the new drive and edit fstabs so it’d boot?

I apologize for my long winding question(s) but after a few days of trying to fix this I am at a loss. I appreciate any and all help!!

Welcome to the community! :vulcan_salute: :enos_flag:

Someone may be able to help you fix it, but in case no one can:

Arch-chroot into the non-booting partition, then run these commands.

Arch-chroot instructions: https://discovery.endeavouros.com/?s=arch-chroot

pacman -Qqm > foreign_pkgs.txt && pacman -Qqn > repo_pkgs.txt

To get just one file, you can do the below command instead:

{ pacman -Qqm; pacman -Qqn; } > combined_pkgs.txt

Note: The 2nd command won’t work in fish shell.

1 Like

I appreciate your help!! That probably would work, but I ended up rsync-ing the entire endeavouros partition from the old drive to the new installation and edited fstab and it worked.

1 Like

If it works, it works! :beers:

1 Like