Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I am trying to install php5 on Ubuntu 12.10 Desktop and getting the following error:

sudo apt-get install php5 php5-cli libapache2-mod-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.
 libapache2-mod-php5 : Depends: libdb4.8 but it is not installable
 php5-cli : Depends: libdb4.8 but it is not installable
E: Unable to correct problems, you have held broken packages.

How can I recover from this?

sources.list:

# deb cdrom:[Ubuntu 12.10 _Quantal Quetzal_ - Release i386 (20121017.2)]/ quantal main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ quantal main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ quantal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ quantal-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ quantal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ quantal universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ quantal universe
deb http://gb.archive.ubuntu.com/ubuntu/ quantal-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ quantal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://gb.archive.ubuntu.com/ubuntu/ quantal multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ quantal multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ quantal-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ quantal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ quantal-backports main restricted universe multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ quantal-backports main restricted universe multiverse

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

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## 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 quantal partner
# deb-src http://archive.canonical.com/ubuntu quantal 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 quantal main
deb-src http://extras.ubuntu.com/ubuntu quantal main
share|improve this question

marked as duplicate by TheX, Seth, Eliah Kagan, Eric Carvalho, hhlp Feb 9 '13 at 10:55

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.

1 Answer 1

Try running sudo apt-get install -f. The -f flag tells apt-get to attempt to fix broken dependencies, which often solves this sort of problem.

Source: man apt-get

share|improve this answer

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