Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Because of Ubuntu updating, I made the mistake to upgrade Apache 2.2 to 2.4—many things went wrong.

I have no idea how to specify the version after apt-get remove apache2. apt-get install apache2 always installs 2.4.

How can I do it?

share|improve this question

3 Answers 3

up vote 9 down vote accepted

You need to do the following:

apt-cache showpkg <pachagename>

The above command will display list of available versions for this package. Then select the needed version and do the following.

apt-get install <packagename>=<complete version name>


apt-cache showpkg apache2
apt-get install apache2=2.2.14-5ubuntu8.7
share|improve this answer

See the ubuntu howto on package pinning:

Edit file /etc/apt/preferences

The 'preferences' file is where the actual pinning takes place. To pin a package, set its Pin-Priority to higher number. Here's an example:

Package: apache2
Pin: release n=raring
Pin-Priority: 1000

Test before running apt-get update or apt-get install with apt-cache policy apache2

See man apt_preferences for details. I chose pinning raring's release because this way you'll still get updates on the 2.2.x branch. Don't forget that you have to make the package available to APT by adding raring's repository URLs.

share|improve this answer
Hi. This seems to be exactly what I want. Can you please also add commands for adding raring's repository URLs? I cannot seem to find the right ones. –  Ravish Bhagdev 2 days ago

You upgraded from Ubuntu 13.04 to 13.10? There is no way to get Apache 2.2 back without going outside the Ubuntu package repositories. It's better to just fix your Apache configuration so that it works with 2.4.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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