Pacman 7.0, the package manager for Arch Linux, was launched in mid-July, but as of today, it is available as an update in the Arch stable repository.
The new major version brings many new features, including introducing support for downloading packages as a separate user with reduced privileges.
While this enhancement improves security, users with local repositories may need to perform manual interventions to ensure seamless operation. Here’s what it’s all about.
For those utilizing local repositories, the new download user might not have the necessary access permissions to the repository files. This can prevent packages from downloading correctly.
To resolve this issue, you should assign the repository files and folders to the “alpm” group and ensure that the executable bit (“+x“) is set on the directories in question.
The group (and the user) are automatically set up during the upgrade to Pacman 7.0, so if you follow the terminal’s output, you will see the following messages:
:: Processing package changes...
(1/1) upgrading pacman [#######################################] 100%
warning: /etc/makepkg.conf.d/rust.conf installed as /etc/makepkg.conf.d/rust.conf.pacnew
warning: /etc/pacman.conf installed as /etc/pacman.conf.pacnew
New optional dependencies for pacman
base-devel: required to use makepkg [installed]
:: Running post-transaction hooks...
(1/3) Creating system user accounts...
Creating group 'alpm' with GID 946.
Creating user 'alpm' (Arch Linux Package Management) with UID 946 and GID 946.
Code language: Bash (bash)
Here’s how you can do it:
sudo chown :alpm -R /path/to/local/repo
Code language: Bash (bash)
This command changes the group ownership of your local repository files to “alpm” group, allowing the Pacman’s download user to access them appropriately.
Additionally, remember to merge any “.pacnew” files (more for them here) generated during the update. These files contain new default configurations introduced with Pacman 7.0. Merging them ensures you’re using the latest settings and helps prevent potential conflicts.
You can easily check the differences between the two files using the diff
command
diff --color /etc/pacman.conf /etc/pacman.conf.pacnew
Code language: Bash (bash)
Here’s how to merge them. First, create a “.diff” file that contains the differences between two files:
diff -u /etc/pacman.conf /etc/pacman.conf.pacnew > diff.patch
Code language: Bash (bash)
This creates a file called “diff.patch” with the differences in a unified format, which is more readable and suitable for merging.
Open the file in your terminal text editor to check its contents. The text highlighted in red is what will be changed (removed), and the text in green is what it will be replaced with (or added).
If all seems well, apply the patch (diff) to the “pacman.conf” file using the patch
command:
sudo patch /etc/pacman.conf < diff.patch
Code language: Bash (bash)
Furthermore, Pacman 7.0 also introduces changes to improve checksum stability for Git repositories that use “.gitattributes” files.
Consequently, you might need to update the checksums in your “PKGBUILD” files that source from Git repositories. This is a one-time adjustment to accommodate the new checksum calculation method.
Just a heads up: If you use yay
to install packages from AUR, be aware that after upgrading to Pacman 7.0, you’ll see an error message when trying to use it:
yay: error while loading shared libraries: libalpm.so.14: cannot open shared object file: No such file or directory
Code language: Bash (bash)
But there is no room for worry. Just recompile it, and it should work perfectly again.
For everything else related to the Pacman package manager, we highly recommend you visit our detailed guide dedicated entirely to its use.
Finally, to clarify, if you’re not working with local repositories, you only need to merge the “.pacnew” files. The official Arch’s announcement on the topic is here.