1. 配置合适的repositories.在/etc/yum.repos.d/目录下添加下列repository参数文件:
CentOS-Base.repo dag.repo dries.repo kbsingh-CentOS-Misc.repo
第一个对操作系统更新有用,这在前人的文章中都有详细的介绍,后面几个是yum使用手册上推荐的rpm网站,对安装非操作系统类的工具和软件有用,这是这篇贴子关注的内容.
2.每个文件的内容如下:
-------------------------------------------------CentOS-Base.repo: (国内镜像版)
# centos-related software undate from the vmmatrix repository
[base]
name=centos-4.3 - Base
baseurl=
enabled=1
gpgcheck=1
gpgkey=RPM-GPG-KEY-centos4
#released updates
[update]
name=centos-4.3 - Updates
baseurl=
enabled=1
gpgcheck=1
gpgkey=
[addons]
name=centos-4.3 - Addons
baseurl=
enabled=1
gpgcheck=1
gpgkey=
[extras]
name=centos-4.3 - Extras
baseurl=
enabled=1
gpgcheck=1
gpgkey=
[centosplus]
name=centos-4.3 - Plus
baseurl=
gpgcheck=1
enabled=1
gpgkey=
[contrib]
name=centos-4.3 - Contrib
baseurl=
gpgcheck=1
enabled=1
gpgkey=
---------------------------------dag.repo
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=
gpgcheck=1
gpgkey=
enabled=1
------------------------------------------------- dries.repo
[dries]
name=Extra Fedora rpms dries - $releasever - $basearch
baseurl=
gpgcheck=1
enabled=1
gpgkey=
------------------------------------------------- kbsingh-CentOS-Misc.repo
[kbs-CentOS-Misc]
name=CentOS.Karan.Org-EL$releasever - Stable
gpgkey=
gpgcheck=1
enabled=1
baseurl=
# Need a ftp mirror ? Uncomment the line below and comment the line above
# baseurl=ftp://rpm.karan.org/pub/kbsingh/el$releasever/misc/stable/$basearch/RPMS/
[kbs-CentOS-Misc-Testing]
name=CentOS.Karan.Org-EL$releasever - Testing
gpgkey=
gpgcheck=1
enabled=0
baseurl=
# Ned a ftp mirror ? Uncomment the line below and comment the line above
# baseurl=ftp://rpm.karan.org/pub/kbsingh/el$releasever/misc/testing/$basearch/RPMS/
有了以上的repository,应该说大部分的软件包都有了,可以用
yum install 软件包名
来安装了.
3.最后再说明一点,如果连国外需要通过代理,需要修改文件/etc/yum.conf
添加两行:
# The proxy server - proxy server
ort number
proxy=
上面的代理地址需要根据实际情况设置.
如果代理还要身分认证,再添两行吧:
proxy_username=用户名
proxy_password=口令
剩下的工作就简单了,可以update或install