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


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

 

操作場景

用戶需要更新彈性雲服務器的系統或者軟件時,可以連接Internet,通過外部CentOS鏡像源提供相關服務。但是,如果彈性雲服務器無法訪問Internet,或者外部CentOS鏡像源提供的服務不穩定時,可以使用華為雲提供的CentOS鏡像源進行更新。

約束與限制

本節內容僅限華北區、華東區、華南區及香港用戶使用。

  • 請確認已經配置了華為雲提供的內網DNS服務器地址。華為雲內網DNS地址,請參見華為雲提供的內網DNS地址是多少
  • 本節操作適用於x86_64架構操作系統的雲服務器。

操作步驟

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

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

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

  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.repo

    • CentOS 7

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

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

    yum makecache

          說明:      
    • 如果執行命令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 版權協議,轉載請附上原文出處鏈接和本聲明。                
                        本文鏈接: https://blog.csdn.net/ltx06/article/details/78030056                
                        
                                                             

    1、打開centos的yum文件夾

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

     

    2、用wget下載repo文件

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

    如果wget命令不生效,說明還沒有安裝wget工具,輸入yum -y install wget 回車進行安裝。

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

     

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

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

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

     

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

    mv Centos-7.repo CentOs-Base.repo

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

     

    5、執行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

     。

     

     

     

     

     

     

     

     

     

     

     


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM