Memcached 1.2.2 on Debian Etch
This article will show how we can install updated versions for memcached (and libevent) for Debian Etch, by backporting the packages from debian testing. Why would we want to do this? Because the versions shipped with Etch are old, and accordingly to the software creators should not be used as the new versions provide much better performance and reliability:
- libevent: version in etch: 1.1a (released on 2005-06-12).
- memcached: version in etch: 1.1.12 (released on 2005-04-04)
Newer versions like libevent-1.3b and memcached-1.2.2 can be found in debian testing (lenny) and this article will show how we can backport them and create our own debian packages of these versions for etch. There is this good article showing how you can achieve the same thing but by recompiling the sources; but if we need to do the same installation on several hosts (and this is quite frequent for memcache deployments) it might be easier to just install the deb created than to compile the sources over and over ;-) )
devscripts
First let’s make sure that we have in our sources.list a line for testing for deb-src:
deb-src http://ftp.us.debian.org/debian/ testing main
once this is done just run
aptitude update
Depending on the state of your system you might need several packages in order to compile and build debian packages. This might be as simple as running:
aptitude install devscripts
(this might install also other packages like binutils cpp cpp-4.1 dpkg-dev fakeroot gcc gcc-4.1 libc6-dev libmudflap0 libmudflap0-dev libssp0 linux-kernel-headers)
libevent 1.3b
Libevent is the only major dependency needed to build memcached so we will build it first. Let’s install what other dependencies we migth need to compile it:
apt-get build-dep libevent
(this might look like: autotools-dev build-essential debhelper g++ g++-4.1 gettext html2text intltool-debian libstdc++6-4.1-dev libtool po-debconf)
The next line will download and uncompress the debian source package in the current folder, so you might want to cd in a location appropriate for this (~/work, /usr/local/src/, whatever):
apt-get source libevent
Last step is to rebuild the package on our system:
cd libevent-1.3b
debuild -us -uc
You can now install it using:
dpkg -i libevent1_1.3b-0_amd64.deb
(the system I am running this is and amd64 so this is the reason for the filename of the resulted package. If you are on i386 you will see i386 instead of amd64, etc.)
Memcached 1.2.2
Let’s continue with memcached using the same procedure. First let’s install the libevent dev package just created previously as this is the only build dependency needed (among debhelper that was already installed in step 1)
dpkg -i libevent-dev_1.3b-0_amd64.deb
You should already have all what is needed on the system now, but if you want to be sure just run:
apt-get build-dep memcached
(normally this will show nothing else is needed for the build)
Finally we rebuild the package:
apt-get source memcached
cd memcached-1.2.2
debuild -us -uc
cd ..
dpkg -i memcached_1.2.2-1_amd64.deb
That’s it. We can now use the packages (either in a local debian repository or manually copying them to all the needed systems) to update memcached to the latest version on several hosts running debian etch more easily.
ps. if you are looking how to build the php memcache module you can find more information about that on my older post…