1

My computer "died".

I got a new one and want to migrate my Arch install to my new machine. Moved from Intel to AMD, new motherboard, etc.. I thought the better approach would be to do a fresh install and then:

  1. install all the packages I had on the old installation
  2. copy my dot files to the new one.

After the fresh installation, how can I list the packages I had on the previous install? I cannot login into it to use pacman to list the packages. I'm moving the SSD to the new computer.

Should I chroot and execute pacman - q >package_list.txt? Is there an easier approach?

1 Answer 1

1

You already answered the question by yourself: chroot is how you run stuff inside another installation, and this includes package manager commands.

Pacman does have its own option to work on an alternative root: -r, e.g. pacman -Qr <dir>, but it's not fundamentally different.

The easiest approach is to ls /mnt/var/lib/pacman/local. Each installed package's metadata is stored as a separate directory which is named after that package; cut off the last two fields to get just the pkgname.

Pacman does not distinguish AUR packages from other types of packages. Once it's installed, it's always a "local" package whether it came from a repo or from your own makepkg.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .