rockylinux简单安装

前言

官网:https://rockylinux.org/
阿里云:https://mirrors.aliyun.com/rockylinux

下载地址 最小镜像只有2G
https://mirrors.aliyun.com/rockylinux/8.8/isos/x86_64/Rocky-8.8-x86_64-minimal.iso?spm=a2c6h.25603864.0.0.234252d54FqxjJ

由于虚拟机没有对应的rockylinux,所以选其他

一 安装rockylinux,虚拟机安装

1 安装跟centos差不多

在这里插入图片描述

2 勾选启动时链接

在这里插入图片描述

在这里插入图片描述

二 最小化配置rockylinux

1 选择语言

在这里插入图片描述
在这里插入图片描述

2 配置磁盘

在这里插入图片描述

我这边只做了俩个分区
/ /boot
如果需要swap分区(1般是内存2倍)请自行添加

在这里插入图片描述

3 修改时间,Shanghai

在这里插入图片描述

4 软件安装

在这里插入图片描述

5 网络配置

在这里插入图片描述

[root@localhost ~]# cat  /etc/sysconfig/network-scripts/ifcfg-ens33 
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
IPV6_ADDR_GEN_MODE=eui64
NAME=ens33
UUID=57ce9875-aaea-4609-8a84-364a9721ff09
DEVICE=ens33
ONBOOT=yes
IPV6_PRIVACY="no"
IPADDR="192.168.200.50"
GATEWAY="192.168.200.250"
NETWASK="255.255.255.0"
DNS1="192.168.200.250"

重启网卡

nmcli c down ens33 && nmcli c up ens33

6 配置镜像源

除了上述两个镜像地址外,阿里云也提供了RockyLinux镜像
地址为:https://mirrors.aliyun.com/rockylinux/
官方配置 https://developer.aliyun.com/mirror/rockylinux/?spm=a2c6h.25603864.0.0.1ed31869hFU1IZ

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mkdir backup
[root@localhost yum.repos.d]# cp ./Rocky-*.repo ./backup/
[root@localhost yum.repos.d]# sed -e 's|^mirrorlist=|#mirrorlist=|g' \
    -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.aliyun.com/rockylinux|g' \
    -i.bak \
    /etc/yum.repos.d/Rocky-*.repo

[root@localhost yum.repos.d]# yum makecache
或者
dnf makecache

在这里插入图片描述

7 系统启动后,最小化安装需要安装的软件

[root@localhost yum.repos.d]# yum -y install gcc gcc-c++ cmake bzip2-devel curl-devel libjpeg-devel libpng-devel  \                  freetype-devel libXpm-devel gmp-devel openldap-devel  postgresql-devel sqlite-devel  net-snmp-devel libxslt-devel \        libxml2-devel pcre-devel mysql-devel   zlib-devel  vim wget   lrzsz  tree openssl-devel curl make  net-tools
dnf clean all && dnf update

8 设置时间同步

[root@localhost ~]# dnf install -y chrony jq curl wget
[root@localhost ~]# timedatectl set-timezone Asia/Shanghai
[root@localhost ~]# systemctl enable --now chronyd
[root@localhost ~]# timedatectl status
               Local time: 三 2024-01-10 14:30:47 CST
           Universal time: 三 2024-01-10 06:30:47 UTC
                 RTC time: 三 2024-01-10 06:30:47
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
#将当前的 UTC 时间写入硬件时钟
[root@localhost ~]# timedatectl set-local-rtc 0


重启依赖于系统时间的服务
#systemctl restart rsyslog
#systemctl restart crond