{"id":269,"date":"2021-07-23T12:26:55","date_gmt":"2021-07-23T12:26:55","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/the-update_local_rpm_versions-script\/"},"modified":"2021-07-23T12:26:55","modified_gmt":"2021-07-23T12:26:55","slug":"the-update_local_rpm_versions-script","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/the-update_local_rpm_versions-script\/","title":{"rendered":"The update_local_rpm_versions Script"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>Use the <code>\/usr\/local\/cpanel\/scripts\/update_local_rpm_versions<\/code> script to update the  <code>\/var\/cpanel\/rpm.versions.d\/local.versions<\/code> file. These updates override the  <code>\/usr\/local\/cpanel\/etc\/rpm.versions<\/code> file and change how the rpm.versions system manages RPMs. You must run this script as the  <code>root<\/code> user.<\/p>\n<p>For more information about how files in the  <code>\/var\/cpanel\/rpm.versions.d\/<\/code> directory override the  <code>\/usr\/local\/cpanel\/etc\/rpm.versions<\/code> file, read our RPM Targets documentation.<\/p>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li>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  <code>\/var\/cpanel\/rpm.versions.d\/local.versions<\/code> file.<\/li>\n<li>Do <strong>not<\/strong> use this script to change your server\u2019s MySQL\u00ae version.<\/li>\n<\/ul><\/div>\n<\/div>\n<h2 id=\"run-the-script\">Run the script<\/h2>\n<p>To run this script on the command line, use the following format:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">\/usr\/local\/cpanel\/scripts\/update_local_rpm_versions <span style=\"color:#f92672\">[<\/span>options<span style=\"color:#f92672\">]<\/span><\/code><\/pre>\n<\/div>\n<h3 id=\"options\">Options<\/h3>\n<p>Use the following options with this script:<\/p>\n<table>\n<thead>\n<tr>\n<th>Options<\/th>\n<th>Description<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>--add<\/code><\/td>\n<td>Use this option to add an RPM target to the  <code>\/var\/cpanel\/rpm.versions.d\/local.versions<\/code> file.<\/td>\n<td><code>--add target_settings.target state<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>--edit<\/code><\/td>\n<td>Use this option to edit an RPM target in the  <code>\/var\/cpanel\/rpm.versions.d\/local.versions<\/code> file.<\/td>\n<td><code>--edit target_settings.target state<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>--del<\/code><\/td>\n<td>Use this option to remove an RPM target in the  <code>\/var\/cpanel\/rpm.versions.d\/local.versions<\/code> file.<\/td>\n<td><code>--del target_settings.target<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 id=\"override-management-of-an-rpm-target\">Override management of an RPM target<\/h4>\n<p>To use the  <code>\/usr\/local\/cpanel\/scripts\/update_local_rpm_versions<\/code> script to override the rpm.versions system\u2019s management of an RPM target, perform the following steps:<\/p>\n<ol>\n<li>\n<p>Run the following command, where  <code>target<\/code> represents the name of the RPM target and  <code>state<\/code> represents  <code>installed<\/code>,  <code>uninstalled<\/code>, or  <code>unmanaged<\/code>:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">\/usr\/local\/cpanel\/scripts\/update_local_rpm_versions --edit target_settings.target state<\/code><\/pre>\n<\/div>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">\/usr\/local\/cpanel\/scripts\/update_local_rpm_versions --edit target_settings.pure-ftpd unmanaged<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\n<p>To confirm that the target now uses the desired state, run the following command:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">cat \/var\/cpanel\/rpm.versions.d\/local.versions<\/code><\/pre>\n<\/div>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 4\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 5\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 6\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 7\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 8\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\"> 9\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">10\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">11\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">12\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">13\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">14\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">file_format:\n  version: <span style=\"color:#ae81ff\">2<\/span>\ninstall_targets: <span style=\"color:#f92672\">{}<\/span>\n\nrpm_groups: <span style=\"color:#f92672\">{}<\/span>\n\nrpm_locations: <span style=\"color:#f92672\">{}<\/span>\n\nsrpm_sub_packages: <span style=\"color:#f92672\">{}<\/span>\n\nsrpm_versions: <span style=\"color:#f92672\">{}<\/span>\ntarget_settings:\n  pure-ftpd: unmanaged\nurl_templates: <span style=\"color:#f92672\">{}<\/span> <\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>\n<p>Run the following command to apply your changes to the rpm.versions system:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">\/usr\/local\/cpanel\/scripts\/check_cpanel_rpms --fix<\/code><\/pre>\n<\/div>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>You <strong>must<\/strong> run this command to apply the changes to the rpm.versions system.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<\/ol>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<p>To set FTP services to  <code>unmanaged<\/code>, run these commands for both the  <code>pure-ftpd<\/code> and  <code>proftpd<\/code> RPM targets.<\/p>\n<\/p><\/div>\n<\/div>\n<h4 id=\"return-an-rpm-target-to-the-cpanel-provided-behavior\">Return an RPM target to the cPanel-provided behavior<\/h4>\n<p>To return an RPM target to the default behavior in the  <code>\/usr\/local\/cpanel\/etc\/rpm.versions<\/code> file, perform the following steps:<\/p>\n<ol>\n<li>Run the following command, where  <code>target<\/code> represents the name of the RPM target:\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">\/usr\/local\/cpanel\/scripts\/update_local_rpm_versions --del target_settings.target<\/code><\/pre>\n<\/div>\n<p>For example, to return the  <code>pure-ftpd<\/code> target to the cPanel-provided settings, run the following command:<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">\/usr\/local\/cpanel\/scripts\/update_local_rpm_versions --del target_settings.pure-ftpd<\/code><\/pre>\n<\/div>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<p>When you use this command, you return that RPM target to its default value in the  <code>\/usr\/local\/cpanel\/etc\/rpm.versions<\/code> file (either  <code>installed<\/code> or  <code>uninstalled<\/code>).<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<li>\n<p>To confirm that the settings in the  <code>\/var\/cpanel\/rpm.versions.d\/local.versions<\/code> file no longer override the cPanel-provided defaults for the RPM target, run the following command:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">cat \/var\/cpanel\/rpm.versions.d\/local.versions<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\n<p>Run the following command to apply your changes to the rpm.versions system:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">\/usr\/local\/cpanel\/scripts\/check_cpanel_rpms --fix<\/code><\/pre>\n<\/div>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>You must run this command to apply the changes to the rpm.versions system.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<\/ol>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<p>To return FTP services to the <code>managed<\/code> state, run these commands for both the <code>pure-ftpd<\/code> and <code>proftpd<\/code> targets.<\/p>\n<\/p><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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. Note: Because YAML &hellip;<\/p>\n","protected":false},"author":1,"featured_media":270,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/269"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=269"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/269\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/270"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}