日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

转载 搭建镜像站

發(fā)布時間:2025/6/15 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 转载 搭建镜像站 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

搭建CentOS在線yum源鏡像服務(wù)器

說明:

操作系統(tǒng):CentOS 6.x

IP地址:192.168.21.188

實(shí)現(xiàn)目的:同步CentOS鏡像站點(diǎn)的內(nèi)容到此服務(wù)器,并且通過配置http服務(wù)器,能夠向外提供yum服務(wù)

準(zhǔn)備篇:

一、安裝http服務(wù)器

這里使用Nginx服務(wù)器提供http服務(wù)

關(guān)于Nginx服務(wù)器搭建,參考:CentOS安裝配置LNMP服務(wù)器(Nginx+PHP+MySQL)

http://www.osyunwei.com/archives/5910.html

二、系統(tǒng)約定

Nginx站點(diǎn)根目錄:/usr/local/nginx/html

服務(wù)器執(zhí)行腳本文件存放目錄:/home/crontab

三、開始Nginx目錄瀏覽功能

vi /usr/local/nginx/conf/nginx.conf #編輯配置文件,在http {下面添加以下內(nèi)容:

autoindex on; #開啟nginx目錄瀏覽功能

autoindex_exact_size off; #文件大小從KB開始顯示

autoindex_localtime on; #顯示文件修改時間為服務(wù)器本地時間

:wq! #保存,退出

service nginx reload #重新加載配置

參考:Nginx開啟目錄瀏覽功能

http://www.osyunwei.com/archives/5051.html

系統(tǒng)運(yùn)維 ?www.osyunwei.com ?溫馨提醒:qihang01原創(chuàng)內(nèi)容版權(quán)所有,轉(zhuǎn)載請注明出處及原文鏈

安裝篇:

一、創(chuàng)建鏡像文件存放目錄

mkdir -p /usr/local/nginx/html/centos #CentOS官方標(biāo)準(zhǔn)源

mkdir -p /usr/local/nginx/html/repoforge #第三方rpmforge源

mkdir -p /usr/local/nginx/html/epel #第三方epel源

說明:這里創(chuàng)建三個文件夾,分別存放CentOS官方標(biāo)準(zhǔn)源、第三方的rpmforge源和epel

二、確定以上三個yum源上游源的同步鏡像地址

1、CentOS官方標(biāo)準(zhǔn)源:rsync://mirrors.ustc.edu.cn/centos/

2、rpmforge源:rsync://mirrors.ispros.com.bd/repoforge/

3、epel源:rsync://mirrors.ustc.edu.cn/epel/

備注:上游yum源必須要支持rsync協(xié)議,否則不能使用rsync進(jìn)行同步。

參考:

CentOS官方標(biāo)準(zhǔn)源:

rsync://mirrors.kernel.org/centos

rpmforge源:

http://apt.sw.be/

rsync://ftp-stud.fht-esslingen.de/dag

epel源:

http://mirrors.fedoraproject.org/publiclist/EPEL/

rsync://mirrors.kernel.org/fedora-epel

三、創(chuàng)建以上三個yum源同步腳本,并且設(shè)定腳本自動執(zhí)行

mkdir -p /home/crontab #創(chuàng)建目錄

vi /home/crontab/yum_rsync.sh #添加以下代碼

#!/bin/sh

/usr/bin/rsync -avrt rsync://mirrors.ustc.edu.cn/centos/ --exclude-from=/usr/local/nginx/html/exclude_centos.list /usr/local/nginx/html/centos/

/usr/bin/rsync -avrt rsync://mirrors.ispros.com.bd/repoforge/ --exclude-from=/usr/local/nginx/html/exclude_repoforge.list /usr/local/nginx/html/repoforge/

/usr/bin/rsync -avrt rsync://mirrors.ustc.edu.cn/epel/ --exclude-from=/usr/local/nginx/html/exclude_epel.list /usr/local/nginx/html/epel/

:wq! #保存退出

chmod +x /home/crontab/yum_rsync.sh #添加腳本執(zhí)行權(quán)限

備注:運(yùn)行此腳本前,先要創(chuàng)建好同步目錄及不需要同步的目錄列表文件

cd /usr/local/nginx/html/ ? #進(jìn)入目錄

touch exclude_centos.list ? #創(chuàng)建文件

touch exclude_repoforge.list ??#創(chuàng)建文件

touch exclude_epel.list ??#創(chuàng)建文件

把不需要同步的目錄寫到上面對應(yīng)的文件中,每行一個目錄

例如:

vi exclude_epel.list

4/

4AS/

4ES/

4WS/

:wq! #保存退出

四、添加腳本定時執(zhí)行任務(wù)

vi /etc/crontab ?#在最后一行添加以下代碼

0 1 * * * root /home/crontab/yum_rsync.sh #設(shè)置每天凌晨1點(diǎn)整開始執(zhí)行腳本

:wq! #保存退出

service crond restart #重啟

測試篇:

一、安裝rsync同步軟件

yum install rsync xinetd #安裝

vi /etc/xinetd.d/rsync #編輯配置文件,設(shè)置開機(jī)啟動rsync

disable = no #修改為

/etc/init.d/xinetd start #啟動(CentOS中是以xinetd 來管理Rsync服務(wù)的)

:wq! #保存退出

二、執(zhí)行同步腳本

sh /home/crontab/yum_rsync.sh

注意:等待腳本執(zhí)行完畢,首次同步,耗費(fèi)的時間比較長!

三、根據(jù)不同版本創(chuàng)建三個yum源的repo配置文件

cd /etc/yum.repos.d/ #進(jìn)入目錄

mv /etc/yum.repos.d/CentOS-Base.repo CentOS-Base.repo-bak

1、CentOS官方標(biāo)準(zhǔn)源:

CentOS 5.x系列:

vi /etc/yum.repos.d/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 - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5

#released updates

[updates]

name=CentOS-$releasever - Updates - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released

[addons]

name=CentOS-$releasever - Addons - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/addons/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5

:wq! #保存退出

#########################

CentOS 6.x系列:

vi /etc/yum.repos.d/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 - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

#released updates

[updates]

name=CentOS-$releasever - Updates - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

:wq! #保存退出

#########################

CentOS 7.x系列:

vi /etc/yum.repos.d/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

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7

#released updates

[updates]

name=CentOS-$releasever - Updates

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7

:wq! #保存退出

#########################

或者參考:https://lug.ustc.edu.cn/wiki/mirrors/help/centos

把里面的http://mirrors.ustc.edu.cn/替換為http://192.168.21.188/

2、rpmforge源:

CentOS 5.x系列:

vi /etc/yum.repos.d/rpmforge.repo #添加以下代碼

[rpmforge]

name = RHEL $releasever - RPMforge.net - dag

baseurl = http://192.168.21.188/repoforge/redhat/el5/en/$basearch/rpmforge

enabled = 1

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

[rpmforge-extras]

name = RHEL $releasever - RPMforge.net - extras

baseurl = http://192.168.21.188/repoforge/redhat/el5/en/$basearch/extras

enabled = 0

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

[rpmforge-testing]

name = RHEL $releasever - RPMforge.net - testing

baseurl = http://192.168.21.188/repoforge/redhat/el5/en/$basearch/testing

enabled = 0

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

:wq! #保存退出

#########################

系統(tǒng)運(yùn)維 ?www.osyunwei.com ?溫馨提醒:qihang01原創(chuàng)內(nèi)容版權(quán)所有,轉(zhuǎn)載請注明出處及原文鏈

CentOS 6.x系列:

vi /etc/yum.repos.d/rpmforge.repo #添加以下代碼

[rpmforge]

name = RHEL $releasever - RPMforge.net - dag

baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/rpmforge

enabled = 1

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

[rpmforge-extras]

name = RHEL $releasever - RPMforge.net - extras

baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/extras

enabled = 0

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

[rpmforge-testing]

name = RHEL $releasever - RPMforge.net - testing

baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/testing

enabled = 0

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

:wq! #保存退出

#########################

CentOS 7.x系列:

vi /etc/yum.repos.d/rpmforge.repo #添加以下代碼

[rpmforge]

name = RHEL $releasever - RPMforge.net - dag

baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/rpmforge

enabled = 1

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

[rpmforge-extras]

name = RHEL $releasever - RPMforge.net - extras

baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/extras

enabled = 0

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

[rpmforge-testing]

name = RHEL $releasever - RPMforge.net - testing

baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/testing

enabled = 0

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

:wq! #保存退出

#########################

3、epel源:

CentOS 5.x系列:

vi /etc/yum.repos.d/epel.repo #添加以下代碼

[epel]

name=Extra Packages for Enterprise Linux 5 - $basearch

baseurl=http://192.168.21.188/epel/5/$basearch

failovermethod=priority

enabled=1

gpgcheck=1

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-5

[epel-debuginfo]

name=Extra Packages for Enterprise Linux 5 - $basearch - Debug

baseurl=http://192.168.21.188/epel/5/$basearch/debug

failovermethod=priority

enabled=0

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-5

gpgcheck=1

[epel-source]

name=Extra Packages for Enterprise Linux 5 - $basearch - Source

baseurl=http://192.168.21.188/epel/5/SRPMS

failovermethod=priority

enabled=0

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-5

gpgcheck=1

:wq! #保存退出

#########################

CentOS 6.x系列:

vi /etc/yum.repos.d/epel.repo #添加以下代碼

[epel]

name=Extra Packages for Enterprise Linux 6 - $basearch

baseurl=http://192.168.21.188/epel/6/$basearch

failovermethod=priority

enabled=1

gpgcheck=1

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]

name=Extra Packages for Enterprise Linux 6 - $basearch - Debug

baseurl=http://192.168.21.188/epel/6/$basearch/debug

failovermethod=priority

enabled=0

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6

gpgcheck=1

[epel-source]

name=Extra Packages for Enterprise Linux 6 - $basearch - Source

baseurl=http://192.168.21.188/epel/6/SRPMS

failovermethod=priority

enabled=0

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6

gpgcheck=1

:wq! #保存退出

#########################

CentOS 7.x系列:

vi /etc/yum.repos.d/epel.repo #添加以下代碼

[epel]

name=Extra Packages for Enterprise Linux 7 - $basearch

baseurl=http://192.168.21.188/epel/beta/7/$basearch

failovermethod=priority

enabled=1

gpgcheck=1

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]

name=Extra Packages for Enterprise Linux 7 - $basearch - Debug

baseurl=http://192.168.21.188/epel/beta/7/$basearch/debug

failovermethod=priority

enabled=0

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7

gpgcheck=1

[epel-source]

name=Extra Packages for Enterprise Linux 7 - $basearch - Source

baseurl=http://192.168.21.188/epel/beta/7/SRPMS

failovermethod=priority

enabled=0

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7

gpgcheck=1

:wq! #保存退出

#########################

四、測試yum源是否配置正確

1、當(dāng)前系統(tǒng)版本為CentOS 6.x,以此為例

cd /etc/yum.repos.d/

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

vi 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 - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

#released updates

[updates]

name=CentOS-$releasever - Updates - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib - huanqiu.com

baseurl=http://192.168.21.188/centos/$releasever/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6

:wq! #保存退出

#########################

vi rpmforge.repo #添加以下代碼

[rpmforge]

name = RHEL $releasever - RPMforge.net - dag

baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/rpmforge

enabled = 1

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

[rpmforge-extras]

name = RHEL $releasever - RPMforge.net - extras

baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/extras

enabled = 0

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

[rpmforge-testing]

name = RHEL $releasever - RPMforge.net - testing

baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/testing

enabled = 0

protect = 0

gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge

gpgcheck = 1

:wq! #保存退出

#########################

vi epel.repo #添加以下代碼

[epel]

name=Extra Packages for Enterprise Linux 6 - $basearch

baseurl=http://192.168.21.188/epel/6/$basearch

failovermethod=priority

enabled=1

gpgcheck=1

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]

name=Extra Packages for Enterprise Linux 6 - $basearch - Debug

baseurl=http://192.168.21.188/epel/6/$basearch/debug

failovermethod=priority

enabled=0

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6

gpgcheck=1

[epel-source]

name=Extra Packages for Enterprise Linux 6 - $basearch - Source

baseurl=http://192.168.21.188/epel/6/SRPMS

failovermethod=priority

enabled=0

gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6

gpgcheck=1

:wq! #保存退出

#########################

系統(tǒng)運(yùn)維 ?www.osyunwei.com ?溫馨提醒:qihang01原創(chuàng)內(nèi)容版權(quán)所有,轉(zhuǎn)載請注明出處及原文鏈

yum clean all?#清除當(dāng)前yum緩存

yum makecache?#緩存yum源中的軟件包信息

yum repolist #列出yum源中可用的軟件包

2、使用yum命令安裝軟件

yum install php?#測試CentOS官方標(biāo)準(zhǔn)源

yum install htop?#測試rpmforge源

yum install nginx #測試epel源

至此,搭建CentOS在線yum源鏡像服務(wù)器完成!


原文地址:?http://www.osyunwei.com/archives/7918.html

轉(zhuǎn)載于:https://blog.51cto.com/anonxiaozi/1697560

總結(jié)

以上是生活随笔為你收集整理的转载 搭建镜像站的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。