El gestor de paquetes de bajo nivel dpkg (de los sistemas Debian y derivados) no resuelve ni instala automáticamente dependencias faltantes (paquetes necesarios para el funcionamiento de otro paquete). Frecuentemente se utiliza para instalar un paquete independiente de forma manual, y generalmente por fuera de los repositorios. Sin embargo, cuando se realiza este tipo de instalaciones es común que falten dependencias del paquete en cuestión. Este artículo explica cómo instalar automáticamente todas las dependencias faltantes de un paquete instalado manualmente con dpkg.



Veamos directamente un ejemplo: descargué el paquete "open-semantic-search" desde el sitio oficial del proyecto (www.opensemanticsearch.org). Al tratar de instalarlo con dpkg arroja unos cuantos errores de dependencias faltantes que dpkg no va a instalar (ya que no es su funcionalidad, sino que es tarea de los gestores de paquetes de alto nivel como apt-get, aptitude o apt):

root@debian10:~# dpkg -i open-semantic-search_20.01.17.deb 
(Reading database ... 83153 files and directories currently installed.)
Preparing to unpack open-semantic-search_20.01.17.deb ...
Unpacking open-semantic-search (20.01.17) over (20.01.17) ...
dpkg: dependency problems prevent configuration of open-semantic-search:
 open-semantic-search depends on default-jre-headless (>= 0); however:
  Package default-jre-headless is not installed.
 open-semantic-search depends on libjs-jquery (>= 0); however:
  Package libjs-jquery is not installed.
 open-semantic-search depends on apache2 (>= 0); however:
  Package apache2 is not installed.
 open-semantic-search depends on libapache2-mod-php (>= 0); however:
  Package libapache2-mod-php is not installed.
 open-semantic-search depends on php (>= 0); however:
  Package php is not installed.
 open-semantic-search depends on php-xml (>= 0); however:
  Package php-xml is not installed.
 open-semantic-search depends on php-bcmath (>= 0); however:
  Package php-bcmath is not installed.
 open-semantic-search depends on libapache2-mod-wsgi-py3 (>= 0); however:
  Package libapache2-mod-wsgi-py3 is not installed.
 open-semantic-search depends on python3-django (>= 0); however:
  Package python3-django is not installed.
 open-semantic-search depends on python3-mysqldb (>= 0); however:
  Package python3-mysqldb is not installed.
 open-semantic-search depends on python3-rdflib (>= 0); however:
  Package python3-rdflib is not installed.
 open-semantic-search depends on python3-openssl (>= 0); however:
  Package python3-openssl is not installed.
 open-semantic-search depends on python3-pysolr (>= 0); however:
  Package python3-pysolr is not installed.
 open-semantic-search depends on python3-dateutil (>= 0); however:
  Package python3-dateutil is not installed.
 open-semantic-search depends on python3-lxml (>= 0); however:
  Package python3-lxml is not installed.
 open-semantic-search depends on python3-feedparser (>= 0); however:
  Package python3-feedparser is not installed.
 open-semantic-search depends on poppler-utils (>= 0); however:
  Package poppler-utils is not installed.
 open-semantic-search depends on pst-utils (>= 0); however:
  Package pst-utils is not installed.
 open-semantic-search depends on python3-pyinotify (>= 0); however:
  Package python3-pyinotify is not installed.
 open-semantic-search depends on python3-celery (>= 0); however:
  Package python3-celery is not installed.
 open-semantic-search depends on python3-nltk (>= 0); however:
  Package python3-nltk is not installed.
 open-semantic-search depends on python3-pip (>= 0); however:
  Package python3-pip is not installed.
 open-semantic-search depends on python3-dev (>= 0); however:
  Package python3-dev is not installed.
 open-semantic-search depends on libffi-dev (>= 0); however:
  Package libffi-dev is not installed.
 open-semantic-search depends on rabbitmq-server (>= 0); however:
  Package rabbitmq-server is not installed.
 open-semantic-search depends on scantailor (>= 0); however:
  Package scantailor is not installed.
 open-semantic-search depends on tesseract-ocr (>= 0); however:
  Package tesseract-ocr is not installed.
 open-semantic-search depends on tesseract-ocr-all (>= 0); however:
  Package tesseract-ocr-all is not installed.
 open-semantic-search depends on hunspell-de-de-frami; however:
  Package hunspell-de-de-frami is not installed.
 open-semantic-search depends on hunspell-hu; however:
  Package hunspell-hu is not installed.

dpkg: error processing package open-semantic-search (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 open-semantic-search

Cabe destacar que el paquete queda instalado, aunque sin configurar. Si en este momento nos arrepentimos de proseguir con la instalación, será necesario desinstalarlo ejecutando dpkg -P open-semantic-search o dpkg --purge open-semantic-search.

Si en cambio se desea proseguir con la instalación de dependencias faltantes, se debe recurrir al gestor de paquetes de alto nivel apt-get. El mismo posee la opción --fix-broken, la cual está pensada para corregir un sistema con dependencias faltantes (instalarlas, siempre que estén disponibles en alguno de los repositorios configurados y disponibles).

Simplemente ejecutar:

# apt-get --fix-broken install

O más simple:

# apt-get -f install

Una vez instaladas todas las dependencias, reinstalar el paquete con dpkg para que sea configurado correctamente:

# dpkg -i open-semantic-search_20.01.17.deb


Tal vez pueda interesarte


Compartí este artículo