--excludepath/--使用 rpm/yum/dnf 安装时默认重新定位某些路径

--excludepath/--使用 rpm/yum/dnf 安装时默认重新定位某些路径

我想释放.mo文件占用的空间/usr/share/locale,因此我用符号链接替换了该目录,/tmp/.locale-blackhole并配置了该目录的自动创建

/etc/tmpfiles.d/locale-blackhole.conf:

# Conserve disk space for unused locales

# pre-create the dir below and clean 1-day-old files periodically:
d /tmp/.locale-blackhole 0755 root root 1d

# pre-create symlinks
L+ /tmp/.locale-blackhole/locale.alias - - - - ../../usr/share/locale.persist/locale.alias
L+ /tmp/.locale-blackhole/en - - - - ../../usr/share/locale.persist/en
L+ /tmp/.locale-blackhole/en_US - - - - ../../usr/share/locale.persist/en_US
L+ /tmp/.locale-blackhole/fr - - - - ../../usr/share/locale.persist/fr

# do not cleanup the paths below:
x /tmp/.locale-blackhole/locale.alias
x /tmp/.locale-blackhole/en
x /tmp/.locale-blackhole/en_US
x /tmp/.locale-blackhole/fr
x /tmp/.locale-blackhole/keepme

它可以工作,除非glibc-common更新或重新安装时,符号链接/tmp/.locale-blackhole/locale.alias被替换为常规文件。

所以我想配置rpm为始终将此文件重新定位到/usr/share/locale.persist/.这可能吗?

或者更好的是,是否可以/usr/share/locale/从 rpm 提取中排除某些语言?

相关内容