4

I've installed a PPA, ondrej/php5, so I can install PHP 5.5 on a Ubuntu 12.04 server. However, I want to install Apache 2.2, and the above PPA provides Apache 2.4.

I created the file /etc/apt/preferences.d/apache2:

Package: *apache*
Pin: release o=LP-PPA-ondrej-php5
Pin-Priority: -100

Relevant lines from apt-cache policy:

 500 http://ppa.launchpad.net/ondrej/php5/ubuntu/ precise/main i386 Packages
     release v=12.04,o=LP-PPA-ondrej-php5,a=precise,n=precise,l=PPA for PHP5,c=main
     origin ppa.launchpad.net
 500 http://ppa.launchpad.net/ondrej/php5/ubuntu/ precise/main amd64 Packages
     release v=12.04,o=LP-PPA-ondrej-php5,a=precise,n=precise,l=PPA for PHP5,c=main
     origin ppa.launchpad.net

After creating the file, here is the result of apt-cache policy apache2:

apache2:
  Installed: (none)
  Candidate: (none)
  Package pin: 2.4.6-3+debphp.org~precise+1
  Version table:
     2.4.6-3+debphp.org~precise+1 -100
        500 http://ppa.launchpad.net/ondrej/php5/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status
     2.2.22-1ubuntu1.4 -100
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     2.2.22-1ubuntu1 -100
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

Why are official Ubuntu repos being given a priority of -100?

2

1 Answer 1

0

Increase the priority of the package in the Ubuntu repositories:

  1. Edit /etc/apt/preferences.d/apache2

    sudo nano /etc/apt/preferences.d/apache2
    
  2. Add the following configuration

    Package: *apache2*
    Pin: release o=ubuntu
    Pin-Priority: 1000
    
  3. Check

    % apt-cache policy apache2                
    apache2:
      Installed: 2.4.12-2ubuntu2
      Candidate: 2.4.12-2ubuntu2
      Package pin: 2.4.12-2ubuntu2
      Version table:
         2.4.16-4+deb.sury.org~wily+4 1000
            500 http://ppa.launchpad.net/ondrej/php5/ubuntu/ wily/main i386 Packages
     *** 2.4.12-2ubuntu2 1000
            500 http://archive.ubuntu.com/ubuntu/ wily/main i386 Packages
            100 /var/lib/dpkg/status
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .