almalinux9新系统常规命令操作

1.更改静态ip

复制代码
[root@alma9 ~]# vi /etc/NetworkManager/system-connections/ens33.nmconnection

[connection]
id=ens33
uuid=b73f0e6f-2416-3779-9009-c18a3432f7c2
type=ethernet
autoconnect-priority=-999
interface-name=ens33
timestamp=1791728375

[ethernet]

[ipv4]
method=manual
addresses=11.0.1.100/24;11.0.1.2
dns=223.5.5.5;8.8.8.8


[ipv6]
addr-gen-mode=eui64
method=disabled

[proxy]

reboot

2.安装docker

指定版本安装时repo源对docker-ce-cli的版本支持,存在同版本支持docker-ce,docker-ce-cli却不支持的情况,例如docker-ce有18.06.03版本但是docker-ce-cli却没有这个版本。用yum list docker-ce --showduplicates|sort -r查看。

复制代码
cd /etc/yum.repos.d
wget https://mirrors.aliyun.com/docker-ce/linux/rhel/docker-ce.repo

#默认最新版本,如果需要指定版本,需要指定docker-ce、docker-ce-cli为同一个版本,containerd.io不需要指定版本。
dnf install -y docker-ce docker-ce-cli containerd.io

换docker镜像源

复制代码
mkdir -p /etc/docker
vi /etc/docker/daemon.json

{
    "registry-mirrors": [
    "https://docker.m.daocloud.io",
    "https://dockerproxy.com",
    "https://9cpn8tt6.mirror.aliyuncs.com",
    "https://mirror.baidubce.com",
    "https://ccr.ccs.tencentyun.com",
    "https://docker.nju.edu.cn",
    "https://docker.mirrors.ustc.edu.cn",
    "https://registry.docker-cn.com",
    "https://mirror.ccs.tencentyun.com",
    "http://hub-mirror.c.163.com",
    "https://dockerhub.azk8s.cn",
    "https://docker.mirrors.sjtug.sjtu.edu.cn",
    "https://registry.cn-hangzhou.aliyuncs.com"
  ]
}

systemctl restart docker
systemctl enable docker

#刷新配置文件
systemctl daemon-reload
systemctl restart docker

#测试运行
docker run hello-world

3.暂时/永久关闭防火墙

复制代码
sudo systemctl stop firewalld
sudo systemctl disable firewalld

4.新系统dnf update

复制代码
dnf update -y

5.换源,目前源比较换乱,暂不换源

自带的源目前下载速度还可以。

6.更换主机名

复制代码
sudo hostnamectl set-hostname ***
bash
相关推荐
无足鸟ICT1 天前
【RHCA+】vmstat命令(监控系统资源)
linux·服务器
垆边人似月.1 天前
RDMA 文件传输踩坑(五):READY 发送成功后,为什么出现 Work Request Flushed Error?
服务器·网络·tcp/ip
闪亮的路灯1 天前
Linux 安装mqtt服务mosquitto
linux·运维·服务器
HideF1 天前
nmcli
linux·服务器·网络
qetfw1 天前
UOS DHCP Relay:跨网段分配与 IP、DNS、网关验证
linux·服务器·网络·tcp/ip·uos
明航咨询-陈老师1 天前
ITSS运行维护服务能力成熟度认证技术纵深:标准模型、等级路径、2026审核趋势与CS/CMMI对比
服务器·数据库·cmmi
szxinmai主板定制专家1 天前
X86 工控机 vs RK3588 异构主控:AMR 控制器 BOM、散热、长期运维对比
运维·stm32·单片机·嵌入式硬件·fpga开发·am62x
缓慢更新1 天前
AI 辅助生成单测:从接口定义到用例的流水线
java·服务器·前端·网络·数据库·人工智能
叼烟扛炮1 天前
Linux 学习笔记(四十一):TCP 并发演进——从单进程到多线程服务器
linux·运维·服务器·网络·笔记·学习·tcp/ip
叼烟扛炮1 天前
Linux 学习笔记(四十四):HTTP 协议解析与极简 Web 服务器实战
linux·服务器·学习