1.Redhat系列
1.1 epel
1.1.1 概述
EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS和Scientific Linux.
装上了 EPEL之后,就相当于添加了一个第三方源。
使用yum安装时往往找不到rpm的情况,官方的rpm repository提供的rpm包也不够丰富,此时epel就是一个很好地选择。
1.1.2 安装
我装的redhat9.1-minimal 就默认装有epel。
安装命令:
yum install epel-release
1.1.3 修改epel源
参考链接:https://mirrors.tuna.tsinghua.edu.cn/
redhat9.1为例,修改后:
[root@localhost ~]# cat /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux $releasever - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/Everything/$basearch/
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=1
gpgcheck=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
[epel-debuginfo]
name=Extra Packages for Enterprise Linux $releasever - $basearch - Debug
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/Everything/$basearch/debug/
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux $releasever - $basearch - Source
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/Everything/source/tree/
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
gpgcheck=1
1.2 包管理
1.2.1 yum
1.2.2 dnf
新一代的RPM软件包管理器。
DNF包管理器克服了YUM包管理器的一些瓶颈,提升了包括用户体验,内存占用,依赖分析,运行速度等多方面的内容。DNF使用 RPM, libsolv 和 hawkey 库进行包管理操作。
dnf –version #看安装在您系统中的 DNF 包管理器的版本
dnf repolist #显示系统中可用的 DNF 软件库
dnf repolist all #显示系统中可用和不可用的所有的 DNF 软件库
dnf list #列出用户系统上的所有来自软件库的可用软件包和所有已经安装在系统上的软件包
dnf list installed #列出所有安装了的 RPM 包
dnf list available #列出来自所有可用软件库的可供安装的软件包
dnf search nano #你不知道你想要安装的软件的准确名称时,你可以用该命令来搜索软件包。你需要在”search”参数后面键入软件的部分名称来搜索。(在本例中我们使用”nano”)
dnf info nano #查看软件包详情
dnf provides /bin/bash #查看是哪个软件包提供了系统中的某一文件时,你可以使用这条命令。(在本例中,我们将查找”/bin/bash”这个文件的提供者)
dnf install nano #系统将会自动安装对应的软件及其所需的所有依赖(在本例中,我们将用该命令安装nano软件)
dnf update systemd #升级制定软件包(在本例中,我们将用命令升级”systemd”这一软件包)
dnf update 或 # dnf upgrade #升级系统中所有有可用升级的软件包
dnf remove nano 或 # dnf erase nano #删除系统中指定的软件包(在本例中我们将使用命令删除”nano”这一软件包)
dnf help #列出所有的 DNF 命令及其用途
dnf history #查看您系统上 DNF 命令的执行历史。
dnf grouplist #列出所有的软件包组
dnf groupinstall ‘Educational Software’ #用于安装一个软件包组(本例中,我们将用命令安装”Educational Software”这个软件包组)
dnf groupupdate ‘Educational Software’ #用于升级一个软件包组中的软件包(本例中,我们将用命令升级”Educational Software”这个软件包组中的软件)
dnf groupremove ‘Educational Software’ #删除一个软件包组(本例中,我们将用命令删除”Educational Software”这个软件包组)
1.2.3 wget
2.