I am attempting to install Apache2 version 2.2 on a computer I just upgraded from Ubuntu 12.04 LTS to 14.04 LTS because a critical software package that runs perfectly on the version of Apache in 12.04 does not work on version 14.04.

From other questions in this forum, I see there is a way to specify a version number while using apt-get, but this isn't working. Here's what I get:

christopher@TRICIA:~$ sudo apt-get install apache2=2.2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '2.2' for 'apache2' was not found

Does anyone know the correct syntax to do this?

  • Version 2.2 is simply not available in the official repositories for Ubuntu 14.04. As far as I can tell, there are no PPAs either. There was a question asking the same thing a couple of days ago. If you really want 2.2, you'll have to use 12.04 or compile from source. – muru Jun 17 '14 at 8:01
  • Personally, I prefer using the latest software which is, in general, less buggy and more secure. That aside, check out this answer askubuntu.com/questions/362682/… to fix most of the problems which might arise after upgrading to apache2.4 and this question might be helpful as well askubuntu.com/questions/448944/… – Dan Jun 17 '14 at 8:02
  • Here's the other one, in case that one ever gets an answer: askubuntu.com/questions/483844/… – muru Jun 17 '14 at 8:08
  • Thanks, all. I would definitely prefer to use the latest version of Apache, but the package specifically references the Apache configuration file that was re-named in the current version. I will try compiling from source. Much appreciated! – user235128 Jun 17 '14 at 16:40
  • I met same problem while moving website to another server – ruX Jul 12 '14 at 10:31

you are getting this error because this version is not available on repository which you are using.

you can check which versions are available in repository
apt-cache showpkg <pachagename>
e.g. apt-cache showpkg apache2

then you can install that version using command
apt-get install <packagename>=<complete version name>
e.g. apt-get install apache2=2.2.14-5ubuntu8.7


To install apache2.2 use the following process:

On a later distro (e.g. 16.04), I downloaded the 2.2.31 from the Apache site.

I built it using the following configuration:

./configure --enable-so --enable-ssl --with-included-apr --enable-mods-shared=all --enable-load-all-modules --enable-rewrite --enable-proxy --enable-proxy_connect --enable-proxy_http --enable-proxy_ajp --enable-authn_alias --with-npm=prefork --enable-proxy_balancer --enable-proxy_ftp --enable-cache --enable-suexec --enable-disk_cache  > conf.txt

Then of course tweaking the httpd.conf and ssl.conf files.

After that I just run the ./httpd -k start

And it works !

note that I added the apache2.4 via apt-get but never removed it. This means that after system start, I need to kill the apache2 process. And then I am able to start apache2.2. I had to install apache2.4 to use apachectl but later disbanded that because I use ./httpd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.