阿里yum源與華爲yum源的配置

如何使用華爲雲提供的CentOS鏡像源(x86_64)?

  更新時間:  2019/08/16 11:17
查看PDF                
分享 

操做場景

用戶須要更新彈性雲服務器的系統或者軟件時,能夠鏈接Internet,經過外部CentOS鏡像源提供相關服務。可是,若是彈性雲服務器沒法訪問Internet,或者外部CentOS鏡像源提供的服務不穩定時,可使用華爲雲提供的CentOS鏡像源進行更新。c++

約束與限制

  • 本節內容僅限華北區、華東區、華南區及香港用戶使用。
  • 請確認已經配置了華爲雲提供的內網DNS服務器地址。華爲雲內網DNS地址,請參見華爲雲提供的內網DNS地址是多少
  • 本節操做適用於x86_64架構操做系統的雲服務器。

操做步驟

  1. 以root用戶登陸彈性雲服務器。
  2. 執行如下命令,備份CentOS-Base.repo文件。

    mkdir -p /etc/yum.repos.d/repo_bak/web

    mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/repo_bak/spring

  3. 使用curl命令下載對應版本的CentOS-Base.repo文件,並將其放入/etc/yum.repos.d/目錄。    
         針對華爲雲當前支持的CentOS鏡像源版本,使用的curl命令分別以下:     
    • CentOS 6

      curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.myhuaweicloud.com/repo/CentOS-Base-6.repodocker

    • CentOS 7

      curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.myhuaweicloud.com/repo/CentOS-Base-7.repojson

  4. 執行如下命令,生成緩存。

    yum makecachecentos

          說明:      
    • 若是執行命令yum makecache後,回顯信息爲「Another app is currently holding the yum lock」,則需執行命令rm -rf /var/run/yum.pid刪除yum.pid文件,而後再執行命令yum makecache生成緩存。
    • 若是執行命令yum makecache後,回顯信息爲「Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again」,則需執行命令yum --disablerepo=epel -y update ca-certificates更新證書,臨時禁用epel源

     

     

     

    超簡單CentOS7 配置阿里雲yum源

                 版權聲明:本文爲博主原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處連接和本聲明。                
                        本文連接: http://www.javashuo.com/article/p-deqgruel-hz.html                
                        
                                                             

    一、打開centos的yum文件夾

    輸入命令cd  /etc/yum.repos.d/

     

    二、用wget下載repo文件

    輸入命令wget  http://mirrors.aliyun.com/repo/Centos-7.repo

    若是wget命令不生效,說明尚未安裝wget工具,輸入yum -y install wget 回車進行安裝。

    當前目錄是/etc/yum.repos.d/,剛剛下載的Centos-7.repo也在這個目錄上

     

    三、備份系統原來的repo文件

    mv  CentOs-Base.repo CentOs-Base.repo.bak

    便是重命名 CentOs-Base.repo -> CentOs-Base.repo.bak

     

    四、替換系統原理的repo文件

    mv Centos-7.repo CentOs-Base.repo

    便是重命名 Centos-7.repo -> CentOs-Base.repo

     

    五、執行yum源更新命令

    yum clean all

    yum makecache

    yum update

    依次執行上述三條命令即配置完畢。

     

     

     

    編譯安裝經常使用包+阿里鏡像源-經常使用資源-系統-下載-科萊軟件下載-docker倉庫包-安全圈-杏雨梨雲-圖形界面安裝-docker私有雙倉庫-阿里源報錯處理-centos7目錄大小

     

     

    yum install apr-util apr-util-devel apr apr-devel pcre pcre-devel zlib zlib-devel openssl openssl-devel gcc cmake gcc-c++ -y

     

    阿里鏡像源和經常使用資源下載

    複製代碼
    https://mirrors.aliyun.com/centos/7.6.1810/isos/x86_64/  http://msdn.itellyou.cn/  http://www.5sharing.com/
    http://www.0933.me/share/2053548.html
    複製代碼

    安全修改配置

    複製代碼
    setenforce 0 systemctl stop firewalld systemctl disable firewalld sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config # 修改字符集, 不然可能報 input/output error的問題, 由於日誌裏打印了中文 $ localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8 $ export LC_ALL=zh_CN.UTF-8 $ echo 'LANG="zh_CN.UTF-8"' > /etc/locale.conf
    複製代碼

     

    阿里雲源配置

       31  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 32 yum makecache 33 yum clean all 34 yum makecache yum install epel-release 

     圖形界面安裝

    https://www.cnblogs.com/passer101/p/9899249.html

     若是報錯卸載組件從新安裝

     

    yum -y remove grub2-common*

     

     

    有陣列沒法安裝的問題

    https://www.linuxidc.com/Linux/2014-02/96871.htm

    一鍵網刻

    https://jingyan.baidu.com/article/0f5fb0993256136d8334ea9a.html

    經常使用系統工具下載

    https://msdn.itellyou.cn

     

    ip查詢和科萊分析軟件下載 http://www.colasoft.com.cn/download/capsa.php https://www.ipchacha.com/

    docker倉庫包

    https://hub.docker.com/r/richarvey/nginx-php-fpm/tags?page=2

    安全圈

    https://www.anquanquan.info/

     vc庫下載

    https://www.fujieace.com/jingyan/vc11-vc14-vc15.html

    https://www.cnblogs.com/hgj123/p/5936656.html

    杏雨梨雲

    https://www.xyboot.com/%e6%9d%8f%e9%9b%a8%e6%a2%a8%e4%ba%91usb%e7%bb%b4%e6%8a%a4%e7%b3%bb%e7%bb%9f2019%e7%ab%af%e5%8d%88%e7%89%88/

     

    阿里源報錯清理

    複製代碼
    yum --enablerepo=base clean metadata rm -f /var/lib/rpm/__* rpm --rebuilddb -v -v yum clean dbcache yum clean metadata yum clean rpmdb yum clean headers yum clean all rm -rf /var/cache/yum/timedhosts.txt rm -rf /var/cache/yum/* yum makecache
    複製代碼

     

    複製代碼
    vi /etc/docker/daemon.json
    { "insecure-registries": [ "192.168.1.197" ] }#私有 { "registry-mirrors": ["https://rncxm540.mirror.aliyuncs.com"] }#公有 兩個鏡像倉庫 { "registry-mirrors":["https://rncxm540.mirror.aliyuncs.com"], "insecure-registries":["192.168.1.197"] } 
    { "registry-mirrors": ["https://7bezldxe.mirror.aliyuncs.com/","https://IP:PORT/"] } 
    systemctl daemon-reload && systemctl restart docker
    複製代碼

     centos7 目錄大小查看

    du -h --max-depth=1 /data/images/

     阿里jar打包配置

    https://www.cnblogs.com/xiaojf/p/10836923.html

    https://repo.spring.io/webapp/#/artifacts/browse/tree/General/libs-milestone

     。

相關文章
相關標籤/搜索