RHEL - 订阅、注册系统和 Yum Repository(新版界面)

《OpenShift / RHEL / DevSecOps 汇总目录》

演示环境说明

本文需要有 redhat.com 账号以及包含 RHEL 的有效订阅。
演示环境使用了通过 minimal 方式安装的 RHEL 7.6 环境,RHEL 可以访问互联网。
红帽网站 access.redhat.com 针对新用户提供了新版界面,对于较早的客户提供的还是老版界面(界面差异见以下 “查看当前用户的有效订阅” 小节的截图,另外还可参见新老版本对应关系)。

红帽订阅及其相关概念

产品订阅(Subscription)

产品订阅是一种使用 RedHat 软件并获得支持服务的购买模式。

权利(Entitlement)

权利是用户可用合法安装使用软件的数量。

注册和注销 RHEL 系统

  1. 在 RHEL 中执行以下命令查看当前 RHEL 版本和订阅情况。
$ subscription-manager list
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        7.6
Arch:           x86_64
Status:         Unknown
Status Details:
Starts:
Ends:
  1. 查看本地 Yum Repo,确认当前本地没有可用的 Repo,另外配置文件中也无有效内容。
$ yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
repolist: 0
 
$ ll /etc/yum.repos.d/redhat.repo
-rw-r--r--. 1 root root 358 Sep 24 22:51 /etc/yum.repos.d/redhat.repo
  1. 执行以下命令,可将该 RHEL 系统注册到红帽官方。
$ subscription-manager register --username xxx --password yyy
Registering to: subscription.rhsm.redhat.com:443/subscription
The system has been registered with ID: bc39c292-79d8-4482-ad5d-098506ff9bbe
The registered system name is: rhel-repo

也可在 RHEL 桌面的设置中注册当前系统。
在这里插入图片描述

  1. 可执行以下命令查看当前的系统也没有关联有效订阅。
$ subscription-manager list --consumed
No consumed subscription pools were found.
  1. 再次执行命令,确认 Status 已经从“Unknown” 变为 “Not Subscribed”,这说明系统还没有和订阅关联起来。
$ subscription-manager list
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        7.6
Arch:           x86_64
Status:         Not Subscribed
Status Details:
Starts:
Ends:
  1. 执行命令,确认本地已有 Yum Repo 和可用的 Repo 配置了。注意:缺省 “$releasever” 是 “7Server”。
$ subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-7-server-rpms
Repo Name: Red Hat Enterprise Linux 7 Server (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/os
Enabled:   1

$ ll /etc/yum.repos.d/redhat.repo
-rw-r--r--. 1 root root 336442 Sep 24 22:53 /etc/yum.repos.d/redhat.repo

$ yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.
rhel-7-server-rpms                                                                        | 3.5 kB  00:00:00
(1/3): rhel-7-server-rpms/7Server/x86_64/group                                            | 631 kB  00:00:08
(2/3): rhel-7-server-rpms/7Server/x86_64/updateinfo                                       | 4.3 MB  00:00:11
(3/3): rhel-7-server-rpms/7Server/x86_64/primary_db                                       |  96 MB  00:00:44
repo id                                           repo name                                                status
rhel-7-server-rpms/7Server/x86_64                 Red Hat Enterprise Linux 7 Server (RPMs)                 33,930
repolist: 33,930
  1. 执行命令可以注销当前的系统。
$ subscription-manager unregister

查看当前用户的有效订阅

  1. 登录 https://access.redhat.com/management,查看当前用户有的红帽订阅。
    在这里插入图片描述
  2. 在 “订阅” 中查看有效订阅。
    在这里插入图片描述
  3. 查看有效订阅详细情况。
    在这里插入图片描述
  4. 可通过命令查看当前用户的有效订阅。
$ subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Developer Subscription for Individuals
Provides:            Red Hat Beta
                     Red Hat Enterprise Linux EUS Compute Node
                     Red Hat Enterprise Linux Fast Datapath
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Build of Quarkus
                     Red Hat Developer Tools (for RHEL Server for ARM)
                     Red Hat OpenShift Enterprise JBoss EAP add-on Beta
                     Red Hat Ansible Automation Platform
                     Red Hat CodeReady Linux Builder for x86_64
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Compute Node)
                     Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update
                     Support
                     Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
                     Red Hat JBoss AMQ Clients
                     Red Hat Enterprise Linux Server
                     dotNET on RHEL (for RHEL Server)
                     Red Hat 3scale API Management Platform
                     Red Hat JBoss Data Grid
                     Red Hat Software Collections (for RHEL Server for ARM)
                     Red Hat CodeReady Linux Builder for ARM 64
                     Red Hat Openshift Application Runtimes
                     Red Hat Enterprise Linux Fast Datapath (for RHEL for ARM 64)
                     Red Hat Enterprise Linux High Availability for x86_64
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Container Images
                     Red Hat OpenShift Container Platform for ARM 64
                     Red Hat OpenShift Container Platform
                     Red Hat Developer Tools Beta (for RHEL Server for ARM)
                     Red Hat Enterprise Linux Resilient Storage for IBM z Systems - Extended Update Support
                     Red Hat JBoss Core Services from RHUI
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server)
                     Red Hat JBoss Middleware
                     OpenJDK Java (for Middleware)
                     Red Hat Enterprise Linux for SAP Solutions for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux for SAP Applications for x86_64 - Update Services for SAP Solutions
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux High Availability (for IBM z Systems) - Extended Update Support
                     Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
                     Red Hat Developer Toolset (for RHEL Server)
                     Red Hat CodeReady Workspaces for OpenShift
                     Red Hat Enterprise Linux for SAP Solutions for x86_64
                     Red Hat AMQ Interconnect
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server)
                     dotNET on RHEL Beta (for RHEL Server)
                     Red Hat Developer Suite v.3
                     Red Hat Enterprise Linux for SAP Applications for Power LE - Update Services for SAP
                     Solutions
                     JBoss Enterprise Web Server from RHUI
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Openshift Application Runtimes for IBM Power LE
                     Red Hat Ansible Engine
                     MRG Realtime
                     Red Hat Enterprise Linux for x86_64 - Update Services for SAP Solutions
                     Red Hat Container Images Beta
                     Red Hat Developer Tools (for RHEL Server)
                     JBoss Enterprise Application Platform from RHUI
                     Red Hat Developer Tools Beta (for RHEL Server)
                     Red Hat Software Collections Beta (for RHEL Server for ARM)
                     Oracle Java (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux for SAP Solutions for x86_64 - Update Services for SAP Solutions
                     Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat CodeReady Linux Builder for IBM z Systems - Extended Update Support
                     Red Hat Enterprise Linux for IBM z Systems - Extended Update Support
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux for ARM 64
                     Red Hat Enterprise Linux Fast Datapath Beta for x86_64
                     Red Hat OpenShift Enterprise JBoss EAP add-on
                     Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
                     JBoss Enterprise Web Platform
                     Red Hat Enterprise Linux for SAP Applications for x86_64 - Extended Update Support
                     Red Hat OpenShift Enterprise JBoss A-MQ add-on
                     Red Hat OpenShift Application Runtimes Beta
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux for Real Time
                     Red Hat Migration Toolkit
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server)
                     Red Hat Enterprise Linux High Availability for x86_64 - Update Services for SAP Solutions
                     Red Hat OpenShift Enterprise JBoss FUSE add-on
                     JBoss Enterprise Application Platform
                     Red Hat Enterprise Linux for SAP Applications for x86_64
                     Red Hat JBoss Core Services
                     Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux Resilient Storage for x86_64
                     Red Hat Container Development Kit
                     Red Hat Enterprise Linux for x86_64 - Extended Update Support
SKU:                 RH00798
Contract:
Pool ID:             2c945dc486db651601870cc2a4351897
Provides Management: No
Available:           16
Suggested:           1
Service Level:       Self-Support
Service Type:
Subscription Type:   Standard
Starts:              03/23/2023
Ends:                03/21/2024
System Type:         Physical

Subscription Name:   Red Hat Beta Access
Provides:            Red Hat Satellite Capsule Beta
                     Red Hat Enterprise Linux for SAP Applications for IBM z Systems Beta
                     Red Hat Enterprise Linux for SAP Applications for Power, little endian Beta
                     Red Hat Enterprise Linux Fast Datapath Beta for Power, little endian
                     Red Hat Enterprise Linux Resilient Storage Beta
                     Red Hat Enterprise Linux for SAP Applications for x86_64 Beta
                     Red Hat CodeReady Linux Builder for IBM z Systems Beta
                     Red Hat Enterprise Linux for SAP HANA for x86_64 Beta
                     Red Hat Enterprise Linux Advanced Virtualization Beta (for RHEL Server for IBM System Z)
                     Red Hat CodeReady Linux Builder for x86_64 Beta
                     Red Hat Enterprise Linux for SAP HANA for Power, little endian Beta
                     Red Hat Directory Server Beta
                     Red Hat Enterprise Linux for Power, little endian Beta
                     Red Hat Certificate System Beta
                     Red Hat Enterprise Linux for Real Time for NFV Beta
                     Red Hat Enterprise Linux for Real Time Beta
                     Red Hat Satellite Beta
                     Red Hat Enterprise Linux Fast Datapath Beta for x86_64
                     Red Hat Enterprise Linux for x86_64 Beta
                     Red Hat Enterprise Linux for IBM z Systems Beta
                     Red Hat Enterprise Linux for ARM 64 Beta
                     Red Hat CodeReady Linux Builder for ARM 64 Beta
                     Red Hat CodeReady Linux Builder for Power, little endian Beta
                     Red Hat Enterprise Linux High Availability Beta
SKU:                 RH00069
Contract:
Pool ID:             2c94d89286ea780d01870cc2f95b0021
Provides Management: No
Available:           Unlimited
Suggested:           1
Service Level:       Self-Support
Service Type:        L1-L3
Subscription Type:   Standard
Starts:              03/23/2023
Ends:                03/21/2024
System Type:         Physical

将 RHEL 系统关联和取关订阅

  1. 执行命令确认当前 RHEL 系统没有和订阅关联。
$ subscription-manager list --consumed
No consumed subscription pools were found.
  1. 执行命令,将当前系统和指定 pool 的订阅关联。
$ subscription-manager attach --pool=2c945dc486db651601870cc2a4351897
Successfully attached a subscription for: Red Hat Developer Subscription for Individuals
  1. 查看已被使用的订阅。
$ subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Developer Subscription for Individuals
Provides:            Red Hat Enterprise Linux High Availability for x86_64 - Update Services for SAP Solutions
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat CodeReady Linux Builder for IBM z Systems - Extended Update Support
                     JBoss Enterprise Application Platform from RHUI
                     Red Hat Enterprise Linux Atomic Host Beta
                     JBoss Enterprise Web Server from RHUI
                     Red Hat Developer Tools (for RHEL Server)
                     Red Hat Container Images
                     Red Hat Developer Tools Beta (for RHEL Server)
                     Red Hat Container Images Beta
                     Red Hat 3scale API Management Platform
                     Red Hat OpenShift Enterprise JBoss EAP add-on
                     Red Hat Software Collections (for RHEL Server for ARM)
                     Red Hat Software Collections Beta (for RHEL Server for ARM)
                     Red Hat OpenShift Enterprise JBoss FUSE add-on
                     Red Hat Migration Toolkit
                     Red Hat OpenShift Enterprise JBoss A-MQ add-on
                     Red Hat JBoss Core Services from RHUI
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Enterprise Linux Resilient Storage for x86_64
                     Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
                     dotNET on RHEL (for RHEL Server)
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server)
                     dotNET on RHEL Beta (for RHEL Server)
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
                     Red Hat Ansible Automation Platform
                     Red Hat OpenShift Container Platform for ARM 64
                     Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux for SAP Solutions for x86_64
                     OpenJDK Java (for Middleware)
                     Red Hat Enterprise Linux for Real Time
                     Red Hat AMQ Interconnect
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Enterprise Linux for SAP Applications for x86_64 - Extended Update Support
                     Red Hat Openshift Application Runtimes for IBM Power LE
                     Oracle Java (for RHEL Server) - Extended Update Support
                     Red Hat Developer Tools (for RHEL Server for ARM)
                     Red Hat Developer Tools Beta (for RHEL Server for ARM)
                     Red Hat Enterprise Linux for SAP Solutions for x86_64 - Extended Update Support
                     Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Enterprise Linux Fast Datapath Beta for x86_64
                     Red Hat Enterprise Linux Fast Datapath
                     Red Hat Ansible Engine
                     Red Hat Enterprise Linux Server
                     Red Hat OpenShift Container Platform
                     Red Hat Container Development Kit
                     MRG Realtime
                     Red Hat CodeReady Linux Builder for x86_64
                     Red Hat CodeReady Linux Builder for ARM 64
                     Red Hat Developer Toolset (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update
                     Support
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Compute Node)
                     Red Hat Build of Quarkus
                     Red Hat OpenShift Application Runtimes Beta
                     Red Hat Enterprise Linux EUS Compute Node
                     Red Hat Enterprise Linux for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux Fast Datapath (for RHEL for ARM 64)
                     Red Hat Openshift Application Runtimes
                     Red Hat Enterprise Linux for IBM z Systems - Extended Update Support
                     Red Hat Enterprise Linux for ARM 64
                     Red Hat Beta
                     Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
                     JBoss Enterprise Application Platform
                     JBoss Enterprise Web Platform
                     Red Hat Developer Suite v.3
                     Red Hat Enterprise Linux for SAP Applications for Power LE - Update Services for SAP
                     Solutions
                     Red Hat Enterprise Linux High Availability (for IBM z Systems) - Extended Update Support
                     Red Hat Enterprise Linux for x86_64 - Update Services for SAP Solutions
                     Red Hat Enterprise Linux for SAP Applications for x86_64 - Update Services for SAP Solutions
                     Red Hat Enterprise Linux for SAP Applications for x86_64
                     Red Hat Enterprise Linux Resilient Storage for IBM z Systems - Extended Update Support
                     Red Hat JBoss AMQ Clients
                     Red Hat Enterprise Linux for SAP Solutions for x86_64 - Update Services for SAP Solutions
                     Red Hat OpenShift Enterprise JBoss EAP add-on Beta
                     Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
                     Red Hat JBoss Middleware
                     Red Hat CodeReady Workspaces for OpenShift
                     Red Hat JBoss Data Grid
                     Red Hat JBoss Core Services
                     Red Hat Enterprise Linux High Availability for x86_64
                     Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server)
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
SKU:                 RH00798
Contract:
Account:             6317226
Serial:              5165834853842457511
Pool ID:             2c945dc486db651601870cc2a4351897
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Self-Support
Service Type:
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              03/23/2023
Ends:                03/21/2024
System Type:         Physical
  1. 执行命令可以将当前的 RHEL 系统取关订阅。
$ subscription-manager remove --serial=5165834853842457511
1 local certificate has been deleted.
The entitlement server successfully removed these serial numbers:
   5165834853842457511

操作 Yum Repository

使用指定版本的 Repo

使用缺省的 Repo 版本

  1. 执行命令,确认当前没有指定特定版本。说明:如果没有指定版本,缺省 “$releasever” 是 “7Server”。
$ subscription-manager release --show
Release not set
$ subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-7-server-rpms
Repo Name: Red Hat Enterprise Linux 7 Server (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/os
Enabled:   1
  1. 执行命令,根据提示确认当前的系统将升级到 RHEL 7.9(注意:正式升级前退出命令。说明:3.10.0-1160 是 RHEL 7.9 的版本号)。
$ yum update
Loaded plugins: product-id, search-disabled-repos, subscription-manager
rhel-7-server-rpms                                                                        | 3.5 kB  00:00:00
(1/3): rhel-7-server-rpms/7Server/x86_64/group                                            | 631 kB  00:00:03
(2/3): rhel-7-server-rpms/7Server/x86_64/updateinfo                                       | 4.3 MB  00:00:08
(3/3): rhel-7-server-rpms/7Server/x86_64/primary_db                                       |  96 MB  00:00:49
Resolving Dependencies
--> Running transaction check
...
...
Dependencies Resolved

=================================================================================================================
 Package                                   Arch      Version                         Repository             Size
=================================================================================================================
Installing:
 iwl7260-firmware                          noarch    25.30.13.0-80.el7_9             rhel-7-server-rpms    6.1 M
     replacing  iwl7265-firmware.noarch 22.0.7.0-69.el7
 kernel                                    x86_64    3.10.0-1160.99.1.el7            rhel-7-server-rpms     52 M
Updating:
 GeoIP                                     x86_64    1.5.0-14.el7                    rhel-7-server-rpms    1.5 M
 NetworkManager                            x86_64    1:1.18.8-2.el7_9                rhel-7-server-rpms    1.9 M
...
...
Transaction Summary
=================================================================================================================
Install    2 Packages (+12 Dependent packages)
Upgrade  214 Packages

Total download size: 303 M
Is this ok [y/d/N]: N

方法1:用固定配置指定使用的 Repo 版本

  1. 执行命令,查看当前 RHEL 有哪些发行版。注意1:“7Server” 将等同于最后一个小版本。
$ subscription-manager release --list
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
7.0
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
7Server

注意2:如果不执行前面的 subscription-manager attach 命令关联有效订阅,此步将没有返回结果。

  1. 执行命令,使用特定发行版。当前本地 Repo 的配置已经使用 7.7 版本了。
$ subscription-manager release --set=7.7
Release set to: 7.7
 
$ subscription-manager release --show
Release: 7.7
 
$ subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-7-server-rpms
Repo Name: Red Hat Enterprise Linux 7 Server (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/7/7.7/$basearch/os
Enabled:   1
  1. 为了使用新版本的 Repo,需要先清除本地已有 Repo 资源,执行完后确认 “enabled repos” 为 “0”。说明:如果命令没有指定删除的版本,将使用缺省的 7Server 版本。
$ yum clean all -v
Not loading "rhnplugin" plugin, as it is disabled
Loading "product-id" plugin
Loading "search-disabled-repos" plugin
Loading "subscription-manager" plugin
Updating Subscription Management repositories.
Config time: 5.335
Yum version: 3.4.3
Cleaning repos: rhel-7-server-rpms
Operating on /var/cache/yum/x86_64/7Server (see CLEAN OPTIONS in yum(8) for details)
Disk usage of /var/cache/yum/*/* after cleanup:
0      enabled repos
0      disabled repos
0      untracked repos
36     other data:
  36     /var/cache/yum/x86_64/7Server/timedhosts
36     total
  1. 再执行升级,确认此次操作会将系统升级到 Kernel 为 3.10.0-1062 的 RHEL 7.7 版本。
$ yum update
Loaded plugins: product-id, search-disabled-repos, subscription-manager
rhel-7-server-rpms                                                                        | 3.5 kB  00:00:00
(1/3): rhel-7-server-rpms/x86_64/group                                                    | 767 kB  00:00:07
(2/3): rhel-7-server-rpms/x86_64/updateinfo                                               | 3.6 MB  00:00:13
(3/3): rhel-7-server-rpms/x86_64/primary_db                                               |  68 MB  00:12:49
Resolving Dependencies
...
...
Dependencies Resolved

=================================================================================================================
 Package                                   Arch      Version                         Repository             Size
=================================================================================================================
Installing:
 kernel                                    x86_64    3.10.0-1062.18.1.el7            rhel-7-server-rpms     50 M
Updating:
 GeoIP                                     x86_64    1.5.0-14.el7                    rhel-7-server-rpms    1.5 M
 NetworkManager                            x86_64    1:1.18.0-5.el7_7.2              rhel-7-server-rpms    1.9 M
...
...
Transaction Summary
=================================================================================================================
Install    1 Package  (+4 Dependent packages)
Upgrade  176 Packages

Total download size: 277 M
Is this ok [y/d/N]: N

方法2:用临时配置指定使用的 Repo 版本

  1. 取消版本设置。
$ subscription-manager release --unset
Release preference has been unset

$ subscription-manager release --show
Release not set
  1. 清除本地已有 Repo 资源。说明:如果没有指定特定次要版本,将使用指定主版本的最新次版本,即 7Server。
$ yum clean all -v
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Cleaning repos: rhel-7-server-rpms
  1. 清除本地已有指定版本的 Repo 资源。
$ yum clean all --releasever=7.7 --verbose
Not loading "rhnplugin" plugin, as it is disabled
Loading "product-id" plugin
Loading "search-disabled-repos" plugin
Loading "subscription-manager" plugin
Updating Subscription Management repositories.
Config time: 6.953
Yum version: 3.4.3
Cleaning repos: rhel-7-server-rpms
Operating on /var/cache/yum/x86_64/7.7 (see CLEAN OPTIONS in yum(8) for details)
Disk usage of /var/cache/yum/*/* after cleanup:
0      enabled repos
0      disabled repos
0      untracked repos
...
  1. 执行升级命令,并在其中指定使用的版本。说明:Kernel 为 3.10.0-957 是 RHEL 7.6 版本。
$ yum update --releasever=7.6
Loaded plugins: product-id, search-disabled-repos, subscription-manager
rhel-7-server-rpms                                                                        | 3.4 kB  00:00:00
(1/3): rhel-7-server-rpms/7.6/x86_64/group                                                | 773 kB  00:00:04
(2/3): rhel-7-server-rpms/7.6/x86_64/updateinfo                                           | 3.2 MB  00:00:10
(3/3): rhel-7-server-rpms/7.6/x86_64/primary_db                                           |  58 MB  00:02:59
Resolving Dependencies
--> Running transaction check
...
...

Dependencies Resolved

=================================================================================================================
 Package                                    Arch       Version                      Repository              Size
=================================================================================================================
Installing:
 kernel                                     x86_64     3.10.0-957.27.2.el7          rhel-7-server-rpms      48 M
Updating:
 NetworkManager                             x86_64     1:1.12.0-10.el7_6            rhel-7-server-rpms     1.7 M
...
...

Transaction Summary
=================================================================================================================
Install   1 Package
Upgrade  76 Packages

Total download size: 136 M
Is this ok [y/d/N]: N

启用和关闭 Repo

  1. 以下命令可以列出当前订阅包含的所有 Repo。
$ subscription-manager repos --list
  1. 以下命令只列出当前使用的 Repo。
$ subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-7-server-rpms
Repo Name: Red Hat Enterprise Linux 7 Server (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/os
Enabled:   1
  1. 执行命令启动和关闭指定 Repo。
$ subscription-manager repos --enable=rhel-ha-for-rhel-7-server-rpms
$ subscription-manager repos --diseble=rhel-ha-for-rhel-7-server-rpms

参考

https://access.redhat.com/labs/registrationassistant/
https://access.redhat.com/solutions/29269
https://access.redhat.com/solutions/238533
https://access.redhat.com/articles/433903
https://access.redhat.com/solutions/23016
https://access.redhat.com/solutions/7019225
https://access.redhat.com/solutions/3176811
https://access.redhat.com/solutions/45956
https://www.redhat.com/en/blog/red-hat-subscription-management-simple-content-access-explained
https://access.redhat.com/articles/simple-content-access
https://access.redhat.com/sites/default/files/attachments/subscriptionandentitlementaccounting-v1.1.pdf

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/689917.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

云原生架构:构建高可用、可伸缩的互联网应用

随着互联网技术的不断发展,云原生架构已经成为构建高可用、可伸缩的互联网应用的最佳实践之一。云原生架构是一种以云计算为基础的应用架构,旨在充分利用云平台的优势,实现应用的高可用性、灵活性和可扩展性。本文将介绍云原生架构的关键概念…

数据结构复习指导之外部排序

目录 外部排序 复习提示 1.外部排序的基本概念 2.外部排序的方法 2.1对大文件排序时使用的排序算法(2016) 3.多路平衡归并与败者树 4.置换-选择排序(生成初始归并段) 4.1置换-选择排序生成初始归并段的实例(2023) 5.最佳…

2. pytorch环境安装

概述 ​ 本文提供基于Anaconda环境Windows11操作系统的Pytorch深度学习环境的配置。深度学习环境分为GPU和CPU两大部分。使用GPU进行环境配置,需要保证电脑配有独立显卡,并且显卡驱动安装正常,详情见前文。 1. 创建新的虚拟环境用来配置Pyt…

【Rust】——面向对象设计模式的实现

🎼个人主页:【Y小夜】 😎作者简介:一位双非学校的大二学生,编程爱好者, 专注于基础和实战分享,欢迎私信咨询! 🎆入门专栏:🎇【MySQL&#xff0…

如何知道ZIP压缩包解压密码?有哪些解密策略?

我们在生活当中,经常会遇到ZIP压缩包,它们以其高效的文件压缩和方便的传输特性而受到广泛欢迎。然而,有时我们可能会遇到一些带有密码保护的ZIP文件,这时就需要知道解压密码才能访问其中的内容。本文将探讨如何知道ZIP压缩包的解压…

Suse Linux ssh配置免密后仍需要输入密码

【问题描述】 Suse Linux已经配置了ssh免密,但无法ssh到目标服务器。 对自身的ssh登陆也需要输入密码。 系统–Suse 15 SP5 【重现步骤】 1.使用ssh-keygen -t rsa生产key文件 2.使用ssh-copy-id拷贝public key到目标机器(或者自身) 3.配置成功后ssh 目标时仍需要输…

使用亮数据代理IP爬取PubMed文章链接和邮箱地址

💂 个人网站:【 摸鱼游戏】【神级代码资源网站】【工具大全】🤟 一站式轻松构建小程序、Web网站、移动应用:👉注册地址🤟 基于Web端打造的:👉轻量化工具创作平台💅 想寻找共同学习交…

Tensorflow音频分类

tensorflow https://www.tensorflow.org/lite/examples/audio_classification/overview?hlzh-cn 官方有移动端demo 前端不会 就只能找找有没有java支持 注意版本 注意JDK版本 package com.example.demo17.controller;import org.tensorflow.*; import org.tensorflow.ndarra…

【Java面试】九、微服务篇-SpringCloud(上)

文章目录 1、SpringCloud五大组件2、服务注册和发现2.1 Eurake2.2 Eurake和Nacos的区别 3、Ribbon负载均衡3.1 策略3.2 自定义负载均衡策略 4、服务雪崩与熔断降级4.1 服务雪崩4.2 服务降级4.3 服务熔断 5、服务限流5.1 Nginx限流5.2 网关限流 6、微服务监控7、面试 1、SpringC…

【Python报错】已解决ModuleNotFoundError: No module named ‘xxx‘ in Jupyter Notebook

解决Python报错:ModuleNotFoundError: No module named ‘xxx’ in Jupyter Notebook 在使用Jupyter Notebook进行数据分析或科学计算时,我们经常需要导入各种Python模块。如果你遇到了ModuleNotFoundError: No module named xxx的错误,这通常…

[word] word如何清除超链接 #媒体#笔记#知识分享

word如何清除超链接 办公中,少不了使用word,这个是大家必备的软件,今天给大家分享下word如何清除超链接的操作办法,一起来学习下吧! 1、清除所有超链接 按下组合键CtrlshiftF9,就可以将网上复制带有超链…

Rust 标记一个属性或函数为废弃

如题,演示Rust 标记一个属性或函数为废弃的基本使用方法: 示例: use serde::{Deserialize, Serialize};#[derive(Clone, Debug, Serialize, Deserialize, Default)] pub struct GrpcOptions {pub addr: String,pub max_recv_message_size: u…

【JavaScript函数详解】Day04

JavaScript函数详解 JavaScript 基础 - 第4天笔记函数声明和调用声明(定义)调用 参数形参和实参参数默认值 返回值函数补充细节作用域全局作用域局部作用域变量的访问原则 匿名函数函数表达式立即执行函数 逻辑中断小知识(转换为Boolean型&am…

企业应如何选择安全合规的内外网文件摆渡系统?

网络隔离是一种安全措施,旨在将网络划分为不同的部分,以减少安全风险并保护敏感信息。常见的隔离方式像物理隔离、逻辑隔离、防火墙隔离、虚拟隔离、DMZ区隔离等,将网络隔离成内网和外网。内外网文件摆渡通常指在内部网络(内网&am…

【吊打面试官系列】CHAR 和 VARCHAR 的区别?

大家好,我是锋哥。今天分享关于 【CHAR 和 VARCHAR 的区别?】面试题,希望对大家有帮助; CHAR 和 VARCHAR 的区别? 1、CHAR 和 VARCHAR 类型在存储和检索方面有所不同 1000道 互联网大厂Java工程师 精选面试题-Java资源…

【吊打面试官系列】MySQL 中 InnoDB 支持的四种事务隔离级别名称,以及逐级之间的区别?

大家好,我是锋哥。今天分享关于 【MySQL 中 InnoDB 支持的四种事务隔离级别名称,以及逐级之间的区别?】面试题,希望对大家有帮助; MySQL 中 InnoDB 支持的四种事务隔离级别名称,以及逐级之间的区别&#xf…

【机器学习】深度卷积生成对抗网络(DCGAN)用于图像生成

1. 引言 1.1 DGGAN是什么? DGGAN(Directed Graph embedding framework based on Generative Adversarial Network)是一种基于生成对抗网络(GAN)的有向图嵌入方法: 基本定义:DGGAN是一种结合了…

【中篇】从 YOLOv1 到 YOLOv8 的 YOLO 物体检测模型历史

YOLO 型号之所以闻名遐迩,主要有两个原因:其速度和准确性令人印象深刻,而且能够快速、可靠地检测图像中的物体。上回我解释了Yolo v1, 今天从Yolov2开始。 YOLOv2:更好、更快、更强 2017 年 7 月一个闷热的星期二下午,雷德蒙(Joseph Redmon, Yolo创始人)再次走上舞台。 …

【微信小程序开发】小程序中的上滑加载更多,下拉刷新是如何实现的?

✨✨ 欢迎大家来到景天科技苑✨✨ 🎈🎈 养成好习惯,先赞后看哦~🎈🎈 🏆 作者简介:景天科技苑 🏆《头衔》:大厂架构师,华为云开发者社区专家博主,…

Socket编程权威指南(二)完美掌握TCP流式协议及Socket编程的recv()和send()

在上一篇文章中,我们学习了Socket编程的基础知识,包括创建Socket、绑定地址、监听连接、接收连接等操作。然而,真正的套接字编程远不止于此。本文将重点介绍TCP 流式协议,什么是粘包问题?如何解决粘包问题 &#xff1f…