yum命令来自于英文词组”YellowdogUpdater,Modified“的缩写,其功能是用于在Linux系统中基于RPM技术进行软件包的管理工作。yum技术通用于RHEL、CentOS、Fedora、OpenSUSE等主流系统,可以让系统管理人员交互式的自动化更新和管理软件包,实现从指定服务器自动下载、更新、删除软件包的工作。
yum软件仓库及命令能够自动处理软件依赖关系,一次性安装所需全部软件,无需繁琐的操作。
语法格式:yum [参数] 软件包
常用参数:
实例参考
清理原有的软件仓库信息缓存:
[root@liuzhongwei ~]# yum clean allUpdating Subscription Management repositories.Unable to read consumer identityThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.12 files removed
建立最新的软件仓库信息缓存:
[root@liuzhongwei ~]# yum makecacheUpdating Subscription Management repositories.Unable to read consumer identityThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.AppStream83 MB/s | 5.3 MB00:00 BaseOS 28 MB/s | 2.2 MB00:00 Last metadata expiration check: 0:00:01 ago on Mon 09 May 11:43:41 PM CST.Metadata cache created.
安装指定的服务及相关软件包:
[root@liuzhongwei ~]# yum install httpd………………省略输出信息………………
更新指定的服务及相关软件包:
[root@liuzhongwei ~]# yum update httpd………………省略输出信息………………
卸载指定的服务及相关软件包:
[root@liuzhongwei ~]# yum remove httpd………………省略输出信息………………
显示可安装的软件包组列表:
[root@liuzhongwei ~]# yum grouplist Updating Subscription Management repositories.Unable to read consumer identityLast metadata expiration check: 0:03:02 ago on Mon 09 May 11:43:41 PM CST.Available Environment Groups: Server Minimal Install Workstation Virtualization Host Custom Operating SystemInstalled Environment Groups: Server with GUIInstalled Groups: Container Management Headless ManagementAvailable Groups: .NET Core Development………………省略部分输出信息………………
显示指定服务的软件信息:
[root@liuzhongwei ~]# yum info httpdUpdating Subscription Management repositories.Unable to read consumer identityLast metadata expiration check: 0:07:21 ago on Mon 09 May 11:43:41 PM CST.Installed PackagesName : httpdVersion: 2.4.37Release: 10.module+el8+2764+7127e69eArch : x86_64Size : 4.3 MSource : httpd-2.4.37-10.module+el8+2764+7127e69e.src.rpmRepo : @SystemFrom repo : AppStreamSummary: Apache HTTP ServerURL: /License: ASL 2.0Description : The Apache HTTP Server is a powerful, efficient, and extensible : web server.
如果觉得《[Linux] yum命令: 基于RPM的软件包管理器》对你有帮助,请点赞、收藏,并留下你的观点哦!