AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1287708
Accepted
Guilherme
Guilherme
Asked: 2020-10-29 07:46:54 +0800 CST2020-10-29 07:46:54 +0800 CST 2020-10-29 07:46:54 +0800 CST

在 Ubuntu 18.04 上安装 libmagick++-dev 的依赖问题

  • 772

我正在尝试使用 install splashr,但遇到了一些依赖问题,似乎没有任何效果。我知道这与操作系统中的错误配置有关,而不是与软件包本身的问题有关,但也许你们可以提供一些指导。基本上在尝试安装 splashr 时,我得到以下日志:

> install.packages("splashr")
Installing package into ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘magick’

trying URL 'https://cloud.r-project.org/src/contrib/magick_2.5.0.tar.gz'
Content type 'application/x-gzip' length 4824979 bytes (4.6 MB)
==================================================
downloaded 4.6 MB

trying URL 'https://cloud.r-project.org/src/contrib/splashr_0.6.0.tar.gz'
Content type 'application/x-gzip' length 1099679 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
 - deb: libmagick++-dev (Debian, Ubuntu)
 - rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
 - csw: imagemagick_dev (Solaris)
 - brew imagemagick@6 (MacOS)
For Ubuntu versions Trusty (14.04) and Xenial (16.04) use our PPA:
   sudo add-apt-repository -y ppa:cran/imagemagick
   sudo apt-get update
   sudo apt-get install -y libmagick++-dev
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4/magick’
Warning in install.packages :
  installation of package ‘magick’ had non-zero exit status
ERROR: dependency ‘magick’ is not available for package ‘splashr’
* removing ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4/splashr’
Warning in install.packages :
  installation of package ‘splashr’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp8hJktb/downloaded_packages’

它抱怨没有找到 Magick++ 并导致它所依赖的包 magick 的另一个失败安装。输出类似:

> install.packages("magick")
Installing package into ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/magick_2.5.0.tar.gz'
Content type 'application/x-gzip' length 4824979 bytes (4.6 MB)
==================================================
downloaded 4.6 MB

* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
 - deb: libmagick++-dev (Debian, Ubuntu)
 - rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
 - csw: imagemagick_dev (Solaris)
 - brew imagemagick@6 (MacOS)
For Ubuntu versions Trusty (14.04) and Xenial (16.04) use our PPA:
   sudo add-apt-repository -y ppa:cran/imagemagick
   sudo apt-get update
   sudo apt-get install -y libmagick++-dev
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/home/guilherme/R/x86_64-pc-linux-gnu-library/3.4/magick’
Warning in install.packages :
  installation of package ‘magick’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp8hJktb/downloaded_packages’

所以我进入终端安装缺少的包 libmagick++-dev,但它也没有走远,因为它一直在询问依赖项的依赖关系:

以下软件包具有未满足的依赖关系: libmagick++-dev :依赖:libmagick++-6.q16-dev 但不会安装

依赖树还在继续:

libmagick++-dev 
    libmagick++-6.q16-dev 
        libmagickcore-6.q16-dev 
            libmagickwand-6.q16-dev 
                librsvg2-dev 
                    libcairo2-dev 
                        libfontconfig1-dev 
                            libfontconfig1 

由于错误,我无法安装它们中的任何一个:“......但它不会被安装”

我已经尝试多次卸载/安装 imagemagick 无济于事。

这些是有关环境变量的一些信息。

$PATH:
/home/guilherme/.local/share/umake/bin:/home/guilherme/bin:/home/guilherme/.local/share/umake/bin:/home/guilherme/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/guilherme/.config/composer/vendor/bin:bin/msys-ssh-1000-18:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/guilherme/.fzf/bin:/home/guilherme/.config/composer/vendor/bin

$PKG_CONFIG_PATH:(空)

lsb_release -a: 
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic

我完全迷路了。谁能帮我这个?

编辑: 根据 N0rbert 的建议,这是输出apt-cache policy libmagick++-6.q16-dev:

libmagick++-6.q16-dev:
  Installed: (none)
  Candidate: 8:6.9.7.4+dfsg-16ubuntu6.8
  Version table:
     8:6.9.7.4+dfsg-16ubuntu6.8 500
        500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     8:6.9.7.4+dfsg-16ubuntu6 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
r imagemagick 18.04
  • 3 3 个回答
  • 3032 Views

3 个回答

  • Voted
  1. N0rbert
    2020-10-29T08:50:05+08:002020-10-29T08:50:05+08:00

    所需的文件Magick++.pc文件包含在libmagick++-6.q16-dev中,可从仿生更新和/或仿生安全口袋中获得。因此,您必须首先通过运行软件和更新 ( software-properties-gtk) 或/etc/apt/sources.list手动编辑来检查您的存储库。

    然后在全新完全更新的 18.04 LTS 系统上执行以下命令将导致编译成功:

    sudo apt-get install r-base-dev libcurl4-openssl-dev libxml2-dev libssl-dev libmagick++-6.q16-dev
    

    最后在R会话中:

    install.packages("splashr")
    

    应该成功结束。

    • 0
  2. Best Answer
    Guilherme
    2020-10-30T04:43:51+08:002020-10-30T04:43:51+08:00

    在这个问题中,我在magick repo的维护者的帮助下想通了。底线,主要问题是我有版本 2.3 但请求的版本是 2:libfontconfig1

    $ sudo apt install libfontconfig1-dev 
    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:
     libfontconfig1-dev : Depends: libfontconfig1 (= 2.12.6-0ubuntu2) but 2.12.6-0ubuntu2.3 is to be installed
    E: Unable to correct problems, you have held broken packages.
    

    按照Jeroen的建议,我只是强制安装第 2 版:

    sudo apt-get install libfontconfig1=2.12.6-0ubuntu2
    

    之后,从底部安装的每个依赖项都没有问题。

    • 0
  3. mikey
    2021-12-14T08:59:27+08:002021-12-14T08:59:27+08:00

    我能够在终端中使用以下命令在 Ubuntu 上安装 magick 包:

    sudo add-apt-repository -y ppa:cran/imagemagick
    sudo apt-get update
    sudo apt-get install -y libmagick++-dev

    • 0

相关问题

  • 从控制台修改多个图像[重复]

  • 蒙太奇中的图像映射(每个图像都是一个超链接)

  • 将图像从灰度转换为二进制

  • 如何在 Kubuntu 中获得 Cantor 的 R 后端?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve