zoukankan      html  css  js  c++  java
  • linux下修改apt下载源

    很多时候使用apt install命令会出现Unable to fetch somearchives的错误,我们需要运行以下apt update,可是经常会出现下载速度很慢的情况

    这里就记一下将apt的下载源改为国内的一些源以提高速度

    方法一:

    方法:

    1、修改源地址:
    cp /etc/apt/sources.list /etc/apt/sources.list.bak
    vim /etc/apt/sources.list

    加入如下内容(中科大的):

    deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted
    deb http://mirrors.ustc.edu.cn/ubuntu/ precise universe
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise universe
    deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe
    deb http://mirrors.ustc.edu.cn/ubuntu/ precise multiverse
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise multiverse
    deb http://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse
    deb http://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
    deb-src http://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse


    比较快的源:

    搜狐源:
    deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
    deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
    deb http://mirrors.sohu.com/ubuntu/ precise universe
    deb-src http://mirrors.sohu.com/ubuntu/ precise universe
    deb http://mirrors.sohu.com/ubuntu/ precise-updates universe
    deb-src http://mirrors.sohu.com/ubuntu/ precise-updates universe
    deb http://mirrors.sohu.com/ubuntu/ precise multiverse
    deb-src http://mirrors.sohu.com/ubuntu/ precise multiverse
    deb http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
    deb-src http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
    deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
    deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse

    网易源:

    deb http://mirrors.163.com/ubuntu/ precise-updates main restricted
    deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted
    deb http://mirrors.163.com/ubuntu/ precise universe
    deb-src http://mirrors.163.com/ubuntu/ precise universe
    deb http://mirrors.163.com/ubuntu/ precise-updates universe
    deb-src http://mirrors.163.com/ubuntu/ precise-updates universe
    deb http://mirrors.163.com/ubuntu/ precise multiverse
    deb-src http://mirrors.163.com/ubuntu/ precise multiverse
    deb http://mirrors.163.com/ubuntu/ precise-updates multiverse
    deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse
    deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

    更新看看速度:

    sudo apt-get update
    sudo apt-get upgrade

    方法二:利用鼠标界面操作

    进入Ubuntu Software Center

    ubuntu software center

    edit software sources

    software and updates

    download from other

    need authenticate for crifan li

    other china mirrors 163 choose server

    already choose 163 close

    也是可以的。

    最好再去做一次:apt update

  • 相关阅读:
    常用变量的获取
    批出里中常用参数的含义
    利用批处理命令复制指定文件到指定目录下
    跟后台打印程序系统服务通讯时出现错误。请打开服务管理单元,确认后台打印程序服务是否在运行。
    系统日志报错i8042prt无法加载
    删除指定路径下指定天数之前(以文件名中包含的日期字符串为准)的文件:字符串截取
    删除指定路径下指定天数之前(以文件的最后修改日期为准)的文件:BAT + VBS
    Linux学习笔记
    Docker
    Python学习笔记
  • 原文地址:https://www.cnblogs.com/wangshaowei/p/8999541.html
Copyright © 2011-2022 走看看