美文网首页
常用系统包管理工具的镜像

常用系统包管理工具的镜像

作者: theache | 来源:发表于2020-02-03 15:32 被阅读0次

    yum(centos7)镜像

    # 自行备份CentOS-Base.repo 文件
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    yum clean all
    yum makecache
    

    apt镜像

    # 默认注释了源码仓库,如有需要可自行取消注释
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    

    homebrew镜像

    # 替换中国镜像
    cd "$(brew --repo)"
    git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
    
    # 更新失效
    cd "$(brew --repo)"
    git pull origin master
    
    # 切回官方镜像
    cd "$(brew --repo)"
    git remote set-url origin https://github.com/Homebrew/brew.git
    cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    git remote set-url origin https://github.com/Homebrew/homebrew-core.git
    

    apk镜像

    # 切换阿里镜像
    sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
    
    # 重置镜像
    sed -i 's/mirrors.aliyun.com/dl-cdn.alpinelinux.org/g' /etc/apk/repositories
    

    相关文章

      网友评论

          本文标题:常用系统包管理工具的镜像

          本文链接:https://www.haomeiwen.com/subject/clvhxhtx.html