nexus yum 私服集成

nexus 集成了 yum 私服使用起来还是比较简单的

配置 yum proxy

实际使用我们可能需要配置centos 以及epel 的源

centos可以用http://mirror.centos.org/centos/
epel 用http://mirrors.aliyun.com/epel/

配置yum repo

nexus.repo /etc/yum.repos.d/
参考

[nexusrepo]
name=Nexus Repository
baseurl=http://hostip:8081/repository/yum-proxy/$releasever/os/$basearch/
enabled=1
gpgcheck=0
priority=1

nexus-epel.repo /etc/yum.repos.d/
参考

[nexus-epel-debuginfo]
name = Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl = http://hostip:8081/repository/aliyun-epel/7/$basearch/debug
failovermethod = priority
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck = 0
[nexus-epel-source]
name = Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl = http://hostip:8081/repository/aliyun-epel/7/SRPMS
failovermethod = priority
enabled = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck = 0
[nexus-epel]
baseurl = http://hostip:8081/repository/aliyun-epel/7/$basearch
failovermethod = priority
gpgcheck = 0
name = EPEL YUM repo

测试效果

yum install -y php


参考资料

https://help.sonatype.com/repomanager3/yum-repositories

原文地址:https://www.cnblogs.com/rongfengliang/p/9100055.html