之前博主學習了軟件的幾種安裝方式,現在決定把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拓展源】
耐心等待安裝即可
四、更換阿里源
參考鏈接:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b115tcIgX