之前博主學習了軟體的幾種安裝方式,現在決定把Centos軟體安裝環境給配置好一點,
因為有互聯網,所以最終決定采取如下措施保證軟體安裝,
思路:
1.更換國內yum源
2.安裝第三方源EPEL
一、環境準備
centos版本:【7.8】
網路:可用外網
遠程連接工具:xshell
感謝相關參考鏈接:
清華大學開源軟體鏡像站:https://mirrors.tuna.tsinghua.edu.cn/help/centos/
EPEL鏡像使用幫助:https://mirrors.tuna.tsinghua.edu.cn/help/epel/
centos中文網關于yum與epel源參考:https://www.centoschina.cn/course/config-centos/9627.html
二、更換yum為國內源
1.查看系統版本
命令:cat /etc/redhat-release

2.備份以前的源的檔案,新建一個檔案夾用于存放以前的源
默認yum源的存放目錄:/etc/yum.repos.d
新建存放備份的目錄:/etc/yum.repos.d/beifei
命令:ll /etc/yum.repos.d 【查看源目錄】

mkdir beifei 【新建beifei的檔案夾】
mv *.repo beifei 【移動所有repo檔案到beifei檔案夾】

3.下載各大網站的源,這里用的是【清華大學】
命令:cp /etc/yum.repos.d/beifei/CentOS-Base.repo /etc/yum.repos.d/ 【復制beif下的源到上級目錄】

前往【清華開源鏡像】:https://mirrors.tuna.tsinghua.edu.cn/help/centos/

復制源的檔案,粘貼至CentOS-Base.repo
命令:vim /etc/yum.repos.d/CentOS-Base.repo 【編輯檔案】
4.清除并更新快取
命令:yum clean all 【清除快取】
命令:yum makecache 【更新新的快取】
三、安裝第三方源EPEL
EPEL:是Enterprise Linux(RHEL、CentOS)中經常用到的包,相當于拓展庫
命令:
yum list | grep epel 【檢查epel包是否存在】
yum -y install epel-release 【安裝epel拓展源】
yum update 【更新】

耐心等待安裝即可
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/226398.html
標籤:其他
