RHEL - 订阅、注册系统和 Yum Repository

news2024/12/24 3:13:47

《OpenShift / RHEL / DevSecOps 汇总目录》

演示环境说明

本文需要有 redhat.com 账号以及包含 RHEL 的有效订阅。
演示环境使用了通过 minimal 方式安装的 RHEL 7.6 环境,RHEL 可以访问互联网。

注册和注销 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
  1. 登录 access.redhat.com,然后访问 https://access.redhat.com/management/systems,确认当前已有一个系统了。注意:目前该系统还没有和用户的有效订阅关联,所以 “已附加订阅” 一列显示为 “0”。
    在这里插入图片描述
    也可执行以下命令查看当前的系统也没有关联有效订阅。
$ 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. 进入订阅产品名称,查看订阅中包含的详细产品清单。
    在这里插入图片描述
  5. 也可通过命令查看当前用户的有效订阅。
$ 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. 在 https://access.redhat.com/management/systems 中可以看到 “已附加订阅” 已经显示 “1”。
    在这里插入图片描述
  2. 执行命令可以将当前的 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 有哪些发行版。注意:“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
  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/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

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

第P8周—YOLOv5-C3模块实现

>- **🍨 本文为[🔗365天深度学习训练营](https://mp.weixin.qq.com/s/Nb93582M_5usednAKp_Jtw) 中的学习记录博客** >- **🍖 原作者:[K同学啊 | 接辅导、项目定制](https://mtyjkh.blog.csdn.net/)** >- **🚀…

transformer不同的包加载模型的结构不一样

AutoModel AutoModelForTokenClassification 结论: AutoModel加载的模型与AutoModelForTokenClassification最后一层是不一样的,从这个模型来看,AutoModelForTokenClassification加载的结果是对的 问题: 为什么AutoModel和Aut…

网络探索之浏览器解析URL

目录 解析URL 特殊情况: 请求响应格式说明 多次请求 解析URL 浏览器是一个具备很多功能的计算机,不仅仅是访问网络浏览信息,使用具体哪个功能是通过url的开头进行区分的,这部分也叫做协议。 协议类型举例: 1.使用…

Windowsold文件夹作用以及删除方法

引言 2021年6月24日,微软正式发布全新操作系统Windows 11。Windows 11系统于2021年10月5日开始全面推送。2021年10月以后生产的电脑已经预装Windows 11系统。刚开始会有一部分人不适应win 11系统,会选择退回win10。现在win11已经推出了稳定版&#xff0…

Gmail 将停止支持基本 HTML 视图

根据 Google 支持文档的更新内容,Gmail 将从明年 1 月起停止支持基本 HTML 视图。 ▲ Gmai 基本 HTML 视图界面 目前网页版 Gmail 提供两个界面:基本 HTML 视图和标准视图。停止支持基本 HTML 视图后,当前打开经典模式的基本 HTML 视图模式 …

【Pandas】数据分组groupby

本文目标: 应用groupby 进行分组对分组数据进行聚合,转换和过滤应用自定义函数处理分组之后的数据 文章目录 1. 数据聚合1.1 单变量分组聚合1.2 Pandas内置聚合方法1.3 聚合方法使用Numpy的聚合方法自定义方法同时计算多种特征向agg/aggregate传入字典 2. 数据转换…

好文学作品的鉴赏标准

好文学作品的鉴赏标准 2023年诺贝尔文学奖颁给了挪威剧作家约恩福瑟。由于之前的博彩公司给中国作家残雪开出了最高的赔率,以及诺贝尔官方推特在揭晓奖项前发布了一张泰戈尔99年前访华的老照片,残雪的获奖氛围在国内各类媒体的渲染下被拉至极高。当奖项…

除静电离子风枪的工作原理及应用

除静电离子风枪的工作原理是利用高压电离空气产生离子风,将静电荷从物体表面中和或分离出来,达到消除静电的目的。它包括一个高压电离器和一个风扇,高压电离器将空气电离成正负两种离子,风扇将离子风喷出。 具体来说,除…

【图像处理GIU】图像分割(Matlab代码实现)

💥💥💞💞欢迎来到本博客❤️❤️💥💥 🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️座右铭&a…

【最终版】tkinter+matplotlib实现一个强大的绘图系统

文章目录 辅助坐标轴功能实现代码优化源代码 Python绘图系统: 前置源码: Python打造动态绘图系统📈一 三维绘图系统 📈二 多图绘制系统📈三 坐 标 轴 定 制📈四 定制绘图风格 📈五 数据生成导入…

lv7 嵌入式开发-网络编程开发 11 TCP管理与UDP协议

目录 1 TCP管理 1.1 三次握手 1.2 四次挥手 1.3 保活计时器 2 wireshark安装及实验 3.1 icmp协议抓包演示 3.2 tcp协议抓包演示 3 UDP协议 3.1 UDP 的主要特点: 4 练习 1 TCP管理 1.1 三次握手 TCP 建立连接的过程叫做握手。 采用三报文握手&#xff1…

代码随想录算法训练营第五十九天 | 647. 回文子串 516.最长回文子序列

1. 回文子串 647. 回文子串 - 力扣(LeetCode) 一个子串左右两个元素相等,并且中间对称,才是回文子串 即 ij 时,[i1: j-1]对称 dp[i][j]: [i:j] 是否是回文字串 当 子串长度大于2 由 dp[i1][j-1] 推出…

协议栈——创建套接字

前面几篇文章讲解的是应用程序使用Socket间接通知协议栈进行的连接,通信阶段,那么从现在开始讲解协议栈和网卡驱动的故事 回顾上篇文章,我们从第一阶段创建套接字,协议栈返回描述符讲起~~~ 协议栈结构 首先来看下协议栈的大致结…

【Python基础】数据容器的切片操作和集合

文章目录 前言一、切片操作1.1 什么是切片?1.2 如何使用切片? 基本切片带步长的切片省略起始和结束索引逆序切片二、集合2.1 什么是集合?2.2 如何定义集合?2.3 集合常用函数1. add()2. remove()3. discard()4. pop()5. clear() 总…

电子器件系列52:达林顿晶体管阵列

其实以前已经学到过,最近在网上看到有的厂家的规格书全部是中文的,一个叫华冠,还有一个叫中科芯,我直接贴它们家的规格书比较方便 其实都是达林顿晶体管阵列 b站上好多视频,搜索达林顿阵列就可以了,这个讲得…

[应用推荐]Web Scraper——轻量数据爬取利器

对于日常的简单网页内容爬取,学习Python等投入太高,可以考虑使用这个Chrome工具。 以下为收集的具体信息,按需取用。 以下内容来自web ScraperWeb Scraper - The #1 web scraping extensionThe most popular web scraping extension. Start …

[计算机入门] Windows附件程序介绍(工具类)

3.14 Windows附件程序介绍(工具类) 3.14.1 计算器 Windows系统中的计算器是一个内置的应用程序,提供了基本的数学计算功能。它被设计为一个方便、易于使用的工具,可以满足用户日常生活和工作中的基本计算需求。 以下是计算器程序的主要功能&#xff1a…

栈的概念|动态顺序栈的详细解析|静态顺序栈链式栈的代码参考

前言 今天我们将学习数据结构中的栈,它是一种特殊的线性表。why——在前面我们学习顺序表、链表它们都属于线性表,它们可以在任意位置进行插入和删除数据;但是今天我们学习栈,它只能在一端进行插入和删除。下面我们就来学习并实现…

[补题记录] Atcoder Beginner Contest 322(E)

URL:https://atcoder.jp/contests/abc322 目录 E Probelm/题意 Thought/思路 Code/代码 E Probelm/题意 有 N 个改进计划,每个计划可以执行一次;有 K 个参数,每个计划可以将所有参数提升固定值,即计划 i 可以为第…

[C国演义] 第十三章

第十三章 三数之和四数之和 三数之和 力扣链接 根据题目要求: 返回的数对应的下标各不相同三个数之和等于0不可包含重复的三元组 – – 即顺序是不做要求的 如: [-1 0 1] 和 [0, 1, -1] 是同一个三元组输出答案顺序不做要求 暴力解法: 排序 3个for循环 去重 — — N^3, …