4

I've been trying to install Percona Toolkit onto my Debian (wheezy) server. I downloaded it as per the instructions: wget percona.com/get/percona-toolkit.deb

then installed it sudo dpkg -i percona-toolkit.deb

But it told me there were missing dependencies that weren't installed, and wouldn't be installed.

I have been downloading these one by one, but each one seems to have a missing dependency of it's own. I've also noticed that most of these are installed, but the toolkit requires a later version. In one case the only version I could find suggested it was designed for the next release of Debian.

So far I have downloaded:

libio-socket-ssl-perl_2.002-2_all.deb
libnet-ssleay-perl_1.65-1+b1_amd64.deb
libterm-readkey-perl_2.30-4+b2_amd64.deb

and now it wants

perl (>= 5.20.0-4)
perlapi-5.20.0
libc6 (>= 2.14)

Is there an easy way to get the system to download / install all of these in one go, and is it likely to cause stability issues if I install versions higher than the default that are already installed?


UPDATE - output from apt-get -f install:

sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  libio-socket-ssl-perl libnet-ssleay-perl percona-toolkit
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 7,319 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 26051 files and directories currently installed.)
Removing percona-toolkit ...
Removing libio-socket-ssl-perl ...
Removing libnet-ssleay-perl ...
Processing triggers for man-db ...
  • or dpkg -i percona-toolkit.deb and then apt-get install --fix-missing – Milind Dumbare Mar 25 '15 at 16:21
  • cheers, I tried that, but it gets stuck at libnet-ssleay-perl: Depends: perl (>= 5.20.0-4) but 5.14.2-21+deb7u2 is installed ; Depends: perlapi-5.20.0 but it is not installable ; Depends: libc6 (>= 2.14) but 2.13-38+deb7u6 is installed – IGGt Mar 25 '15 at 16:24
  • Try my answer.. – Milind Dumbare Mar 25 '15 at 16:27
  • Please paste the complete output of apt-get -f install, and we can take it from there. – Faheem Mitha Mar 25 '15 at 16:42
  • Hi Faheem Mitha, I've added it above. – IGGt Mar 25 '15 at 16:47
4

First try installing by which will fail.

dpkg -i percona-toolkit.deb

Then do following to install and fix the missing dependencies.

apt-get install --fix-missing -f

Then try again to install the .deb package

dpkg -i percona-toolkit.deb
  • cheers, but it doesn't like: dpkg: dependency problems prevent configuration of percona-toolkit: percona-toolkit depends on libio-socket-ssl-perl; however: Package libio-socket-ssl-perl is not configured yet. – IGGt Mar 25 '15 at 16:27
  • Did you try all three steps? – Milind Dumbare Mar 25 '15 at 16:28
  • ah, I missed the -f. Now I get Package libio-socket-ssl-perl is not installed. I tried to install that earlier bit it failed with Package libnet-ssleay-perl is not installed. I guess I need to download and install that separately? – IGGt Mar 25 '15 at 16:33
  • 1
    @Miline apt-get -f install does not have magic powers. One needs to look at the situation and figure out what is wrong. – Faheem Mitha Mar 25 '15 at 16:41
  • 1
    Hi guys, I can confirm there was a Firewall issue. It is now installed using the above method. Thanks for your help. – IGGt Mar 26 '15 at 8:08
3

First, run apt-get -f install to make APT happy about the current state of the system. Having half-installed or half-removed packages or broken dependencies tends to put APT in a state where it won't do what you tell it to do, even if that would theoretically be possible because it wouldn't affect the broken packages.

dpkg is a low-level tool that does only what you explicitly tell it to do. It verifies dependencies, but it is unable to fulfill them. apt-get and other APT tools are higher-level tools that manage dependencies, among other things. For example, if you tell apt-get to install a package, it will automatically download install the package's dependencies as well; but if you tell dpkg to install a package (which you must provide in a local file) and the required dependencies are not installed, it just signals an error.

When you install third-party packages manually with dpkg, you need to install dependencies first. You can see what a deb file depends on with the command

dpkg-deb -I percona-toolkit.deb

Look at the Depends: line and install packages listed there. This is a comma-separated list; if some package names are separated by a | then you need to install only one of those. Also check the Recommends: line, which lists packages that are not necessary to everyone but are very useful or are necessary for one of the package's feature.

Alternatively, you can initiate the installation with

dpkg -i percona-toolkit.deb

see what packages it complains are missing, and (assuming these packages are provided by the distribution) immediately use apt-get to install them. So in your case:

apt-get install libio-socket-ssl-perl libnet-ssleay-perl libterm-readkey-perl
apt-get -f install

(The second command takes care of finishing the installation of percona-toolkit which was interrupted midway due to missing dependencies.)

If you have several deb files that are not provided by your distribution and they have dependencies among themselves, install them in the order given by their dependencies, or pass them all on a single dpkg -i command line.

  • cheers for the description. Being new to Linux, it's good to see how people explain them, as it now makes more sense what was actually happening. – IGGt Mar 26 '15 at 8:09

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.