Migrating Arch Linux Installation to a New Machine: Listing Pacman AUR Installed Packages and Mounted Drives

Abstract: List manually installed AUR packages and mounted drives to preserve software and storage layout during Arch Linux migration.

Created: 2026-09-29 by
Migrating an Arch Linux installation to new hardware requires precise inventory of custom software and storage configurations. You can list all manually installed AUR packages using pacman -Qm and identify currently mounted filesystems with the mount or lsblk commands. This data forms the foundation for restoring your specific environment on the target machine without losing critical user settings or drive mappings.

Inventorying Custom Software

The primary challenge in an Arch migration is preserving the exact state of your user-installed software. The default package manager, pacman, distinguishes between repository packages and those built from the Arch User Repository (AUR). To generate a complete list of these custom installations, you must query the local database for packages that are not found in any configured sync database. Run the following command in your terminal to export this list to a file:
pacman -Qm > aur_packages.txt
This output includes only packages marked as "orphaned" or explicitly built outside the official repositories. It is crucial because reinstalling these on the new system ensures you retain tools like yay, paru, or specific kernel modules that were compiled locally. If you have previously used helpers like yaourt or trizen, their logs might be stored elsewhere, but pacman -Qm remains the authoritative source for what pacman itself tracks as non-standard. For a more robust backup strategy, consider combining this with a list of explicitly installed packages from official repos. Use pacman -Qeqn to get packages that were manually installed rather than pulled in as dependencies. This prevents the new system from cluttering with unnecessary libraries that were only needed on the old hardware architecture.

Documenting Storage Layout

Storage configuration often breaks during migration due to differing UUIDs or partition schemes. Before wiping the old drive or formatting the new one, you must document exactly how your drives were mounted. The mount command provides a human-readable view of active filesystems, showing device paths, mount points, and filesystem types. Execute this command to capture the current state:
mount | grep -E "^/dev" > mounted_drives.txt
However, mount can sometimes show virtual filesystems like tmpfs or sysfs if not filtered correctly. A cleaner approach is using lsblk with JSON output, which preserves hierarchical relationships between disks and partitions. This is particularly useful if you use LVM (Logical Volume Manager) or RAID arrays, as text-based outputs often fail to represent these complex structures accurately.
lsblk -f > block_layout.json
Review the resulting files carefully. Note the UUIDs of your root, home, and swap partitions. During the installation on the new machine, you will need to match these UUIDs in your /etc/fstab file. If the new machine has different hardware controllers, the device names (like sda vs nvme0n1) may change, making UUID-based mounting essential for a bootable system.

Preserving Configuration Files

Beyond packages and drives, your dotfiles and system configurations define your workflow. While pacman handles binaries, it does not back up /etc or ~/.config. Create a compressed archive of your home directory, excluding large temporary folders like .cache or Downloads to save space.
tar -czf home_backup.tar.gz --exclude='.cache' --exclude='.local/share/Trash' ~/
Simultaneously, back up your system configuration directory. Be cautious with /etc/pacman.conf and /etc/mkinitcpio.conf, as these contain hardware-specific hooks that may need adjustment for the new machine. For example, if you switched from SATA to NVMe storage, you might need to add the nvme hook to mkinitcpio.conf. If you use encryption via LUKS, ensure you also note the keyslot numbers and the order of hooks in your initramfs. Failure to update these hooks after migration will result in a system that fails to decrypt the root partition at boot.

Restoring on the New Hardware

Once the base Arch Linux system is installed on the new machine, begin the restoration process. First, install the AUR helper if you do not already have one. Then, iterate through the aur_packages.txt file to reinstall each package. Using a script to automate this loop saves significant time compared to manual installation.
while read pkg; do yay -S --noconfirm "$pkg"; done < aur_packages.txt
Next, restore your /etc/fstab using the UUIDs recorded earlier. Verify that the mount points align with your restored home directory structure. Finally, extract your dotfiles archive into the new home directory. Remember to adjust permissions so that the user owns their configuration files. If you encounter issues with proprietary drivers or specific kernel parameters, refer to the original mkinitcpio configuration and rebuild the initial ramdisk. Regularly check the Arch Wiki for updates related to your new hardware components, as driver requirements may have shifted since your last installation. For more detailed insights on managing these transitions, see our guide on Migrating Arch Linux to a New Machine: Installing listpacman AUR packages and mounted drives.

Frequently Asked Questions

What happens if I skip backing up my /etc/fstab?

Your system will likely fail to boot because the kernel will not know where to mount the root and home partitions. Without UUID references, the system may assign random device names that do not match your previous setup, leading to a drop into emergency mode.

Can I use Pacman to list packages from third-party repositories like Chaotic-AUR?

Yes, pacman -Qm lists all packages not found in the official core, extra, multilib, or community repos. This includes packages from any enabled third-party mirror, provided they are tracked by pacman's local database.

Why is lsblk preferred over df for migration planning?

df shows disk usage per mounted filesystem but lacks structural details about partitions and physical disks. lsblk reveals the hierarchy of devices, including LVM volumes and encrypted containers, which is vital for recreating the exact storage layout on new hardware.

Should I include the .cache directory in my home backup?

No, .cache contains temporary data generated by applications that can be safely regenerated. Including it wastes bandwidth and storage space during transfer and may cause conflicts if cached data from the old hardware interferes with the new environment.

How do I handle different CPU architectures during migration?

Arch Linux generally supports multiple architectures within the same release, but you must ensure you are installing the correct version (e.g., x86_64) on the new machine. Packages compiled for AUR may require rebuilding if they depend on architecture-specific binaries, so always verify compatibility before installation.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More