日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

RedHat7使用yum源安装依赖包

發布時間:2023/12/14 编程问答 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 RedHat7使用yum源安装依赖包 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
  • 由于Redhat版本的linux不能免費使用yum源安裝依賴包,這導致不能愉快的安裝Oracle的相關產品,本文就介紹一下如何在Redhat7上配置yum源
  • 首先查看一下Redhat7默認安裝的yum,查詢結果如下
[wen@localhost Desktop]$ rpm -qa | grep yum
  • 發現默認有安裝yum,先將其卸載

[wen@localhost Desktop]$ su - root //切換到root用戶 進行卸載 Password: Last login: Sat Nov 2 19:50:09 CST 2019 on pts/0 [root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps //忽略依賴性 卸載 [root@localhost ~]# rpm -qa | grep yum //再次查詢是否還有yum相關的安裝包,以確保卸載完全
  • 將準備好的yum安裝包上傳到虛擬主機,我是放在/home/yum目錄下

  • 因為要替換,所以一定要是完整的一套,還有一個rhel-debuginfo.repo文件要配置。部分博客配置的不對,這個文件配置不對也是不行的,所以我是測試好的一套yum包給大家包括配置文件,需要的可以找我。執行: rpm -ivh *.rpm 一次性執行依賴包,因為包之間會相互依賴。
[root@localhost yum]# rpm -ivh *.rpm
  • 新建配置文件/etc/yum.repos.d/CentOS-Base.repo,加入以下內容即可,不要改動,不要以為你很厲害,真的!然后保存退出
[root@localhost yum]# vi /etc/yum.repos.d/CentOS-Base.repo #CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$7 - Base - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os baseurl=http://mirrors.163.com/centos/7/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#released updates [updates] name=CentOS-$7 - Updates - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful [extras] name=CentOS-$7 - Extras - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages [centosplus] name=CentOS-$7 - Plus - 163.com baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7


然后執行yum clear all,就可以用yum來安裝依賴包了

[root@node ~]# yum clear all

總結

以上是生活随笔為你收集整理的RedHat7使用yum源安装依赖包的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。