redhat7.2上搭建网易、epel的yum repo

近期从百度云盘上下载下来rhel7.2(MaiPo),之后,开始解决怎么在rhel7.2上使用非红帽官方的yum仓库,终于解决了。解决方法如下:

1、网易163的yum repo:

在/etc/yum.repos.d/下面新建163.repo:

total 8
-rw-r--r--. 1 root root 87 Aug 5 01:13 163.repo
-rw-r--r--. 1 root root 358 Aug 1 00:27 redhat.repo

[zqf@rhel7-2 yum.repos.d]$ cat 163.repo
[163]
name=163
baseurl=http://mirrors.163.com/centos/7/os/x86_64/
gpgcheck=0
enabled=1

就OK了,下面安装nvme试试:

[zqf@rhel7-2 r12058]$ sudo yum -y install nvme-cli
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
163 | 3.6 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package nvme-cli.x86_64 0:0.7-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
nvme-cli x86_64 0.7-1.el7 163 103 k

Transaction Summary
===============================================================================================================================================
Install 1 Package

Total download size: 103 k
Installed size: 172 k
Downloading packages:
nvme-cli-0.7-1.el7.x86_64.rpm | 103 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : nvme-cli-0.7-1.el7.x86_64 1/1
Verifying : nvme-cli-0.7-1.el7.x86_64 1/1

Installed:
nvme-cli.x86_64 0:0.7-1.el7

Complete!

2、epel源:

[zqf@rhel7-2 yum.repos.d]$ sudo rpm -vih http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm
[sudo] password for zqf:
Retrieving http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm
warning: /var/tmp/rpm-tmp.DI8Hiy: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:epel-release-7-10 ################################# [100%]

装完这个rpm包之后就自动生成了epel.repo和epel-testing.repo

[zqf@rhel7-2 yum.repos.d]$ ll
total 16
-rw-r--r--. 1 root root 87 Aug 5 01:13 163.repo
-rw-r--r--. 1 root root 951 Jun 24 11:04 epel.repo
-rw-r--r--. 1 root root 1050 Jun 24 11:04 epel-testing.repo
-rw-r--r--. 1 root root 358 Aug 1 00:27 redhat.repo

注意http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm这个链接有可能会变,因为在不断更新,比如之前几个月就是http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm

查看当前系统所有可用的yum repository:

[zqf@rhel7-2 ~]$ sudo yum repolist all
[sudo] password for zqf:
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
epel/x86_64/metalink | 4.7 kB 00:00:00
epel | 4.3 kB 00:00:00
(1/3): epel/x86_64/group_gz | 170 kB 00:00:01
(2/3): epel/x86_64/updateinfo | 807 kB 00:00:04
(3/3): epel/x86_64/primary_db | 4.8 MB 00:00:14
repo id repo name status
163 163 enabled: 9,363
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 enabled: 11,930
epel-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Debug disabled
epel-source/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Source disabled
epel-testing/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debug disabled
epel-testing-source/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Source disabled
repolist: 21,293

 

转载于:https://www.cnblogs.com/zengqingfu1442/p/7299329.html

redhat 7.2 可用的yum源, 亲自测试可以使用 ,使用过程: 1.卸载已经存在的yum: rpm -qa | grep yum | xargs rpm -e --nodeps 2.将yum 文件放到server中 3.执行rpm -ivh yum-* 4.创建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=os baseurl=http://mirrors.163.com/centos/7/os/$basearch/ gpgcheck=1 gpgkey=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=updates baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ gpgcheck=1 gpgkey=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=extras baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$7 - Plus - 163.com baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 5.测试是否安装成功 yum -y install tree
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值