I have read and followed Is it possible to update, upgrade and install software before flashing an image?. I managed to mount the official Arch image, synchronise the database and update the preinstalled packages. Unfortunately, it was rather slow. I think it was slow because pacman was being emulated, which seems a little excessive.

I did a little research and man pacman lists the following option

-r, --root
Specify an alternative installation root (default is /). This should not be used as a way to install software into /usr/local instead of /usr. This option is used if you want to install a package on a temporary mounted partition that is "owned" by another system.
NOTE: if database path or logfile are not specified on either the command line or in pacman.conf(5), their default location will be inside this root path.

Can we use exploit this option to install packages on a mounted image?


1 Answer 1



It's not too hard. Make sure you have followed the instructions on Is it possible to update, upgrade and install software before flashing an image? carefully and you have qemu-user-static installed correctly on the mounted system.


The /etc/pacman.conf file controls pacman, and normally, we wouldn't need to edit it. However, there is a problem with the supplied pacman.conf when used in this way. It includes the directive

Include = /etc/pacman.d/mirrorlist

Unfortunately, this picks up the mirror list from your host system, which probably won't mirror ARM packages. Copy /etc/pacman.conf from your mount to an appropriate directory and replace that line with

Server = http://mirror.archlinuxarm.org/arm/$repo

You can find my adapted pacman.conf at github.

Running pacman

You can now run pacman. Assuming your config file is in your pwd, run

sudo pacman -r <mount-point> --config pacman.conf -Syu


  1. Github project, which is forked from @Jivings Github project.

You must log in to answer this question.

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