• ubuntu 把软件源修改为国内源


    国内有很多Ubuntu的镜像源,比如:阿里源、网易源等,还有很多教育网的源,比如:清华源、中科大源等。

    这里以清华源为例讲解如何修改Ubuntu 18.04里面默认的源。

    修改步骤

    第一步:备份原始源文件,当然需要系统管理员权限操作

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

    第二步:修改sources.list文件并添加国内源

    vi /etc/apt/sources.list

    第三步:注释原文件内的源(Ubuntu官方源)

    #Ubuntu 官方源 
    deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

    第四步:在文件中添加清华源,保存并退出

    #清华源
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

    第五步:更新源

    sudo apt-get update

    第六步:到此完成国内源修改

    其他源

    阿里源:

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

    网易源:

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

    中科大源:

    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
    deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

     浙大源:

    deb http://mirrors.zju.edu.cn/ubuntu/ trusty main multiverse restricted universe
    deb http://mirrors.zju.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe
    deb http://mirrors.zju.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe
    deb http://mirrors.zju.edu.cn/ubuntu/ trusty-security main multiverse restricted universe
    deb http://mirrors.zju.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe
    deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty main multiverse restricted universe
    deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe
    deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe
    deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty-security main multiverse restricted universe
    deb-src http://mirrors.zju.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

    搜狐源:

    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://ftp.sjtu.edu.cn/ubuntu/ dapper main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-backports main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-proposed main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-security main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-updates main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu-cn/ dapper main multiverse restricted universe

    北京理工大源:

    deb http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe

    北京交大源:

    deb http://mirror.bjtu.edu.cn/ubuntu/ raring main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ raring-backports main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ raring-proposed main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ raring-security main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ raring-updates main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ raring main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ raring-backports main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ raring-proposed main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ raring-security main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ raring-updates main multiverse restricted universe
  • 相关阅读:
    练习12
    练习11
    练习10(图片题)
    练习9(第九章习题)
    练习8(图片题)
    练习5
    练习4
    对象的赋值与比较
    静态方法
    静态变量
  • 原文地址:https://www.cnblogs.com/Jimc/p/10214081.html
Copyright © 2020-2023  润新知