Red Hat Linux安裝CentOS的yum源
設定步驟
1. 查詢原有的yum
[root@orcl ~]# rpm -qa |grep yum yum-plugin-fastestmirror-1.1.30-37.el6.noarch yum-metadata-parser-1.1.2-16.el6.i686 yum-utils-1.1.30-37.el6.noarch yum-plugin-security-1.1.30-37.el6.noarch yum-3.2.29-75.el6.centos.noarch yum-rhn-plugin-0.9.1-43.el6.noarch
2. 刪除原有的yum
[root@orcl ~]# rpm -aq|grep yum|xargs rpm -e –-nodeps [root@orcl ~]# rpm -qa |grep yum [root@orcl ~]#
3. 查詢原有yum配置
[root@orcl ~]# whereis yum yum: /etc/yum [root@orcl ~]# rm -fr /etc/yum
4. 下載需要的安裝包
系統為32的,所以我選擇i386。64的自行查詢x86_64。
可以使用
wget yum-3.2.29-73.el6.centos.noarch.rpm
下載
yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm yum-metadata-parser-1.1.2-16.el6.i686.rpm Python-iniparse-0.3.1-2.1.el6.noarch.rpm
5. 安裝python
[root@orcl ~]# rpm -ivh python-iniparse-….noarch.rpm warning: python-iniparse-0.4-9.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY error: Failed dependencies: python(abi) = 2.7 is needed by python-iniparse-0.4-9.el7.noarch
當前安裝版本與伺服器不相容,退後一個版本再試。
檢視當前發行版本號
cat /etc/issue
遇到的錯誤
系統位數與安裝程式包位數不一致 file /bin/ls
error: Failed dependencies: libc.so.6()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64 libc.so.6(GLIBC_2.2.5)(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64 libglib-2.0.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64 libpthread.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64 libpython2.6.so.1.0()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64 libsqlite3.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64 libxml2.so.2()(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64 libxml2.so.2(LIBXML2_2.4.30)(64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
重新下載32位程式包
[root@orcl ~]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm Preparing… ########################################### [100%] package python-iniparse-0.3.1-2.1.el6.noarch is already installed [root@orcl ~]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm Preparing… ########################################### [100%] 1:yum-metadata-parser ########################################### [100%] [root@orcl ~]# rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm Preparing… ########################################### [100%] 1:yum-plugin-fastestmirro########################################### [ 50%] 2:yum ########################################### [100%] [root@orcl ~]#
注意最後兩個包必需同時安裝,否則會相互依賴
更改yum源(使用網易的CentOS映象源)
[root@localhost yum]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# rm -rf * [root@localhost yum.repos.d]# wget [root@localhost yum.repos.d]# vi CentOS6-Base-163.repo
將所有 $releasever 修改為具體的版本號,我這裡寫的是6.8,這個自己開啟()找一下就可以。
# 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 - 163.com baseurl=/6.8/os/$basearch/ #mirrorlist= gpgcheck=1 gpgkey= #released updates [updates] name=CentOS-$releasever - Updates - 163.com baseurl=/6.8/updates/$basearch/ #mirrorlist= gpgcheck=1 gpgkey= #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - 163.com baseurl=/6.8/extras/$basearch/ #mirrorlist= gpgcheck=1 gpgkey= #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - 163.com baseurl=/6.8/centosplus/$basearch/ #mirrorlist= gpgcheck=1 enabled=0 gpgkey= #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - 163.com baseurl=/6.8/contrib/$basearch/ #mirrorlist= gpgcheck=1 enabled=0 gpgkey=
清理yum快取
yum clean all
顯示已安程式包及可安程式包
yum list
可以按要求更新程式包或安裝
yum update / yum install 包名
到此結束了,親們
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69901823/viewspace-2952331/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在Red Hat和Centos上安裝MongoDBCentOSMongoDB
- Red Hat Enterprise Linux Server 7.4 安裝LinuxServer
- Red Hat 7.5 Yum Replacement
- Linux red hat 核心版下安裝NginxLinuxNginx
- G005-OS-INS-02 Red Hat Enterprise Linux V8.2 安裝Linux
- Red Hat Enterprise Linux 9的簡介Linux
- Linux – CentOS 7 yum方式快速安裝MongoDBLinuxCentOSMongoDB
- Linux CentOS 7 更新yum源LinuxCentOS
- CentOS安裝配置yumCentOS
- 新的安全漏洞正影響 CentOS 和 Red Hat Linux 發行版CentOSLinux
- 【yum源】CentOS7安裝第三方源CentOS
- linux CentOS更換 ali YUM源LinuxCentOS
- Linux 安裝 yumLinux
- Linux(CentOS)軟體管理(2)- yum 線上安裝LinuxCentOS
- Centos 7 yum 安裝nginxCentOSNginx
- CentOS 7 yum 安裝 NGINXCentOSNginx
- CentOS 7 yum 安裝 MySQLCentOSMySql
- linux 安裝yum 安裝phpLinuxPHP
- postgres yum源安裝
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)線上安裝方式LinuxRedhatCentOSMySql
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)離線安裝方式LinuxRedhatCentOSMySql
- 【Linux】yum 安裝nginxLinuxNginx
- centos 7中 yum安裝jdkCentOSJDK
- CentOs6.8 yum安裝GitLabCentOSGitlab
- CentOS 7 用yum安裝 MySQLCentOSMySql
- How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7Linux
- How to disable transparent Hugepage (THP) on Red Hat Enterprise Linux 8?Linux
- Linux Red Hat啟動時顯示system not foundLinux
- Red Hat Enterprise Linux 10 下載 - 紅帽企業 LinuxLinux
- 在CentOS7上安裝MySQL5.7-YUM源方式CentOSMySql
- CentOS7 安裝 Mysql 8:0 的yum安裝方式CentOSMySql
- CentOS 7.0下使用yum安裝MySQLCentOSMySql
- CentOS 7 yum 安裝與配置 JDKCentOSJDK
- CentOS 7 yum 安裝與配置 RedisCentOSRedis
- CentOS 7 yum安裝與配置 TomcatCentOSTomcat
- CentOS 7 yum 安裝 PHP7.3CentOSPHP
- Linux安裝MySQL(使用yum)LinuxMySql
- CentOS 配置yum源CentOS