5

Step 1) Checked the version of Ubuntu with lsb_release -a. My server has 16.04.3 LTS.

Step 2) Installed Apache with apt-get install apache2.

Step 3) Checked the version of Apache with apache2 -v. I have 2.4.18.

However according to the Apache website the latest version is 2.4.29.

Is it common practice or generally safe to upgrade to the latest version of Apache or other packages? If so how would I do that? Is there an obvious reason why I shouldn't update to the latest?

DR01D
  • 185

2 Answers2

12

You can use the ppa https://launchpad.net/~ondrej/+archive/ubuntu/apache2 to get the latest version.

There's always some risk involved in using a ppa but this one is popular; I myself have used it for a long time without issue.

Since you already have Apache installed, you can get the update by

sudo add-apt-repository ppa:ondrej/apache2
sudo apt update
sudo apt upgrade
Organic Marble
  • 23,641
  • 15
  • 70
  • 122
  • Thanks so much! I'll use the ondrej ppa. One question, how often does Ubuntu update it's repository? By that I mean if I use the PPA am I typically weeks, months or years ahead of when Ubuntu updates a package? – DR01D Nov 29 '17 at 18:32
  • I couldn't answer that without some research; when I first set up my website, I looked for the newest version as you are doing, found this ppa, and I've never paid any attention to what's in the official repos since then. – Organic Marble Nov 29 '17 at 18:51
  • I've already done that, but it still won't go higher than 2.4.18. At the time of writing my server is Ubuntu 16.04.7. I've even tried the command sudo apt-get dist-upgrade – ckhatton May 12 '22 at 09:54
1

I found that for some reason my newly installed PPA that Organic Marble posted did not work immediately not because it wasn't right it was my machine not upgrading correctly, with a little research I found that upgrading the distribution worked for me

sudo add-apt-repository ppa:ondrej/apache2
sudo apt update
sudo apt upgrade
sudo apt-get dist-upgrade

this together with Organic Marble answer did the trick for me

Reference: "The following packages have been kept back:" Why and how do I solve it?