2

I have installed a fresh Ubuntu 14.04.03 and I am running into a problem I have never had before.

First thing I did when logging into the new install was apt-get update and upgrade. Then I wanted to install apache2 but I get an error returned that I have broken packages. Broken dependencies/packages

I don't even know where I should start looking as this has never happened to me before. I tried apt-get autoclean and apt-get -f install but it did nothing.

Any help is much appreciated!

EDIT:

sync-s@sync-s:~$ apt-cache policy apache2 apache2-bin ssl-cert
apache2:
  Installed: (none)
  Candidate: 2.4.7-1ubuntu4.5
  Version table:
     2.4.7-1ubuntu4.5 0
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
apache2-bin:
  Installed: (none)
  Candidate: 2.4.7-1ubuntu4.5
  Version table:
     2.4.7-1ubuntu4.5 0
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
ssl-cert:
  Installed: (none)
  Candidate: (none)
  Version table:

An attempt to install php5:

sync-s@sync-s:~$ sudo apt-get install php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5 : Depends: libapache2-mod-php5 (>= 5.5.9+dfsg-1ubuntu4.14) but it is not going to be installed or
                 libapache2-mod-php5filter (>= 5.5.9+dfsg-1ubuntu4.14) but it is not going to be installed or
                 php5-cgi (>= 5.5.9+dfsg-1ubuntu4.14) but it is not going to be installed or
                 php5-fpm (>= 5.5.9+dfsg-1ubuntu4.14) but it is not going to be installed
        Depends: php5-common (>= 5.5.9+dfsg-1ubuntu4.14) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Attempt to install mysql-server-5.5:

sync-s@sync-s:~$ sudo apt-get install mysql-server-5.5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mysql-server-5.5 : Depends: libdbi-perl but it is not installable
                    Depends: mysql-client-5.5 (>= 5.5.46-0ubuntu0.14.04.2) but it is not going to be installed
                    Depends: mysql-server-core-5.5 (>= 5.5.46-0ubuntu0.14.04.2) but it is not going to be installed
                    Recommends: libhtml-template-perl but it is not installable
E: Unable to correct problems, you have held broken packages.

Attempt to install proftpd:

sync-s@sync-s:~$ sudo apt-get install proftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package proftpd

Contents of /etc/apt/sources.list:

# deb cdrom:[Ubuntu-Server 14.04.3 LTS _Trusty Tahr_ - Beta amd64 (20150805)]/ trusty main restricted

#deb cdrom:[Ubuntu-Server 14.04.3 LTS _Trusty Tahr_ - Beta amd64 (20150805)]/ trusty main restricted

deb http://security.ubuntu.com/ubuntu trusty-security main
deb-src http://security.ubuntu.com/ubuntu trusty-security main
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

Attempt to installing dependencies of apache2:

sync-s@sync-s:~$ sudo apt-get install apache2-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 apache2-bin : Depends: libapr1 (>= 1.5.0) but it is not installable
               Depends: libaprutil1 (>= 1.5.0) but it is not installable
               Depends: libaprutil1-dbd-sqlite3 but it is not installable or
                        libaprutil1-dbd-mysql but it is not installable or
                        libaprutil1-dbd-odbc but it is not installable or
                        libaprutil1-dbd-pgsql but it is not installable or
                        libaprutil1-dbd-freetds but it is not installable
               Depends: libaprutil1-ldap but it is not installable
E: Unable to correct problems, you have held broken packages.
sync-s@sync-s:~$ sudo apt-get install libapr1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libapr1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libapr1' has no installation candidate
John
  • 2,413
  • 2
  • 16
  • 11
  • Please [edit] your question and paste the output of apt-cache policy apache2 apache2-bin ssl-cert. And don't upload screenshots of text please, you may copy&paste it (remember to use code formatting). – Byte Commander Jan 12 '16 at 14:34
  • 1
    Related:http://askubuntu.com/questions/140246/how-do-i-resolve-unmet-depend – Elder Geek Jan 12 '16 at 14:40
  • Stupid question, but did you run sudo apt-get update yet to refresh the list of dependencies and packages and such? Did you also then do sudo apt-get upgrade to install all the updates available? – Thomas Ward Jan 12 '16 at 14:44
  • @ByteCommander see edit. – John Jan 12 '16 at 14:45
  • @ThomasW. Yes I ran sudo apt-get update; sudo apt-get upgrade – John Jan 12 '16 at 14:48
  • @John include your /etc/apt/sources.list file contents as an edit here, I think that there's something missing in your sources but need to see the list first. – Thomas Ward Jan 12 '16 at 14:55
  • @ThomasW. See edit. – John Jan 12 '16 at 14:59
  • @John your sources.list is missing critical repositories, that without you will NEVER be able to install software. Read my answer. – Thomas Ward Jan 12 '16 at 15:23

2 Answers2

5

Your sources.list is horribly mangled, missing CRITICAL repositories, and is therefore not usable.

You're missing quite a lot of things you MUST have - at the VERY least, the trusty main repositories which were created upon Trusty's release; without these, you can't install anything. This is because trusty-security ONLY contains security updates; it does NOT contain base packages for the system, and running with just trusty-security and not trusty in the sources will cause everything to explode.


I am going to make the assumption that you ONLY want trusty + security updates, and NOT the standard updates repository.

This sources.list is extracted from a 14.04 Server ISO's SquashFS filesystem, extracted from the ISO itself. It's got a few changes, which I'll comment on accordingly, or I extracted from your list sources above.

# The original Trusty repository, for Main, Universe, and Multiverse pockets. 
# DO NOT REMOVE THIS!
deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse

# Security updates for Main, Universe, and Multiverse pockets.
# DO NOT REMOVE THIS, OR YOUR SYSTEM MAY BECOME A SECURITY RISK!
deb http://security.ubuntu.com/ubuntu/ trusty-security main universe multiverse

# Standard software updates for Main, Universe, and Multiverse pockets.
# You do not need to keep these enabled, but you can if you wish to.
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main universe multiverse

## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

Once you've replaced your /etc/apt/sources.list with this one, adapting accordingly for your country mirror by replacing archive.ubuntu.com with CC.archive.ubuntu.com where CC is your two letter country code, run sudo apt-get update; sudo apt-get upgrade and apply all updates again. Then, try installing your software.

Thomas Ward
  • 74,764
0

This is really a comment on the answer here by Thomas Ward, but it is too long to be a comment, and I don't think it would qualify as an edit. Someone with more experience or privilege, may judge on how to adjust this appropriately.

There are also backports. These are updated versions available in newer versions of Ubuntu. These are considered less stable, but have been tested. If you are not using a different version, replace trusty with your current Ubuntu version. The deb-src just includes sources instead of binaries.

# Backports
deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse

There also seems to be a different source available for architecture that is not a standard PC. Again, replace trusty with your current version of Ubuntu. The architectures were added to the searchable database at packages.ubuntu.com in 2016-04-19. If you already have the equivalent repositories as archives.ubuntu.com, they will be duplicates. Its at ports.ubuntu.com and lists arm64, armhf, powerpc, and ppc64el.