5

This question already has an answer here:

Im trying to install Apache 2.4.12 or apache2.4 at least. I see some listings for apache2.2 in the apt-cache, but I don't see apache2.4. How can I verify the actually version that sudo apt-get install apache2 will install, without having to install?

marked as duplicate by muru, karel, Braiam apt Aug 16 '18 at 11:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

6

do:

apt-cache policy apache2

you'll get output like this:

apache2:
  Installed: (none)
  Candidate: 2.4.7-1ubuntu4.1
  Version table:
     2.4.7-1ubuntu4.1 0
        500 http://ca.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     2.4.7-1ubuntu4 0
        500 http://ca.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

The version listed as "Candidate" is the one that will be installed if you do apt-get install apache2.

If there's more than one version available, you can force which one you want by giving the version number, in my example it would by default install 2.4.7-1ubuntu4.1 but I can force the other version with:

apt-get install apache2=2.4.7-1ubuntu4

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