≡ Menu

How To Upgrade CentOS Linux To Version 5.2

CentOS Linux 5.2 has been released and available for immediate update via yum command or
the i386 and x86_64 Architectures. From the announcement page:

CentOS-5.2 is based on the upstream release EL 5.2.0, and includes packages from all variants including Server and Client. All upstream repositories have been combined into one, to make it easier for end users to work with. And the option to further enable external repositories at install time is now available in the installer.

How do I update from CentOS-5.0 and 5.1 to 5.2?

Simply type the following command as root user:
# yum update
OR
# yum upgrade
Sample output:

......
....
shadow-utils-4.0.17-13.el 100% |=========================|  50 kB    00:00
---> Package shadow-utils.i386 2:4.0.17-13.el5 set to be updated
---> Downloading header for cups to pack into transaction set.
cups-1.2.4-11.18.el5_2.1. 100% |=========================| 165 kB    00:00
Transaction Summary
=============================================================================
Install      8 Package(s)
Update     191 Package(s)
Remove       2 Package(s)
Total download size: 298 M
Is this ok [y/N]: y

Finally, reboot your computer, enter:
# reboot

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 17 comments… add one }

  • Robert de Bock June 25, 2008, 12:32 pm

    Wow, that is not very difficult… Would there be an upgrade path for CentOS 4.6 to 5.2?

    Regards,

    Robert.

  • yoander June 25, 2008, 1:48 pm

    if your CentOS version is < 5.0 the you must upgrade through out a fresh install

  • Mathieu June 25, 2008, 4:24 pm

    I can read “yum upgrade” in the announcement, not “yum update”.

  • nixCraft June 25, 2008, 5:02 pm

    Mathieu,

    upgrade option is the same as the update command with the –obsoletes flag set. There is little history behind upgrade. It was suppose to upgrade from CentOS 3 to 5.2. But it is not possible. Bottom line you can use yum upgrade or yum update to upgrade to 5.2 from 5.x only.

    HTH

  • Mick Russom July 2, 2008, 10:47 am

    I just upgraded from Centos 3.9 to 4.6

    I will be trying to upgrade from 4.6 to 5.2 for the heck of it. You could manually install the following rpms (worked from 3 to 4):

    All compat*rpm from CentOS 5.2, plus

    centos-release
    centos-yumconf
    compat-gcc
    compat-gcc
    compat-glibc
    compat-glibc-headers
    compat-libgcc
    compat-libstdc++
    compat-libstdc++
    compat-openldap
    comps
    comps-extras
    gcc
    gcc-c++
    gcc-g77
    gcc-gnat
    glibc
    glibc
    glibc-common
    glibc-devel
    glibc-headers
    glibc-kernheaders
    glibc-profile
    glibc-utils
    libgcc
    libselinux
    libxml2
    libxml2-devel
    libxml2-python
    more6
    python
    python-devel
    python-elementtree
    python-lxml
    python-tools
    python-urlgrabber
    rpm
    rpm-build
    rpmdb-CentOS
    rpm-devel
    rpm-libs
    rpm-python
    yum
    yum-metadata-parse

    rpm -Uvh –nodeps –replacepkgs –force all of these at once. The compat* libs protect your old userland from failing until the new one comes up.

    Then do yum upgrade.

    Worked from 3.9 to 4.6.

    Nothing is impossible if you put your mind to it. Ill try and document 4.6 to 5.2 if i get it to work.

    • John Roberson March 9, 2011, 9:17 pm

      Also trying to upgrade from 3.9 to at least 4 x
      And I’m remote

      So you downloaded the above RPM’s forced the install
      then yum upgraded and it worked? No errors on the reboot?

      Thanks

  • nixCraft July 2, 2008, 10:58 am

    Mick,

    Let us update all if you got it working.

    TIA

  • Diamonds October 7, 2008, 11:35 pm

    wow, easy

  • Ayman October 24, 2008, 11:22 am

    I’m now still trying to update from centOS 5.1 to centOS 5.2 but when i type the commannd

    # yum upgrade
    or
    # yum update

    I get this in the end

    Error: Cannot find a valid baseurl for repo: extras

    tact.php”>Contact Us
    not using ftp, http[s], or file for repos, skipping –
    not using ftp, http[s], or file for repos, skipping –
    not using ftp, http[s], or file for repos, skipping –
    not using ftp, http[s], or file for repos, skipping –
    not using ftp, http[s], or file for repos, skipping –
    not using ftp, http[s], or file for repos, skipping –
    not using ftp, http[s], or file for repos, skipping –
    not using ftp, http[s], or file for repos, skipping –
    Error: Cannot find a valid baseurl for repo: extras

  • yoander October 24, 2008, 1:49 pm

    Maybe you must enable the mirrorlist and disable baseurl for extras repo

  • Michael N December 11, 2008, 3:27 pm

    Mick Russom,
    did you succeed to upgrade 4.6/4.7 to 5.2 using yum?
    I am interested in how did you do that. spent a lot of days trying but without success.

  • Raphael April 15, 2009, 9:01 pm

    I think the procedure you were all looking for, to migrate from version 4 to version 5, is available here :
    http://wiki.centos.org/HowTos/MigrationGuide/ServerCD_4.4_to_5

  • Raphael April 16, 2009, 3:38 pm

    Hello,

    This comment to add what gave me some difficulties – following the procedure given on wiki.centos.org – during my tries with a VMware VM CentOS 4.7 upgrading to CentOS 5.3 (thank to the snapshot function !), before doing it on our productions servers…

    I required several tries because of rpm dependencies’ hell…

    I had to force rpm upgrade/replace of packages (because of python-elementtree and python-sqlite which have same version level in CentOS 5 as in CentOS 4 without being the same packages !) with :

    rpm -Uvh –nodeps –replacepkgs –oldpackage *.rpm

    on the /tmp/upgrade directory containing :

    beecrypt-4.1.2-10.1.1.i386.rpm
    beecrypt-python-4.1.2-10.1.1.i386.rpm
    binutils-2.17.50.0.6-9.el5.i386.rpm
    centos-release-5-3.el5.centos.1.i386.rpm
    centos-release-notes-5.3-3.i386.rpm
    db4-4.3.29-9.fc6.i386.rpm
    elfutils-0.137-3.el5.i386.rpm
    elfutils-libelf-0.137-3.el5.i386.rpm
    elfutils-libs-0.137-3.el5.i386.rpm
    glib2-2.12.3-2.fc6.i386.rpm
    glibc-2.5-34.i386.rpm
    glibc-common-2.5-34.i386.rpm
    glibc-devel-2.5-34.i386.rpm
    glibc-headers-2.5-34.i386.rpm
    libselinux-1.33.4-5.1.el5.i386.rpm
    libsepol-1.15.2-1.el5.i386.rpm
    libxml2-2.6.26-2.1.2.7.i386.rpm
    libxml2-python-2.6.26-2.1.2.7.i386.rpm
    m2crypto-0.16-6.el5.3.i386.rpm
    mcstrans-0.2.11-3.el5.i386.rpm
    neon-0.25.5-10.el5.i386.rpm
    openssl-0.9.8e-7.el5.i386.rpm
    popt-1.10.2.3-9.el5.i386.rpm
    python-2.4.3-24.el5.i386.rpm
    python-devel-2.4.3-24.el5.i386.rpm
    python-elementtree-1.2.6-5.i386.rpm
    python-iniparse-0.2.3-4.el5.noarch.rpm
    python-sqlite-1.1.7-1.2.1.i386.rpm
    python-urlgrabber-3.1.0-5.el5.noarch.rpm
    readline-5.1-1.1.i386.rpm
    rpm-4.4.2.3-9.el5.i386.rpm
    rpm-libs-4.4.2.3-9.el5.i386.rpm
    rpm-python-4.4.2.3-9.el5.i386.rpm
    yum-3.2.19-18.el5.centos.noarch.rpm
    yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm
    yum-metadata-parser-1.1.2-2.el5.i386.rpm

    A warning note about SELinux which – if enabled – broke the “yum upgrade” at the selinux upgrade stage, killing the OS (!).
    I had to modify /etc/selinux/config with
    SELINUX=disabled before running :
    yum upgrade

    Except those little problem, the procedure is fine to go from CentOS 4.7 to 5.3

  • M.S. Babaei May 26, 2009, 1:47 am

    I have CentOS 5.2. When I run yum update ro yum upgrade, I faced with the following error:

    Error: Missing Dependency: perl(Convert::ASN1) is needed by package samba

    I tried this guide (http://www.cyberciti.biz/faq/how-do-i-install-a-perl-module/). and it runs well:

    Convert::ASN1 is up to date (0.22).

    But still I get this error:

    Error: Missing Dependency: perl(Convert::ASN1) is needed by package samba

    any suggestions?

  • Chris June 29, 2009, 1:25 pm

    Tried to update my CentOS using the yum upgrade command, get a whole page of details but then terminates with
    —> Package httpd.x86_64 0:2.2.3-22.el5.centos.1 set to be updated
    filelists.xml.gz | 3.4 MB 00:01
    Traceback (most recent call last):
    File “/usr/bin/yum”, line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
    File “/usr/share/yum-cli/yummain.py”, line 229, in user_main
    errcode = main(args)
    File “/usr/share/yum-cli/yummain.py”, line 145, in main
    (result, resultmsgs) = base.buildTransaction()
    File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 647, in buildTra
    nsaction
    (rescode, restring) = self.resolveDeps()
    File “/usr/lib/python2.4/site-packages/yum/depsolve.py”, line 704, in resolveD
    eps
    for po, dep in self._checkFileRequires():
    File “/usr/lib/python2.4/site-packages/yum/depsolve.py”, line 939, in _checkFi
    leRequires
    if not self.tsInfo.getOldProvides(filename) and not self.tsInfo.getNewProvid
    es(filename):
    File “/usr/lib/python2.4/site-packages/yum/transactioninfo.py”, line 414, in g
    etNewProvides
    for pkg, hits in self.pkgSack.getProvides(name, flag, version).iteritems():
    File “/usr/lib/python2.4/site-packages/yum/packageSack.py”, line 300, in getPr
    ovides
    return self._computeAggregateDictResult(“getProvides”, name, flags, version)
    File “/usr/lib/python2.4/site-packages/yum/packageSack.py”, line 470, in _comp
    uteAggregateDictResult
    sackResult = apply(method, args)
    File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 861, in getPro
    vides
    return self._search(“provides”, name, flags, version)
    File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 43, in newFunc
    return func(*args, **kwargs)
    File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 837, in _searc
    h
    for pkg in self.searchFiles(name, strict=True):
    File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 43, in newFunc
    return func(*args, **kwargs)
    File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 586, in search
    Files
    self._sql_pkgKey2po(rep, cur, pkgs)
    File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 470, in _sql_p
    kgKey2po
    pkg = self._packageByKey(repo, ob[‘pkgKey’])
    File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 413, in _packa
    geByKey
    po = self.pc(repo, cur.fetchone())
    File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 68, in __init_
    _
    self._read_db_obj(db_obj)
    File “/usr/lib/python2.4/site-packages/yum/sqlitesack.py”, line 94, in _read_d
    b_obj
    setattr(self, item, _share_data(db_obj[item]))
    TypeError: unsubscriptable object

    I have no idea what it means!

  • Chris June 29, 2009, 7:20 pm

    It’s OK, found the problem.
    Have to run the following command first: yum clean metadata
    All upgraded fine after that.
    Chris

  • David August 11, 2009, 9:40 pm

    Chris,

    About that Python traceback…

    # cd /var/lib/rpm
    # \rm __db*

    The “temporary” database files may be safely removed… a requirement if having followed Raphael’s guidance listed above.

    hth,
    david

Leave a Comment