服務上搭建本地倉庫【centos、ubuntu、kylin系統(中標麒麟、銀河麒麟)】

1、centos/mips64el(中標麒麟中redhat)上配置本地源

在/etc/yum.repos.d這個目錄下建立*.repo文件
格式:
建立centos.repo
[centos]
name=centos
baseurl=file:///home/casic/mirror/X86/CentOS6
enabled=1
gpgcheck=0

清理之前的源     yum clean all
加載本地源         yum makecache

建立mips64el.repo
[mips64el]
name=mips64el
baseurl=file:///home/casic/mirror/mips64el/NKLS7.0-LS64
enabled=1
gpgcheck=0

通過http建立apache2服務的源的配置見最後!!!!!!!!!

也可以ftp連接本地源
首先下載yum install vsftp
啓動 systemctl start vsftp服務
掛載 mount --bind /home/casic/源/centos /var/ftp/pub/centos源
頁面訪問:ftp://ip/pub/centos源


通過http建立apach2服務的源的配置見最後!!!!!!!!#

CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - huanqiu.com
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-CentOS-6
#released updates

[updates]
name=CentOS-$releasever - Updates - huanqiu.com
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful

[extras]
name=CentOS-$releasever - Extras - huanqiu.com
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages

[centosplus]
name=CentOS-$releasever - Plus - huanqiu.com
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users

[contrib]
name=CentOS-$releasever - Contrib - huanqiu.com
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-CentOS-6

[cloud]
name=CentOS-$releasever - cloud - huanqiu.com
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/$releasever/cloud/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-CentOS-6

[sclo]
name=CentOS-$releasever - sclo - huanqiu.com
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/$releasever/sclo/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-CentOS-6

[storage]
name=CentOS-$releasever - sclo - huanqiu.com
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/$releasever/storage/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-CentOS-6

[virt]
name=CentOS-$releasever - sclo - huanqiu.com
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/$releasever/virt/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-CentOS-6

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://10.11.200.66:18080/mirror/X86/CentOS6/epel/$releasever/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey =http://10.11.200.66:18080/mirror/X86/CentOS6/RPM-GPG-KEY-EPEL-6

 

2、ubuntu/debian/aarch64(銀河麒麟)上配置本地源   apt update


通過http來訪問本機源目錄
首先,下載apache2服務,apt install apache2
其次,啓動apache2服務,/etc/init.d/apache2 start  啓動Apache2服務
apache2服務默認的端口是80端口,可以自己修改,在/etc/apache2目錄下去修改 
將目錄建立軟連接到/var/www/html目錄下 直接通過http://ip:80(默認端口)/軟連接目錄 來訪問
配置在/etc/apt/source.list中添加

mips64el上的中標麒麟(debian)系統
deb     http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian stretch main contrib non-free
deb     http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb-src http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb     http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian stretch-backports main contrib non-free
deb-src http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian stretch-backports main contrib non-free
deb     http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian stretch-proposed-updates main contrib non-free
deb-src http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian stretch-proposed-updates main contrib non-free
deb     http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian Debian9.1 main contrib non-free
deb-src http://10.11.200.66:18080/mirror/mips64el/debain/mirror/mirrors.aliyun.com/debian Debian9.1 main contrib non-free

aarch64上的銀河麒麟(ubuntu)系統
deb     http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial main restricted universe multiverse
deb     http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-updates main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-updates main restricted universe multiverse
deb     http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-backports main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-backports main restricted universe multiverse
deb     http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-security main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-security main restricted universe multiverse
deb     http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-proposed main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/Arm/Ubuntu16.04/mirror/mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-proposed main restricted universe multiverse

x86上的ubuntu系統
deb     http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial main restricted universe multiverse
deb     http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial-updates main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial-updates main restricted universe multiverse
deb     http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial-backports main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial-backports main restricted universe multiverse
deb     http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial-security main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial-security main restricted universe multiverse
deb     http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial-proposed main restricted universe multiverse
deb-src http://10.11.200.66:18080/mirror/X86/ubuntu16.04-20180924/mirror/mirrors.aliyun.com/ubuntu xenial-proposed main restricted universe multiverse

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章