Ubuntu – How to install Apache with a specific version

apache-2.2apache-2.4Ubuntu

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?

Best Answer

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>

Example:

apt-cache showpkg apache2
apt-get install apache2=2.2.14-5ubuntu8.7