VPS are an incredibly cost-effective way to host sites and solutions : the one running this site happily chugs along with under 400Mb of ram. Unfortunately, jumping from shared hosting to the “you’re on your own” world of VPS can be daunting – even more so when the operating systems are diliberately stripped right back (which is no bad thing in the majority of cases). With Centos, it would be nice to have the benefits of YUM to drop new packages on (far safer than building from source), but with Virtuozzo powered VPS’s, the excellent package manager isn’t available. Here’s how to get it back, and how to upgrade PHP to the latest 5.2 branch to boot …
1. Install Yum from RPM’s
Yum is really just some clever Python scripts, so assuming you already have Python on your system (which was installed by default on my VPS via the Virtuozzo manager), theoretically you can just install the update manager from RPM’s. It does have a few dependencies – the packages I needed were:
- Yum
- python-elementtree
- python-iniparse
- python-sqlite
- python-urlgrabber
- yum-metadata-parser
- m2crypto
These can all be installed in one deft command, executed as root of course [the following is for Centos 5 on i386 - the package versioning will change with time, so this may need manual tweaking]
rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.19-18.el5.centos.noarch.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-2.el5.i386.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/m2crypto-0.16-6.el5.3.i386.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/python-urlgrabber-3.1.0-5.el5.noarch.rpm
2. Add the Atomic repository
The Atomic repository is a third-party community channel specifically aimed at VPS owners and users and covers Redhat/Fedora/Centos OSes. The channel contains far more recent versions of packages that is found on the main “official channels”. It can be installed into Yum with an easy installer:
wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
3. Update PHP
yum update php and voila



