Upgrading HAProxy On Ubuntu

Overview

Following my earlier post using Vbernat’s PPA to install the latest Haproxy on Ubuntu, there have been several minor versions since the original post. The steps below will show you how to upgrade to any version offered by Vbernat’s PPA including the latest branch, 1.8 as of the time writing.

Upgrade Steps

Check the version of Haproxy that’s currently installed as a note for step later on:
sudo haproxy -v

Go to Debian/Ubuntu HAProxy packages page and enter the relevant information. For example Ubuntu and 1.8.

This will list some command lines to run however you only need to use the information for reference although going through all the steps won’t hurt.

Add the selected PPA version. For example:
sudo add-apt-repository ppa:vbernat/haproxy-1.8
It will ask for confirmation to add this to the repository list. Press the Enter key to confirm (or Ctrl+C to cancel if you do not wish to continue).

Check for updates:
sudo apt update
At the end of this command it should automatically detect the newer version from the recently added PPA (Cool right!). Press ‘y’ and Enter to confirm the upgrade.

It may ask if you wish to overwrite the haproxy.cfg file. The changes will depend on the version you’re upgrading to. If you chose to install the maintainers version i.e the default then it will backup the current version to /etc/haproxy/haproxy.cfg.dpkg-old (recommended) and merge the differences).

Clean up and remove the old PPA. You’ll need to know what version you was running before or use the command:
apt-cache policy
and find the old entry. The example below will use 1.5 as the version to be removed:
sudo add-apt-repository --remove ppa:vbernat/haproxy-1.5

Summary

Ubuntu’s PPA system made the upgrade smoother than I first thought and love the simplicity. I hope the Snap packages are just as easy.

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in Infrastructure, Linux, Networking and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *.

All comments must go through an approval and anti-spam process before appearing on the website. Please be patience and do not re-submit your comment if it does not appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.