前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >专栏 >VMWare 11安装RedHat Linux 7过程中碰到的坑

VMWare 11安装RedHat Linux 7过程中碰到的坑

作者头像
bisal
发布于 2021-09-06 07:26:34
发布于 2021-09-06 07:26:34
56600
代码可运行
举报
运行总次数:0
代码可运行

VMWare11安装RedHat Linux 7过程中会碰到一些坑,这里列举一些。

问题1

RedHat7安装的时候选择的是简体中文,安装完成,想改成英文。

修改配置文件,/etc/locale.conf,

将:LANG="zh_CN.UTF-8"

修改为:LANG="en_US.UTF-8"

重启系统即可。

问题2

防火墙临时关闭,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
systemctl stop firewalld

防火墙永久关闭,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
syustemctl disable firewalld

Linux 6和Linux 7的防火墙设置有些区别,可以参考《探索Linux 6和7的防火墙》。

问题3

如何修改当前系统时间?Linux 7中用到了timedatectl,该指令是作为systemd系统和服务管理器的一部分分发的工具,可以用他来查看和更改系统时钟的配置,包括更改当前的日期和时间、设置时区以及可以激活与远端服务器系统时钟的自动同步,是红帽企业版7版本新增的命令。timedatectl或者timedatectl status,可以看当前信息,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
[root@bisal ~]# timedatectl
      Local time: Sun 2020-12-06 03:49:15 CST
  Universal time: Sat 2020-12-05 19:49:15 UTC
        RTC time: Sat 2020-12-05 19:44:03
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

修改当前时间,提示错误,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
[root@bisal ~]# timedatectl set-time 15:00:00
Failed to set time: Automatic time synchronization is enabled

此时,可以关闭NTP,暂停自动同步,NTP enabled改为了no,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
[root@bisal ~]# timedatectl set-ntp no
[root@bisal ~]# timedatectl 
      Local time: Sun 2020-12-06 03:53:01 CST
  Universal time: Sat 2020-12-05 19:53:01 UTC
        RTC time: Sat 2020-12-05 19:47:37
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

再次设置,更改成功了,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
[root@bisal ~]# timedatectl set-time '16:42:25'
[root@bisal ~]# timedatectl 
      Local time: Sun 2020-12-06 16:42:30 CST
  Universal time: Sun 2020-12-06 08:42:30 UTC
        RTC time: Sun 2020-12-06 08:42:30
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

问题4

宿主机虚拟机之间的网络连通性,虚拟机网络适配器选择“NAT模式”,通常情况下,宿主机就可以ping通虚拟机了,如果宿主机和外网是通的,此时在虚拟机中就可以访问外网了,

问题5

yum install提示错误,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
This system is not registered with an entitlement server. You can use subscription-manager to register.

这是因为红帽的企业版Linux系统RHEL是收费的,必须要注册才可正常使用。这时替代方案,就是替掉原版的yum,安装一个免费的yum源,例如CentOS(CentOS已经被红帽收购,且跟RHEL系统没多大区别,最主要还是可以免费使用),将RHEL7的yum源更换为CentOS7的。

1.检查并删除原有的yum源

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
rpm -qa | grep yum

一般出现6个,

2.下载安装CentOS的yum源

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm

为了防止几个包安装时有互相依赖,使用rpm -ivh yum*命令一次性安装三个包。检查yum是否安装成功:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
rpm -qa |grep yum

3.配置repo文件

在/etc目录下重命名备份原来的repo,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
mv yum.repos.d yum.repos.d.backup

/etc下建一个新的yum.repos.d目录

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
mkdir yum.repos.d

下载一个CentOS的repo,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

打开CentOS7-Base-163.repo,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
# 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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7


#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7


#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/$releasever/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-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

可以用快捷方式,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
:%s@$releasever@7@g

将其中的$releasever全部替换成版本号,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
# 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

yum clean all,清理缓存,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
[root@bisal yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Cleaning repos: base extras updates

yum makecache,重新生成缓存,期间可能还会出现未注册的提示,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Determining fastest mirrors
base                                                                                                       | 3.6 kB  00:00:00     
extras                                                                                                     | 2.9 kB  00:00:00     
updates                                                                                                    | 2.9 kB  00:00:00     
(1/10): base/x86_64/group_gz                                                                               | 153 kB  00:00:00     
(2/10): base/x86_64/primary_db                                                                             | 6.1 MB  00:00:03     
(3/10): extras/x86_64/primary_db                                                                           | 222 kB  00:00:01     
(4/10): extras/x86_64/filelists_db                                                                         | 224 kB  00:00:01     
(5/10): extras/x86_64/other_db                                                                             | 134 kB  00:00:00     
(6/10): base/x86_64/other_db                                                                               | 2.6 MB  00:00:02     
(7/10): updates/x86_64/filelists_db                                                                        | 2.1 MB  00:00:01     
(8/10): updates/x86_64/other_db                                                                            | 227 kB  00:00:00     
(9/10): updates/x86_64/primary_db                                                                          | 3.7 MB  00:00:03     
(10/10): base/x86_64/filelists_db                                                                          | 7.2 MB  00:00:10     
Metadata Cache Created

yum repolist all查看是否成功,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
[root@bisal yum.repos.d]# yum repolist all
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
repo id                                             repo name                                                      status
base/x86_64                                         CentOS-7 - Base - 163.com                                      enabled: 10,072
centosplus/x86_64                                   CentOS-7 - Plus - 163.com                                      disabled
extras/x86_64                                       CentOS-7 - Extras - 163.com                                    enabled:    448
updates/x86_64                                      CentOS-7 - Updates - 163.com                                   enabled:    775
repolist: 11,295

问题6

vmware-tool安装过程中,错误提示,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(process:17532): GLib-CRITICAL **: g_file_test: assertion 'filename != NULL' failed

安装这些包,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
[root@bisal yum.repos.d]# yum -y install gcc gcc-c++ automake make kernel-devel

问题7

vmware设置共享文件夹,但是登录/mnt/hgfs,内容是空的。

vmware-hgfsclient指令用于查看当前有哪些共享目录,同样是空的,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
[root@bisal C]# vmware-hgfsclient
C

用如下指令,挂载共享文件夹,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs

此时,vmware-hgfsclient,可以看到当前的共享文件夹了,

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
[root@bisal C]# vmware-hgfsclient
C

参考文献,

https://blog.csdn.net/otmqixi/article/details/81564515

https://blog.csdn.net/qq_28401965/article/details/82019139

https://blog.csdn.net/mingtianwendy/article/details/78393583

https://blog.csdn.net/Paranoid_cc/article/details/81455061

https://blog.csdn.net/xzm5708796/article/details/103733211

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/12/17 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
Redhad 7改用CentOS7 yum源【亲测】
redhat 默认自带的 yum 源需要注册,才能更新。我们想不花钱,需要替换掉redhat的yum源,最好是国内的源。
程裕强
2022/05/06
1.6K0
Redhad 7改用CentOS7 yum源【亲测】
Red Hat Enterprise Linux 7.3更换CentOS 7 yum源
系统版本:Red Hat Enterprise Linux Server release 7.3 (Maipo)
用户8705048
2021/06/08
1.9K0
yum源配置
在配置yum前首先得说说rpm,在redhat和centos linux系统上,rpm作为软件包管理工具,可以方便的安装、查询、卸载软件包。常见命令如下:
我的小碗汤
2018/08/22
5.3K0
yum源配置
解决虚拟机Centos7 报错 curl#56
win10上安装的centos7虚拟机 在虚拟机yum安装及yum update命令中 都报错 无法连接,尝试其他镜像等。
heasy3
2020/08/02
1.1K0
Redhat的yum配置步骤
Redhat Linux是免费的操作系统,但是里面的yum服务是收费的,有的时候我们安装软件必须从yum上面安装。虽然Redhat的yum是收费的,但我们可以使用CentOS的yum代替Redhat的yum,下面我们就要讲解一下如何安装。
全栈程序员站长
2022/09/06
7920
centos6.8使用外网yum源
在数据中心内是不允许直接连外网的,上外网需要通过代理。那么如何使用外网YUM源呢? 1、设置/etc/profile 在最后添加两行: http_proxy=代理的IP:端口 export http_proxy 然后保存 source /etc/profile
孙杰
2019/10/29
2.9K0
centos6.8使用外网yum源
Centos7更换yum镜像源
2、下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份) 以CentOS7-Base-163.repo为例
全栈程序员站长
2022/09/02
7.4K0
Linux yum 命令
yum( Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器。
小小工匠
2021/08/16
6.3K0
使用Nexus配置Linux Yum Repository代理
在生产环境中,我们不可能所有的服务器都能连接外网更新RPM包,比较理想的环境是:有一台Linux服务器可以连接外网,剩余的服务器通过这台YUM服务器更新。以前比较传统的做法是先把包下载到内网中的YUM服务器上,然后通过createrepo命令生成本地仓库,其余服务器通过HTTP访问这个链接,这种做法比较费时费事。有没有一种比较好的方式,让我们直接通过这台服务器代理连接到公网的163、阿里 YUM仓库呢,这就是本次介绍的Nexus代理。无论你的客户机是CentOS6还是CentOS7又或者是Ubuntu,不论你是想用YUM还是PIP又或者是NPM包管理器,Nexus都能满足你的需求。
星哥玩云
2022/07/14
4.4K0
Linux下更换默认yum源为网易yum源的操作记录
废话不多说,下面记录了centos下更换系统默认yum源为网易yum源的操作过程: 1)备份原有的默认yum源 [root@bastion-IDC ~]# cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 2)修改CentOS-Base.repo文件。将文件中的baseurl地址修改为网易163的yum源地址即可! [root@bastion-IDC ~]# vim /etc/yum.repos.d/Ce
洗尽了浮华
2018/01/23
3.8K0
Linux下更换默认yum源为网易yum源的操作记录
开源网管Zabbix4.0部署与简单使用
Zabbix 是一个企业级分布式开源监控解决方案。ta能够监控众多网络参数和服务器的健康度、完整,灵活的告警机制,允许用户为几乎任何事件配置基于邮件的告警。这样用户可以快速响应服务器问题。ta基于存储的数据提供出色的报表和数据可视化功能。这些功能使得 Zabbix 成为容量规划的理想选择。并且是免费的。Zabbix 是根据 GPL 通用公共许可证的第二版编写和发布的。这意味着产品源代码是免费发布的,可供公共使用。
Tommonkey
2023/02/27
4780
CentOS 5至CentOS 5.8 YUM 源
本源是http://mirrors.163.com的,也可用http://centos.ustc.edu.cn/的,
三杯水Plus
2018/11/14
5.1K0
centos7停止更新后yum报错
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
青丝束马尾
2024/10/26
2670
centos7停止更新后yum报错
CentOS 6.5安装自动化工具Ansible和图形化工具Tower
[root@ansible-server etc]# lsb_release -a
用户8704835
2021/06/07
1.1K0
yum扩展源、下载rpm包、源码包安装 原
说明: 执行完curl命令后,原有yum源文件CentOS-Base.repo被替换成CentOS7-Base-163.repo。查看该yum源文件:
阿dai学长
2019/04/03
3.4K0
安装CentOS7虚拟机, 配置docker套件
CentOS7比ubuntu的一键式安装要稍微复杂一些, 有些小伙伴按照下一步, 下一步的套路安装完成, 发现没有图像化界面, 在纯粹的命令行里面, 很多小伙伴是不适应的, 这里我把centos7在vmware里面的安装过程记录一下, 没有centos7安装经验的小伙伴可以参考一下
zhaoolee
2018/08/02
7440
安装CentOS7虚拟机, 配置docker套件
linux代理设置
有些局域网环境上网需要使用代理上网,图形界面的很好解决就设置一下浏览器的代理就好了,但是Linux纯命令行的界面就需要手动配置了。
孙杰
2019/10/29
9.2K0
【香菇带你学Linux】yum源配置,这一篇就够了!(包括本地,网络,本地共享yum源)
yum(全称为 Yellow dog Updater, Modified)是一个在 Fedora ,centos,BClinux,RedHat 以及 CentOS 中的 Shell 前端软件包管理器。基于 RPM 包管理 , 能够从指定的服务器自动下载 RPM 包并且安装 , 可以自动处理依赖性关系 , 并且一次安装所有依赖的软件包 , 无须繁琐地一次次下载、安装。
炒香菇的书呆子
2024/08/09
6.4K0
linux之yum源设置代理
原文链接:https://rumenz.com/rumenbiji/linux-yum-proxy.html
入门笔记
2021/10/09
1.6K0
CentOS7报cannot found a valid baseurl for repo:base
清空原有配置 echo > /etc/yum.repos.d/CentOS-Base.repo 编辑文件 vi /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 an
流柯
2021/08/10
6580
相关推荐
Redhad 7改用CentOS7 yum源【亲测】
更多 >
领券
社区富文本编辑器全新改版!诚邀体验~
全新交互,全新视觉,新增快捷键、悬浮工具栏、高亮块等功能并同时优化现有功能,全面提升创作效率和体验
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文