FS#46169 - pacman -S PACKAGE: error: could not determine cachedir mount point /var/cache/pacman/pkg

Attached to Project: Pacman
Opened by Jaroslav Škarvada (yarda) - Tuesday, 01 September 2015, 16:34 GMT
Last edited by Allan McRae (Allan) - Thursday, 15 December 2022, 06:22 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 4.2.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
I used arch-bootstrap.sh (from https://wiki.archlinux.org/index.php/Archbootstrap) to bootstrap archlinux i686 from Fedora 22 x86_64. I rbind-mounted dev, sys, var, run and also mounted proc and chrooted into the system. I initialized pacman, but it refuses to install packages with "error: could not determine cachedir mount point /var/cache/pacman/pkg"

Steps to Reproduce:
Bootstrap from Fedora 22 using arch-bootstrap.sh.
Chroot into the system.
Initialize pacman.
Try to install systemd-sysvcompat package:

# pacman -S systemd-sysvcompat
resolving dependencies...
looking for conflicting packages...

Packages (1) systemd-sysvcompat-224-1

Total Download Size: 0.01 MiB
Total Installed Size: 0.00 MiB

:: Proceed with installation? [Y/n] y
error: could not determine cachedir mount point /var/cache/pacman/pkg
error: failed to commit transaction (not enough free disk space)
Errors occurred, no packages were upgraded.

Mounts visible from chroot:
none on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=4015144k,nr_inodes=1003786,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel)
mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel)
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755)
tmpfs on /run/user/989 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=805284k,mode=700,uid=989,gid=987)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=805284k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000

Run with --debug:
# pacman --debug -S systemd-sysvcompat
debug: pacman v4.2.1 - libalpm v9.0.1
debug: parseconfig: options pass
debug: config: attempting to read file /etc/pacman.conf
debug: config: finish section '(null)'
debug: config: new section 'options'
debug: config: HoldPkg: pacman
debug: config: HoldPkg: glibc
debug: config: arch: i686
debug: config: SigLevel: Required
debug: config: SigLevel: DatabaseOptional
debug: config: LocalFileSigLevel: Optional
debug: config: finish section 'options'
debug: config: new section 'core'
debug: config file /etc/pacman.conf, line 75: including /etc/pacman.d/mirrorlist
debug: config: attempting to read file /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.d/mirrorlist
debug: config: finish section 'core'
debug: config: new section 'extra'
debug: config file /etc/pacman.conf, line 78: including /etc/pacman.d/mirrorlist
debug: config: attempting to read file /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.d/mirrorlist
debug: config: finish section 'extra'
debug: config: new section 'community'
debug: config file /etc/pacman.conf, line 84: including /etc/pacman.d/mirrorlist
debug: config: attempting to read file /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.d/mirrorlist
debug: config: finish section 'community'
debug: config: new section '(null)'
debug: config: finished parsing /etc/pacman.conf
debug: setup_libalpm called
debug: option 'logfile' = /var/log/pacman.log
debug: option 'gpgdir' = /etc/pacman.d/gnupg/
debug: option 'cachedir' = /var/cache/pacman/pkg/
debug: parseconfig: repo pass
debug: config: attempting to read file /etc/pacman.conf
debug: config: finish section '(null)'
debug: config: new section 'options'
debug: config: finish section 'options'
debug: config: new section 'core'
debug: config file /etc/pacman.conf, line 75: including /etc/pacman.d/mirrorlist
debug: config: attempting to read file /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.d/mirrorlist
debug: config: finish section 'core'
debug: registering sync database 'core'
debug: database path for tree core set to /var/lib/pacman/sync/core.db
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: missing optional signature
debug: setting usage of 15 for core repoistory
debug: adding new server URL to database 'core': http://archlinux.mirror.dkm.cz/pub/archlinux/core/os/i686
debug: adding new server URL to database 'core': http://gluttony.sin.cvut.cz/arch/core/os/i686
debug: adding new server URL to database 'core': http://mirror.oss.maxcdn.com/archlinux/core/os/i686
debug: adding new server URL to database 'core': http://mirrors.nic.cz/archlinux/core/os/i686
debug: adding new server URL to database 'core': http://mirror.vpsfree.cz/archlinux/core/os/i686
debug: adding new server URL to database 'core': http://mirrors.kernel.org/archlinux/core/os/i686
debug: config: new section 'extra'
debug: config file /etc/pacman.conf, line 78: including /etc/pacman.d/mirrorlist
debug: config: attempting to read file /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.d/mirrorlist
debug: config: finish section 'extra'
debug: registering sync database 'extra'
debug: database path for tree extra set to /var/lib/pacman/sync/extra.db
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: missing optional signature
debug: setting usage of 15 for extra repoistory
debug: adding new server URL to database 'extra': http://archlinux.mirror.dkm.cz/pub/archlinux/extra/os/i686
debug: adding new server URL to database 'extra': http://gluttony.sin.cvut.cz/arch/extra/os/i686
debug: adding new server URL to database 'extra': http://mirror.oss.maxcdn.com/archlinux/extra/os/i686
debug: adding new server URL to database 'extra': http://mirrors.nic.cz/archlinux/extra/os/i686
debug: adding new server URL to database 'extra': http://mirror.vpsfree.cz/archlinux/extra/os/i686
debug: adding new server URL to database 'extra': http://mirrors.kernel.org/archlinux/extra/os/i686
debug: config: new section 'community'
debug: config file /etc/pacman.conf, line 84: including /etc/pacman.d/mirrorlist
debug: config: attempting to read file /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.d/mirrorlist
debug: config: finish section 'community'
debug: registering sync database 'community'
debug: database path for tree community set to /var/lib/pacman/sync/community.db
debug: "/var/lib/pacman/sync/community.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/community.db.sig could not be opened
debug: missing optional signature
debug: setting usage of 15 for community repoistory
debug: adding new server URL to database 'community': http://archlinux.mirror.dkm.cz/pub/archlinux/community/os/i686
debug: adding new server URL to database 'community': http://gluttony.sin.cvut.cz/arch/community/os/i686
debug: adding new server URL to database 'community': http://mirror.oss.maxcdn.com/archlinux/community/os/i686
debug: adding new server URL to database 'community': http://mirrors.nic.cz/archlinux/community/os/i686
debug: adding new server URL to database 'community': http://mirror.vpsfree.cz/archlinux/community/os/i686
debug: adding new server URL to database 'community': http://mirrors.kernel.org/archlinux/community/os/i686
debug: config: new section '(null)'
debug: config: finished parsing /etc/pacman.conf
debug: loading package cache for repository 'core'
debug: opening archive /var/lib/pacman/sync/core.db
debug: added 209 packages to package cache for db 'core'
debug: adding package 'systemd-sysvcompat'
debug: loading package cache for repository 'local'
debug: added 80 packages to package cache for db 'local'
debug: adding package systemd-sysvcompat-224-1 to the transaction add list
resolving dependencies...
debug: resolving target's dependencies
debug: started resolving dependencies
debug: checkdeps: package systemd-sysvcompat-224-1
debug: finished resolving dependencies
looking for conflicting packages...
debug: looking for conflicts
debug: check targets vs targets
debug: check targets vs targets
debug: check targets vs db and db vs targets
debug: check targets vs db
debug: check db vs targets
debug: checking dependencies
debug: checkdeps: package systemd-sysvcompat-224-1
debug: setting download size 5788 for pkg systemd-sysvcompat
debug: sorting by dependencies
debug: started sorting dependencies
debug: sorting dependencies finished
debug: returning error 31 from alpm_db_get_pkg : could not find or read package

Packages (1) systemd-sysvcompat-224-1

Total Download Size: 0.01 MiB
Total Installed Size: 0.00 MiB

:: Proceed with installation? [Y/n] y
debug: using cachedir: /var/cache/pacman/pkg/
debug: checking available disk space for download
debug: discovered mountpoint: /sys/kernel/security
debug: discovered mountpoint: /sys/kernel/debug
debug: discovered mountpoint: /sys/kernel/config
debug: discovered mountpoint: /sys/fs/selinux
debug: discovered mountpoint: /sys/fs/pstore
debug: discovered mountpoint: /sys/fs/fuse/connections
debug: discovered mountpoint: /sys/fs/cgroup/systemd
debug: discovered mountpoint: /sys/fs/cgroup/perf_event
debug: discovered mountpoint: /sys/fs/cgroup/net_cls,net_prio
debug: discovered mountpoint: /sys/fs/cgroup/memory
debug: discovered mountpoint: /sys/fs/cgroup/hugetlb
debug: discovered mountpoint: /sys/fs/cgroup/freezer
debug: discovered mountpoint: /sys/fs/cgroup/devices
debug: discovered mountpoint: /sys/fs/cgroup/cpuset
debug: discovered mountpoint: /sys/fs/cgroup/cpu,cpuacct
debug: discovered mountpoint: /sys/fs/cgroup/blkio
debug: discovered mountpoint: /sys/fs/cgroup
debug: discovered mountpoint: /sys/firmware/efi/efivars
debug: discovered mountpoint: /sys
debug: discovered mountpoint: /run/user/989
debug: discovered mountpoint: /run/user/1000/gvfs
debug: discovered mountpoint: /run/user/1000
debug: discovered mountpoint: /run
debug: discovered mountpoint: /proc
debug: discovered mountpoint: /dev/shm
debug: discovered mountpoint: /dev/shm
debug: discovered mountpoint: /dev/pts
debug: discovered mountpoint: /dev/pts
debug: discovered mountpoint: /dev/mqueue
debug: discovered mountpoint: /dev/mqueue
debug: discovered mountpoint: /dev/hugepages
debug: discovered mountpoint: /dev/hugepages
debug: discovered mountpoint: /dev
debug: discovered mountpoint: /dev
error: could not determine cachedir mount point /var/cache/pacman/pkg
debug: returning error 7 from _alpm_check_downloadspace : not enough free disk space
error: failed to commit transaction (not enough free disk space)
Errors occurred, no packages were upgraded.
debug: unregistering database 'local'
debug: freeing package cache for repository 'local'
debug: unregistering database 'core'
debug: freeing package cache for repository 'core'
debug: unregistering database 'extra'
debug: unregistering database 'community'

It seems there is some stupid check looking for some mountpoint that is probably not there (/ ?) that prevents the tool from running inside chroot.
This task depends upon

Closed by  Allan McRae (Allan)
Thursday, 15 December 2022, 06:22 GMT
Reason for closing:  Not a bug
Comment by Dave Reisner (falconindy) - Tuesday, 01 September 2015, 16:50 GMT
Your chroot is malformed and has no / mountpoint. If the base of the chroot is not an actual device, then it needs to be bind mounted on itself. The official arch installation tools do this.
Comment by Dave Reisner (falconindy) - Tuesday, 01 September 2015, 16:55 GMT
> It seems there is some stupid check looking for some mountpoint that is probably not there (/ ?) that prevents the tool from running inside chroot.
Well, you asked for diskspace checking, and pacman can't give you an answer. The sane thing to do is abort. If you want to avoid this safety check, just disable it...
Comment by Jaroslav Škarvada (yarda) - Tuesday, 01 September 2015, 17:01 GMT
Thanks for the quick reply and hints. I found it in the config "CheckSpace". Could you improve the error message to instruct users how to bypass it? Or add command line option to bypass it for one run? It would be especially helpful for newcomers. I also checked the manual page and haven't noticed anything related.
Comment by Dave Reisner (falconindy) - Tuesday, 01 September 2015, 17:07 GMT
I'd rather not explain how to fix a broken chroot in an error message. Suggesting that a user disable an important safety feature isn't really wise, either.

For your own sake, perhaps you could use official installation scripts, rather than random things found on the wiki.
Comment by Jaroslav Škarvada (yarda) - Tuesday, 01 September 2015, 17:21 GMT
Why do you think the chroot is broken? I used chroot command from my distro and there is nothing about the '/' mountpoint in its documentation (or is there any specification?). Chroot bootstrap works correctly for couple of other distros. I don't see any reason why it shouldn't work for archlinux. Also I wasn't able to find anything related to this issue on the wiki and the bootstrap script I used is listed as one of the install method on the wiki, thus I thought it's supported. But this is not about bootstrap script. Requiring user to download and use some hacked scripts instead of distros own chroot command to enter chroot is a bit silly.
Comment by Dave Reisner (falconindy) - Tuesday, 01 September 2015, 20:53 GMT
> Why do you think the chroot is broken?
It has no well-defined root? You can't use mount propagation or a mount namespace without this, and tools which expect / to correlate to a device are broken (as you've found).

> Requiring user to download and use some hacked scripts instead of distros own chroot command to enter chroot is a bit silly.
But here you are using some "hacked script" you found rather than just "pacstrap -d /path/to/chroot" or "arch-chroot /path/to/chroot". These aren't just convenience nor are they "silly." They codify good practices and allow you to avoid the pitfalls of chroot setup. chroot(1) is just a thin wrapper around a syscall. You seem to have no qualms over doing a partial job of chroot setup before calling chroot(1), only the pieces you've missed out on.
Comment by Jaroslav Škarvada (yarda) - Tuesday, 01 September 2015, 21:24 GMT
I am afraid you still don't get the point. I have no pacstrap nor arch-chroot on my host system. Imagine the situation I downloaded archlinux-bootstrap archive from some mirror, unpacked it, chrooted into it and encountered the strange error. After few hours later and after reading most of the wiki regarding installation and pacman manual page I had still no clue what's wrong there. Later, after using --debug and strace I began to suspect where the problem is. And even later after filling bugzilla and/or checking the source code I learn how to overcome the problem. Moreover the "feature" that blocked me for a while is not very helpful, because I usually know how much free space is there in chroot. The error messages and documentation also didn't help to guide me where the problem is. I don't think this gives good user experience especially if one can bootstrap other distros (e.g. gentoo, debian, ...) this way and everything works correctly.
Comment by Constantine (Hi-Angel) - Wednesday, 13 July 2016, 15:08 GMT
That was a nice discussion, but I still didn't get: how to resolve the error? Do I have to mount the «/» directory in the chrooted bootstrap/livecd ? Or do I have to mount it to «/mnt/the-actual-partition-to-install-archlinux»? And what do I need to substitute in place of «block device» argument?
Comment by Constantine (Hi-Angel) - Wednesday, 13 July 2016, 15:14 GMT
Aha, I get it! One have to run in the distro, from which the installation happens, the command «mount --bind <directory-to-livecd-or-bootstrap> <directory-to-livecd-or-bootstrap>». E.g. I have to run from Ubuntu «sudo mount --bind ~/Downloads/squashfs-root/ ~/Downloads/squashfs-root/».

Loading...