zoukankan      html  css  js  c++  java
  • apt和yum安装源替换 阿里云源

    1、原文件重命名备份

    sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

    2、编辑源列表文件

    sudo vim /etc/apt/sources.list

    3、用下面的文本作为内容

    ubuntu 14

    deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse 
    deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse 
    deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse 
    deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse 
    deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse 
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse 
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse 
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse 
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse 
    deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

    ubuntu 16

    deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    ##测试版源
    deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
    # 源码
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    ##测试版源
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
    # Canonical 合作伙伴和附加
    deb http://archive.canonical.com/ubuntu/ xenial partner
    deb http://extras.ubuntu.com/ubuntu/ xenial main

    4、更新

    sudo apt-get update
    sudo apt-get upgrade

    ######################

    centos版

    1、原文件备份

    cd  /etc/yum.repos.d
    mv CentOS-Base.repo CentOS-Base.repo_bak

    2、下载阿里的,这里自己看对应版本了,我是安装的8(本来想用网易的,结果网易只提供到7)

    curl -o CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

    3、clean一下,重新生成缓存

    yum clean all
    yum makecache

    4、好了完事

  • 相关阅读:
    python idea 利用树莓派做家庭报警系统
    Browserslist: caniuse-lite is outdated. Please run next command `npm update`
    maven项目最外层有个红x,项目其他没有x
    要取消:根据 sitemap 的规则[0],当前页面 [pages/index/index] 将被索引
    MySQL的DATE_FORMAT()用法
    maven项目的java和resources等文件夹不在Java Resources的文件夹里,并且缺少Deployment...
    小程序开发demo及资源
    wx.requestSubscribeMessage 订阅消息
    java获取年月日
    goland 文件头自动注释
  • 原文地址:https://www.cnblogs.com/gabin/p/6519352.html
Copyright © 2011-2022 走看看