sudo apt-get install memcached#To restart memcahce
/etc/init.d/memcached restart#To install ruby binding gem to memecache
sudo gem install memcached
and to start memcache automatically on system startup
sudo gedit /etc/default/memcached# Set this to yes to enable memcached.
ENABLE_MEMCACHED=yes