web-dev-qa-db-fra.com

Le programme d'installation de cpan échoue avec «Impossible de trouver la commande pkg-config».

Je configure un nouveau serveur Ubuntu (Ubuntu 16.04.1 LTS (Xenial Xerus)), et je veux installer tout ce que j'avais installé sur mon serveur précédent avec Ubuntu 14.04. Parmi ceux-ci le module cpan Text :: QRCode:

Bien sûr, je commence par:

root@myserver:~# apt update && apt full-upgrade

Ensuite, j'essaie d'installer le module:

root@myserver:~# cpanm install Text::QRCode

J'obtiens cette sortie:

install is up to date. (0.01)
--> Working on Text::QRCode
Fetching http://www.cpan.org/authors/id/K/KU/KURIHARA/Text-QRCode-0.04.tar.gz ... OK
Configuring Text-QRCode-0.04 ... N/A
! Configure failed for Text-QRCode-0.04. See /root/.cpanm/work/1471767672.8638/build.log for details.

Je regarde donc ce fichier journal:

root@myserver:~# cat /root/.cpanm/work/1471767672.8638/build.log

et voyez ceci:

cpanm (App::cpanminus) 1.7040 on Perl 5.022001 built for x86_64-linux-gnu-thread-multi
Work directory is /root/.cpanm/work/1471767672.8638
You have make /usr/bin/make
You have LWP 6.15
You have /bin/tar: tar (GNU tar) 1.28
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching install () on cpanmetadb ...
install is up to date. (0.01)
Searching Text::QRCode () on cpanmetadb ...
--> Working on Text::QRCode
Fetching http://www.cpan.org/authors/id/K/KU/KURIHARA/Text-QRCode-0.04.tar.gz
-> OK
Unpacking Text-QRCode-0.04.tar.gz
Entering Text-QRCode-0.04
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.04_01)
Configuring Text-QRCode-0.04
Running Makefile.PL
Cannot determine Perl version info from lib/Text/QRCode.pm
Checking if your kit is complete...
Looks good
Cannot find pkg-config command.
Specify it to PKG_CONFIG_BIN_PATH env variable if you have pkg-config cmd at Makefile.PL line 41.
-> N/A
-> FAIL Configure failed for Text-QRCode-0.04. See /root/.cpanm/work/1471767672.8638/build.log for details.

Il y a la ligne
Impossible de trouver la commande pkg-config.

Évidemment, il n'y a pas de pkg-config installé sur mon Ubuntu 16.04.

Mes questions:

  • Pourquoi le package pkg-config n'est pas installé par défaut?
  • Si j'installe ce paquet: y aura-t-il un conflit entre pkg-config et tout ce qui est utilisé pour le remplacer en 16.04?
  • Si pkg-config peut causer des problèmes en 16.04: Comment puis-je installer le module cpan voulu dans ubuntu 16.04?
1
Hubert Schölnast

Par défaut pkg-config est installé sur le bureau mais pas dans la version serveur d'Ubuntu. C'est parce que vous compilez moins de choses qui ont besoin de pkg-config sur un serveur et la plupart de ses dépendances sont de toute façon installées sur le bureau mais pas sur un serveur.

Il est également utilisé en 16.04. Si vous en avez besoin sur votre serveur, vous pouvez simplement l'installer.

3
Florian Diesch