配置redhat 使用163 or sohu 的yum 源 centos
1.#cp /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.bk 首先備份下redhat yum 的配置樣例文件。spa
2.#wget http://mirrors.163.com/.help/CentOS-Base-163.repo 或者 #wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo 下載163或sohu提供的yum 配置文件.net
3.#vi CentOS-Base-163.repo 替換$releaserver 爲5或者6[5/6爲centos的版本] 插件
4.#yum makecache 第3部不修改則第4部會出現以下錯誤:「[root@localhost ~]# yum makecache
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
http://mirrors.163.com/centos/5Server/addons/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again」debug
5.#cd /etc/pki/rpm-gpg #wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5server
#yum update 錯誤信息:warning:rpmts_hdrfromfdno:header v3 dsa signature:nokey,key id e823568 GPG key retrieval:[errno 5] oserror:[errno 2] no such file or directory:'/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5'xml
緣由:localhost不存在指定的文件/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5rem
6.#yum install yum-fastestmirror 安裝fastestmirror插件可自動選擇最快的yum 源get
7.#yum install -y yumex 安裝圖形化界面的yumit
yum 經常使用的命令 #yum install -y xxx 安裝xxx軟件 #yum info xxx 查看xxx軟件的基本信息 #yum remove/erase xxx 卸載xxx軟件