You are not logged in.

#1 2025-12-17 14:25:58

diederick76
Member
Registered: 2010-02-14
Posts: 169

[SOLVED] pacman: error: switching to sandbox user 'alpm' failed!

$ pacman -Syu

or using pacman with any other arguments, indeed, fails after:

:: Synchronizing package databases...
error: restricting filesystem access failed because Landlock is not supported by the kernel!
error: switching to sandbox user 'alpm' failed!
error: failed to synchronize all databases (failed to retrieve some files)
 -> error refreshing databases - exit status 1

The second error is what my question is about. I've tried:

$ id alpm
uid=935(alpm) gid=935(alpm) groups=935(alpm)
$ sudo su - alpm
This account is currently not available.
$ cat /etc/passwd | grep alpm
alpm:x:935:935:Arch Linux Package Management:/:/usr/bin/nologin

What is this user alpm supposed to do and how do I fix this?

Last edited by diederick76 (2025-12-18 06:44:18)

Offline

#2 2025-12-17 14:30:33

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

Re: [SOLVED] pacman: error: switching to sandbox user 'alpm' failed!

What kernel are you using?

Online

#3 2025-12-17 14:32:00

diederick76
Member
Registered: 2010-02-14
Posts: 169

Re: [SOLVED] pacman: error: switching to sandbox user 'alpm' failed!

Scimmia wrote:

What kernel are you using?

Nothing special.

$ uname -a
Linux zaphod 6.18.1-arch1-2 #1 SMP PREEMPT_DYNAMIC Sat, 13 Dec 2025 18:23:21 +0000 x86_64 GNU/Linux

Offline

#4 2025-12-17 15:54:43

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,182
Website

Re: [SOLVED] pacman: error: switching to sandbox user 'alpm' failed!

Mod note: Moving to Pacman issues.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2025-12-17 17:22:16

loqs
Member
Registered: 2014-03-06
Posts: 18,724

Re: [SOLVED] pacman: error: switching to sandbox user 'alpm' failed!

Does the version reported `pacman -Q linux` match the uname output?  If it does,  do you pass the security option to the kernel to change the default LSM use?

Offline

#6 2025-12-17 17:57:39

diederick76
Member
Registered: 2010-02-14
Posts: 169

Re: [SOLVED] pacman: error: switching to sandbox user 'alpm' failed!

loqs wrote:

Does the version reported `pacman -Q linux` match the uname output?

It does:

$ pacman -Q linux
linux 6.18.1.arch1-2
loqs wrote:

If it does, do you pass the security option to the kernel to change the default LSM use?

I'm passing on apparmor. Could that be it?

Last edited by diederick76 (2025-12-17 18:20:09)

Offline

#7 2025-12-17 18:23:22

diederick76
Member
Registered: 2010-02-14
Posts: 169

Re: [SOLVED] pacman: error: switching to sandbox user 'alpm' failed!

This is odd, though. My current lsm config appears:

$ cat /sys/kernel/security/lsm
capability,apparmor

But if I understand it correctly, this is configured:

$ grep CONFIG_LSM= /proc/config.gz
CONFIG_LSM="landlock,lockdown,yama,integrity,bpf"

Also:

grep GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet lsm=apparmor"

I did not alter these options during last boot. What does this apparent inconsistency mean?

Last edited by diederick76 (2025-12-17 18:27:18)

Offline

#8 2025-12-17 19:04:12

loqs
Member
Registered: 2014-03-06
Posts: 18,724

Re: [SOLVED] pacman: error: switching to sandbox user 'alpm' failed!

diederick76 wrote:

I did not alter these options during last boot. What does this apparent inconsistency mean?

lsm=apparmor

Disables all the default LSM landlock,lockdown,yama,integrity,bpf.

Offline

#9 2025-12-18 06:43:52

diederick76
Member
Registered: 2010-02-14
Posts: 169

Re: [SOLVED] pacman: error: switching to sandbox user 'alpm' failed!

And that was the issue. Adding

lsm=landlock,lockdown,yama,integrity,apparmor,bpf

to the kernel command line made pacman work as expected again. Thanks for pointing me in that direction.

Offline

Board footer

Powered by FluxBB