You are not logged in.

#1 2025-02-28 16:39:59

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 718

[SOLVED] Pacman error when running from $HOME with apparmor.d rules

Why am I constantly getting this error message when installing anything with pacman?

:: Processing package changes...
error: could not get current working directory

Last edited by Zibi1981 (2025-03-01 10:54:50)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#2 2025-02-28 17:42:25

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

Re: [SOLVED] Pacman error when running from $HOME with apparmor.d rules

Broken custom hook?

grep -rF 'Processing package changes' /usr/share/libalpm/hooks/ /etc/pacman.d/hooks

Offline

#3 2025-02-28 19:35:38

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 718

Re: [SOLVED] Pacman error when running from $HOME with apparmor.d rules

I don't think so. This command does nothing.


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#4 2025-02-28 19:47:23

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

Re: [SOLVED] Pacman error when running from $HOME with apparmor.d rules

Please post the full output of a pacman command that installs, removes or upgrades a package with the --debug option added.

Offline

#5 2025-02-28 20:14:01

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 718

Re: [SOLVED] Pacman error when running from $HOME with apparmor.d rules

It could be related to BTRFS file system, as it was not present before I've reinstalled and changed EXT4 to BTRFS.

https://github.com/wesbarnett/snap-pac/issues/20

EDIT

Digging a little bit more into this I get to think it's related to appamor.d rules that I've set up.

https://github.com/roddhjav/apparmor.d

Last edited by Zibi1981 (2025-02-28 20:17:47)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#6 2025-02-28 20:27:06

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

Re: [SOLVED] Pacman error when running from $HOME with apparmor.d rules

"Reloading AppArmor service..." https://github.com/roddhjav/apparmor.d/ … or.hook#L4 is not in the output you have shared why do you believe that hook is the cause?  Why have you not shared the output I requested?

Offline

#7 2025-02-28 21:53:19

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

Re: [SOLVED] Pacman error when running from $HOME with apparmor.d rules

The cause isn't gonna be so much any hook as the access restriction imposed by apparmor.
https://apparmor.pujol.io/issues/

Offline

#8 2025-02-28 22:10:13

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

Re: [SOLVED] Pacman error when running from $HOME with apparmor.d rules

seth wrote:

The cause isn't gonna be so much any hook

https://bbs.archlinux.org/viewtopic.php?id=57855

Offline

#9 2025-02-28 22:55:16

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 718

Re: [SOLVED] Pacman error when running from $HOME with apparmor.d rules

seth wrote:

The cause isn't gonna be so much any hook as the access restriction imposed by apparmor.
https://apparmor.pujol.io/issues/

Gotta love that "it's not a bug, it'a a feature" thing big_smile

This is a feature, not a bug! It can safely be ignored. Pacman tries to get your current directory. You will only get this error when you run pacman in your home directory.

According to the Arch Linux guideline, on Arch Linux, packages cannot install files under /home/. Therefore, the pacman profile purposely does not allow access of your home directory.

This provides a basic protection against some packages (on the AUR) that may have rogue install script.

Last edited by Zibi1981 (2025-02-28 22:55:37)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#10 2025-03-01 07:45:15

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

Re: [SOLVED] Pacman error when running from $HOME with apparmor.d rules

Hardening the system implies feature constrain.
The idea is somewhat sound but you'll likely no longer be able to "pacman -U ~/some.pkg.tar.zst"? (whether you want to be on a hardened system is a different matter)
Running pacman from /tmp will likely prevent the message, you could use a script or alias for that.

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

Board footer

Powered by FluxBB