** 1.删除原來配置YUM倉庫****
rm -rf /etc/yum.repos.d/*
** 2.配置新的YUM本地倉庫**
vim /etc/yum.repos.d/dvd.repo
3.VIM配置内容
[[email protected] ~]# vim /etc/yum.repos.d/dvd.repo #配置yum倉庫
[dvd] #倉庫名
name=pan #名稱
baseurl=file:///mnt #路徑
enabled=1
gpgcheck=0
4. 運作YUM安裝gcc
[[email protected] ~]# yum -y install gcc #安裝gcc包
已加載插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
軟體包 gcc-4.8.5-36.el7.x86_64 已安裝并且是最新版本
無須任何處理
5.檢查安裝
[[email protected] ~]# rpm -q gcc #檢查包是否安裝
gcc-4.8.5-36.el7.x86_64
6.您可以嘗試添加 --skip-broken 選項來解決該問題 您可以嘗試執行:rpm -Va --nofiles --nodigest 解決方案
[[email protected] 桌面]# yum clean all #請除yum緩存
已加載插件:fastestmirror, langpacks, ovl
正在清理軟體源: riadb
Cleaning up everything
[[email protected] ~]# yum repolist #測試yum檔案
已加載插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
源辨別 源名稱 狀态
dvd pan 5,152
repolist: 5,152
7.解除安裝yum 安裝程式 gcc
[[email protected] 桌面]# yum remove gcc
作為依賴被删除:
gcc-c++.x86_64 0:4.8.5-4.el7