【RHEL】RHEL 7.6 YUM介绍

目录

1 YUM语法

2 常用示例

2.1 查看YUM资源库信息

2.2 查看可用的更新

2.3 更新软件

2.4 搜索软件包

2.5 列出软件包

2.6 查看软件包信息

2.7 安装软件包

2.8 卸载软件包

2.9 查看安装的历史信息

2.10 回滚已安装的软件

2.11 重做已安装的软件


YUM是Red Hat的包管理器,基于RPM包管理,能够从指定的服务器自动下载RPM包并安装,可以自动处理依赖关系,并且一次安装所有依赖的软件包。本篇将对YUM的命令进行介绍。

1 YUM语法

yum [options] [command] [package ...]

2 常用示例

2.1 查看YUM资源库信息

1)方法一

[root@strong ~]# yum repoinfo
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repo-id : server
Repo-name : Red Hat Enterprise Linux 7.6
Repo-revision: 1539194633
Repo-updated : Thu Oct 11 02:03:53 2018
Repo-pkgs : 5,152
Repo-size : 3.4 G
Repo-baseurl : file:///mnt/
Repo-expire : 21,600 second(s) (last: Wed Sep 25 22:50:12 2019)
Filter : read-only:present
Repo-filename: /etc/yum.repos.d/server.repo
repolist: 5,152

2)方法二

[root@strong ~]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
repo id repo name status
server Red Hat Enterprise Linux 7.6 5,152
repolist: 5,152

可以指定-v 查看更详细的信息。

2.2 查看可用的更新

[root@strong ~]# yum check-update

2.3 更新软件

1)更新所有软件

[root@strong ~]# yum update

2)更新某一个软件

[root@strong ~]# yum update sshd

3)仅更新到最新版本

[root@strong ~]# yum update --security sshd

4)仅更新到安全更新的版本

[root@strong ~]# yum update-minimal --security sshd

2.4 搜索软件包

[root@strong ~]# yum search sshd
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
=========================================================== Matched: sshd ============================================================
openssh-server.x86_64 : An open source SSH server daemon

2.5 列出软件包

1)列出所有软件包,包括已安装的和可用的

[root@strong ~]# yum list all

2)列出已安装的软件包

[root@strong ~]# yum list installed

3)列出可用的软件包

[root@strong ~]# yum list available |grep ssh
fence-agents-ilo-ssh.x86_64 4.2.1-11.el7 server
libssh2.i686 1.4.3-12.el7 server
openssh-askpass.x86_64 7.4p1-16.el7 server
openssh-keycat.x86_64 7.4p1-16.el7 server

2.6 查看软件包信息

[root@strong ~]# yum info openssh-server
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Installed Packages
Name : openssh-server
Arch : x86_64
Version : 7.4p1
Release : 16.el7
Size : 971 k
Repo : installed
From repo : anaconda
Summary : An open source SSH server daemon
URL : http://www.openssh.com/portable.html
License : BSD
Description : OpenSSH is a free version of SSH (Secure SHell), a program for logging
: into and executing commands on a remote machine. This package contains
: the secure shell daemon (sshd). The sshd daemon allows SSH clients to
: securely connect to your SSH server.

2.7 安装软件包


                
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值