当依赖项已从 PPA 安装时,如何安装软件包?

当依赖项已从 PPA 安装时,如何安装软件包?

我正在尝试安装libgdal-dev

sudo apt-get install libgdal-dev

但它有未满足的依赖关系:Depends: libpng-dev

但其本身无法安装,因为:

libpng12-dev : Depends: libpng12-0 (= 1.2.54-1ubuntu1.1) but 1.2.54-5x0~ppa is to be installed

该软件包从以下位置安装ppa

dpkg -s libpng12-0 | grep ^Maintainer
Maintainer: Otto Meier <[email protected]>

通过

我想保留它苯甲酸因为它提供了 GIMP 2.9。


问题

  • 我该如何安装libpng12-devlibgdal-dev(可能忽略或手动更改某些依赖项)?

  • 或者一般来说:当依赖项已从 PPA 安装在另一个版本中时,如何安装软件包?


(提示:使用 Snap 安装 GIMP 既不是首选也不可能的



我尝试过的:

我安装了libpng12-dev忽略libpng12-0依赖性(通过):

apt download libpng12-dev
sudo dpkg --ignore-depends=libpng12-0 -i libpng12-dev_1.2.54-1ubuntu1.1_amd64.deb

这有效。
此外,libgdal-dev仍然有 unmnet 依赖项,因此我做了同样的事情:

sudo apt install libgdal-dev
sudo dpkg --ignore-depends=libpng12-0 -i libgdal-dev_2.2.2+dfsg-1~xenial1_amd64.deb #png12-dev_1.2.54-1ubuntu1.1_amd64.deb

dpkg: dependency problems prevent configuration of libgdal-dev:
 libgdal-dev depends on libarmadillo-dev; however:
  Package libarmadillo-dev is not installed.
 libgdal-dev depends on libcurl4-gnutls-dev | libcurl-ssl-dev; however:
  Package libcurl4-gnutls-dev is not installed.
  Package libcurl-ssl-dev is not installed.
 libgdal-dev depends on libdap-dev; however:
  Package libdap-dev is not installed.
 libgdal-dev depends on libepsilon-dev; however:
  Package libepsilon-dev is not installed.
 libgdal-dev depends on libfreexl-dev; however:
  Package libfreexl-dev is not installed.
 libgdal-dev depends on libfyba-dev; however:
  Package libfyba-dev is not installed.
 libgdal-dev depends on libgeos-dev; however:
  Package libgeos-dev is not installed.
 libgdal-dev depends on libgeotiff-dev; however:
  Package libgeotiff-dev is not installed.
 libgdal-dev depends on libgif-dev; however:
  Package libgif-dev is not installed.
 libgdal-dev depends on libhdf4-alt-dev; however:
  Package libhdf4-alt-dev is not installed

因此,我在这里停下来并再次修复了这种情况:

sudo dpkg -r libgdal-dev
sudo dpkg -r libpng12-dev

答案1

@dsstorefile1 给出了正确的提示来解决我的问题:

我在问题中链接的 ppa曾是当我安装它时,它是为 16.04 制作的,但是它发生了变化并且维护者删除了包括xenial在内的大多数软件包libpng12-0


所以我是这样解决这个问题的:

  • 使用以下命令删除 ppa ppa-purge

    sudo ppa-purge ppa:otto-kesselgulasch/gimp
    
  • 将软件包降级libpng12-0为官方存储库中的版本:

    sudo apt install libpng12-0=1.2.54-1ubuntu1.1
    
  • 安装libgdal-dev

    sudo apt install libgdal-dev
    

我还注意到,以下软件包也是该 ppa 的残留:

libbabl-0.1-0
libgegl-0.3-0
liblcms2
libwebp6

因此,我还降级/删除了这些:

sudo apt install libbabl-0.1-0=0.1.16-1
sudo apt install libgegl-0.3-0=0.3.4-1ubuntu2
sudo apt install liblcms2-2=2.6-3ubuntu2
sudo apt remove libwebp6 #no candidate from repos

相关内容