(dv):Upgrade software with YUM

  • This page was last modified on February 1, 2012, at 08:47.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki

Contents

Many customers have noticed that our (dv) Dedicated-Virtual Servers have outdated software installed and have wanted to know how to go about upgrading to a newer version of PHP or MySQL. This article will discuss how to go about upgrading the software on your (dv) Dedicated-Virtual Server to the very latest available for CentOS.

Results

Your server will now have updated versions of all the software installed.

Please note that this article goes over making significant changes to your server, so we recommend making backups before upgrading. Before completing the following, understand that there may be the risk of serious damage occurring to your server along with data loss or downtime. Also note that this is outside of (mt) Media Temple's Scope of Support http://mediatemple.net/support/statement.php#dv.

Requirements

This article has the following dependencies:

root access enabled: Enable Root Access
Developer Tools installed: Install Developer Tools
YUM installed with the Atomic Rocket Turtle repository added: Install YUM (dv) 3.5 (If you're using a (dv) 4.0, you already have YUM installed and can simply just add the ART repo)

Instructions

1. Connect to your server via SSH as root.

2. Once logged in, use the following command:

yum upgrade

3. This will pool the currently enabled repositories for newer software, display the software in need of an upgrade and ask you if you'd like to upgrade.

4. Once you press yes, YUM will now download and install the new applications on your server.

5. Once completed, you may notice that MySQL refuses to start. The reason is because MySQL 5.1 no longer uses the Berkley DB that 5.0 uses. To fix this, you'll need to edit the /etc/my.cnf file and comment out the following lines:

skip-bdb

Save this file and type the following command:

service mysqld start

You will also need to run this command to upgrade the tables for MySQL:

mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`

Once complete, you should be good to go for MySQL. *Note* If you upgrade to major versions of MySQL, you'll need to run this command every time. e.g. Upgrading from 5.0.x to 5.1.x or 5.1.x to .5.5.x (like on the (dv) 4.0).

6. If you are returned all OK, MySQL has successfully started, along with the other software on your server. To view the updated software versions, you can easily type in:

php -v

You will see that PHP is now at version 5.3.9 (or later). You can also substitute php for httpd, or even simply typing my to find out your MySQL version.

If you would like to continue with installing updates beyond what CentOS offers, please read the following.

7. To update the software versions beyond what is available via CentOS repositories (or ART repositories), you can add the following repo to your list:

vi /etc/yum.repos.d/newrepo.repo

Add the following text to this new file:

[rusia-repo]
name=CentOS-$releasever – rusia packages for $basearch
#baseurl=file:///raid/RH/CentOS/$releasever/local/$basearch
baseurl=http://centos.alt.ru/pub/repository/centos/5/i386/
enabled=1
gpgcheck=0
protect=1

8. Save this file and do another 'yum upgrade' and complete the steps. This is cautionary as the software it installs, might not work with Plesk, so please make sure you have backups of all your data, and even do a snapshot backup if available.

Please note that if you're using a (dv) 4.0, you will want to change the baseurl to http://centos.alt.ru/pub/repository/centos/5/x86_64/ instead.

Please do not use the "Remi" repository at all if you are using the Atomic Rocket Turtle repository. This repository has conflicting packages that can (and will) damage your (dv) Dedicated-Virtual Server.

Contributions

Thanks to Atomic Rocket Turtle for providing their amazing repository.