解决redhat 没注册的情况下yum无法使用的问题
2024-09-20 23:42:17
官网下载的rhel,安装后是没有配置yum源的,需要自己配置yum源。网络上的很难找到rhel的yum源,但是在ISO镜像里面有很多redhat提供的软件包,也是正版软件,我们可以把这个拷贝出来,自己建立yum源。
第一种:搭建本地源
1、安装成功rhel后,我们使用yum会发现提示未注册,第一步,从ISO镜像中拷贝出软件包,放到桌面上一个叫base的文件夹里。
2、搭建一个ftp环境,允许匿名登录。匿名登录的帐号为anonymous,密码没有。将ftp的默认目录设置在base文件夹那一路径。我这里将ftp目录指定在桌面上的。
3、登录rhel,配置yum源。
cd /etc/yum.repos.d
vi base.repo
输入以下配置,红色更改成你ftp的ip地址,蓝色是名称顺便写。
[base]
name=my base repo
baseurl=ftp://192.168.7.62/base
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.7.62/base/RPM-GPG-KEY-redhat-release
4、完成,可以使用yum。
第二种:使用centos的仓库,让rhel使用centos的仓库
如下是163.rep的配置文件,我的系统是rhel 7.3 对应着 centos 7.3.1611版本,下面是配置文件,在/etc/yum.repo.d/下新建163.repo,将如下的内容拷贝进去。
注意:1)、拷贝进去后,要修改的参数是,请参照http://mirrors.163.com/开源网站的具体路径对应你所用的系统版本。这份配置文件支持rhel 7使用centos 7的yum仓库。
2)、使用前请将原有仓库备份。并执行yum clean all 指令。
3)、正常使用yum
[root@localhost yum.repos.d]# cat 163.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.3.1611 - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=7.3.1611&arch=x86_64&repo=os
baseurl=http://mirrors.163.com/centos/7.3.1611/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-7.3.1611 - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=7.3.1611&arch=x86_64&repo=updates
baseurl=http://mirrors.163.com/centos/7.3.1611/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
enabled=1
#additional packages that may be useful
[extras]
name=CentOS-7.3.1611 - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=7.3.1611&arch=x86_64&repo=extras
baseurl=http://mirrors.163.com/centos/7.3.1611/extras/x86_64/
gpgcheck=1
enabled=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-7.3.1611 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7.3.1611/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
最新文章
- 利用powerDesigner16.5连接oracle数据库并自动生成表结构图
- bzoj3631树链剖分
- PHP之call user func()函数
- 深入理解URL
- SortedSet有序集合类型
- Storm calculate pv
- 发布HTML5 RTS游戏-古代战争
- MSSQLServer基础01(数据类型)
- VS下面的编译错误-----转换到 COFF 期间失败: 文件无效或损坏
- 如果ASM磁盘组由哪些物理磁盘组成?
- Python easy_insatll 安装包
- Web框架——Django笔记
- img标签实现和背景图一样的显示效果——object-fit和object-positon
- Linux 高性能服务器编程——高性能服务器程序框架
- 解决ruby安装后无法添加淘宝gem源------------学习记录
- 做数据挖掘,就算发 20 几分的 CNS 子刊,也是垃圾!?--转载
- OpenGL绘制一个四边形
- sqlserver中的数据转换与子查询
- 这些简单实用的Word技巧,你get了吗
- python 3.4 error: Microsoft Visual C++ 10.0 is required(Unable to find vcvarsall.bat)