CentOS6 配置网络yum源
ELRepo(http://elrepo.org/tiki/tiki-index.php)
el kernel源
CentOS7 http://elrepo.org/linux/kernel/el7/x86_64/
CentOS6 http://elrepo.org/linux/kernel/el6/x86_64/ 提示:docker overlay网络需要升级kernel
curl -sSL
epel
http://mirrors.ustc.edu.cn/fedora/epel
到http://mirrors.sohu.com/fedora-epel/6/x86_64/repoview/epel-release.html下载最新的repo包,例如:
wget
rpm -ivh epel-release-6-8.noarch.rpm
或
sohu
rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
会自动在/etc/yum.repos.d/目录下生成repo文件
http://repoforge.org/faq/
ftp://ftp.riken.jp/pub/Linux/repoforge/redhat/
ftp://ftp.riken.jp/pub/Linux/rpmfusion
repoforge就是原来的rpmforge,到http://pkgs.repoforge.org/rpmforge-release/下载最新对应版本的repo包,例如:
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
或
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
会自动在/etc/yum.repos.d/目录下生成repo文件
aliyun
repoforgehttp://repoforge.org/faq/
ftp://ftp.riken.jp/pub/Linux/repoforge/redhat/
ftp://ftp.riken.jp/pub/Linux/rpmfusion
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
或
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
网络比较慢话可以尝试如下,
rpmfusion
到http://download1.rpmfusion.org/nonfree/el/updates/6/x86_64/下载最新对应版本的repo包,例如:下载最新对应版本的repo包,例如:
wget
http://download1.rpmfusion.org/free/el/updates/6/x86_64/rpmfusion-free-release-6-1.noarch.rpm
wget
http://download1.rpmfusion.org/nonfree/el/updates/6/x86_64/rpmfusion-nonfree-release-6-1.noarch.rpm
rpm -ivh *.rpm
remi
到http://rpms.famillecollet.com/enterprise/下载最新对应版本的repo包,例如:下载最新对应版本的repo包,例如:
wget
http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -ivh
http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
atomic
wget -q -O - http://www.atomicorp.com/installers/atomic | sh
percona
http://www.percona.com/downloads/percona-release/
nginx
方法一:
到http://nginx.org/en/download.html下载对应版本的repo包,例如:
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
或
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
会自动在/etc/yum.repos.d/目录下生成repo文件
方法二:
Create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “5” or “6”, for 5.x or 6.x versions, respectively.
fcitx
wget http://download.opensuse.org/repositories/home:/cathay4t:/misc-rhel6/CentOS_CentOS-6/home:cathay4t:misc-rhel6.repo -O fcitx.repo
提示:
可以通过createrepo制作本地repo
键入命令:
yum -y install createrepo
root@jun-live:6#createrepo x86_64/
Spawning worker 0 with 87 pkgs
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
还可以通过yumdownloader来仅下载rpm包
rpm -ivh http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
会自动在/etc/yum.repos.d/目录下生成repo文件
rpmfusion
到http://download1.rpmfusion.org/nonfree/el/updates/6/x86_64/下载最新对应版本的repo包,例如:下载最新对应版本的repo包,例如:
wget
wget
rpm -ivh *.rpm
remi
到http://rpms.famillecollet.com/enterprise/下载最新对应版本的repo包,例如:下载最新对应版本的repo包,例如:
wget
rpm
atomic
wget -q -O - http://www.atomicorp.com/installers/atomic | sh
percona
http://www.percona.com/downloads/percona-release/
nginx
方法一:
到http://nginx.org/en/download.html下载对应版本的repo包,例如:
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
或
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
会自动在/etc/yum.repos.d/目录下生成repo文件
方法二:
Create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “5” or “6”, for 5.x or 6.x versions, respectively.
fcitx
wget http://download.opensuse.org/repositories/home:/cathay4t:/misc-rhel6/CentOS_CentOS-6/home:cathay4t:misc-rhel6.repo -O fcitx.repo
提示:
可以通过createrepo制作本地repo
键入命令:
yum -y install createrepo
root@jun-live:6#createrepo x86_64/
Spawning worker 0 with 87 pkgs
Workers Finished
Gathering worker results
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
还可以通过yumdownloader来仅下载rpm包
yum -y install yum-utils
yumdownloader --downloadonly --downloaddir=. curl
或
yum -y (re)install curl --downloadonly
--downloaddir=.
附:epel & repoforge同步脚本
#####################################
#!/bin/bash
#To rsync yum extra repos to local
#Mady by liujun,liujun_live@msn.com
#####################################
#------CentOS 7---------
############
#EPEL源
############
#定义相关变量
epel_local_path="/mnt/foo/epel"
epel_log_file="/var/log/epel_rsync_$(date +%Y%m%d).log"
epel_mirror_url7="rsync://mirrors.ustc.edu.cn/fedora/epel/7"
epel_mirror_url6="rsync://mirrors.ustc.edu.cn/fedora/epel/6"
#执行同步
echo -e "----$(date) \e[31;1mrsync epel\e[0m ----"|tee $epel_log_file
rsync -avrt --delete --exclude=SRPMS/ --exclude=ppc64/ $epel_mirror_url7 $epel_local_path|tee $epel_log_file
rsync -avrt --delete --exclude=SRPMS/ --exclude=ppc64/ $epel_mirror_url6 $epel_local_path|tee $epel_log_file
echo -e "----$(date) \e[32;1mFinish\e[0m ----"|tee $epel_log_file
echo ""
############
#repoforge源
############
#定义相关变量
repoforge_local_path="/mnt/foo/repoforge"
repoforge_log_file="/var/log/repoforge_rsync_$(date +%Y%m%d).log"
#repoforge_mirror_url="rsync://apt.sw.be/redhat/el7/en/x86_64/rpmforge"
repoforge_mirror_url="rsync://ftp.riken.jp/repoforge/*"
#执行同步
echo -e "----$(date) \e[31;1mrsync repoforge\e[0m ----"|tee $repoforge_log_file
#rsync -avrt --delete --exclude=el4/ --exclude=el3/ --exclude=el2.1/ $repoforge_mirror_url $repoforge_local_path|tee $repoforge_log_file
echo -e "----$(date) \e[32;1mFinish\e[0m ----"|tee $repoforge_log_file
#------CentOS 7---------
附:epel & repoforge同步脚本
#####################################
#!/bin/bash
#To rsync yum extra repos to local
#Mady by liujun,liujun_live@msn.com
#####################################
#------CentOS 7---------
############
#EPEL源
############
#定义相关变量
epel_local_path="/mnt/foo/epel"
epel_log_file="/var/log/epel_rsync_$(date +%Y%m%d).log"
epel_mirror_url7="rsync://mirrors.ustc.edu.cn/fedora/epel/7"
epel_mirror_url6="rsync://mirrors.ustc.edu.cn/fedora/epel/6"
#执行同步
echo -e "----$(date) \e[31;1mrsync epel\e[0m ----"|tee $epel_log_file
rsync -avrt --delete --exclude=SRPMS/ --exclude=ppc64/ $epel_mirror_url7 $epel_local_path|tee $epel_log_file
rsync -avrt --delete --exclude=SRPMS/ --exclude=ppc64/ $epel_mirror_url6 $epel_local_path|tee $epel_log_file
echo -e "----$(date) \e[32;1mFinish\e[0m ----"|tee $epel_log_file
echo ""
############
#repoforge源
############
#定义相关变量
repoforge_local_path="/mnt/foo/repoforge"
repoforge_log_file="/var/log/repoforge_rsync_$(date +%Y%m%d).log"
#repoforge_mirror_url="rsync://apt.sw.be/redhat/el7/en/x86_64/rpmforge"
repoforge_mirror_url="rsync://ftp.riken.jp/repoforge/*"
#执行同步
echo -e "----$(date) \e[31;1mrsync repoforge\e[0m ----"|tee $repoforge_log_file
#rsync -avrt --delete --exclude=el4/ --exclude=el3/ --exclude=el2.1/ $repoforge_mirror_url $repoforge_local_path|tee $repoforge_log_file
echo -e "----$(date) \e[32;1mFinish\e[0m ----"|tee $repoforge_log_file
#------CentOS 7---------