[Fixed] filesystem package fails to upgrade on docker/lxc containers – centos 7/8

Have had an ongoing issue with a handful of lxc containers that fail to dnf upgrade the ‘filesystem’ package. Reading online it looks to also occur on docker containers.

Error:
Failed:
filesystem-3.8-2.el8.x86_64

Issue is caused by the /proc subsystem that is passed through from proxmox / the base OS.
filesystem package upgrade tries to chrown root:root a folder within /proc.

Workaround:
Append the following line:

%_netsharedpath /sys:/proc

to “/etc/rpm/macros.dist”

Or:

#!/bin/bash
echo "%_netsharedpath /sys:/proc" >> /etc/rpm/macros.dist

And rerun your upgrade.

All the fix does is tell dnf/yum/rpm that the proc subsystem is not locally managed and cannot be modified.

  1 comment for “[Fixed] filesystem package fails to upgrade on docker/lxc containers – centos 7/8

  1. Ådne Hovda
    January 5, 2021 at 8:59 pm

    Thanks! This works, but the macros.dist file will be overwritten by the release package, so better put the macro in a separate file in /etc/rpm/, e.g. /etc/rpm/macros.sysprocfs. Any macros.* file will be picked up by rpm, as shown by rpm –showrc | grep ‘Macro path’ .

    HTH

Leave a Reply

Your email address will not be published. Required fields are marked *