“yum update”后如何交互合并配置文件

Ant*_*ich 7 yum fedora rpm rhel etc

使用yum update 更新系统包后,无法覆盖的配置文件不会被替换,但我们可以在附近找到*.rpmnew 文件。按照设计,系统管理员必须合并配置文件。

在 Gentoo Linux 中有一个etc-update 工具,它允许交互式合并配置文件更改,如下所示:

Beginning of differences between /etc/pear.conf and /etc/._cfg0000_pear.conf
[...]
End of differences between /etc/pear.conf and /etc/._cfg0000_pear.conf
1) Replace original with update
2) Delete update, keeping original as is
3) Interactively merge original with update
4) Show differences again
Run Code Online (Sandbox Code Playgroud)

我想知道是否有办法在 RHEL/Fedora/CentOS 中以交互方式合并配置?

she*_*onh 5

我发现最接近 Gentoo 的etc-updaterpmconf

# yum install -y rpmconf    
# rpmconf -a
Configuration file `/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.25-5.b18.fc21.x86_64/jre/lib/security/US_export_policy.jar'
-rw-r--r--. 1 root root 620 Oct  2 16:38 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.25-5.b18.fc21.x86_64/jre/lib/security/US_export_policy.jar
-rw-r--r--. 1 root root 620 Dec 15 12:11 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.25-5.b18.fc21.x86_64/jre/lib/security/US_export_policy.jar.rpmnew
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      M     : merge configuration files
      Z     : background this process to examine the situation
      S     : skip this file
 The default action is to keep your current version.
*** aliases (Y/I/N/O/D/Z/S) [default=N] ? 
Your choice: Y
Run Code Online (Sandbox Code Playgroud)


小智 5

这个 yum 插件添加了“--merge-conf”命令行选项。使用此选项,Yum 将询问您如何处理更新包时更改的配置文件。

https://apps.fedoraproject.org/packages/yum-plugin-merge-conf