Good,True and Beautiful

Good Good Study, Day Day Up

导航

Rocky9.1 编译 skopeo

Skopeo

这是一个开源的容器镜像同步工具,地址在:https://github.com/containers/skopeo

本博客通过记录安装过程,提供初始报错的解决过程。因为没有开源编译好的二进制,需要自己下载源码编译。

编译使用的环境是Rocky 9.1在一台Intel x86_64架构的服务器上, 已提前安装好Golang版本1.22

  • 下载最新的relase源码
    wget https://github.com/containers/skopeo/archive/refs/tags/v1.18.0.tar.gz

  • 解压,得到Makefile文件
    通过查看Makefile,使用bin/skopeo即可,得到一个编译的二进制

  • 编译
    make bin/skopeo

  • 报错

go build github.com/proglottis/gpgme:
# pkg-config --cflags  -- gpgme
Package gpgme was not found in the pkg-config search path.
Perhaps you should add the directory containing `gpgme.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gpgme' found
  • 解决

通过 rpm -qa | grep gpgme 查看,已安装 gpgme包, 但没有gpgme-devel

通过yum install gpgme-devel,失败,默认仓库里没有该软件包

搜索发现: https://mirror.stream.centos.org/9-stream/CRB/x86_64/os/Packages/,这里有https://mirror.stream.centos.org/9-stream/CRB/x86_64/os/Packages/gpgme-devel-1.15.1-6.el9.x86_64.rpm

详细对比小版本号, 下载好 rpm -i 安装,结果报错, 需要依赖

warning: gpgme-devel-1.15.1-6.el9.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
error: Failed dependencies:
        libgpg-error-devel(x86-64) >= 1.36 is needed by gpgme-devel-1.15.1-6.el9.x86_64
        pkgconfig(glib-2.0) is needed by gpgme-devel-1.15.1-6.el9.x86_64
        pkgconfig(gpg-error) is needed by gpgme-devel-1.15.1-6.el9.x86_64
        pkgconfig(libassuan) is needed by gpgme-devel-1.15.1-6.el9.x86_64

首先是libgpg-error-devel问题,通过yum install libgpg-error-devel解决

其次是glib-2.0 问题,通过yum install glib2-devel解决

最后是libassuan问题,默认仓库没有,继续在上面一个网站找到对应的https://mirror.stream.centos.org/9-stream/CRB/x86_64/os/Packages/libassuan-devel-2.5.5-3.el9.x86_64.rpm

通过rpm -i 安装后,顺利安装 gpgme-devel, 再次编译,编译通过。

posted on 2025-04-29 15:23  Simple Love  阅读(49)  评论(0)    收藏  举报