温馨提示×

怎样给centos minimal加工具

小樊
34
2026-10-23 08:29:09
栏目: 智能运维

在 CentOS Minimal(最小化安装)里,默认只有最基础的命令,很多常用工具都没有。下面按“最常见需求”给你一套实用做法。


一、先确保能上网(最重要)

Minimal 经常默认没开网卡。

ip addr

如果没 IP,开启网卡(示例 eth0 / ens33):

dhclient
# 或
nmcli connection up ens33

设置开机自动连接(可选):

nmcli connection modify ens33 connection.autoconnect yes

二、更新系统 & 基础工具

yum update -y

常用“必装”工具包

yum install -y \
  vim \
  wget \
  curl \
  net-tools \
  bash-completion \
  lrzsz \
  unzip \
  tar \
  gcc \
  make

说明:

  • net-tools → ifconfig
  • bash-completion → Tab 补全更智能
  • lrzsz → Xshell 可直接拖文件

三、按需加装“常用工具”

1️⃣ 网络排查

yum install -y traceroute bind-utils

得到:

  • ping
  • dig
  • nslookup
  • traceroute

2️⃣ 进程 / 资源监控

yum install -y htop iotop

3️⃣ 时间同步

yum install -y chrony
systemctl enable --now chronyd

4️⃣ 防火墙(建议保留)

systemctl enable --now firewalld

四、如果你想要“接近完整系统”

yum groupinstall -y "Base" "Development Tools"

五、国内源(加速,可选)

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache

六、一句话总结

Minimal = 只给“能启动”,工具全靠 yum 自己加。

如果你告诉我:

  • CentOS 7 还是 8 / Stream
  • 用来做 服务器 / 开发 / 运维 / 容器

我可以直接给你一套 精准工具清单。

0 踩