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 RPMs. 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 RPM Targets 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.versions
file. - 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 an RPM target to the /var/cpanel/rpm.versions.d/local.versions file. |
--add target_settings.target state |
--edit |
Use this option to edit an RPM target in the /var/cpanel/rpm.versions.d/local.versions file. |
--edit target_settings.target state |
--del |
Use this option to remove an RPM target in the /var/cpanel/rpm.versions.d/local.versions file. |
--del target_settings.target |
Override management of an RPM target
To use the /usr/local/cpanel/scripts/update_local_rpm_versions
script to override the rpm.versions system’s management of an RPM target, perform the following steps:
-
Run the following command, where
target
represents the name of the RPM target andstate
representsinstalled
,uninstalled
, orunmanaged
:/usr/local/cpanel/scripts/update_local_rpm_versions --edit target_settings.target state
/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.versions
1 2 3 4 5 6 7 8 9 10 11 12 13 14
file_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_rpms --fix
Important: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
RPM targets.
Return an RPM target to the cPanel-provided behavior
To return an RPM target to the default behavior in the /usr/local/cpanel/etc/rpm.versions
file, perform the following steps:
- Run the following command, where
target
represents the name of the RPM target:/usr/local/cpanel/scripts/update_local_rpm_versions --del target_settings.target
For example, to return the
pure-ftpd
target to the cPanel-provided settings, run the following command:/usr/local/cpanel/scripts/update_local_rpm_versions --del target_settings.pure-ftpd
Note:When you use this command, you return that RPM target to its default value in the
/usr/local/cpanel/etc/rpm.versions
file (eitherinstalled
oruninstalled
). -
To confirm that the settings in the
/var/cpanel/rpm.versions.d/local.versions
file no longer override the cPanel-provided defaults for the RPM target, run the following command:cat /var/cpanel/rpm.versions.d/local.versions
-
Run the following command to apply your changes to the rpm.versions system:
/usr/local/cpanel/scripts/check_cpanel_rpms --fix
Important: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.