cPanel Update Fails with Exit Code 6400

Rate this post

Since the release of cPanel 11.32, the cPanel update process has extended OS checks to ensure that you are only updating cPanel on a compatible system. Specifically, you can no longer upgrade past version 11.32 on CentOS 4, or 11.30 on Redhat 9.  Trying to do so will verbosely inform you that the upgrade is not possible.

However, if you’re running CentOS or RHEL 5 or 6 and still either see this error or a cryptic “exited with code 6400” message as shown below, it’s usually a simple fix.
Running `/usr/local/cpanel/scripts/updatenow --upcp --log=/var/cpanel/updatelogs/update.1xxxxxx.log --force` failed, exited with code 6400

Firstly, if you run the updatenow command directly, you’ll see the error in its true form:

/usr/local/cpanel/scripts/updatenow –upcp

Results in:

Only Distro versions 5 and 6 supported in this version of cPanel & WHM

But, as you’ve already established, you are running version 5 or 6, but upcp doesn’t seem to recognize that.  To fix this, simply edit /var/cpanel/sysinfo.config and change the value of rpm_dist_ver to the major OS version you are running. For example, if you run CentOS/RHEL 6, you would do:

rpm_dist_ver=6

Then attempt to run the upgrade again, and it should be fine.  As to how it got this way, well, we’re not entirely sure. From thumbing through the code of the updatenow script, it appears to be trying to use the rpm headers to capture the OS version.  If your RPM database is/was corrupted at one point, the update process may have put an ‘unknown’ in there instead:

if ( -e $sys_info_file && ( !$locked_values{'rpm_dist_ver'} && !$new_conf{'rpm_dist_ver'} or $new_conf{'rpm_dist'} eq 'unknown' ) ) {
print "ERROR: Refusing to update $sys_info_file since I cannot determine your distro's major versionn";
print "Please run: " . q{rpm -qf --queryformat '%{VERSION}n' /etc/redhat-release} . "n";
...

If your cPanel update eventually completed, you’re probably fine.  If you have RPM issues still, the quick and dirty way to fix this is as so:

rm -rf /var/lib/rpm/__db.00*
yum clean all

Note:  Don’t try to trick the system by setting rpm_dist_ver to something that you’re not running, especially if you’re trying to force cPanel to update on your CentOS 4 system.  We’ve tried it, and it doesn’t work.

Leave a Reply

Your email address will not be published. Required fields are marked *

Log in