You are not logged in.

#1 2024-09-16 12:54:41

nikitarevenco
Member
Registered: 2024-09-16
Posts: 7

Trying to create local pacman DB but pacman "cannot open file"

Hello, I am trying to do an offline install of arch linux because on my laptop the internet isn't working. For that I will also need to install the `r8168-dkms` driver from the AUR and enable it

I am following [Prepare Local Repository](https://wiki.archlinux.org/title/Offlin … repository) with these commands:

```
# mkdir /tmp/blankdb
# mkdir ~/packages
# cd ~/packages

# pacman -Syw --cachedir . --dbpath /tmp/blankdb base base-devel linux linux-firmware neovim btrfs-progs lvm2 grub efibootmgr zsh networkmanager mkinitcpio
```

Then when I get the `Proceed with download? [Y/n] Y`
I get the following output:

```
Total Download Size:  637.51 MiB

:: Proceed with download? [Y/n] Y
:: Retrieving packages...
Total (  0/195)                                                               637.5 MiB  62.3 GiB/s 00:00 [################################################################] 100%
error: restricting filesystem access failed because the landlock rule for the temporary download directory could not be added!
error: could not open file ./download-lleq3F/linux-firmware-20240909.552ed9b8-1-any.pkg.tar.zst.part: No such file or directory
error: failed to setup a download payload for linux-firmware-20240909.552ed9b8-1-any.pkg.tar.zst
warning: failed to retrieve some files
error: failed to commit transaction (failed to retrieve some files)
Errors occurred, no packages were upgraded.
```

Not sure what I am supposed to do now, I tried the command with various directories but it didn': work. I tried removing `/tmp/blankdb` but it also did not work

Offline

#2 2024-09-16 12:57:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,105

Re: Trying to create local pacman DB but pacman "cannot open file"

Using an really old ISO or something?

Edit: This is before you get to the ISO? If so, what kernel are you using?

Last edited by Scimmia (2024-09-16 13:01:47)

Offline

#3 2024-09-16 13:06:43

nikitarevenco
Member
Registered: 2024-09-16
Posts: 7

Re: Trying to create local pacman DB but pacman "cannot open file"

Scimmia wrote:

Using an really old ISO or something?

Edit: This is before you get to the ISO? If so, what kernel are you using?

Yes, I should have clarified that I am executing those commands on my main PC where I have arch installed.

Kernel: 6.10.10-arch1-1

Offline

#4 2024-09-16 13:12:29

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,105

Re: Trying to create local pacman DB but pacman "cannot open file"

OK, so the problem is that you're doing this in your home dir, where the download user does not have access. You need to give the alpm user access (either change permissions or do it elsewhere), change the download user, or disable the download sandbox altogether.

Last edited by Scimmia (2024-09-16 13:19:10)

Offline

#5 2025-02-15 21:41:40

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

Re: Trying to create local pacman DB but pacman "cannot open file"

wrong post, deleted

Last edited by NuSkool (2025-02-15 22:10:35)


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

#6 2025-04-10 20:16:58

lovelyHanibal
Member
Registered: 2025-03-20
Posts: 8

Re: Trying to create local pacman DB but pacman "cannot open file"

Did you solve it ?
Because I'm having the same problem.

changing owner to alpm doesn't seem to be chaning anything.

# chown alpm ~/packages
# chown alpm /tmp/blankdb

Adding --disable-sandbox removes only first error.

# pacman -Syw --cachedir ./ --dbpath /tmp/blankdb --disable-sandbox   vim curl mc
...
:: Retrieving packages...
 Total ( 0/68)
error: could not open file ./download-NTtPf6/gcc-libs-14.2.1+r753+g1cd744a6828f-1-x86_64.pkg.tar.zst.part: No such file or directory
error: failed to setup a download payload for gcc-libs-14.2.1+r753+g1cd744a6828f-1-x86_64.pkg.tar.zst
warning: failed to retrieve some files
error: failed to commit transaction (failed to retrieve some files)
Errors occurred, no packages were upgraded.

Offline

#7 2025-04-10 21:55:51

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,483

Offline

#8 2025-04-10 22:46:13

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,105

Re: Trying to create local pacman DB but pacman "cannot open file"

lovelyHanibal wrote:

changing owner to alpm doesn't seem to be chaning anything.

# chown alpm ~/packages
# chown alpm /tmp/blankdb

It needs access to not only the dir, but all dirs above it.

Just stop putting things like this in your home dir.

Offline

#9 2025-04-11 02:35:52

EBADFD
Member
Registered: 2025-03-31
Posts: 11

Re: Trying to create local pacman DB but pacman "cannot open file"

I remember I had a pacman problem and fixed it by not having the cache point to /tmp (softlink). I wasn't sure why it was a problem but changing it fixed my problem

Offline

#10 2025-04-11 03:32:35

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,105

Re: Trying to create local pacman DB but pacman "cannot open file"

That's a different issue, symlinking the cache dir will completely fail when pacman is updated. Nothing to do with this permission issue, but set things in pacman.conf if you want to change the cache.

Offline

#11 2025-04-21 01:09:35

lovelyHanibal
Member
Registered: 2025-03-20
Posts: 8

Re: Trying to create local pacman DB but pacman "cannot open file"

Moving packages directory to /var/packages solved the problem for me.
Thank you for help.

sudo mkdir /var/my_local_repo
sudo chown alpm:alpm /var/my_local_repo
sudo mkdir /tmp/blankdb
sudo pacman -Syw --cachedir /var/my_local_repo --dbpath /tmp/blankdb   base linux linux-firmware vim grub

But I found other solution that also work for me.
It download whole reposytory, and doesn't require root:

mkdir ~/my_local_repo
rsync -rtHl --delete-after --delay-updates --safe-links   rsync://mirror.rackspace.com/archlinux/core/os/x86_64/	~/my_local_repo
rsync -rtHL --delete-after --delay-updates                rsync://mirror.rackspace.com/archlinux/core/os/x86_64/	~/my_local_repo

From my point of view this thread can be marked as solved. But I'm not OP.

Offline

Board footer

Powered by FluxBB