Access denied to '/var/lib/pacman/sync/download-ASOzbC' permission denied

Hello
I have this message each time i use: pamac upgrade -a

pamac upgrade -a  :check_mark:  6s 
Vorbereitung…
Synchronisiere Paketdatenbanken…
Aktualisierung von AUR…
cp: Zugriff auf ‘/var/lib/pacman/sync/download-ASOzbC’ nicht möglich: Keine Berechtigung
cp: Zugriff auf ‘/var/lib/pacman/sync/download-axt88o’ nicht möglich: Keine Berechtigung

What can I do to get access to these files? I always get this message each time I upgrade..
Thank You Very Much

These are probably old and not needed anymore.
They may be remnants from you using pamac with sudo in the past.

ls -hl /var/lib/pacman/sync/

There likely are no files there.

Check:

ls -hl /var/lib/pacman/sync/download*

I don’t have such directories present here - but I don’t have anything from AUR installed.

remove these directories after you have convinced yourself that there is nothing there that you want:

sudo rm -rf /var/lib/pacman/sync/download*

to get the command output in english, prepend

LANG=C

2 Likes

That’s what it looks like to me as well. :wink:

2 Likes

Those are temporary download folders, usually empty. The problem is those are created from the new download user “alpm” after one of the last update. Which confuses other tools like yay or pamac, because those start to run with your user and only ask for root if needed… obviously they do not detect it is needed here.

I am still thinking of a smart solution myself which allows me to use yay -Scc for example.

In the meantime you can ignore it if it does not stop you workflow, or periodically rm those folders manually with sudo, or revert to the old behavior of alpm to download as root. To do this, the setting is in pacman.conf

1 Like

It’s a known issue:

3 Likes

But… But… But… :backhand_index_pointing_down:

BUGS
       Bugs? You must be kidding; there are no bugs in this software.

:stuck_out_tongue:

1 Like

Pacman 7.1 has man pacman | less -p BUGS. :bug:

1 Like

my temporary solution

sudo rm /var/cache/pacman/pkg/download*/* && sudo rmdir /var/cache/pacman/pkg/download*

before or after yay -Scc

1 Like

This works for me:
sudo rm -rv /var/cache/pacman/pkg/download-*
followed by:
sudo pacman -Scc

2 Likes

I am on Manjaro stable with XFCE and i get issues with pacman that “forgets” to remove empty folders in folder pkg with names like downloads-*

KI told me it is a known problem of pacman 7

I didn’t experience this issue in the year 2025 ( i think ) and my pacman --version tells me

[john1@manjaro ~]$ pacman --version

 .--.                  Pacman v7.1.0 - libalpm v16.0.1
/ _.-' .-.  .-.  .-.   Copyright (C) 2006-2025 Pacman Development Team
\  '-. '-'  '-'  '-'   Copyright (C) 2002-2006 Judd Vinet

Does anybody knows what could be the extra reason that i see now this empty folders ? Pacman itself has not changed lately ?

Ok, only yay -Sccc can’t handle this empty folders.

I am curious !

It is, indeed. The problem is known about upstream. :wink:

pacman was updated with the Stable Update of 2025.12.23. That’s when the problem began. There was another update to pacman in the Stable Update of 2026.02.01.

1 Like

One can revert to the old behavior in pacman.conf, but since this change was done to enhance security, and is a known bug, i would just ignore those or delete them with sudo until a fix arrives.

3 Likes

This issue exists since january 2026. Is that really more than a one liner in code to remove this directory ?

Wondering !

What is “the issue”?
The directory and everything in it (it’s probably empty anyway) can be removed.

ls -h /var/cache/pacman/pkg/download-*
shows the names - there might be more than one

sudo rm -rf /var/cache/pacman/pkg/download-*
removes these directories recursively

You can use the file manager if you prefer - need admin (root) permissions to do it.

Until December 2025 there was no need to remove these directories “by hand”. But perhaps the issue is gone just now, but i did not see it with this stable update and i have to wait for next update ?

As i said: “wondering”

p.s.

pacman history tells me:

[2026-02-24T11:32:22+0100] [ALPM] upgraded pacman-static (7.1.0.r9.g54d9411-2 -> 7.1.0.r9.g54d9411-4)

So its probably allready fixed .. have to wait some days !

@Nachlese Can you move this thread to support please ?

As far as I know, these directories are created but then not removed automatically
when pamac is used as root (sudo pamac …)
which one should never do.
It is not really an issue when pamac is used as intended.

1 Like

Nope, this is not (the only?) case. This is actually the new version of pacman using a new user ALPM owning the temporary download dirs instead of root to tighten security.
I think i saw somewhere an open issue upstream about polishing this new function in the future/bugfixing so that the temp folders are removed. Patience. Is not that critical anyway, the only thing it breaks is yay -Scc for example.

3 Likes

Aha… I must admit to having done it a couple of times - but now…

➤ sudo pamac upgrade
[sudo] password for ben: 
Warning: Do not use 'pamac' with 'root' privileges. It can cause permission issues.
Are you sure you want to continue? (y/n): 

I can’t say it happened recently, but I’m terrible for confusing similar words with similar spelling - pacman and pamac are a little too easy to switch.

So, extra protection…

➤ which pamac
/usr/local/bin/pamac
                                                                                                                       
➤ z /usr/local/bin
/usr/local/bin
                                                                                                       
➤ kate pamac

Then paste this:

#!/bin/bash


if [[ $(ps -o comm= $PPID) == "sudo" ]]; then
    echo "Warning: Do not use 'pamac' with 'root' privileges. It can cause permission issues."
    read -p "Are you sure you want to continue? (y/n): " choice
    if [[ $choice != "y" ]]; then
        echo "Exiting..."
        exit 1
    else
        echo "Continuing..."
    fi
fi

/usr/bin/pamac "$@"

Then:

chmod +x /usr/local/bin/pamac

Then this new ‘pamac’ becomes your new pamac with a reminder…

3 Likes