为了编译Tesseract 培训计划从源代码来看,必须安装pango
和的开发包。但是,我在 Centos 8.1 上安装它们时遇到了麻烦。cairo
# cat /etc/redhat-release
Centos release 8.1.1911 (Core)
# dnf makecache
CentOS-8 - AppStream 58 kB/s | 4.3 kB 00:00
CentOS-8 - Base 20 kB/s | 4.3 kB 00:00
CentOS-8 - Extras 1.7 kB/s | 1.5 kB 00:00
CentOS-8 - PowerTools 129 kB/s | 4.3 kB 00:00
CERT Forensics Tools Repository 1.1 kB/s | 3.0 kB 00:02
CERT Forensics Tools Repository - Splunk 1.1 kB/s | 3.0 kB 00:02
Extra Packages for Enterprise Linux Modular 8 - x86_64 11 kB/s | 7.9 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 7.5 kB/s | 5.7 kB 00:00
Node.js Packages for Enterprise Linux 8 - x86_64 50 kB/s | 2.5 kB 00:00
Metadata cache created.
然后:
# dnf install cairo-devel
Last metadata expiration check: 0:00:28 ago on Sun 13 Aug 2023 05:24:52 PM +08.
Error:
Problem: cannot install the best candidate for the job
- nothing provides pkgconfig(gobject-2.0) needed by cairo-devel-1.15.12-3.el8.x86_64
- nothing provides pkgconfig(glib-2.0) >= 2.14 needed by cairo-devel-1.15.12-3.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
和...
# dnf install pango-devel
Last metadata expiration check: 0:01:35 ago on Sun 13 Aug 2023 05:24:52 PM +08.
Error:
Problem: cannot install the best candidate for the job
- nothing provides pkgconfig(glib-2.0) needed by pango-devel-1.42.4-8.el8.x86_64
- nothing provides pkgconfig(gobject-2.0) needed by pango-devel-1.42.4-8.el8.x86_64
- nothing provides glib2-devel(x86-64) >= 2.56.1 needed by pango-devel-1.42.4-8.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
使用--nobest
会给出更长的“未提供任何内容...”错误列表。我尝试先安装这两个pkgconfig
包,但找不到任何匹配的内容。
如何安装 pango-devel 和 cairo-devel?
(遗憾的是,操作系统固定在 Centos 8.1.1911,无法升级)
答案1
pango-devel 和 cairo-devel 都依赖于 glib2-devel,而后者又依赖于 glib2。
glib2-devel 和 glib2 的版本必须匹配,但 Centos 8.1.1911“vault”repo 没有正确版本的软件包。
因此我找到了一个与已安装的 glib2 包版本匹配的 glib2-devel:
dnf install https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/glib2-devel-2.56.4-7.el8.x86_64.rpm
dnf install cairo-devel
dnf install https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/glib2-devel-2.56.4-7.el8.x86_64.rpm