这篇文章主要介绍“Redhat7怎么使用Centos7的Yum网络源”,在日常操作中,相信很多人在Redhat7怎么使用CentOS7的Yum网络源问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Redhat7
这篇文章主要介绍“Redhat7怎么使用Centos7的Yum网络源”,在日常操作中,相信很多人在Redhat7怎么使用CentOS7的Yum网络源问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Redhat7怎么使用CentOS7的Yum网络源”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
首先查看redhat 7.0系统本身所安装的那些yum 软件包:
[root@linuxprobe ~]# rpm -qa | grep yumyum-utils-1.1.31-24.el7.noarchyum-langpacks-0.4.2-3.el7.noarchyum-metadata-parser-1.1.4-10.el7.x86_64yum-rhn-plugin-2.0.1-4.el7.noarchPackageKit-yum-0.8.9-11.el7.x86_64yum-3.4.3-118.el7.noarch
卸载这些软件包;
[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
保证本机电脑能上网;
[root@linuxprobe ~]# ping www.baidu.comPING www.a.shifen.com (61.135.169.121) 56(84) bytes of data.64 bytes from 61.135.169.121: icmp_seq=1 ttl=53 time=31.8 ms64 bytes from 61.135.169.121: icmp_seq=2 ttl=53 time=31.9 ms64 bytes from 61.135.169.121: icmp_seq=3 ttl=53 time=32.0 ms
进入以下网站上面查看软件包的版本是否升级或者找到自己系统所对应的文件包版本更新;
网易163网络源地址:Http://mirrors.163.com/CentOS网络源地址:http://centos.ustc.edu.cn/centos/
找到自己所需要的版本下载:
[root@Linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm--2016-01-17 20:43:15-- http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpmResolving mirrors.163.com (mirrors.163.com)... 123.58.173.185, 123.58.173.186Connecting to mirrors.163.com (mirrors.163.com)|123.58.173.185|:80... connected.HTTP request sent, awaiting response... 404 Not Found2016-01-17 20:43:15 ERROR 404: Not Found. //如果找不到,是安装包更新了,你可以到这个网站http://mirrors.163.com/centos/7/os/x86_64/Packages/复制下载链接,然后再下载下来;[root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm[root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm[root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-34.el7.noarch.rpm [root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-34.el7.noarch.rpm[root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
查看下载完成结果;
[root@linuxprobe ~]# lsyum-3.4.3-132.el7.centos.0.1.noarch.rpmyum-metadata-parser-1.1.4-10.el7.x86_64.rpmyum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpmyum-updateonboot-1.1.31-34.el7.noarch.rpmyum-utils-1.1.31-34.el7.noarch.rpm
安装软件包:
[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: NOKEYPreparing... ################################# [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%]
新建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=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=osbaseurl=http://mirrors.163.com/centos/7/os/$basearch/gpGCheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#released updates[updates]name=CentOS-$7 - Updates - 163.com#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updatesbaseurl=http://mirrors.163.com/centos/7/updates/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful[extras]name=CentOS-$7 - Extras - 163.com#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extrasbaseurl=http://mirrors.163.com/centos/7/extras/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$7 - Plus - 163.combaseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
至此YUM 网络源已经安装完成;
[root@linuxprobe ~]# yum clean all
测试安装是否正常;
[root@Linuxprobe ~]# yum -y install lftpLoaded plugins: fastestmirror, product-id, subscription-managerThis system is not reGIStered to Red Hat Subscription Management. You can use subscription-manager to register.Loading mirror speeds from cached hostfileResolving Dependencies--> Running transaction check---> Package lftp.x86_64 0:4.4.8-7.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved================================================================================================Package Arch Version Repository Size================================================================================================Installing:lftp x86_64 4.4.8-7.el7 base 750 kTransaction Summary================================================================================================Install 1 Package………………省略部分安装过程………………Installed:lftp.x86_64 0:4.4.8-7.el7Complete!
到这里安装完成,以后安装所需包,可以不用本地yum源了,直接使用网络yum源。
到此,关于“Redhat7怎么使用CentOS7的Yum网络源”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注编程网网站,小编会继续努力为大家带来更多实用的文章!
--结束END--
本文标题: Redhat7怎么使用CentOS7的Yum网络源
本文链接: https://lsjlt.com/news/316124.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0