Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3647313
  • 博文数量: 880
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 6155
  • 用 户 组: 普通用户
  • 注册时间: 2016-11-11 09:12
个人简介

To be a better coder

文章分类

全部博文(880)

文章存档

2022年(5)

2021年(60)

2020年(175)

2019年(207)

2018年(210)

2017年(142)

2016年(81)

yum

分类: LINUX

2020-10-13 14:30:35

1、卸载掉冲突的文件,安装新的文件。如果由于由于依赖关系导致要卸载很多软件,那可以优先考虑下一个方法。

yum -y remove libstdc++-4.4.7-11.el6.i686

注意,卸载的是软件,不是rpm包。可以使用rpm -qa|grep lisbstdc 查看已安装的包含lisbstadc的软件名


2、安装的时候增加–replacefiles参数,例如 rpm -ivh xxx.rpm –replacefiles


============================================================

我们在更新yum源或者出现配置yum源之后,通常都会使用yum makecache 生成缓存

yum makecache fast

这个命令是将软件包信息提前在本地缓存一份,用来提高搜索安装软件的速度

yum clean all

yum 会把下载的软件包和header存储在cache中而不自动删除。如果觉得占用磁盘空间,可以使用yum clean指令清除缓存。


==========================================================

yum-config-manager的讲解


1 查看系统内已经拥有的仓库
命令: yum repolist all
2 使能要用的仓库
命令: yum-config-manger --add-repo 具体的文件来源
(yum-config-manger --enable 使能所有仓库的所有文件)
3 使用yum-config-manger 命令时,
有时系统会提示 : yum-config-manager: command not found
这是因为系统默认没有安装这个命令,这个命令在yum-utils包里,
可以通过命令:yum install yum-utils 安装此包即可

查询仓库内容

yum repolist all # 显示所有资源库 yum repolist enabled # 显示所有已启动的资源库 yum repolist disabled # 显示所有被禁用的资源库 

可以搭配grep使用,例如

yum repolist all | grep mysql 


添加repository

yum-config-manager --add-repo repository_url 


切换库中资源---禁用+启用

yum-config-manager --disable itemName yum-config-manager --enable itemName 

或者直接编辑/etc/yum.repos.d/下的对应资源库文件

enabled=0 #禁用 enabled=1 #禁用 

如果同时启用了多个版本,安装时会自动选择新版本

 ==========================================================
本地yum源制作
[root@localhost yum.repos.d]# cat local-yum.repo 
[mylocal-yum]          
name=local-yum 
baseurl=file:///all_packages      
gpgcheck=0             
enabled=1                 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# createrepo /all_packages/

=========================================================
飞腾适配
有时不用建本地源,删除所有源,
[root@localhost yum.repos.d]# yum repolist all
repolist: 0
[root@localhost yum.repos.d]# 
rpm报错
Error: Package: curl-7.29.0-57.el7.aarch64 (/curl-7.29.0-57.el7.aarch64)
           Requires: libcurl = 7.29.0-57.el7
           Installed: libcurl-7.29.0-51.el7.aarch64 (@anaconda/rawhide)
               libcurl = 7.29.0-51.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@localhost all_packages]# 
[root@localhost all_packages]# 
[root@localhost all_packages]# 
[root@localhost all_packages]# rm curl-7.29.0-57.el7.aarch64.rpm 
rm: remove regular file ?????url-7.29.0-57.el7.aarch64.rpm????? y
[root@localhost all_packages]# 
使用麒麟源更新rpm包降低版本;


阅读(1147) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~