nexus创建内网apt yum epel

服务端配置

安装jdk1.8.0_161

tail -10 /etc/profile
JAVA_HOME=/usr/local/java/jdk1.8.0_161
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH

useradd nexus,用于安装启动nexus-3.26.1-02-unix.tar.gz

cd /home/nexus/nexus-3.26.1-02/bin && ./nexus start
./nexus status
nexus is running.

访问 http://ip:8081,admin初始密码在/home/nexus/sonatype-work/nexus3
创建仓库:选择相应apt、yum等类型,host为离线储存模式,proxy为在线代理模式,group为组模式,用于整合仓库资源
在这里插入图片描述

创建yum源:
https://mirrors.tuna.tsinghua.edu.cn/centos/
创建apt源:
https://mirrors.tuna.tsinghua.edu.cn/ubuntu/
#bionic,focal抓取ubuntu18.04、ubuntu20.04
创建epel源:
http://mirrors.aliyun.com/epel
创建centos6 yum源:
http://mirrors.aliyun.com/centos-vault/6.10

客户端配置

yum源-7

cat /etc/yum.repos.d/CentOS-Base.repo

[base]
name=base
baseurl=http://ip:8081/repository/tsinghua-yum/$releasever/os/$basearch/
enabled=1
gpgcheck=0

[updates]
name=updates
baseurl=http://ip:8081/repository/tsinghua-yum/$releasever/updates/$basearch/
enabled=1
gpgcheck=0

[extras]
name=extras
baseurl=http://ip:8081/repository/tsinghua-yum/$releasever/extras/$basearch/
enabled=1
gpgcheck=0

[plus]
name=plus
baseurl=http://ip:8081/repository/tsinghua-yum/$releasever/centosplus/$basearch/
enabled=1
gpgcheck=0

apt源

cat /etc/apt/sources.list

deb http://ip:8081/repository/tsinghua-ubuntu/ bionic main restricted universe multiverse
deb http://ip:8081/repository/tsinghua-ubuntu/ bionic-updates main restricted universe multiverse
deb http://ip:8081/repository/tsinghua-ubuntu/ bionic-backports main restricted universe multiverse
deb http://ip:8081/repository/tsinghua-ubuntu/ bionic-security main restricted universe multiverse

epel源

cat /etc/yum.repos.d/CentOS-Base.repo

[epel]
name=epel
baseurl=http://ip:8081/repository/ali-epel/7/$basearch
enabled=1
gpgcheck=0

[epel-debuginfo]
name=epel-debuginfo
baseurl=http://ip:8081/repository/ali-epel/7/$basearch/debug
enabled=0
gpgcheck=0

[epel-source]
name=epel-source
baseurl=http://ip:8081/repository/ali-epel/7/SRPMS
enabled=0
gpgcheck=0

yum源-6

cat /etc/yum.repos.d/CentOS-Base.repo

[base]
name=Base
failovermethod=priority
baseurl=http://172.29.8.103:8081/repository/vault-yum/os/$basearch/
gpgcheck=0

[updates]
name=Updates
failovermethod=priority
baseurl=http://172.29.8.103:8081/repository/vault-yum/updates/$basearch/
gpgcheck=0
 
 
[extras]
name=Extras
failovermethod=priority
baseurl=http://172.29.8.103:8081/repository/vault-yum/extras/$basearch/
gpgcheck=0

[centosplus]
name=Plus
failovermethod=priority
baseurl=http://172.29.8.103:8081/repository/vault-yum/centosplus/$basearch/
gpgcheck=0
enabled=0
  
[contrib]
name= Contrib
failovermethod=priority
baseurl=http://172.29.8.103:8081/repository/vault-yum/contrib/$basearch/
gpgcheck=0
enabled=0

开机自启动

vi /etc/rc.d/init.d/nexusstart.sh

#!/bin/bash
#chkconfig: 2345 90 10
#description: auto start nexus when system on
su - nexus -c "sh /home/nexus/nexus-3.26.1-02/bin/nexus start"

chkconfig --add nexusstart.sh
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值