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
    • 最新
    • 标签
主页 / unix / 问题 / 705910
Accepted
Marcus Müller
Marcus Müller
Asked: 2022-06-13 06:58:05 +0800 CST2022-06-13 06:58:05 +0800 CST 2022-06-13 06:58:05 +0800 CST

我需要一个适用于我的 RHEL/EPEL/CentOS/Fedora 版本的软件包,但它仅适用于其他版本的 Redhatoids

  • 772

我经常遇到这样的情况:我将一些 Fedora 打包的软件反向移植到 CentOS,或者将一些旧版本的 EPEL 向前移植到 Fedora,反之亦然。

我怎样才能以最少的努力做到这一点?

centos fedora
  • 1 1 个回答
  • 64 Views

1 个回答

  • Voted
  1. Best Answer
    Marcus Müller
    2022-06-13T06:58:05+08:002022-06-13T06:58:05+08:00

    本质上,这就是 distgit 的用途:保持包规范的协调和可用。所以,让我们使用它。

    我们需要设置我们的系统以便能够构建包:

    # only on CentOS and other RHEL derivatives:
    sudo dnf install 'dnf-command(config-manager)'
    sudo dnf config-manager --set-enabled powertools
    sudo dnf install --refresh epel-release 
    # all:
    sudo dnf install --refresh fedpkg 'dnf-command(builddep)' git
    

    首先,在https://src.fedoraproject.org/browse/projects/上找到你的包。我用guile22一个例子:

    太好了,此时我们拥有构建软件包所需的一切!让我们转到我们通过搜索找到的guile22distgit 站点,然后单击“克隆”按钮;我们会看到 URL https://src.fedoraproject.org/rpms/guile22.git。

    pkgname=guile22
    # clone the distgit
    git clone "https://src.fedoraproject.org/rpms/${pkgname}.git"
    cd "${pkgname}"
    
    ## Ask dnf to install build dependencies
    ### if this fails, read diligently – packages might have changed names and you might
    ### need to slightly edit the .spec file, or you might need to build the missing 
    ### dependencies yourself, just like you're building this package, before you can
    ### continue.
    sudo dnf builddep "${pkgname}.spec"
    
    ## build
    ### `fedpkg local` executes the build "unisolatedly" on this very distro.
    ### Instead of that, you could also omit the `dnf builddep` step above and do a
    ### `fedpkg mockbuild`. This will take a bit longer, as it needs to set up a clean
    ### build chroot. Often it's worth it.
    fedpkg local
    ## install
    ### `fedpkg local` put the RPMs into $arch subdirs, so on my machine those are `x86_64`
    ### and `noarch`, but if you build for e.g. ppc64, that might be different.
    sudo rpm -i x86_64/${pkgname}-*.rpm
    

    就是这样!

    • 1

相关问题

  • systemctl 命令在 RHEL 6 中不起作用

  • 为什么我的交换机没有从指定的池中获取地址

  • 在 CentOS7 GNOME 的 Applications-menu 选项卡中创建自定义菜单

  • 如何正确分区 SSD 以进行双启动设置

  • 奇怪的路由器与centos 6一起工作[关闭]

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve