[排错] RHEL 解决使用 yum 命令时卡住

报错代码

# yum update 
Updating Subscription Management repositories.
Unable to read consumer identity

可尝试的解决方法一:修改 /etc/yum/pluginconf.d/subscription-manager.conf 文件

# vim /etc/yum/pluginconf.d/subscription-manager.conf

将以下内容:

......
[main] 
enabled=1
......

修改为:

......
[main] 
enabled=0
......

可尝试的解决方法二:安装对应的 katello-ca-consumer-latest.noarch.rpm 软件包

(步骤略)

(补充:katello-ca-consumer-latest.noarch.rpm 软件包下载自对应的 Red Hat Satellite 服务器,补充链接:Red Hat Satellite client register

[步骤] 系统升级 (从 openSUSE Leap 15.3 升级到 openSUSE Leap 15.4)

步骤一:显示现在的系统版本

# cat /etc/*release*
NAME="openSUSE Leap"
VERSION="15.3"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.3"
PRETTY_NAME="openSUSE Leap 15.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

(注意:确保显示的系统版本是 openSUSE Leap 15.3)

步骤二:准备升级

2.1 确认已使用的软件库

# zypper ls -d
#  | Alias                     | Name                               | Enabled | GPG Check | Refresh | Priority | Type   | URI
---+---------------------------+------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------------------------
1  | repo-non-oss              | Non-OSS Repository                                           | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.3/repo/non-oss/
2  | repo-oss                  | Main Repository                                              | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.3/repo/oss/
3  | repo-update               | Main Update Repository                                       | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/oss/
4  | repo-update-non-oss       | Update Repository (Non-Oss)                                  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/non-oss/
5  | repo-backports-update     | Update repository of openSUSE Backports                      | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/backports/
6  | repo-sle-update           | Update repository with updates from SUSE Linux Enterprise 15 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/sle/


补充:
1) 确保以上软件库已处于 Enabled 状态
2) 手动启动这些软件库的命令如下

# zypper ar -fcg http://download.opensuse.org/distribution/leap/${releasever}/repo/non-oss/ Non-OSS Repository
# zypper ar -fcg http://download.opensuse.org/distribution/leap/${releasever}/repo/oss/ Main Repository
# zypper ar -fcg http://download.opensuse.org/update/leap/${releasever}/oss/ Main Update Repository
# zypper ar -fcg http://download.opensuse.org/update/leap/${releasever}/non-oss/ Update Repository (Non-Oss)
# zypper ar -fcg http://download.opensuse.org/update/leap/${releasever}/backports/ Update repository of openSUSE Backports
# zypper ar -fcg http://download.opensuse.org/update/leap/${releasever}/sle/ Update repository with updates from SUSE Linux Enterprise 15

2.2 刷新已使用的软件库

# zypper ref

(注意:确保刷新成功,否则请检查网络)

2.3 将所有 openSUSE Leap 15.3 软件包更新到最新版本

# zypper -n update

2.4 用 releasever 变量替换所有版本号

# sed -i 's/15.3/${releasever}/g' /etc/zypp/repos.d/*.repo

步骤三:升级系统

3.1 将版本号设置为 15.4 并刷新

# zypper --releasever=15.4 refresh

3.2 提前下载并安装 openSUSE Leap 15.4 所需的软件包

# zypper --releasever=15.4 dup --download-in-advance

3.3 升级系统

# zypper --releasever=15.4 dup

3.4 重启系统

# reboot

步骤四:后续检查

4.1 显示升级后的系统版本

# cat /etc/*release*
NAME="openSUSE Leap"
VERSION="15.4"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.4"
PRETTY_NAME="openSUSE Leap 15.4"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.4"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

4.2 显示升级后已使用的软件库

# zypper ls -d
#  | Alias                     | Name                                                         | Enabled | GPG Check | Refresh | Priority | Type   | URI
---+---------------------------+------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------------------------
1  | repo-non-oss              | Non-OSS Repository                                           | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.4/repo/non-oss/
2  | repo-oss                  | Main Repository                                              | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.4/repo/oss/
3  | repo-update               | Main Update Repository                                       | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.4/oss/
4  | repo-update-non-oss       | Update Repository (Non-Oss)                                  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.4/non-oss/
5  | repo-backports-update     | Update repository of openSUSE Backports                      | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.4/backports/
6  | repo-sle-update           | Update repository with updates from SUSE Linux Enterprise 15 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.4/sle/

[命令] Linux 命令 modprobe、rmmod、insmod、lsmod、modinfo 的使用 (管理模块)

内容一:modprobe 命令的选项

1) -a 或者 –all,载入所有模块
2) -c 或者 –show-conf 显示所有模块的配置信息
3) -r 或者 –remove 卸载模块,必须在模块闲置不用时操作。
4) -v 或者 –verbose 显示执行时的详细信息
5) -V 或者 –version 显示命令的版本信息
6) -h 或者 –help 显示命令的帮助信息

内容二:modprobe、insmod、rmmod、lsmod、modinfo 命令的案例

2.1 案例一:安装模块

# modprobe floppy

或者:

# insmod floppy

2.2 案例二:删除模块

# modprobe -r floppy

或者:

# rmmod floppy

2.3 案例三:显示所有模块

# lsmod

2.4 案例四:显示某 1 个模块的详细信息

# modinfo floppy

[内容] Linux 常用软件

bash-completion

作用:用于使用 tab 键补全命令

安装方法:

如果是 Rocky Linux & RHEL:

# yum install bash-completion

或者:

# dnf install bash-completion

如果是 openSUSE & SLES:

# zypper install bash-completion

lsb-release

作用:可以在 openSUSE & SLES 上显示系统版本信息

安装方法:

# zypper install lsb-release

redhat-lsb-core

作用:可以在 CentOS Linux & RHEL 上显示系统版本信息

安装方法:

如果是 Rocky Linux & RHEL:

# yum install redhat-lsb-core

如果是 openSUSE & SLES:

# dnf install redhat-lsb-core

sysstat

作用:包含多种对 Linux 系统综合性能分析的命令,包括 iostat、mpstat、sar、pidstat 等命令

安装方法:

如果是 Rocky Linux & RHEL:

# yum install sysstat

或者:

# yum install sysstat

如果是 openSUSE & SLES:

# zypper install sysstat

vim-enhanced

作用:可以使用 vim 命令编辑文档

安装方法:

如果是 Rocky Linux & RHEL:

# yum install vim-enhanced

或者:

# dnf install vim-enhanced

如果是 openSUSE & SLES:

# zypper install vim-enhanced

xorg-x11-xauth.x86_64 和 xorg-x11-fonts-*

作用:让需要图形化环境的软件可以启动

安装方法:

如果是 Rocky Linux & RHEL:

# yum install xorg-x11-xauth.x86_64; yum install xorg-x11-fonts-*

或者:

# dnf install xorg-x11-xauth.x86_64; dnf install xorg-x11-fonts-*

如果是 openSUSE & SLES:

# zypper install xorg-x11-xauth.x86_64; dnf install xorg-x11-fonts-*