当前位置:   article > 正文

内网Nexus代理yum、epel 源私有仓库 + 内网设备配置(centos)_nexus yum 代理

nexus yum 代理

一、准备

一些常用的镜像开源站
yum:
阿里开源镜像源:http://mirrors.aliyun.com/centos
网易开源镜像站:http://mirrors.163.com/
Centos社区镜像站:http://mirror.centos.org/centos/
中科大开源镜像站:http://centos.ustc.edu.cn/
清华开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn/
epel
阿里开源镜像源:http://mirrors.aliyun.com/epel
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

二、nexus 先创建一个Blob Stores.
在这里插入图片描述
三、创建Repositories

  1. 创建yum(proxy) 配置yum-ali-proxy
    点击设置 - -> Repositories – > Create repository --> yum(proxy)进入到以下界面。
    配置阿里 :http://mirrors.aliyun.com/centos
    在这里插入图片描述
  2. 创建yum(hosts)配置yum-host
    点击设置 - -> Repositories – > Create repository --> yum(hosted)进入到以下界面。
    是否允许 updates 根据情况选择 Allow redeploy
    在这里插入图片描述
  3. 创建yum(proxy) 配置epel-ali-proxy
    点击设置 - -> Repositories – > Create repository --> yum(proxy)进入到以下界面。
    配置阿里 :http://mirrors.aliyun.com/epel
    在这里插入图片描述
  4. 创建yum(group)
    点击设置 - -> Repositories – > Create repository --> yum(group)进入到以下界面。
    将 yum-hosts、yum-ali-proxy epel-ali-proxy 代理都附加进来
    在这里插入图片描述
    6、创建成功
    在这里插入图片描述
    复制代理连接http://ip:端口/repository/yum-group/ 备用

四、目标机器上配置yum源
登录到机器
以下针对的是centos的操作系统
进入/etc/yum.repos.d/ 备份好*.repo的文件

cp CentOS-Base.repo CentOS-Base.repo.bak
vi CentOS-Base.repo
  • 1
  • 2

修改 CentOS-Base.repo 按照 http://mirrors.aliyun.com/repo/Centos-7.repo

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://ip:端口/repository/yum-group/$releasever/os/$basearch/
        http://ip:端口/repository/yum-group/$releasever/os/$basearch/
        http://ip:端口/repository/yum-group/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
 
#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://ip:端口/repository/yum-group/$releasever/updates/$basearch/
        http://ip:端口/repository/yum-group/$releasever/updates/$basearch/
        http://ip:端口/repository/yum-group/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://ip:端口/repository/yum-group/$releasever/extras/$basearch/
        http://ip:端口/repository/yum-group/$releasever/extras/$basearch/
        http://ip:端口/repository/yum-group/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://ip:端口/repository/yum-group/$releasever/centosplus/$basearch/
        http://ip:端口/repository/yum-group/$releasever/centosplus/$basearch/
        http://ip:端口/repository/yum-group/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://ip:端口/repository/yum-group/$releasever/contrib/$basearch/
        http://ip:端口/repository/yum-group/$releasever/contrib/$basearch/
        http://ip:端口/repository/yum-group/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50

进入/etc/yum.repos.d/ 备份好*.repo的文件

cp epel.repo epel.repo.bak
vi epel.repo
  • 1
  • 2

修改 epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://ip:端口/repository/yum-group/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://ip:端口/repository/yum-group/7/$basearch/debug
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://ip:端口/repository/yum-group/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

清理缓存
$ yum clean all
$ yum makecache

成功

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/168728
推荐阅读
相关标签
  

闽ICP备14008679号