yum 常用命令指南

配置源

1
2
curl -o /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
curl -o /etc/yum.repos.d/CentOS-Base-aliyun.repo https://mirrors.aliyun.com/repo/Centos-7.repo

安装

查询软件版本

1
yum list --showduplicates docker-ce

查询命令在那个软件包里面

1
yum provides kubectl

使用指定的源,速度会快

1
yum --disablerepo=* --enablerepo=base list

回退

查看安装历史

1
2
3
4
5
6
7
8
9
10
11
# 查看所有安装记录
yum history list
# 查看某个命令的安装记录
yum history list nginx

[root@host-10-14 ~]# yum history list nginx
Loaded plugins: fastestmirror
ID | Command line | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
6 | install nginx | 2022-11-27 09:56 | Install | 2 EE
history list

使用undo撤销一次安装

1
yum history undo <id>
打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2018-2024 Outsrkem
  • 访问人数: | 浏览次数:

      请我喝杯咖啡吧~

      支付宝
      微信