0

I have a VPS running Ubuntu 12.04.5, lsb_release -a output:

No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.5 LTS Release: 12.04 Codename: precise 

However, running

sudo apt-get install apache2 

Installs apache 2.4, not apache 2.2 as I expected. The output of "apache2 -v" is:

Server version: Apache/2.4.12 (Ubuntu) Server built: Feb 4 2015 14:21:10 

The contents of my /etc/apt/sources.list is:

deb http://archive.ubuntu.com/ubuntu precise main restricted universe deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse deb http://archive.canonical.com/ubuntu precise partner 

As I understand, isn't Ubuntu 12.04 meant to use Apache 2.2? How can I get the server to install the correct version of Apache?

I had to remove http:// from the sources.list quote as I don't have enough reputation to post the links, but the http is there in the actual file.

2
  • For future reference: by formatting sections of configurations files as code rather than blockquote you won't run into the problem of them being considered URL's Commented Mar 23, 2015 at 20:45
  • 1
    Check for files in /etc/apt/sources.list.d Commented Mar 23, 2015 at 20:47

2 Answers 2

1

The solution was to check in /etc/apt/sources.list.d as suggested by Michael Hampton. I had some extra sources in there.

0

First check what are the packages available,

apt-cache showpkg <pachagename> 

The above command will display list of available versions for this package. Check if your version is available post that you can specify version for installation.

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

Example:

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.