自建Yum源并与科大开源镜像站进行同步
生活随笔
收集整理的這篇文章主要介紹了
自建Yum源并与科大开源镜像站进行同步
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
安裝Nginx
yum?-y?install?nginx新增yum.conf配置文件
啟動nginx
systemctl?start?nginx systemctl?enable?nginx創建目錄
注:如果需要其它系統還需要創建對應的其它目錄
同步鏡像
#!/bin/bash # #?此腳本用于同步"http://mirrors.ustc.edu.cn"的鏡像到本地? #?如果還需要其它系統那么直接往后面加上去 # rsync?-avrt?rsync://rsync.mirrors.ustc.edu.cn/epel/7/x86_64/??/usr/share/nginx/yum/epel/7/x86_64?&&?\ rsync?-avrt?rsync://rsync.mirrors.ustc.edu.cn/centos/7/extras/x86_64/??/usr/share/nginx/yum/centos/7/extras/x86_64?&&?\ rsync?-avrt?rsync://rsync.mirrors.ustc.edu.cn/centos/7/updates/x86_64/??/usr/share/nginx/yum/centos/7/updates/x86_64?&&?\ rsync?-avrt?rsync://rsync.mirrors.ustc.edu.cn/centos/7/os/x86_64/??/usr/share/nginx/yum/centos/7/os/x86_64?&&?\ rsync?-avrt?rsync://rsync.mirrors.ustc.edu.cn/epel/6/x86_64/??/usr/share/nginx/yum/epel/6/x86_64?&&?\ rsync?-avrt?rsync://rsync.mirrors.ustc.edu.cn/centos/6/extras/x86_64/??/usr/share/nginx/yum/centos/6/extras/x86_64?&&?\ rsync?-avrt?rsync://rsync.mirrors.ustc.edu.cn/centos/6/updates/x86_64/??/usr/share/nginx/yum/centos/6/updates/x86_64?&&?\ rsync?-avrt?rsync://rsync.mirrors.ustc.edu.cn/centos/6/os/x86_64/??/usr/share/nginx/yum/centos/6/os/x86_64加入計劃任務
CentOS7的repo文件
CentOS-Base.repo
#?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 baseurl=http://yum.gogen.cn/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#released?updates [updates] name=CentOS-$releasever?-?Updates baseurl=http://yum.gogen.cn/centos/$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 baseurl=http://yum.gogen.cn/centos/$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 baseurl=http://yum.gogen.cn/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7epel.repo
[epel] name=Extra?Packages?for?Enterprise?Linux?7?-?$basearch baseurl=http://yum.gogen.cn/epel/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://yum.gogen.cn/epel/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://yum.gogen.cn/epel/7/SRPMS failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=1CentOS6的repo文件
CentOS-Base.repo
#?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?-?yum.gogen.cn baseurl=http://yum.gogen.cn/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://yum.gogen.cn/centos/RPM-GPG-KEY-CentOS-6#released?updates [updates] name=CentOS-$releasever?-?Updates?-?yum.gogen.cn baseurl=http://yum.gogen.cn/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://yum.gogen.cn/centos/RPM-GPG-KEY-CentOS-6#additional?packages?that?may?be?useful [extras] name=CentOS-$releasever?-?Extras?-?yum.gogen.cn baseurl=http://yum.gogen.cn/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://yum.gogen.cn/centos/RPM-GPG-KEY-CentOS-6#additional?packages?that?extend?functionality?of?existing?packages [centosplus] name=CentOS-$releasever?-?Plus?-?yum.gogen.cn baseurl=http://yum.gogen.cn/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://yum.gogen.cn/centos/RPM-GPG-KEY-CentOS-6#contrib?-?packages?by?Centos?Users [contrib] name=CentOS-$releasever?-?Contrib?-?yum.gogen.cn baseurl=http://yum.gogen.cn/centos/$releasever/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://yum.gogen.cn/centos/RPM-GPG-KEY-CentOS-6epel.repo
[epel] name=Extra?Packages?for?Enterprise?Linux?6?-?$basearch baseurl=http://yum.gogen.cn/epel/6/$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6[epel-debuginfo] name=Extra?Packages?for?Enterprise?Linux?6?-?$basearch?-?Debug baseurl=http://yum.gogen.cn/epel/6/$basearch/debug failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=1[epel-source] name=Extra?Packages?for?Enterprise?Linux?6?-?$basearch?-?Source baseurl=http://yum.gogen.cn/epel/6/SRPMS failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=1轉載于:https://blog.51cto.com/270142877/2097066
總結
以上是生活随笔為你收集整理的自建Yum源并与科大开源镜像站进行同步的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 北京快运停运(2021北京快运停运)
- 下一篇: 相濡以沫的意思(相濡以沫的出处)