[英]List of changed files in RPM
I wonder, if there is a way to do the following: I have rpmA-v1 installed on the system. 我想知道,如果有办法做到以下几点:我在系统上安装了rpmA-v1。 It has a lot of config files which user can edit for their purposes.
它有很多配置文件,用户可以根据其目的进行编辑。 Then, I want to install new version of rpmA, say, rpmA-v2 and before installing it I want to back up those config files, which were edited, not to edit config files one more time.
然后,我想安装rpmA的新版本,比如rpmA-v2,在安装之前我想备份那些已编辑的配置文件,而不是再次编辑配置文件。
Is there any way to know which files were edited in such a situation? 有没有办法知道在这种情况下编辑了哪些文件?
If you are talking about config files related to given package, rpm
already has pretty robust mechanism for this known as .rpmnew
/ .rpmsave
. 如果您正在讨论与给定包相关的配置文件,则
rpm
已经具有相当强大的机制,称为.rpmnew
/ .rpmsave
。
If package is being upgraded, at the discretion of package creator/maintainer there are 2 possible actions that may be taken by rpm
: 如果正在升级软件包,则由软件包创建者/维护者自行决定,
rpm
可能采取两种可能的操作:
/etc/myprog/config
, and new one is installed right next to it as /etc/myprog/config.rpmnew
. /etc/myprog/config
完整保留,并且新的/etc/myprog/config
安装在它旁边,如/etc/myprog/config.rpmnew
。 Presence of *.rpmnew
file typically means that old config was NOT edited. *.rpmnew
文件的存在通常意味着未编辑旧配置。 /etc/myprog/config.rpmsave
, and new one is installed as /etc/myprog/config
(replacing old one). /etc/myprog/config.rpmsave
,新配置安装为/etc/myprog/config
(替换旧/etc/myprog/config
)。 New config may be completely fresh (vanilla) or it may incorporate settings inherited from old, .rpmsave
'd version. .rpmsave
版本继承的设置。 Presence of *.rpmsave
files is pretty robust sign that config files were actually edited by rpm
. *.rpmsave
文件是相当健壮的标志,配置文件实际上是由rpm
编辑的。 Typically, after upgrading of one or more packages (or the whole system) it is recommended to search for all .rpmnew
/ .rpmsave
files using command like 通常,在升级一个或多个软件包(或整个系统)之后,建议使用类似命令搜索所有
.rpmnew
/ .rpmsave
文件
find /etc -name "*.rpmsave" -or -name "*.rpmnew"
and carefuly inspect all configs against their .rpmnew
/ .rpmsave
versions (if they are around) to make sure that settings are correct. 并仔细检查所有配置的
.rpmnew
/ .rpmsave
版本(如果它们在附近)以确保设置正确。 You can use diff -u
to see text diffs or meld
for graphical diff/merge. 您可以使用
diff -u
查看文本差异或meld
图形差异/合并。
@mvp has provided a good way to determine changed config files - provided they are marked as such. @mvp提供了一种确定更改的配置文件的好方法 - 只要它们被标记为这样。
If they aren't, you can/should verify the installed package with rpm -V packagename
in order to display any changed files. 如果不是,您可以/应该使用
rpm -V packagename
验证已安装的软件包,以便显示任何已更改的文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.