3

My attempts to install the PHP 5 Memcached module on my Debian 7 VirtualBox VM failed:

root@testvm:~# apt-get install php5-memcached
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-memcached : Depends: libmemcached11 but it is not installable
E: Unable to correct problems, you have held broken packages.

I also could not install it over Synaptic Package Manager.

I guess, the problem can lie in the missing source information in /etc/apt/sources.list.


UPDATE:

/etc/apt/sources.list

# deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 NETINST Binary-1 20130615-23:04]/ wheezy main

# deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 NETINST Binary-1 20130615-23:04]/ wheezy main

deb http://ftp.de.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.de.debian.org/debian/ wheezy main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

# wheezy-updates, previously known as 'volatile'
deb http://ftp.de.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.de.debian.org/debian/ wheezy-updates main contrib non-free

# nginx
deb http://packages.dotdeb.org wheezy all
deb-src http://packages.dotdeb.org wheezy all

# PHP 5.5
deb http://packages.dotdeb.org wheezy-php55 all
deb-src http://packages.dotdeb.org wheezy-php55 all

UPDATE:

I tried to install the missing dependency manually, but it also doesn't work:

root@devvm:~# apt-get install libmemcached11
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libmemcached11 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 'libmemcached11' has no installation candidate

UPDATE:

root@devvm:~# apt-cache depends php5-memcached libmemcached10
php5-memcached
  Depends: libc6
  Depends: <libmemcached11>
  Depends: zlib1g
  Depends: <phpapi-20121212>
    libapache2-mod-php5filter
    libapache2-mod-php5
    libphp5-embed
    php5-cgi
    php5-cli
    php5-fpm
  Depends: php5-common
 |PreDepends: dpkg
  PreDepends: <dpkg-maintscript-helper>
libmemcached10
  Depends: libc6
  Depends: libgcc1
  Depends: libstdc++6
  PreDepends: multiarch-support
  Conflicts: <libmemcached2>
  Conflicts: <libmemcached3>
  Conflicts: <libmemcached6>
  Conflicts: <libmemcached9>
4
  • I'm confused (based on this and other posts) about what you're trying to achieve. Are you specifically trying to install non-Debian packages or Debian backports? php5-memcached is in Wheezy, and only depends on libmemcached10. So you're installing it from somewhere else which requires a non-Wheezy library. Jul 21 '13 at 16:32
  • Just stick to Wheezy sources only, or, work out how to sort out your own dependencies? Here's the package page - packages.debian.org/wheezy/php5-memcached Jul 21 '13 at 16:33
  • @EightBitTony I just want to install php5-memcached. It should work with apt-get install, but it doesn't. Just tried it with the Debian installation package. It also doesn't work -- because of the dependencies. Sorry, but I'm not really getting, what you mean with "php5-memcached is in Wheezy" and "you're installing it from somewhere else". Should I install all dependencies manually?
    – automatix
    Jul 21 '13 at 16:58
  • You have non-Debian sources in your sources.list. Unless you know you need them you should remove them. Jul 21 '13 at 19:01
6

To solve your problem, you just have to add the following to your sources.list :

# Wheezy
deb http://ftp.hosteurope.de/mirror/packages.dotdeb.org/ wheezy all
deb-src http://ftp.hosteurope.de/mirror/packages.dotdeb.org/ wheezy all

# Wheezy-php55
deb http://ftp.hosteurope.de/mirror/packages.dotdeb.org/ wheezy-php55 all
deb-src http://ftp.hosteurope.de/mirror/packages.dotdeb.org/ wheezy-php55 all

Indeed, the missing dependency (libmemcached11) is present in the wheezy distribution of the dotdeb repository.

2

Trying with release tag

Since you have repositories that are not of Debian, lets specify apt-get from where you want the package. Try using:

sudo apt-get -t stable install php5-memcached

That will fix your dependency problems since it will install php5-memcached and libmemcached10 from the stable repositories.

The pinning way

Since apt-get -t stable takes that dotdeb.org as latest stable version of the package, is either, disabling the mirror, apt-get update and installing the package or using pinning magic. Create the file /etc/apt/preferences.d/aptpinning with this content:

Package: php5-memcached
Pin: origin "ftp.de.debian.org"
Pin-Priority: 990

Package: php5-memcached
Pin: origin "packages.dotdeb.org"
Pin-Priority: 500

This will give the priority to the package from ftp.de.debian.org over the one from packages.dotdeb.org.

Again, mixing repos is bad idea, since this kind of situations can (and already) happen. Unless is something critical, you should not mix repos that can cause broken dependencies.

Maybe you need the backport repo

If the reason why you are using PHP from another source is about "security", you could be better using the wheezy-backport repositories. Just add deb http://YOURMIRROR.debian.org/debian wheezy-backports main to your sources.list, run apt-get update, then install the package using apt-get -t wheezy-backports install "package". If you try this, please revert any change of using the other methods.

4
  • apt-get -t stable install php5-memcached Didn't work: php5-memcached : Depends: libmemcached11 but it is not installable E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
    – automatix
    Jul 23 '13 at 19:04
  • Just updateed the question with the output of apt-cache depends php5-memcached libmemcached10.
    – automatix
    Jul 23 '13 at 19:10
  • @automatix I updated my answer as well.
    – Braiam
    Jul 23 '13 at 21:16
  • Thank you very much for all your efforts! I have not tried your last solution out, since I've just got php5-memcached installed another way. See my answer.
    – automatix
    Jul 23 '13 at 22:09
1

Make sure you have

deb http://packages.dotdeb.org wheezy all

in your sources! See PHP 5.5.6, for Debian 7.0 “Wheezy”. Worked for me.

0

The version of php5-memcached in Debian Wheezy has a dependency on libmemcached10.

You can see that on this page, http://packages.debian.org/wheezy/php5-memcached.

You're trying to install php5-memcached, and it's telling you, you need libmemcached11. libmemcached11 is not in Debian Wheezy. It's also, evidently, not in any of the other sources in your sources.list, so apt can't find it. This is because you're installing a version which is newer than the one in Debian Wheezy, and you're installing it from a non-Debian repository. I don't know why the repository doesn't have the correct dependencies.

These entries in your sources.list are causing you issues,

# nginx
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all

# PHP 5.5
deb http://packages.dotdeb.org wheezy-php55 all
deb-src http://packages.dotdeb.org wheezy-php55 all

Are you sure you need them - because they're stopping you installing stuff.

The version of PHP5 in Debian Wheezy is 5.4.4-14+deb7u2. If you need something higher than that, then yes, you'll need other repositories, but you'll also need to ensure you install any missing dependencies. Debian is all about providing a stable server environment, which means it is often running slightly older versions of software. If you want newer stuff,

  • Try Debian Test
  • Try Debian Unstable (don't, unless you want the risks)
  • Use Ubuntu Server
  • Understand how repositories work, and where to get dependencies

If you remove the other repositories now, I'm not sure what Debian might do, it might well downgrade your version of PHP next time you try and do anything. I really think you need to question why you're using Debian Stable.

Do you need Debian and PHP5.5 or do you just need PHP5.5? If you just need PHP5.5 then you would be better off using a distribution that already has it in, or compiling your own (including all the dependencies and all other packages you want).

You can't install php5-memcached with your current setup, because you're missing a dependency.

3
  • Thank you for your answer, but also for the comments! 1. libmemcached11 and not libmemcached10 dependency. I see it now. Do you have an idea, why it needs 11 instead of 10 and how to change this? 2. wheezy-php55 sources. I need(-ed) them in order to install PHP 5.5. Do I still need them now, when PHP 5.5 is already installed. 3. To try Debian Test / Debian Unstable -- what do you mean? 4. Why Ubuntu Server? 5. Thank you for the hint to understand, how it works. Yes, I actually have to. But now I have to get php5-memcached installed first.
    – automatix
    Jul 22 '13 at 22:04
  • 1
    Stackexchange isn't the place for sprawling discussion, I've answered the specific query you had, and expanded it to cover some of your questions here, but you sound like you need to do a lot more reading about Debian, or use the StackExchange chat room stuff. Jul 22 '13 at 22:47
  • You are right, SO is not the place for discussions. It's a question-answer plattform. I asked a question (describing the issue), you gave an answer. The problem is still not resolved. That's why I asked further questions, in order to understand your answer and to achieve the goal of question -- problem solution.
    – automatix
    Jul 23 '13 at 8:35
0

I've got it installed. Somehow...

I tried to install libmemcached11. Since the installation with apt-get didn't work, I installed it from the source:

root@devvm:~# wget http://ftp.de.debian.org/debian/pool/main/libm/libmemcached/libmemcached11_1.0.17-2_amd64.deb
...
2013-07-23 22:07:02 (713 KB/s) - `libmemcached11_1.0.17-2_amd64.deb' saved [112238/112238]

root@devvm:~# dpkg --install libmemcached11_1.0.17-2_amd64.deb 
Selecting previously unselected package libmemcached11:amd64.
(Reading database ... 149070 files and directories currently installed.)
Unpacking libmemcached11:amd64 (from libmemcached11_1.0.17-2_amd64.deb) ...
dpkg: dependency problems prevent configuration of libmemcached11:amd64:
 libmemcached11:amd64 depends on libc6 (>= 2.16); however:
  Version of libc6:amd64 on system is 2.13-38.

dpkg: error processing libmemcached11:amd64 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libmemcached11:amd64

With errors, as you see. But now libmemcached11 was installed.

Since I thought, that the installation failed, I first desided to remove the downloaded (broken?) package, but aborted the process, in order to try the php5-memcached installation with it (maybe it would work... somehow...):

root@devvm:~# apt-get remove libmemcached11
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
...
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  libmemcached11
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 261 kB disk space will be freed.
Do you want to continue [Y/n]? n
Abort.

Then I tried to install php5-memcached again -- and this time successfully:

root@devvm:~# apt-get -t stable install php5-memcached
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
...
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libmemcached11
The following NEW packages will be installed:
  libmemcached11 php5-memcached
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 148 kB of archives.
After this operation, 397 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://packages.dotdeb.org/ wheezy/all libmemcached11 amd64 1.0.16-1 [113 kB]
Get:2 http://packages.dotdeb.org/ wheezy-php55/all php5-memcached amd64 5.5.0-1~dotdeb.1 [34.9 kB]
Fetched 148 kB in 0s (328 kB/s)      
Selecting previously unselected package libmemcached11:amd64.
(Reading database ... 149070 files and directories currently installed.)
Unpacking libmemcached11:amd64 (from .../libmemcached11_1.0.16-1_amd64.deb) ...
Selecting previously unselected package php5-memcached.
Unpacking php5-memcached (from .../php5-memcached_5.5.0-1~dotdeb.1_amd64.deb) ...
Processing triggers for php5-fpm ...
[ ok ] Restarting PHP5 FastCGI Process Manager: php5-fpm.
Setting up libmemcached11:amd64 (1.0.16-1) ...
Setting up php5-memcached (5.5.0-1~dotdeb.1) ...

Creating config file /etc/php5/mods-available/memcached.ini with new version
Processing triggers for php5-fpm ...
[ ok ] Restarting PHP5 FastCGI Process Manager: php5-fpm.
3
  • Get:1 http://packages.dotdeb.org/ wheezy/all libmemcached11 amd64 1.0.16-1 [113 kB] you were trolled. Don't know why it wasn't included in repository.
    – Braiam
    Jul 23 '13 at 22:24
  • Could you please explain, what you mean? I was trolled? What wasn't included to repository?
    – automatix
    Jul 23 '13 at 22:39
  • libmemcached11 was not included before in any of your repositories, hence it was added recently and you spent 2 days figuring out 'what was wrong'.
    – Braiam
    Jul 23 '13 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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