linux的yum命令
linux yum 命令
yum( Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器。
基於RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装。
yum提供了查找、安装、删除某一个、一组甚至全部软件包的命令,而且命令简洁而又好记。
yum 语法
yum [options] [command] [package ...]
- options:可选,选项包括-h(帮助),-y(当安装过程提示选择全部为"yes"),-q(不显示安装的过程)等等。
- command:要进行的操作。
- package操作的对象。
yum常用命令
- 1.列出所有可更新的软件清单命令:yum check-update
- 2.更新所有软件命令:yum update
- 3.仅安装指定的软件命令:yum install <package_name>
- 4.仅更新指定的软件命令:yum update <package_name>
- 5.列出所有可安裝的软件清单命令:yum list
- 6.删除软件包命令:yum remove <package_name>
- 7.查找软件包 命令:yum search <keyword>
- 8.清除缓存命令:
- yum clean packages: 清除缓存目录下的软件包
- yum clean headers: 清除缓存目录下的 headers
- yum clean oldheaders: 清除缓存目录下旧的 headers
- yum clean, yum clean all (= yum clean packages; yum clean oldheaders) :清除缓存目录下的软件包及旧的headers
国内 yum 源
网易(163)yum源是国内最好的yum源之一 ,无论是速度还是软件版本,都非常的不错。
将yum源设置为163 yum,可以提升软件包安装和更新的速度,同时避免一些常见软件版本无法找到。
[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# ll
total 24
-rw-r--r--. 1 root root 1991 Mar 28 2017 CentOS-Base.repo
-rw-r--r--. 1 root root 647 Mar 28 2017 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 289 Mar 28 2017 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Mar 28 2017 CentOS-Media.repo
-rw-r--r--. 1 root root 7989 Mar 28 2017 CentOS-Vault.repo
[root@localhost yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@localhost yum.repos.d]# ll
total 24
-rw-r--r--. 1 root root 1991 Mar 28 2017 CentOS-Base.repo.backup
-rw-r--r--. 1 root root 647 Mar 28 2017 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 289 Mar 28 2017 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Mar 28 2017 CentOS-Media.repo
-rw-r--r--. 1 root root 7989 Mar 28 2017 CentOS-Vault.repo
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
--2019-12-04 01:17:41-- http://mirrors.163.com/.help/CentOS6-Base-163.repo
Resolving mirrors.163.com... 59.111.0.251
Connecting to mirrors.163.com|59.111.0.251|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2006 (2.0K) [application/octet-stream]
Saving to: “CentOS6-Base-163.repo” 100%[=================================================================================================================>] 2,006 --.-K/s in 0s 2019-12-04 01:17:42 (349 MB/s) - “CentOS6-Base-163.repo” saved [2006/2006] [root@localhost yum.repos.d]# mv CentOS6-Base-163.repo CentOS-Base.repo
[root@localhost bin]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@localhost bin]# yum makecache
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
base | 3.7 kB 00:00
base/group_gz | 242 kB 00:00
base/filelists_db | 6.4 MB 00:02
base/primary_db | 4.7 MB 00:01
base/other_db | 2.8 MB 00:00
extras | 3.4 kB 00:00
extras/filelists_db | 24 kB 00:00
extras/prestodelta | 2.2 kB 00:00
extras/primary_db | 29 kB 00:00
extras/other_db | 14 kB 00:00
updates | 3.4 kB 00:00
updates/filelists_db | 5.2 MB 00:06
updates/prestodelta | 258 kB 00:00
updates/primary_db | 7.5 MB 00:02
updates/other_db | 330 kB 00:00
Metadata Cache Created
[root@localhost bin]#
实例 1
安装 pam-devel
[root@localhost bin]# yum install pam-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package pam-devel.x86_64 0:1.1.1-24.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved ===========================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================
Installing:
pam-devel x86_64 1.1.1-24.el6 base 205 k Transaction Summary
===========================================================================================================================================================
Install 1 Package(s) Total download size: 205 k
Installed size: 547 k
Is this ok [y/N]: y
Downloading Packages:
pam-devel-1.1.1-24.el6.x86_64.rpm | 205 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : pam-devel-1.1.1-24.el6.x86_64 1/1
Verifying : pam-devel-1.1.1-24.el6.x86_64 1/1 Installed:
pam-devel.x86_64 0:1.1.1-24.el6 Complete!
[root@localhost bin]#
实例 2
移除 pam-devel
[root@localhost bin]# yum remove pam-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package pam-devel.x86_64 0:1.1.1-24.el6 will be erased
--> Finished Dependency Resolution Dependencies Resolved ===========================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================
Removing:
pam-devel x86_64 1.1.1-24.el6 @base 547 k Transaction Summary
===========================================================================================================================================================
Remove 1 Package(s) Installed size: 547 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : pam-devel-1.1.1-24.el6.x86_64 1/1
Verifying : pam-devel-1.1.1-24.el6.x86_64 1/1 Removed:
pam-devel.x86_64 0:1.1.1-24.el6 Complete!
[root@localhost bin]#
实例 3
利用 yum 的功能,找出以 yum 为开头的软件名称有哪些?
[root@localhost bin]# yum list yum*
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Installed Packages
yum.noarch 3.2.29-81.el6.centos @anaconda-CentOS-201703281317.x86_64/6.9
Available Packages
yum.noarch 3.2.29-81.el6.centos.0.1 updates
[root@localhost bin]#
linux的yum命令的更多相关文章
- Linux关于yum命令Error: Cannot retrieve repository metadata (repomd.xml) for repository:xxxxxx.
Linux关于yum命令Error: Cannot retrieve repository metadata (repomd.xml) for repository:xxxxxx. 问题: Linux ...
- Linux.Centos.yum命令的“No module named yum”错误
Centos版本: uname -a Linux ygpiao -.el6.x86_64 # SMP Tue Jun :: UTC x86_64 x86_64 x86_64 GNU/Linux 在一次 ...
- linux中yum命令的解析
yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...
- Linux教程 Yum命令的使用
在这篇文章中,我们将学习如何安装,更新,删除,查找安装包,管理安装包以及安装包的仓库在Linux系统使用RedHat开发的YUM(Yellowdog Updater Modified)工具.以下这些命 ...
- Linux学习—yum命令(转载)
yum简介 yum( Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器. 基於RPM包管理,能够从指定的服务器自动 ...
- [Linux] 025 yum 命令
1. 常用 yum 命令 (1) 查询 查询所有可用软件包列表 $ yum list 搜索服务器上所有和关键字相关的包 $ yum search 关键字 ps 有点像 Python 的 pip lis ...
- Linux系统yum命令安装软件时保留(下载)rpm包 -- 转载
昨天在部署zabbix监控的时候,遇到一个问题:监控服务器处于无外网状态,在线安装不可用.而某些依赖包度娘或谷姐搜索起来也挺呛人的!于是想到一个办法,利用有外网的服务器的yum命令来安装这些软件,并自 ...
- Red Hat Linux 无法使用yum命令
一:首先提供部分Red Hat 镜像下载地址 1.rhel-server-6.8-i386-dvd.iso 链接: https://pan.baidu.com/s/18VqxRgBMuAJE7Ty0H ...
- Linux 添加yum命令
第一步,国内的yum仓库 http://mirrors.163.com/centos/7/os/x86_64/Packages/ http://mirrors.aliyun.com/centos/7/ ...
随机推荐
- The system has no LUN copy license
[问题描述] ipsan作为cinder后端的时候,通过快照创建磁盘失败,报以下错误: { u 'data': {}, u 'error': { u 'code': 1077950181, u 'de ...
- spring boot-4.配置文件
官方文档的23.4章节介绍了关于配置文件的内容 springboot 启动会扫描以下位置的application.properties或者application.yml文件作为Spring boot的 ...
- Statistics项目学习笔记
1. http://218.244.157.0:55443/index.html 初始访问时,弹出的窗口为index.html文件,文件有html命令组成.html展现的UI界面用的是WIN10-UI ...
- mybatis 批量操作 ------持续更新
mybatis 不存在则才进行添加 # 添加的 sql 语句insert into sys_link_post_user(post_id,user_id)# 进行批量添加 (若不需要可以取消 froe ...
- 图片水印处理-temp
/media/watermark 简要描述: 用户注册接口 应用场景:比较复杂的水印处理,如需要多次添加水印,或者水印图片本身也需要处理,如果处理相对简单,java项目可以通过dubbo接口Image ...
- 字典树(trie树) 后缀树 广义后缀树
转自:http://www.cnblogs.com/dong008259/archive/2011/11/11/2244900.html (1)字典树(Trie树) Trie是个简单但实用的数据结构, ...
- Centos7 升级php版本到php7
一.首先查看是否有老版本 yum list installed | grep php 二.如果安装的有 yum remove php.x86_64 php-cli.x86_64 php-common. ...
- Codeforces 1215D. Ticket Game
传送门 博弈,发现情况有点多,分析一下把有用的状态提取出来 显然各个位置的数字是没用的,我们只要知道两边的数字和分别是多少 并且状态显然和左右两边的 "?" 数量有关 因为最终我们 ...
- yum 问题
[root@localhost ~]# yum update There are no enabled repos. Run "yum repolist all" to see t ...
- Jmeter分布式测试dubbo接口1
最近工作中接到一个需求,需要对一个Dubbo接口进行压力测试,测试其性能,之前一直使用jmeter做压力测试,在踏了好多坑之后,决定把这些记录下来,顺便也希望能帮助到大家. 开始测试之前,我们需要先知 ...