So here’s how you do it. Please remember, this is code I use on Ubuntu. If that is not your server, you are better off following the Varnish Cache website.
Begin with getting the key.
curl http://repo.varnish-cache.org/debian/GPG-key.txt | apt-key add -
If you have been following the Server from the beginning, you don’t have curl installed. So you install it and run the command again.
apt-get install curl
If this fails with a missing package, update
and then install curl, and then import key.
Add varnish to your sources.list.
echo "deb http://repo.varnish-cache.org/ubuntu/ lucid varnish-3.0" >> /etc/apt/sources.list
Or, if you have been installing other stuff too, and would like to add them all at once, simply edit the sources.list file and add the repository in.
Update and install varnish.
apt-get install varnish
Done. But follow on to configuring. Configuring Varnish for WordPress is another animal altogether.