前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Centos的替代者--RockyLinux之初体验

Centos的替代者--RockyLinux之初体验

作者头像
爱技术的小黄鸭
发布2023-06-15 15:13:36
3.5K0
发布2023-06-15 15:13:36
举报
文章被收录于专栏:IT小圈
04.webp
04.webp

Centos 曾经处于RHEL下游,所以成为了众多公司的首选之一。可后来它变了,它变成“Centos Stream”,别看只是多了一个“Stream”,但它却由原来的RHEL下游变成了RHEL上游

如此一来,所有使用 Centos Stream 的用户都变成了 RedHat 的测试用户,此举真的很阴险,不得不说 Centos 变了初衷。

庆幸的是,Centos 创始人 Gregory Kurtzer 研发了 RockyLinux,并且正式版已经发布。而且同样是基于 RHEL 进行开发的,和原来的 Centos 一样处于 RHEL 下游,并且同样开源免费、不和RedHat有任何关系。

在未来,博主同样相信,RockyLinux 会和 Centos 一样火爆,大型网络科技公司必将会支持这一发行版本。如同当年支持 Mariadb一般。


  • 安装和Centos没啥区别,安装界面除了文字logo不一样以外,恕我才疏学浅暂时看不出有啥异常;
01.webp
01.webp
02.webp
02.webp
03.webp
03.webp

  • 新版特性【和Centos 8 一样】
    • 软件管理使用的是 dnf,当然 yum 命令也是可以使用的,只不过你用yum其实也是在调用 dnf命令
    2021-11-05T04:03:45.png
    2021-11-05T04:03:45.png
    • 和Centos 8 一样,网络管理移除了脚本,也就是说你无法使用 systemctl restart network 来管理卡,可以使用 nnclinmtui 来管理;
    • 安装需要注意的事项
      1. 语言支撑选择 English 和 中文简体(当然如果你后续不考虑中文字符也可以只是 English);
      2. 博主建议最小化安装,后续需要什么再进行补充(如果是新手更建议这种方式,坑有很多,但是成长的都是你自己)
      3. 最小化安装是没有 ifconfig 命令的,那么查看ip信息可以使用 ip a show,同时也是没有 vim 命令的,但是有 vi,所以你也不懂担心不能编辑文本。

网络配置

网卡配置(网卡名以实际为准),我这里没有写 DNS地址,如果你出现公网IP可以ping通,但是域名无法ping通,那么你该检查你的DNS配置了。

代码语言:javascript
复制
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s3
UUID=b5f199eb-ef34-4a34-b289-f24c934e5d6a
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.56.2
NETMASK=255.255.255.0
GATEWAY=192.168.56.1       

网卡管理

代码语言:javascript
复制
ifdown enp0s3   # 关闭网卡
ifup enp0s3     # 启用网卡

本地 YUM 配置

上传镜像文件到 /media/ 下,确定是 DVD 版本,否则软件不全;

挂载镜像文件为虚拟光驱mount -o loop Rocky-8.4-x86_64-dvd1.iso rocky-media/;

修改 yum 配置文件

代码语言:javascript
复制
[[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-yjshash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-yjsemail')){for(e='',o=0,r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)<=6&&a.length>=128)o=(parseInt(m)<=191)?1:o*2;if(o>1)break;e+='%'+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ rocky-media]# cd /etc/yum.repos.d/
[[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-yjshash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-yjsemail')){for(e='',o=0,r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)<=6&&a.length>=128)o=(parseInt(m)<=191)?1:o*2;if(o>1)break;e+='%'+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ yum.repos.d]# mkdir repoback
[[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-yjshash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-yjsemail')){for(e='',o=0,r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)<=6&&a.length>=128)o=(parseInt(m)<=191)?1:o*2;if(o>1)break;e+='%'+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ yum.repos.d]# mv ./*.repo repoback/
[[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-yjshash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-yjsemail')){for(e='',o=0,r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)<=6&&a.length>=128)o=(parseInt(m)<=191)?1:o*2;if(o>1)break;e+='%'+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ repoback]# cp repoback/Rocky-Media.repo ./
[[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-yjshash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-yjsemail')){for(e='',o=0,r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)<=6&&a.length>=128)o=(parseInt(m)<=191)?1:o*2;if(o>1)break;e+='%'+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ yum.repos.d]# vi Rocky-Media.repo
[[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-yjshash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-yjsemail')){for(e='',o=0,r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)<=6&&a.length>=128)o=(parseInt(m)<=191)?1:o*2;if(o>1)break;e+='%'+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ yum.repos.d]# cat Rocky-Media.repo
# Rocky-Media.repo
#
# You can use this repo to install items directly off the installation media.
# Verify your mount point matches one of the below file:// paths.

[media-baseos]
name=Rocky Linux $releasever - Media - BaseOS
baseurl=file:///media/rocky-media/BaseOS
file:///media/cdrom/BaseOS
file:///media/cdrecorder/BaseOS
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

[media-appstream]
name=Rocky Linux $releasever - Media - AppStream
baseurl=file:///media/rocky-media/AppStream
file:///media/rocky-media/AppStream
file:///media/rocky-media/AppStream
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial

这样你就可以使用 dnf install 安装你想安装的软件了

2021-11-05T04:57:08.png
2021-11-05T04:57:08.png

如果你还是习惯用 ifconfig ,那么请执行 dnf install net-tools

代码语言:javascript
复制
[[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-yjshash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-yjsemail')){for(e='',o=0,r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)<=6&&a.length>=128)o=(parseInt(m)<=191)?1:o*2;if(o>1)break;e+='%'+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ yum.repos.d]# dnf provides ifconfig     查询命令属于哪个软件包
Last metadata expiration check: 0:03:18 ago on Fri 05 Nov 2021 12:56:03 PM CST.
net-tools-2.0-0.52.20160912git.el8.x86_64 : Basic networking tools
Repo        : media-baseos
Matched from:
Filename    : /usr/sbin/ifconfig

[[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p,m,o){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-yjshash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-yjsemail')){for(e='',o=0,r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2){m=('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);if((a.length-n)<=6&&a.length>=128)o=(parseInt(m)<=191)?1:o*2;if(o>1)break;e+='%'+m;}p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */ yum.repos.d]# dnf install net-tools
Last metadata expiration check: 0:03:51 ago on Fri 05 Nov 2021 12:56:03 PM CST.
Dependencies resolved.
=================================================================================
 Package                   Architecture           Version                                     Repository                    Size
=================================================================================
Installing:
 net-tools                 x86_64                 2.0-0.52.20160912git.el8                    media-baseos                 321 k

Transaction Summary
=================================================================================
Install  1 Package

Total size: 321 k
Installed size: 942 k
Is this ok [y/N]:

视 频 参 考,高 清 视 频 请 亲 前 往 B站https://www.bilibili.com/video/BV1b44y1e7vE?t=3.1 观 看

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

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

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

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

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 视 频 参 考,高 清 视 频 请 亲 前 往 B站https://www.bilibili.com/video/BV1b44y1e7vE?t=3.1 观 看
相关产品与服务
弹性公网 IP
弹性公网 IP(Elastic IP,EIP)是可以独立购买和持有,且在某个地域下固定不变的公网 IP 地址,可以与 CVM、NAT 网关、弹性网卡和高可用虚拟 IP 等云资源绑定,提供访问公网和被公网访问能力;还可与云资源的生命周期解耦合,单独进行操作;同时提供多种计费模式,您可以根据业务特点灵活选择,以降低公网成本。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档