zoukankan      html  css  js  c++  java
  • Ubuntu更改软件源

    1、为防止误操作后无法恢复,先备份原文件sources.list

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

    2、修改软件源

    sudo gedit /etc/apt/sources.list  
    

    删除原来的内容把下面内容复制进去

    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
    
    # 预发布软件源,不建议启用
    # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
    

    3、没有图形界面的使用下面的命令

    rm /etc/apt/sources.list 
    echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse" >> /etc/apt/sources.list
    echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse" >> /etc/apt/sources.list
    echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list
    echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse" >> /etc/apt/sources.list
    

    清华软件源

  • 相关阅读:
    php 用csv文件导出大量数据初方案
    用php导入10W条+ 级别的csv大文件数据到mysql。导出10W+级别数据到csv文件
    升级 phpStudy 中 MySQL 版本至 5.7.17
    使用 mybatis-generator 自动生成 MyBatis 代码
    使用 JSON-lib 出现异常 java.lang.reflect.InvocationTargetException
    Eclipse 中 Java 代码报版本错误的问题
    Maven 的安装与配置
    Java 中 & | ^ 运算符的简单使用
    经典词句赏析
    酒色财气诗
  • 原文地址:https://www.cnblogs.com/long5683/p/13475181.html
Copyright © 2011-2022 走看看