You are not logged in.

#1 2025-03-16 05:56:44

jroovy-11904
Member
Registered: 2020-01-01
Posts: 22

[Solved] How to configure pacman to not download to a temp directory?

When pacman downloads packages, it downloads to /var/cache/pacman/pkg/download-XXXXXX, then moves the downloaded packages from that temp directory back to /var/cache/pacman/pkg.

How do I tell pacman to download packages directly to /var/cache/pacman/pkg and not that download-XXXXXX temp directory? The problem is interrupted downloads do not resume and instead download from scratch in a new temp directory.

Last edited by jroovy-11904 (2025-03-16 14:28:16)

Offline

#2 2025-03-16 07:39:59

seth
Member
Registered: 2012-09-03
Posts: 64,560

Re: [Solved] How to configure pacman to not download to a temp directory?

https://man.archlinux.org/man/core/pacm … en#OPTIONS - DisableSandbox will hopefully do.
Though with https://gitlab.archlinux.org/pacman/pacman/-/issues/209 adding an explicit DownloadUser seems to do as well?

Offline

#3 2025-03-16 09:18:57

jroovy-11904
Member
Registered: 2020-01-01
Posts: 22

Re: [Solved] How to configure pacman to not download to a temp directory?

seth wrote:

https://man.archlinux.org/man/core/pacm … en#OPTIONS - DisableSandbox will hopefully do.
Though with https://gitlab.archlinux.org/pacman/pacman/-/issues/209 adding an explicit DownloadUser seems to do as well?

Adding

DownloadUser = root
DisableSandbox

to /etc/pacman.conf fixes the issue for me. Thanks!

Offline

#4 2025-03-16 13:52:57

seth
Member
Registered: 2012-09-03
Posts: 64,560

Re: [Solved] How to configure pacman to not download to a temp directory?

Jus adding "DownloadUser = alpm" and removing/commenting "DisableSandbox" again does't suffice?

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#5 2025-03-16 14:24:22

jroovy-11904
Member
Registered: 2020-01-01
Posts: 22

Re: [Solved] How to configure pacman to not download to a temp directory?

seth wrote:

Jus adding "DownloadUser = alpm" and removing/commenting "DisableSandbox" again does't suffice?

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

You're right, only DownloadUser is required. Thanks!
(I'll edit my post as resolved)

EDIT:
Wait, how do I edit the subject? I don't see a button/link for that anywhere.

Edit 2:
Wait, nevermind, I figured it out, have to click edit on the initial comment.

Last edited by jroovy-11904 (2025-03-16 14:27:57)

Offline

#6 2025-04-01 00:51:32

credomane
Member
Registered: 2025-04-01
Posts: 1

Re: [Solved] How to configure pacman to not download to a temp directory?

Another thing to note is if a download is interrupted and a download-* folder is left behind. This folder cannot be cleaned with "pacman -Sc" and must be done manually.


# pacman -Sc
Packages to keep:
  All locally installed packages

Cache directory: /var/cache/pacman/pkg/
:: Do you want to remove all other packages from cache? [Y/n] y
removing old packages from cache...
error: could not open file /var/cache/pacman/pkg/download-wNOug2: Error reading fd 7

Database directory: /var/lib/pacman/

Hopefully there will be a fix released for sandboxed downloads when there is an interrupted download. Until then `DownloadUser = alpm` it is.

Offline

#7 2025-04-01 14:35:02

NuSkool
Member
Registered: 2015-03-23
Posts: 268

Re: [Solved] How to configure pacman to not download to a temp directory?

Maybe wrapping or aliasing 'pacman -Sc / -Scc' with code to delete the leftover dir's, rather than disabling the sandbox feature would be a better alternative?
My thinking is, the pacman sandbox feature is worth the inconvenience of having to manually clean up after.
I use the following in an aur related script as part of a cleanup process.

find "${AURREPO}" -maxdepth 1 -type d -name "download-*" -delete -print

find /build  /var/cache/pacman/pkg -maxdepth 1 -type d -name "download-*" -delete

Last edited by NuSkool (2025-04-01 14:39:24)


Scripts I Use                                                 :  https://github.com/Cody-Learner
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 7 8745HS w/ Radeon 780M Graphics
grep -m1 'model name' /proc/cpuinfo    : Intel(R) N95
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics

Offline

Board footer

Powered by FluxBB