yum
原单词yum(Yellow dog Updater, Modified)
yum 命令 是centos提供给用户查找、安装、删除,更新某一个、一组甚至全部软件包的命令。
yum的功能类似于 手机系统 中的应用商店 ,可以 查找、安装、删除、更新 应用。
yum包管理工具适用于Centos版本linux 如果是其他系统请对应

<mark style="box-sizing: border-box; background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">工作中应用于下载更新linux服务器上软件,配置环境部署应用等等</mark>
使用yum 安装软件
语法:
yum install 软件名称
yum 换源
当你使用yum install 命令安装软件时,比较慢,需要换 yum源
- 先备份原有的yum源 的配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 下载阿里云的yum源文件到 /etc/yum.repos.d/目录
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 使配置生效
yum makecache
实战:
使用yum 安装 zip 软件(zip是用来压缩文件的不过压缩格式为 .zip)
yum install zip

免确认安装 unzip (用来解压 .zip压缩文件的命令)
yum install -y unzip
在 install 后面加入 -y 参数,在安装过程中就不需要输入y来确认,可以直接安装

使用 yum 卸载软件
语法
yum remove 软件名
举例:
卸载刚才安装的 unzip 软件
yum remove unzip

更新所有已安装的所有软件
更新所有软件的命令 在实际工作中尽量别用,因为某些系统固定使用软件的某个版本,如果软件版本过高,可能导致系统软件不兼容等情况
yum update

查找到要更新 225个安装包,输入y 回车,确认更新安装

可能安装时间比较久,等待出现Complete! 就代表更新完成

更新指定软件
yum update 软件名
实战:
更新 zip 软件包
yum update zip

由于zip是刚装的,所以并没有更新,已经是最新版本了,大家只知道一下如何更新指定软件就好了
网友评论