Ubuntu 12.04 安裝 graphviz 遇到 confclit

在 Ubuntu 12.04 裝 graphviz 遇到 liggd2-xpm 和 libgd2-noxpm 衝突的問題:

$ sudo aptitude install graphviz
The following NEW packages will be installed:
  fonts-liberation{a} graphviz libcdt4{a} libcgraph5{a} libgd2-noxpm{ab} libgraph4{a} libgvc5{a} libgvpr1{a} libpathplan4{a} ttf-liberation{a}
0 packages upgraded, 10 newly installed, 0 to remove and 427 not upgraded.
Need to get 2,716 kB of archives. After unpacking 6,188 kB will be used.
The following packages have unmet dependencies:
 libgd2-xpm:i386 : Conflicts: libgd2 which is a virtual package.
                   Conflicts: libgd2-noxpm but 2.0.36~rc1~dfsg-6ubuntu2 is to be installed.
 libgd2-noxpm : Conflicts: libgd2:i386 which is a virtual package.
                Conflicts: libgd2-xpm:i386 but 2.0.36~rc1~dfsg-6ubuntu2 is installed.
Internal error: the solver Install(fontconfig-config:amd64 2.8.0-3ubuntu9  {fontconfig-config:amd64 2.8.0-3ubuntu9}>) of a supposedly unresolved dependency is already installed in step 125

$ dpkg -l  | grep libgd2
ii  libgd2-xpm:i386                      2.0.36~rc1~dfsg-6ubuntu2            GD Graphics Library version 2

用 apt-cache depends graphviz 了解 graphviz 用到的套件 (可參考這篇說明輸出的內容):

$ apt-cache depends graphviz
graphviz
  Depends: libc6
  Depends: libcdt4
  Depends: libcgraph5
  Depends: libexpat1
 |Depends: libgd2-noxpm
  Depends: libgd2-xpm
  Depends: libgraph4
  Depends: libgvc5
  Depends: libgvpr1
  Depends: libx11-6
  Depends: libxaw7
  Depends: libxmu6
  Depends: libxt6
  Suggests: gsfonts
  Suggests: graphviz-doc
  Recommends: ttf-liberation
    fonts-liberation
  Conflicts: 
  Conflicts: 
  Conflicts: graphviz:i386

我想說既然 conflict 的原因是 libgd2-xpm 和 libgd2-noxmp, 試看看一起指定要裝的東西,不要讓 aptitude 自己選,結果就 OK 了:

$ sudo aptitude install graphviz libexpat1 libgd2-xpm
The following NEW packages will be installed:
  fonts-liberation{a} graphviz libcdt4{a} libcgraph5{a} libgd2-xpm libgraph4{a} libgvc5{a} libgvpr1{a} libpathplan4{a} ttf-liberation{a}
0 packages upgraded, 10 newly installed, 0 to remove and 427 not upgraded.
Need to get 2,719 kB of archives. After unpacking 6,197 kB will be used.
Do you want to continue? [Y/n/?] Y
...

留言

這個網誌中的熱門文章

(C/C++ ) 如何在 Linux 上使用自行編譯的第三方函式庫

virtualbox 使用 USB 裝置

熟悉系統工具好處多多