The update_local_rpm_versions Script
Last modified: 2022 July 13
Overview
Use the /usr/local/cpanel/scripts/update_local_rpm_versions script to update the /var/cpanel/rpm.versions.d/local.versions file. These updates override the /usr/local/cpanel/etc/rpm.versions file and change how the rpm.versions system manages packages. You must run this script as the root user.
For more information about how files in the /var/cpanel/rpm.versions.d/ directory override the /usr/local/cpanel/etc/rpm.versions file, read our Target Settings documentation.
- Because YAML is space-sensitive, misspelled words are common when system administrators edit a file manually. For this reason, we encourage system administrators to use this script to edit the
/var/cpanel/rpm.versions.d/local.versionsfile. - Do not use this script to change your server’s MySQL® version.
Run the script
To run this script on the command line, use the following format:
/usr/local/cpanel/scripts/update_local_rpm_versions [options]Options
Use the following options with this script:
| Options | Description | Example |
|---|---|---|
--add |
Use this option to add a package target to the /var/cpanel/rpm.versions.d/local.versions file. |
--add target_settings.target state |
--edit |
Use this option to edit a package target in the /var/cpanel/rpm.versions.d/local.versions file. |
--edit target_settings.target state |
--del |
Use this option to remove a package target in the /var/cpanel/rpm.versions.d/local.versions file. |
--del target_settings.target |
Override management of a target
To use the /usr/local/cpanel/scripts/update_local_rpm_versions script to override the rpm.versions system’s management of a package target, perform the following steps:
-
Run the following command, where
targetrepresents the name of the target andstaterepresentsinstalled,uninstalled, orunmanaged:/usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.target stateFor example, to set the
pure-ftpdtarget to theunmanagedstate, run the following command:/usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.pure-ftpd unmanaged -
To confirm that the target now uses the desired state, run the following command:
cat /var/cpanel/rpm.versions.d/local.versionsThe system displays the current state next to the target name. If, for example, you set the
pure-ftpdtarget tounmanaged, the/var/cpanel/rpm.versions.d/local.versionsfile will resemble the following example:1 2 3 4 5 6 7 8 9 10 11 12 13 14file_format: version: 2 install_targets: {} rpm_groups: {} rpm_locations: {} srpm_sub_packages: {} srpm_versions: {} target_settings: pure-ftpd: unmanaged url_templates: {} -
Run the following command to apply your changes to the rpm.versions system:
/usr/local/cpanel/scripts/check_cpanel_pkgs --fixImportant:You must run this command to apply the changes to the rpm.versions system.
To set FTP services to unmanaged, run these commands for both the pure-ftpd and proftpd targets.
Return a target to the cPanel-provided behavior
To return a package target to the default behavior in the /usr/local/cpanel/etc/rpm.versions file, perform the following steps:
-
Run the following command, where
targetrepresents the name of the target:For example, to return the/usr/local/cpanel/scripts/update_local_rpm_versions --del target_settings.targetpure-ftpdtarget to the cPanel-provided settings, run the following command:/usr/local/cpanel/scripts/update_local_rpm_versions --del target_settings.pure-ftpdNote:When you use this command, you return that target to its default value in the
/usr/local/cpanel/etc/rpm.versionsfile (eitherinstalledoruninstalled). -
To confirm that the settings in the
/var/cpanel/rpm.versions.d/local.versionsfile no longer override the cPanel-provided defaults for the target, run the following command:cat /var/cpanel/rpm.versions.d/local.versionsThe
/var/cpanel/rpm.versions.d/local.versionsfile will no longer list that target. -
Run the following command to apply your changes to the rpm.versions system:
/usr/local/cpanel/scripts/check_cpanel_pkgs --fixImportant:You must run this command to apply the changes to the rpm.versions system.
To return FTP services to the managed state, run these commands for both the pure-ftpd and proftpd targets.