包管理 YUM 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 yum repolist all yum list all yum install name yum update name yum info name yum reinstall name yum remove name yum clean all yum check-update yum grouplist yum grouplist name yum groupinfo name yum groupremove name yum list installed | grep xxx rpm -qa | grep xxx ps -ef | grep nginx
RPM RPM(RedHat Package Manager)是软件包管理器1 2 3 4 5 6 rpm -ivh rpm文件名 rpm -Uvh rpm文件名 rpm -e rpm文件名 rpm -qpi rpm文件名 rpm -qpl rpm文件名 rpm -qf 文件名
1.查询是否安装了软件:rpm -qa | grep -i 软件名
2.删除已安装的软件包:根据第一步显示的软件包名,一个个删除1 2 sudo rpm -e -- 包名 # 普通删除模式 sudo rpm -e --nodeps 包名 # 强力删除模式,如果用上面命令删除时,提示有依赖的其他文件,则用该命令可以对其进行强力删除
DNF 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 dnf –version dnf repolist dnf repolist all dnf list dnf search nano dnf info nano dnf install nano dnf update systemd dnf remove nano/dnf erase nano dnf autoremove dnf clean all dnf help clean dnf grouplist dnf groupinstall ‘Educational Software’ dnf groupupdate ‘Educational Software’ dnf groupremove ‘Educational Software’ dnf reinstall nano dnf provides /bin/bash
软件源 国内源 1 2 3 4 5 6 7 8 9 yum install -y wget mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backupwget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g' -i.bak /etc/yum.repos.d/CentOS-Base.repo
其他源 1 2 3 EPEL:yum install -y epel-release IUS:rpm -Uvh https://centos7.iuscommunity.org/ius-release.rpm REMI:rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
1 2 3 4 5 yum repolist yum clean all yum makecache