yum-config-manager命令介紹


介紹

yum-config-manager命令是對資源庫(/etc/yum.repos.d/下的文件)進行增刪改查
系統默認沒有安裝這個命令,這個命令在yum-utils包里,可以通過yum install -y yum-utils安裝

查詢倉庫內容

查詢所有資源庫
# yum repolist all
查詢已啟用的資源庫
# yum repolist enabled
查詢禁用的資源庫
# yum repolist disabled

添加資源庫

# yum-config-manager --add-repo repository_url
# yum-config-manager --add-repo https://mirrors.tuna.tsinghua.edu.cn/centos/8/BaseOS/x86_64/os/
啟用資源庫
# yum-config-manager --enable itemName

禁用資源庫
# yum-config-manager --disable itemName
或者直接編輯/etc/yum.repos.d/下對應資源庫文件
enabled=0

刪除資源庫
在/etc/yum.repos.d/下手動刪除對應repo文件即可,這會使得該庫中所有信息被刪除

轉載 https://www.cnblogs.com/G-Aurora/p/13166168.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM