包管理
一、YUM 镜像仓库
1.1 YUM 命令
yum [-y] [参数] [软件包名称]参数:
install:安装remove:卸载repolist:查看默认仓库reinstall:类似覆盖安装clean all:清理仓库缓存
查找命令所在软件包:
yum provides rz # 有的搜不到1.2 查看当前系统仓库:
yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com # 默认仓库地址
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 526
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 6,173
repolist: 16,771 # 默认仓库软件的个数1.3 修改默认的仓库
阿里云仓库地址:developer.aliyun.com/mirror
LinuxMirrors:linuxmirrors.cn
1.3.1 备份默认仓库
1.3.2 下载仓库到本地
1.3.3 检查配置是否正确
1.4 配置EPEL扩展仓库
配置 epel 扩展仓库:
尝试安装 sl 和 cowsay:
二、RPM 软件包管理
rpm(Red Hat Package Manager),是用于管理Linux各项套件的程序。它不支持自动管理包依赖。
2.1 命令语法
语法格式:
选项:
-i:install,安装-v:verbose,显示更详细的信息-h:hash,打印 #,显示安装进度-e:erase,卸载-q:query,查询包名-a:all,查询全部已安装包-l:list,列出包中的文件
示例:
最后更新于