Centos6.x更新YUM软件源

Yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。

curl下载repo文件到/etc/yum.repos.d、目录下

curl -o /etc/yum.repos.d/CentOS-Base.repo http://file.kangle.odata.cc/repo/Centos-6.repo
curl -o /etc/yum.repos.d/epel.repo http://file.kangle.odata.cc/repo/epel-6.repo
yum clean all && yum makecache 
 

yum clean all清除缓存

yum makecache生成缓存

常用命令行命令

安装软件(以foo-x.x.x.rpm为例):yum install foo-x.x.x.rpm

删除软件:yum remove foo-x.x.x.rpm或者yum erase foo-x.x.x.rpm

升级软件:yum upgrade foo或者yum update foo

查询信息:yum info foo

搜索软件(以包含foo字段为例):yum search foo

显示软件包依赖关系:yum deplist foo

  • -q 静默执行
  • -t 忽略错误
  • -R[分钟] 设置等待时间
  • -y 自动应答yes
  • --skip-broken 忽略依赖问题
  • --nogpgcheck 忽略GPG验证
  • check-update 检查可更新的包
  • clean all 清除全部
  • clean packages 清除临时包文件(/var/cache/yum 下文件)
  • clean headers 清除rpm头文件
  • clean oldheaders 清除旧的rpm头文件
  • deplist 列出包的依赖
  • list 可安装和可更新的RPM包
  • list installed 已安装的包
  • list extras 已安装且不在资源库的包
  • info 可安装和可更新的RPM包 信息
  • info installed 已安装包的信息(-qa 参数相似)
  • install[RPM包] 安装包
  • localinstall 安装本地的 RPM包
  • update[RPM包] 更新包
  • upgrade 升级系统
  • search[关键词] 搜索包
  • provides[关键词] 搜索特定包文件名
  • reinstall[RPM包] 重新安装包
  • repolist 显示资源库的配置
  • resolvedep 指定依赖
  • remove[RPM包] 卸载包
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值