赞
踩
还不会安装dockers嘛?亲手教会你在Red Hat 8.5安装docker以及万能的hello world_redhat安装docker什么版本-CSDN博客
uname -r
配置网络
vim /etc/sysconfig/network-scripts/ifcfg-ens160
- TYPE=Ethernet
- PROXY_METHOD=none
- BROWSER_ONLY=no
- #BOOTPROTO=none
- BOOTPROTO=dhcp
- DEFROUTE=yes
- IPV4_FAILURE_FATAL=no
- IPV6INIT=yes
- IPV6_AUTOCONF=yes
- IPV6_DEFROUTE=yes
- IPV6_FAILURE_FATAL=no
- NAME=ens160
- UUID=b4db5cd7-7109-4b65-be9a-cb4005550313
- DEVICE=ens160
- ONBOOT=yes
- #IPADDR=192.168.200.1
- #PREFIX=24
- #DNS=192.168.200.1
ping www.baidu.com 测试连通性
- mkdir /iso
- mount /dev/cdrom /iso/
- mount /dev/cdrom /iso
- vim /etc/yum.repos.d/dvd.repo
- [BaseOS]
- name=BaseOS
- baseurl=file:///iso/BaseOS
- gpgcheck=0
- enabled=1
-
- [AppStream]
- name=AppStream
- baseurl=file:///iso/AppStream
- gpgcheck=0
- enabled=1
防火墙关闭
- systemctl stop firewalld
- systemctl disable firewalld
(1)安装 gcc
yum install gcc –y
(2)安装 gcc-c++
yum install gcc-c++ -y
(3)安装 yum-utils
yum install -y yum-utils
- 故障示范
- [root@localhost ~]# sudo yum update
- 正在更新 Subscription Management 软件仓库。
- 无法读取客户身份
-
- 本系统尚未在权利服务器中注册。可使用 subscription-manager 进行注册。
-
-
- BaseOS 0.0 B/s | 0 B 00:00
- Errors during downloading metadata for repository 'BaseOS':
- - Curl error (37): Couldn't read a file:// file for file:///ios/BaseOS/repodata/repomd.xml [Couldn't open file /ios/BaseOS/repodata/repomd.xml]
- 错误:为仓库 'BaseOS' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
-
- 成功安装gcc软件包了。如果您遇到任何问题,请随时告诉我。
-
- 正在注册到:subscription.rhsm.redhat.com:443/subscription
- 用户名: CJ_john
- 密码:
- 这个系统已使用 ID b52d07ba-6eee-46fb-ae33-cc795282203c 进行了注册
- 注册的系统名是:localhost.localdomain
- [root@localhost iso]# subscription-manager status
- +-------------------------------------------+
- 系统状态详情
- +-------------------------------------------+
- 总体状态:禁用
- 内容访问模式设置为简单内容访问。无论订阅状态如何,该主机都可以访问内容。
-
- 系统目的状态:禁用
-
- [root@localhost iso]# yum install gcc -y
- 正在更新 Subscription Management 软件仓库。
- Repository AppStream is listed more than once in the configuration
- Repository BaseOS is listed more than once in the configuration
- Repository AppStream is listed more than once in the configuration
- BaseOS 0.0 B/s | 0 B 00:00
- Errors during downloading metadata for repository 'BaseOS':
- - Curl error (37): Couldn't read a file:// file for file:///ios/BaseOS/repodata/repomd.xml [Couldn't open file /ios/BaseOS/repodata/repomd.xml]
- 错误:为仓库 'BaseOS' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
- [root@localhost iso]#
-
-
- [root@localhost iso]# subscription-manager attach --auto
- 忽略自动附加的请求。 因为内容访问模式的设置 ,组织“ 18111461”禁用了这个功能。
- [root@localhost iso]#
-
-
- [root@localhost iso]# subscription-manager list --available
- +-------------------------------------------+
- 可用订阅
- +-------------------------------------------+
- 订阅名称: Red Hat Beta Access
- 提供: 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
- 合同:
- 池子 Id: 2c94699b8f35e63c018f56f2b0b31e39
- 提供管理: 否
- 可用: 无限
- 推荐的: 1
- 服务类型: L1-L3
- 角色:
- 服务等级: Self-Support
- 使用方法:
- 附加组件:
- 订阅类型: Standard
- 开始: 2024年05月08日
- 结束: 2025年05月08日
- 权利类型: 物理的
-
- 订阅名称: Red Hat Developer Subscription for Individuals
- 提供: Red Hat Enterprise Linux Fast Datapath
- Red Hat OpenShift Enterprise JBoss EAP add-on Beta
- Red Hat Ansible Automation Platform
- Red Hat OpenShift Workload Availability
- Red Hat Enterprise Linux Server
- dotNET on RHEL (for RHEL Server)
- Red Hat 3scale API Management Platform
- OpenShift Developer Tools and Services
- Red Hat CodeReady Linux Builder for ARM 64
- Custom Metric Autoscaler
- 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 Enterprise Linux Resilient Storage for IBM z Systems -
- Extended Update Support
- Red Hat OpenShift GitOps for ARM 64
- Red Hat CoreOS Beta
- 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
- Network Observability (NETOBSERV)
- Red Hat Developer Toolset (for RHEL Server)
- Red Hat Enterprise Linux for SAP Solutions for x86_64
- 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 distributed tracing
- Red Hat Ansible Engine
- MRG Realtime
- Red Hat Enterprise Linux for x86_64 - Update Services for SAP
- Solutions
- JBoss Enterprise Application Platform from RHUI
- Red Hat Developer Tools Beta (for RHEL Server)
- Red Hat Software Collections Beta (for RHEL Server)
- Red Hat Enterprise Linux for IBM z Systems - Extended Update Support
- Red Hat Enterprise Linux for ARM 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 Application Runtimes Beta
- Red Hat Migration Toolkit
- Red Hat Enterprise Linux Scalable File System (for RHEL Server)
- Red Hat Container Native Virtualization for ARM 64
- Red Hat Enterprise Linux Fast Datapath Beta (for RHEL for ARM 64)
- Red Hat Enterprise Linux for x86_64 - Extended Update Support
- Red Hat Container Native Virtualization
- Red Hat Beta
- Red Hat Openshift Serverless
- Red Hat Enterprise Linux EUS Compute Node
- Red Hat Enterprise Linux for x86_64
- Red Hat Developer Tools (for RHEL Server for ARM)
- Red Hat CodeReady Linux Builder for ARM 64 - Extended Update Support
- Red Hat CoreOS
- 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 JBoss Data Grid
- Red Hat Software Collections (for RHEL Server for ARM)
- Kernel Module Management
- 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
- Run Once Duration Override Operator
- Red Hat Developer Tools Beta (for RHEL Server for ARM)
- Red Hat JBoss Core Services from RHUI
- Red Hat build of Quarkus
- Red Hat Service Interconnect
- Red Hat Enterprise Linux Load Balancer (for RHEL Server)
- Red Hat JBoss Middleware
- Red Hat CodeReady Workspaces for OpenShift
- Red Hat OpenShift Enterprise Client Tools
- 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 OpenShift Builds for ARM
- Red Hat Openshift Application Runtimes for IBM Power LE
- Red Hat Enterprise Linux for ARM 64 - Extended Update Support
- Red Hat Container Images Beta
- Red Hat Developer Tools (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 CodeReady Linux Builder for IBM z Systems - Extended Update
- Support
- Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended
- Update Support
- Red Hat Enterprise Linux Fast Datapath Beta for x86_64
- Red Hat Developer Hub
- Red Hat OpenShift Pipelines
- Cert Manager support for Red Hat OpenShift release
- Red Hat OpenShift Enterprise JBoss A-MQ add-on
- Red Hat OpenShift Pipelines for ARM
- Red Hat OpenShift GitOps
- Secondary Scheduler Operator for Red Hat OpenShift (OSSO)
- Red Hat Enterprise Linux Scalable File System (for RHEL Server) -
- Extended Update Support
- Red Hat Enterprise Linux for Real Time
- 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 Quay Enterprise
- Red Hat Enterprise Linux Resilient Storage for x86_64
- Red Hat Container Development Kit
- Red Hat OpenShift Builds
- SKU: RH00798
- 合同:
- 池子 Id: 2c94699b8f35e63c018f56f2b0bd1e3b
- 提供管理: 否
- 可用: 16
- 推荐的: 1
- 服务类型:
- 角色: RHEL Server
- RHEl Workstation
- 服务等级: Self-Support
- 使用方法: Development/Test
- 附加组件:
- 订阅类型: Standard
- 开始: 2024年05月08日
- 结束: 2025年05月08日
- 权利类型: 物理的
-
- [root@localhost iso]# subscription-manager attach --pool=<Subscription_ID>
- bash: 未预期的符号 `newline' 附近有语法错误
- [root@localhost iso]# subscription-manager attach --pool=<Subscription_ID>
- bash: 未预期的符号 `newline' 附近有语法错误
- [root@localhost iso]#
-
-
- [root@localhost iso]# subscription-manager attach --pool=2c94699b8f35e63c018f56f2b0bd1e3b
- You must first accept Red Hat's Terms and conditions. Please visit https://www.redhat.com/wapps/tnc/ackrequired?site=candlepin&event=attachSubscription
-
- [root@localhost iso]# subscription-manager attach --auto
- 忽略自动附加的请求。 因为内容访问模式的设置 ,组织“ 18111461”禁用了这个功能。
- [root@localhost iso]# yum install gcc -y
- 正在更新 Subscription Management 软件仓库。
- Repository AppStream is listed more than once in the configuration
- Repository BaseOS is listed more than once in the configuration
- Repository AppStream is listed more than once in the configuration
- BaseOS 0.0 B/s | 0 B 00:00
- Errors during downloading metadata for repository 'BaseOS':
- - Curl error (37): Couldn't read a file:// file for file:///ios/BaseOS/repodata/repomd.xml [Couldn't open file /ios/BaseOS/repodata/repomd.xml]
- 错误:为仓库 'BaseOS' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
- [root@localhost iso]#
免费注册红帽用于获取下载权限
https://www.redhat.com/wapps/ugc/register.html
具体操作参考其他博主
Red Hat Subscription 开发者订阅与激活订阅_redhat开发者订阅-CSDN博客
免费注册 Redhat 开发者订阅和激活订阅_红帽合作伙伴如何订阅-CSDN博客
切换根权限
sudo su
运行以下命令开始系统注册过程
subscription-manager register
按照提示输入您的Red Hat订阅信息,包括用户名和密码。如果您还没有Red Hat订阅,请先获取一个有效的订阅。
注册成功后,您应该会收到一条消息确认系统已成功注册
可以使用以下命令来验证系统的订阅状态:
subscription-manager status
运行以下命令激活系统:
subscription-manager attach --auto
然后再次运行subscription-manager status
命令,确保系统状态已激活
查看可用的订阅列表:
subscription-manager list --available
手动选择一个订阅并附加它。您可以使用以下命令,将<Subscription_ID>
替换为您选择的订阅的ID:
subscription-manager attach --pool=(修改为自己的ID)2c94699b8f35e63c018f56f2b0bd1e3b
确保订阅已成功附加:
subscription-manager list --consumed
最后再次运行subscription-manager status
命令,确保系统状态已激活
注册红帽以后的问题
- [root@localhost iso]# subscription-manager attach --auto
- 忽略自动附加的请求。 因为内容访问模式的设置 ,组织“ 18111461”禁用了这个功能。
- [root@localhost iso]# yum install gcc -y
- 正在更新 Subscription Management 软件仓库。
- Repository AppStream is listed more than once in the configuration
- Repository BaseOS is listed more than once in the configuration
- Repository AppStream is listed more than once in the configuration
- BaseOS 0.0 B/s | 0 B 00:00
- Errors during downloading metadata for repository 'BaseOS':
- - Curl error (37): Couldn't read a file:// file for file:///ios/BaseOS/repodata/repomd.xml [Couldn't open file /ios/BaseOS/repodata/repomd.xml]
- 错误:为仓库 'BaseOS' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
- [root@localhost iso]#
- 解决办法
清理存储库缓存:
yum clean all
重新生成存储库缓存:
yum makecache
再次尝试安装gcc软件包:
yum install gcc -y
以上解决办法都无法处理当前问题
请参考其他博主
然后顺序执行
- yum clean all
- yum makecache
- yum install gcc -y
停用之前所配置的yum源,并清理缓存
- mv redhat.repo redhat.repo.bak
-
- yum clean all
卸载默认的 pomdman (红帽默认的容器)
yum remove pomdman
添加新的 yum 源(以阿里云地址为例)
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
更新 yum 软件包索引
yum makecache
安装 docker 替换 红帽基础上安装需要
yum install docker-ce --allowerasing
安装依赖包
yum install -y libseccomp-devel
检测
docker -v
启动 docker
systemctl start docker
查看 docker 版本(包括 C端和 S 端)
docker version
查看状态
systemctl status docker
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。