Pacman 7.0 Required Manual Intervention for Local Repositories

Attention Arch users, Pacman 7.0 has just landed in stable Arch's repos. However, if you use local ones, you must manually intervene. Here's how to do it.

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/repoCode 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.pacnewCode language: Bash (bash)
Find the changes needed to be applied to the "pacman.conf" file.
Find the changes needed to be applied to the “pacman.conf” file.

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.patchCode 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).

Review the contents of the ".diff" file for the changes to be made.
Review the contents of the “diff.patch” file for the changes to be made.

If all seems well, apply the patch (diff) to the “pacman.conf” file using the patch command:

sudo patch /etc/pacman.conf < diff.patchCode language: Bash (bash)
Patching the "pacman.conf" file.
Patching the “pacman.conf” file.

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 directoryCode 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.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%