Skip to content

Click on each book below to review & buy on Amazon.

As an Amazon Associate, I earn from qualifying purchases.


CompTIA Linux+ XK0-005 - 1.7 - Updating Configuration Files: .rpmnew & .rpmsave

When updating software packages on a Linux system, sometimes the package manager encounters configuration files that have been modified by the user. To prevent overwriting these user modifications, the package manager creates backup files with the extensions .rpmnew and .rpmsave. These files allow you to review the changes and merge them with the updated configuration files manually. This guide will explain the concepts of .rpmnew and .rpmsave files and provide instructions on how to handle them effectively.

.rpmnew Files

.rpmnew files are created when the package manager encounters a configuration file that has been modified by the user and the package being updated includes a new version of the same configuration file. Instead of overwriting the user-modified file, the package manager renames the existing file with the .rpmnew extension.

Handling .rpmnew Files

To handle .rpmnew files, follow these steps:

  1. Identify .rpmnew files: After updating a package, check for .rpmnew files in the relevant configuration directories. You can use the find command to locate these files. For example:

    find /etc -name "*.rpmnew"
    

    This command searches the /etc directory for files with the .rpmnew extension.

  2. Review the changes: Once you have identified the .rpmnew files, review the changes made in the new version of the configuration file. Compare the content of the .rpmnew file with the original configuration file to understand the modifications.

  3. Merge the changes: Manually merge the changes from the .rpmnew file into the original configuration file. Use a text editor of your choice to open the original file and apply the necessary modifications. Ensure that you retain any customizations made to the original file.

  4. Remove the .rpmnew file: Once you have merged the changes into the original configuration file, you can remove the .rpmnew file if you no longer need it. It is recommended to keep a backup of the .rpmnew file until you are certain that all necessary changes have been successfully incorporated into the original file.

.rpmsave Files

.rpmsave files are created when the package manager encounters a configuration file that has been modified by the user, and the package being updated includes a new version of the same configuration file. Instead of overwriting the user-modified file, the package manager renames the existing file with the .rpmsave extension.

Handling .rpmsave Files

To handle .rpmsave files, follow these steps:

  1. Identify .rpmsave files: After updating a package, check for .rpmsave files in the relevant configuration directories. You can use the find command to locate these files. For example:

    find /etc -name "*.rpmsave"
    

    This command searches the /etc directory for files with the .rpmsave extension.

  2. Review the changes: Once you have identified the .rpmsave files, review the changes made in the new version of the configuration file. Compare the content of the .rpmsave file with the original configuration file to understand the modifications.

  3. Merge the changes: Manually merge the changes from the .rpmsave file into the original configuration file. Use a text editor of your choice to open the original file and apply the necessary modifications. Ensure that you retain any customizations made to the original file.

  4. Remove the .rpmsave file: Once you have merged the changes into the original configuration file, you can remove the .rpmsave file if you no longer need it. It is recommended to keep a backup of the .rpmsave file until you are certain that all necessary changes have been successfully incorporated into the original file.

Conclusion

When updating software packages on a Linux system, the presence of .rpmnew and .rpmsave files indicates that configuration files have been modified by the user and new versions of those files are available. In this guide, we explored how to handle .rpmnew and .rpmsave files effectively.

By following the steps outlined for handling .rpmnew and .rpmsave files, you can review the changes made in the new configuration files and merge them with your custom modifications, ensuring that your system maintains the desired configuration.

Remember to exercise caution when merging changes and make sure to retain any important customizations from the original configuration files. It is recommended to keep backups of the .rpmnew and .rpmsave files until you are confident that all necessary changes have been successfully incorporated.


Support DTV Linux

Click on each book below to review & buy on Amazon. As an Amazon Associate, I earn from qualifying purchases.

NordVPN ®: Elevate your online privacy and security. Grab our Special Offer to safeguard your data on public Wi-Fi and secure your devices. I may earn a commission on purchases made through this link.