Keep WordPress & phpMyAdmin up-to-date with a single command

Notice: see this follow-up post for better ways of keeping WordPress & phpMyAdmin up-to-date.

Keeping up-to-date with the latest versions of commonly used web software such as WordPress and phpMyAdmin can be a bit of a drag if you would have to manually download, unzip and upload new files through FTP each time a new version is released.

But keeping WordPress and phpMyAdmin up-to-date can be as simple as logging into your server with SSH and executing just a single command. The key to this is that these software are being developed using version control software like Subversion and Git. Not only developers can take advantage of this however; you as end-user can use them as well.

First you’ll need to install Subversion and/or Git of course. On Debian (and Ubuntu presumably) you can do this by simply running the following command (as root):

aptitude install subversion git-core

Once either or both have been installed, I can simply recommend the excellent Installing/Updating WordPress with Subversion article in the case of WordPress.

For phpMyAdmin you will need to following commands from the root directory where you would want to install phpMyAdmin in:

git clone https://github.com/phpmyadmin/phpmyadmin.git
cd phpmyadmin/
git branch --track STABLE origin/STABLE
git checkout STABLE
git pull

In case of a new install don’t forget to copy “config.sample.inc.php” to “config.inc.php” and editing it where applicable (see the phpMyAdmin documentation for more info). To keep it up-to-date, then simply run the following command from the “phpmyadmin” folder  whenever a new version is released:

git pull

This command should not overwrite custom files like the configuration file.

Update April 2012: it would appear phpMyAdmin has moved to GitHub, so the URL above has been updated.