红旗linux yum,更换红旗Linux: Asianux的yum源为网易源
測試環境:
Linux系統版本Asianux4_x64:Linux localhost.localdomain 2.6.32-279.2.1.el6.x86_64 #1 SMP Tue Aug 14 11:42:24 CST 2012 x86_64 x86_64 x86_64 GNU/Linux
本質上Asianux4_x64就是基于Redhat6企業版的。
出現問題:
安裝完系統之后,想通過yum安裝一些程序,但是提示錯誤:
Loaded plugins: axtu-plugin, refresh-packagekit, security
Please register, or you can not connect to Asianux Update Server!
Setting up Install Process
No package gcc available.
Error: Nothing to do
以上的錯誤提示我們必須先注冊,否則無法連接到Asianux的yum服務器。
那么我們不注冊,怎么更換yum源為可以直接使用的網易yum源呢?
解決方案:
1. 卸載Asianux自帶的yum源
[root@localhost 桌面]# rpm -aq | grep yum | xargs rpm -e --nodeps
[root@localhost 桌面]# whereis yum
yum: /etc/yum
[root@localhost 桌面]# rm -rf /etc/yum
2. 下載yum安裝包
下載地址:http://mirrors.163.com/centos/6/os/x86_64/Packages/
從這個地址中下載需要的包:
python-iniparse-0.3.1-2.1.el6.noarch.rpm
yum-3.2.29-60.el6.centos.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
如果不是通過瀏覽器找到具體文件下載,可以通過wget下載。
3. 安裝yum的相關rpm包
[root@localhost myself]# rpm -ivh python*
warning: python-iniparse-0.3.1-2.1.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...??????????????? ########################################### [100%]
1:python-iniparse??????? ########################################### [100%]
[root@localhost myself]# rpm -ivh yum*
warning: yum-3.2.29-69.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...??????????????? ########################################### [100%]
1:yum-metadata-parser??? ########################################### [ 33%]
2:yum-plugin-fastestmirro########################################### [ 67%]
3:yum??????????????????? ########################################### [100%]
[root@localhost myself]#
4. 配置網易源
如果 /etc/yum.repos.d/rhel-debuginfo.repo 這個文件存在的話就備份一下:
[root@localhost myself]# mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.bak
如果本來就沒有,就新建:
[root@localhost myself]# touch /etc/yum.repos.d/rhel-debuginfo.repo
編輯新建的文件,加入網易源:
[root@localhost myself]# vim /etc/yum.repos.d/rhel-debuginfo.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released
#[addons]
#name=CentOS-$releasever - Addons
#baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
#gpgcheck=1
#gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
保存退出編輯器即可。
5. 清理緩存
[root@localhost myself]# yum clean all
已加載插件:fastestmirror
Cleaning repos: base extras updates
清理一切
6. 將服務器上的軟件包信息緩存到本地,以提高搜索安裝軟件的速度
[root@localhost 桌面]# yum makecache
已加載插件:fastestmirror
Determining fastest mirrors
base???????????????????????????????????????????????????? | 3.7 kB???? 00:00
base/group_gz??????????????????????????????????????????? | 219 kB???? 00:01
base/filelists_db??????????????????????????????????????? | 6.3 MB???? 01:40
base/primary_db????????????????????????????????????????? | 4.6 MB???? 01:06
base/other_db??????????????????????????????????????????? | 2.8 MB???? 00:40
extras?????????????????????????????????????????????????? | 3.4 kB???? 00:00
extras/filelists_db????????????????????????????????????? |? 30 kB???? 00:00
extras/prestodelta?????????????????????????????????????? |? 601 B???? 00:00
extras/primary_db??????????????????????????????????????? |? 27 kB???? 00:00
extras/other_db????????????????????????????????????????? |? 30 kB???? 00:00
updates????????????????????????????????????????????????? | 3.4 kB???? 00:00
updates/filelists_db???????????????????????????????????? | 1.0 MB???? 00:14
updates/prestodelta????????????????????????????????????? |? 93 kB???? 00:01
updates/primary_db?????????????????????????????????????? | 1.3 MB???? 00:19
updates/other_db???????????????????????????????????????? |? 15 MB???? 03:43
元數據緩存已建立
至此,網易yum源已經安裝成功。
總結
以上是生活随笔為你收集整理的红旗linux yum,更换红旗Linux: Asianux的yum源为网易源的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux程序计数器,如何在C中打印程序
- 下一篇: glib 2.0 arm linux,g