CentOS8 dnf软件包管理配置
生活随笔
收集整理的這篇文章主要介紹了
CentOS8 dnf软件包管理配置
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
CentOS8 dnf包管理
CentOS8的包管理和CentOS7的類似
一、配置本地源倉庫
mkdir /mnt/centos8 mount /dev/sr0 /mnt/centos8 mv /etc/yum.repos.d/CentOS.* /opt/ cat <<EOF>/etc/yum.repos.d/local.repo [AppStream] name=AppStream baseurl=file:///mnt/centos8/AppStream gpgcheck=0 enabled=1[BaseOS] name=BaseOS baseurl=file:///mnt/centos8/BaseOS gpgcheck=0 enabled=1 EOFdnf clean all dnf makecache二、dnf包管理使用
# 列出所有RPM包 dnf list # 安裝軟件包 dnf install wget # 卸載軟件包 dnf remove wget # 查詢所有軟件包組 dnf grouplist # 安裝軟件包組 dnf groupinstall 包 # 查看系統(tǒng)中可用dnf軟件庫 dnf repolist # 列出系統(tǒng)中可用和不可用的dnf軟件庫 dnf repolist list # 列出已經(jīng)安裝過的軟件包 dnf list installed # 列出可安裝的軟件包 dnf list available # 所有一個軟件包 dnf search wget # 查詢某個軟件包的詳情 dnf info wget # 查找某個文件的提供者 dnf provider /bin/bash # 刪除無用孤立的軟件包 dnf autoremove # 刪除緩存的無用軟件包 dnf clean all # 查詢有關(guān)某條命令的使用幫助 dnf help clean # 查詢dnf命令的執(zhí)行歷史 dnf history # 從特定的軟件寶庫中安裝特定的軟件包 dnf -enablerepo=epel install nginx # 重新安裝軟件包 dnf reinstall wget三、配置阿里云軟件源
# 添加基礎(chǔ)源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backupwget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo # 添加epel源 mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backupyum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel* sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*總結(jié)
以上是生活随笔為你收集整理的CentOS8 dnf软件包管理配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: GIF 截图工具
- 下一篇: 用pyecharts的map模块实现齐齐