Redhat 7使用CentOS 7的Yum網路源
在學習“ —Yum軟體倉庫”有介紹yum網路源,所以決定嘗試一下 的網路源,這樣在安裝依賴包時就會方便很多,由於redhat 的更新包只對註冊的使用者生效,所以需要自己手動更改成CentOS 的更新包,CentOS幾乎和redhat是一樣的,所以無需擔心軟體包是否可安裝,安裝之後是否有問題,另外CentOS公司去年已經被Redhat 收購了,下面是安裝步驟。
1、首先檢視redhat 7.0系統本身所安裝的那些yum 軟體包:
[root@linuxprobe ~]# rpm -qa | grep yum yum-utils-1.1.31-24.el7.noarch yum-langpacks-0.4.2-3.el7.noarch yum-metadata-parser-1.1.4-10.el7.x86_64 yum-rhn-plugin-2.0.1-4.el7.noarch PackageKit-yum-0.8.9-11.el7.x86_64 yum-3.4.3-118.el7.noarch
2、解除安裝這些軟體包;
[root@linuxprobe ~]# rpm -e yum-3.4.3-118.el7.noarch --nodeps [root@linuxprobe ~]# rpm -e yum-utils-1.1.31-24.el7.noarch --nodeps [root@linuxprobe ~]# rpm -e yum-rhn-plugin-2.0.1-4.el7.noarch --nodeps [root@linuxprobe ~]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps [root@linuxprobe ~]# rpm -e yum-langpacks-0.4.2-3.el7.noarch --nodeps [root@linuxprobe ~]# rpm -e PackageKit-yum-0.8.9-11.el7.x86_64 --nodeps
3、保證本機電腦能上網;
[root@linuxprobe ~]# ping PING (61.135.169.121) 56(84) bytes of data. 64 bytes from 61.135.169.121: icmp_seq=1 ttl=53 time=31.8 ms 64 bytes from 61.135.169.121: icmp_seq=2 ttl=53 time=31.9 ms 64 bytes from 61.135.169.121: icmp_seq=3 ttl=53 time=32.0 ms
4、進入以下網站上面檢視軟體包的版本是否升級或者找到自己系統所對應的檔案包版本更新;
網易163網路源地址: CentOS網路源地址:
5、找到自己所需要的版本下載:
[root@Linuxprobe ~]# wget centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm --2016-01-17 20:43:15-- centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm Resolving mirrors.163.com (mirrors.163.com)... 123.58.173.185, 123.58.173.186 Connecting to mirrors.163.com (mirrors.163.com)|123.58.173.185|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2016-01-17 20:43:15 ERROR 404: Not Found. //如果找不到,是安裝包更新了,你可以到這個網站centos/7/os/x86_64/Packages/複製下載連結,然後再下載下來;[root@linuxprobe ~]# wget centos/7/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm [root@linuxprobe ~]# wget centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm [root@linuxprobe ~]# wget centos/7/os/x86_64/Packages/yum-utils-1.1.31-34.el7.noarch.rpm [root@linuxprobe ~]# wget centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-34.el7.noarch.rpm [root@linuxprobe ~]# wget centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
6、檢視下載完成結果;
[root@linuxprobe ~]# ls yum-3.4.3-132.el7.centos.0.1.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm yum-updateonboot-1.1.31-34.el7.noarch.rpm yum-utils-1.1.31-34.el7.noarch.rpm
7、安裝軟體包:
[root@Linuxprobe ~]# rpm -ivh yum-* warning: yum-3.4.3-132.el7.centos.0.1.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 20%] 2:yum-plugin-fastestmirror-1.1.31-3 ################################# [ 40%] 3:yum-3.4.3-132.el7.centos.0.1 ################################# [ 60%] 4:yum-updateonboot-1.1.31-34.el7 ################################# [ 80%] 5:yum-utils-1.1.31-34.el7 ################################# [100%]
8、新建repo 配置檔案;
[root@linuxprobe ~]# vim /etc/yum.repos.d/CentOS-Base.repo #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-$7 - Base - 163.com #mirrorlist= baseurl=centos/7/os/$basearch/ gpgcheck=1 gpgkey=centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$7 - Updates - 163.com #mirrorlist= baseurl=centos/7/updates/$basearch/ gpgcheck=1 gpgkey=centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$7 - Extras - 163.com #mirrorlist= baseurl=centos/7/extras/$basearch/ gpgcheck=1 gpgkey=centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$7 - Plus - 163.com baseurl=centos/7/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=centos/RPM-GPG-KEY-CentOS-7
9、至此YUM 網路源已經安裝完成;
[root@linuxprobe ~]# yum clean all
10、測試安裝是否正常;
[root@Linuxprobe ~]# yum -y install lftp Loaded plugins: fastestmirror, product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package lftp.x86_64 0:4.4.8-7.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================ Package Arch Version Repository Size ================================================================================================ Installing: lftp x86_64 4.4.8-7.el7 base 750 k Transaction Summary ================================================================================================ Install 1 Package ………………省略部分安裝過程……………… Installed: lftp.x86_64 0:4.4.8-7.el7 Complete!
到這裡安裝完成,以後安裝所需包,可以不用本地yum源了,直接使用網路yum源。
本文地址:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69955379/viewspace-2726994/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- centos7實現上網和管理網路yum源CentOS
- Linux CentOS 7 更新yum源LinuxCentOS
- CentOS7 修改 yum 源CentOS
- Centos 7 常用yum源配置CentOS
- CentOS7--配置yum源CentOS
- redhat 5.5 配置網路yum源Redhat
- centos 7 yum 使用文件CentOS
- Centos-7修改yum源為國內的yum源CentOS
- Linux之RedHat7如何更換yum源LinuxRedhat
- redhat 7 使用nmcli 命令配置網路Redhat
- CentOS7 配置 163 yum 源CentOS
- CentOS 7 配置 阿里雲 yum源CentOS阿里
- Centos7配置阿里epel源|yum源CentOS阿里
- CentOS7配置yum國內源CentOS
- centos7 更換為aliyun的yum源CentOS
- centos7 更換yum為阿里源或者別的源CentOS阿里
- centos7替換yum源為阿里雲CentOS阿里
- 修改Centos7預設yum源為阿里雲源CentOS阿里
- CentOS7 yum源修改為阿里,配置阿里epel源CentOS阿里
- RHEL7/CentOS7 yum私服搭建CentOS
- centos同步yum源到本地,建立本地網路yum源CentOS
- Centos7或RedHat7下安裝MysqlCentOSRedhatMySql
- Redhat7/CentOS7 網路配置與管理(nmtui、nmcli、GNOME GUI、ifcfg檔案、IP命令)RedhatCentOSGUI
- Centos7/Redhat7 禁止普通使用者關機/重啟CentOSRedhat
- Centos 7 yum 安裝nginxCentOSNginx
- CentOS 7 yum 安裝 NGINXCentOSNginx
- CentOS 7 yum 安裝 MySQLCentOSMySql
- Vmware配置Centos7配置yum源(新手小白福音)CentOS
- Redhat8 yum源內網部署Redhat內網
- 【yum源】CentOS7安裝第三方源CentOS
- redhat6.7修改為centos6.7官方yum源RedhatCentOS
- centos7安裝mysql5.7 使用yumCentOSMySql
- centos7使用yum安裝lnmp環境CentOSLNMP
- CentOS7 yum 安裝 提示 網路問題解決辦法CentOS
- readhalt7.4 系統替換 CentOS7 yum 源CentOS
- centos 7 橋接網路CentOS橋接
- centos7網路配置CentOS
- centos 7中 yum安裝jdkCentOSJDK