[SOLVED] Errors when installing packages in LXC, after changing UID and GID assignment

Sandbo

Well-Known Member
Jul 4, 2019
85
10
48
34
After I have changed the UID and GID for an LXC, I also changed the UID:GID on host for that image file (mounted by pct then chown).
While I can boot up the LXC and everything seems to work, when I install any package into the LXC as LXC's root, these errors always show up

Any idea what maybe missing in my configurations?

Code:
Processing triggers for man-db (2.10.2-1) ...
/usr/bin/mandb: can't chmod /var/cache/man/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/ro/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/ro/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/ro/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/sl/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/sl/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/sl/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/fi/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/fi/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/fi/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/de/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/de/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/de/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/pt/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/pt/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/pt/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/zh_CN/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/zh_CN/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/zh_CN/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/pl/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/pl/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/pl/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/it/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/it/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/it/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/da/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/da/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/da/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/sr/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/sr/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/sr/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/nl/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/nl/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/nl/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/es/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/es/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/es/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/ko/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/ko/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/ko/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/pt_BR/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/pt_BR/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/pt_BR/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/sv/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/sv/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/sv/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/hu/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/hu/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/hu/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/id/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/id/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/id/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/tr/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/tr/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/tr/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/ru/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/ru/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/ru/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/uk/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/uk/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/uk/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/zh_TW/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/zh_TW/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/zh_TW/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/ja/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/ja/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/ja/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/fr/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/fr/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/fr/1013: Permission denied
/usr/bin/mandb: can't chmod /var/cache/man/cs/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/cs/CACHEDIR.TAG: Permission denied
/usr/bin/mandb: fopen /var/cache/man/cs/1013: Permission denied
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
 
Last edited:
Turns out I just didn't know how ubuntu works:
After the change of UID:GID assignment, the directory /var/cache/man
should be owned by the user man, not root.

Thus, if your new UID is 400000 for root, then for man it will be 400006 and man's GID is 4000012.
On host, you should then first mount the lxc image, then do
chown -R 400006:400012 /var/lib/lxc/100/rootfs/var/cache/man/
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!