更新时间:2022-04-07 GMT+08:00
分享

建立CentOS 8.1 AppStream&PowerTools本地源

AppStream/PowerTools源,ARM上名字形如*module_el8.0.0+*的软件无法直接通过yum安装,需要手动下载到本地建立local repo。

  1. 创建本地源目录。

    1
    2
    3
    4
    5
    6
    mkdir -p /opt/ovirt/centos/8.1.1911/
    cd /opt/ovirt/centos/8.1.1911/
    mkdir -p AppStream/kickstart/
    mkdir -p AppStream/os/
    mkdir -p PowerTools/kickstart/
    mkdir -p PowerTools/os/
    

  2. 创建CentOS 8.1 AppStream OS本地源。

    1
    2
    3
    4
    5
    6
    cd /opt/ovirt/centos/8.1.1911/AppStream/os/
    wget http://mirrors.huaweicloud.com/centos-vault/8.1.1911/AppStream/aarch64/os/Packages/
    cat index.html | grep href | awk -F"\"" '{print $4}' | grep module_el8 | xargs -I {} wget http://mirrors.huaweicloud.com/centos-vault/8.1.1911/AppStream/aarch64/os/Packages/{}
    createrepo_c .
    repo2module  -s stable -d . modules.yaml
    modifyrepo_c --mdtype=modules modules.yaml repodata/
    

  3. 创建CentOS 8.1 PowerTools OS本地源。

    1
    2
    3
    4
    5
    6
    cd /opt/ovirt/centos/8.1.1911/PowerTools/os/
    wget http://mirrors.huaweicloud.com/centos-vault/8.1.1911/PowerTools/aarch64/os/Packages/
    cat index.html | grep href | awk -F"\"" '{print $4}' | grep module_el8 | xargs -I {} wget http://mirrors.huaweicloud.com/centos-vault/8.1.1911/PowerTools/aarch64/os/Packages/{}
    createrepo_c .
    repo2module  -s stable -d . modules.yaml
    modifyrepo_c --mdtype=modules modules.yaml repodata/
    

  4. 新建local repo文件。

    1
    touch /etc/yum.repos.d/CentOS-AppStream-PowerTools-local.repo
    

  5. 将以下配置写入“/etc/yum.repos.d/CentOS-AppStream-PowerTools-local.repo”文件。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    [Centos8-AppStream-local1]
    name=Centos8-AppStream-local1
    baseurl=file:///opt/ovirt/centos/8.1.1911/AppStream/os/
    enabled=1
    gpgcheck=0
    priority=2
    
    [Centos8-PowerTool-local1]
    name=Centos8-PowerTool-local1
    baseurl=file:///opt/ovirt/centos/8.1.1911/PowerTools/os/
    enabled=1
    gpgcheck=0
    priority=2
    

分享:

    相关文档

    相关产品

关闭导读