In Linux, .rpmnew
and .rpmsave
files are created by the RPM Package Manager during the installation or upgrade of software packages. These files are part of RPM’s mechanism to handle changes to configuration files, ensuring that user modifications are not accidentally lost or overwritten. Here’s what they mean:
1. .rpmnew
Files
- What it is:
- A
.rpmnew
file contains a new version of a configuration file that comes with a software package update.
- A
- When it’s created:
- It’s created when the current configuration file has been modified by the user or administrator and the package update includes a new version of the file.
- The existing file remains unchanged, and the new version is saved as
.rpmnew
for review.
- Purpose:
- Allows the administrator to review and merge changes from the new configuration file, ensuring that new settings or features are not missed.
- Example:
- Original file:
/etc/app.conf
(modified by the user) - New version provided by the package:
/etc/app.conf.rpmnew
- Original file:
2. .rpmsave
Files
- What it is:
- A
.rpmsave
file contains a backup of an existing configuration file that has been replaced by a new version from a package update.
- A
- When it’s created:
- It’s created when a package update or reinstallation overwrites a modified configuration file.
- The user’s modified file is saved as
.rpmsave
before being replaced with the new version.
- Purpose:
- Ensures that any custom configurations are preserved and can be restored or reviewed later.
- Example:
- Original file:
/etc/app.conf
(modified by the user) - Replaced by the new version from the package:
/etc/app.conf
- User’s modified file saved as:
/etc/app.conf.rpmsave
- Original file:
Why Are These Files Important?
- They help manage configuration changes during software updates, ensuring user modifications are not lost.
- Administrators can compare the original, new, and saved files to decide how to update or preserve settings.
How to Handle .rpmnew
and .rpmsave
Files?
- Identify the files:
- Look for
.rpmnew
and.rpmsave
files in directories like/etc
. - Example:
find /etc -name "*.rpmnew" -o -name "*.rpmsave"
- Look for
- Compare the files:
- Use tools like
diff
orvimdiff
to compare the active file with the.rpmnew
or.rpmsave
versions. - Example:
diff /etc/app.conf /etc/app.conf.rpmnew
- Use tools like
- Merge or replace:
- Merge changes from
.rpmnew
into the active configuration file if needed. - Restore settings from
.rpmsave
if they are still relevant.
- Merge changes from
- Clean up:
- Once reviewed and merged, delete unnecessary
.rpmnew
and.rpmsave
files to avoid confusion.
- Once reviewed and merged, delete unnecessary
Summary of Differences
Aspect | .rpmnew | .rpmsave |
---|---|---|
Created When | User-modified file exists, and the package installs a new version | Modified file is replaced by the package update |
Purpose | Save the new version for review | Backup the old modified file for safekeeping |
Action Needed | Review and merge changes | Restore or review if necessary |
These files are an essential part of system configuration management in RPM-based distributions.