Rpm参数
-ivh安装软件 --force强制再次安装软件
-ql查看软件安装的文件
-qf查看文件依赖的软件
-qi可以查看软件官网和版本等信息
-qa查看所有安装的软件
-e卸载软件 --nodeps忽略依赖关系
--scripts 查看包含脚本

救援模式
误删rpm,进行救援模式恢复安装rpm,需要区分磁盘根目录和用户家目录—root=/mnt/sysimages

Centos8阿里和华为yum源
https://mirrors.huaweicloud.com/centos/8/BaseOS/x86_64/
https://mirrors.huaweicloud.com/centos/8/AppStream/x86_64/os/
https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/

centos7阿里和华为yum源
https://mirrors.aliyun.com/centos/7/os/x86_64/
https://mirrors.huaweicloud.com/centos/7/os/x86_64/

本地yum原:/misc/cd
需要安装:yum install –y autofs;systemctl restart autofs;挂载光盘,就会出现/misc/cd

Yum history 查看安装软件的历史
Yum history info 25 查看编号为25的安装历史的信息
Yum history undo 25/redo 25(卸载依赖软件)删除某软件后查看有未删除的依赖软件可删除或还原
Yum install --enablerepo=epel sl临时启用被禁用的软件原
Yum install --disablerepo=* 临时禁用所有软件原

Yum provides */mime.types(需要将查询的文件加上路径)方可查询文件依赖软件包
Yum info 软件 查看软件版本|官网等信息

内核升级
yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
生产用lt
个人测试ml

yum list --disablerepo="*" --enablerepo="elrepo-kernel" 查看内核软件包
yum --enablerepo="elrepo-kernel" install kernel-ml –y 安装内核

内部仓库基于http的私有仓库
Centos6,7配置私有epel原,下载epel源软件包
reposync -r epel -p /root/ (下载epel软件包到本地)
centos8下载方式:dnf reposync –repo=epel –p /root/
createrepo -v /root/epel (自建元数据目录)

配置局域网内epel源
Vim my-epel.repo
[my-epel]
Name=myepel
Baseurl=http://IP:端口/epel
Enabled=1
Gpgcheck=0

测试:yum clean all;yum repolist all

Ubuntu命令:
apt
install remove list update search show