一:问题概述

ubuntu,我们在使用apt新装软件的时候,会使用官方的网站去下载软件,但是会因为国内的转接点太多,而导致下载的速度非常慢 ,我们可以通过换成一些中间的节点来进行下载,比如阿里源,中科大源,清华源等等,这样的网站,他们会定时和官方的源进行同步和更新,而我们直接同步他们,速度就会比直接同步官方的源快很多,这样能够大大增加我们的下载软件的速度。

二:ubuntu系统更换源

更换源的方法非常简单:修改/etc/apt/sources.list文件即可

2.1:进入/etc/apt/

cd /etc/apt

2.2:修改sources.list文件

sudo vi sources.list (要有管理员权限)

2.3:可以在修改前先对 sources.list文件进行备份

sudo cp sources.list sources.list.bak

2.4:删除掉sources.list的其他内容,任意选择一种源的内容复制粘贴进去,保存,例如,选择阿里源

2.5:更新apt

sudo apt-get update

三:ubuntu各个版本的阿里云源内容

3.1:ubuntu16.04 LTS

3.1.1:阿里源:

deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

3.1.2:东北大学:

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial main restricted #Added by software-properties

deb http://mirror.neu.edu.cn/ubuntu/ xenial main restricted

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial restricted multiverse universe #Added by software-properties

deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties

deb http://mirror.neu.edu.cn/ubuntu/ xenial universe

deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates universe

deb http://mirror.neu.edu.cn/ubuntu/ xenial multiverse

deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates multiverse

deb http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties

deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties

deb http://mirror.neu.edu.cn/ubuntu/ xenial-security universe

deb http://mirror.neu.edu.cn/ubuntu/ xenial-security multiverse

3.1.3:清华大学:

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse

3.2:ubuntu 14.04 LTS

3.2.1:Ubuntu 官方更新服务器(欧洲,此为官方源,国内较慢,但无同步延迟问题,电信、移动/铁通、联通等公网用户可以使用):

deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

Ubuntu官方提供的其他软件(第三方闭源软件等):

deb http://archive.canonical.com/ubuntu/ trusty partner

deb http://extras.ubuntu.com/ubuntu/ trusty main

3.2.2:阿里云:

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

3.2.3:以下为有教育网接入的服务器(推荐教育网用户使用,部分非教育网用户也有可观的速度。教育网用户请优先使用IPv6地址。

中国科学技术大学更新服务器(位于合肥,千兆教育网接入,百兆电信/联通线路智能路由),由中科大Linux 用户协会和中科大学网络信息中心维护,包含其他开源镜像,Deepin 官方服务器 实际亦指向此处:

deb http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe

deb http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

deb http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

deb http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

deb http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

IPv6-Only 地址

deb http://mirrors6.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe

deb http://mirrors6.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

deb http://mirrors6.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

deb http://mirrors6.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

deb http://mirrors6.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

deb-src http://mirrors6.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe

deb-src http://mirrors6.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe

deb-src http://mirrors6.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe

deb-src http://mirrors6.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe

deb-src http://mirrors6.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe

3.2.4搜狐更新服务器(山东联通千兆接入,官方中国大陆地区镜像跳转至此) ,包含其他开源镜像:

deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse

3.2.5:网易163更新服务器(广东广州电信/联通千兆双线接入),包含其他开源镜像:

deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

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

deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

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

常用的APT命令参数:

apt-cache search package 搜索包
apt-cache show package 获取包的相关信息,如说明、大小、版本等
sudo apt-get install package 安装包
sudo apt-get install package - - reinstall 重新安装包
sudo apt-get -f install 修复安装"-f = ——fix-missing"

sudo apt-get remove package 删除包
sudo apt-get remove package - - purge 删除包,包括删除配置文件等
sudo apt-get update 更新源
sudo apt-get upgrade 更新已安装的包
sudo apt-get dist-upgrade 升级系统
sudo apt-get dselect-upgrade 使用 dselect 升级
apt-cache depends package 了解使用依赖
apt-cache rdepends package 是查看该包被哪些包依赖
sudo apt-get build-dep package 安装相关的编译环境
apt-get source package 下载该包的源代码
sudo apt-get clean && sudo apt-get autoclean 清理无用的包
sudo apt-get check 检查是否有损坏的依赖

参考:https://www.cnblogs.com/dtiove/p/5917263.html

查询Linux某命令来自哪个包

Debian:(Ubuntu等)

先安装apt-file

sudo apt-get install -y apt-file
apt-file update
查询命令:(已查询ifconfig为例)
root@debian ~ # apt-file search bin/ifconfig
net-tools: /bin/ifconfig

apt-file search -x(--regexp) 后可接正则表达式,如:

root@deepin ~ # apt-file search -x 'bin/rz$'
lrzsz: /usr/bin/rz
root@deepin ~ # apt-file search --regexp 'bin/rz$'
lrzsz: /usr/bin/rz

CentOS:

root@CentOS7 ~ # yum provides *bin/ifconfig
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.shuosc.org
 * extras: mirrors.shuosc.org
 * updates: mirrors.163.com
net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo        : base
Matched from:
Filename    : /sbin/ifconfig

net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo        : @base
Matched from:
Filename    : /sbin/ifconfig
————————————————
版权声明:本文为CSDN博主「离尘zh」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_26507799/article/details/78998439

ubuntu系统更换源和apt命令参数的更多相关文章

  1. ubuntu apt 命令参数(转)

    apt-get是一条linux命令,适用于deb包管理式的操作系统,主要用于自动从互联网的软件仓库中搜索.安装.升级.卸载软件或操作系统. apt-get update 在修改/etc/apt/sou ...

  2. ubuntu系统更换源

    一:问题概述 ubuntu,我们在使用apt新装软件的时候,会使用官方的网站去下载软件,但是会因为国内的转接点太多,而导致下载的速度非常慢 ,我们可以通过换成一些中间的节点来进行下载,比如阿里源,中科 ...

  3. Ubuntu新手指引-软件包apt命令使用

    看到这个博客,你十有八九是刚接触Ubuntu,不知从何下手.Ubuntu社区虽然现在不活跃,但里有很多文,可以帮助你快速上手,比如Ubuntu中文社区新手指引. 软件包的管理常常涉及root权限,普通 ...

  4. ubuntu下常用的apt-get 命令参数

    apt-cache search package 搜索包 apt-cache show package 获取包的相关信息,如说明.大小.版本等 sudo apt-get install package ...

  5. ubuntu系统 用户进入后命令行只有一个“$” 美元符号

    在新添加用户后,切换到该用户下面后: 发现命令行前面只有一个$符号,很不方便. 虽然每次输入一个bash可以解决,但是太麻烦. 如何解决呢? sudo vi /etc/passwd 找到该用户 wan ...

  6. ubuntu系统普通用户sudo命令执行报错解决方案

    通过adduser user1命令创建普通用户,且使该用户具有sudo权限(将该新用户user1添加到sudo或root用户组中,或者修改/etc/sudoer文件),但是依然无法执行sudo指令,会 ...

  7. Ubuntu系统怎么切换多用户命令界面

    ctrl+alt+F2~F6 切换窗口 返回桌面 Ctrl+Alt+F7

  8. Ubuntu系统下面软件安装更新命令

    在ubuntu服务器下安装包的时候,经常会用到sudo apt-get install 包名 或 sudo pip install 包名,那么两者有什么区别呢? 1.区别 pip用来安装来自PyPI( ...

  9. ubuntu下,apt的参数使用,很实用呦

    ubuntu下apt-get 命令参数 常用的APT命令参数 apt-cache search package 搜索包 apt-cache show package 获取包的相关信息,如说明.大小.版 ...

  10. Ubuntu 清除缓存 apt-get命令参数

    整理了Ubuntu Linux操作系统下apt-get命令的详细说明,分享给大家.常用的APT命令参数:apt-cache search package 搜索包apt-cache show packa ...

随机推荐

  1. VSCode 国内镜像下载地址

    https://vscode.cdn.azure.cn/stable/,比如: https://vscode.cdn.azure.cn/stable/e4503b30fc78200f846c62cf8 ...

  2. Word 表格对文字、图文进行排版

    在以前,Web 前端工程师利用 <table /> 元素对网页布局进行排版,但是如今却不推荐此元素排版了,而是改用 <div /> 元素和 CSS 弹性布局(或网格布局)对网页 ...

  3. Django-drf-序列化器高级用法之SerializerMethodField

    在Drf框架中的serializers.py序列化中, SerializerMethodField字段是一个只读字段.它通过调用附加到的序列化程序类上的方法来获取其值.它可用于将任何类型的数据添加到对 ...

  4. left join(一)

    例表aaid adate1 a12 a23 a3 表bbid bdate1 b12 b24 b4 两个表a,b相连接,要取出id相同的字段select * from a inner join b on ...

  5. rfid串口dma_delay()引发的问题

    接rfid读卡器的串口,有dma_delay()时,会有问题 现象是: 规律性的错误 解决办法:去掉dma_delay()即可

  6. DOM06~

    Window 对象 BOM (浏览器对象模型) 定时器-延时函数 js 执行机制 location 对象 navigator 对象 history 对象 BOM BOM (Browser Object ...

  7. 20230103~05code

    目录 U190849 最简分式 P5734 [深基6.例6]文字处理软件 P1104 生日 P4305 [JLOI2011]不重复数字 P8218 [深进1.例1]求区间和 P3397 地毯 P236 ...

  8. 前端面试题 10 个「有用」JavaScript 代码片段

    携手创作,共同成长!这是我参与「掘金日新计划 · 8 月更文挑战」的第16天,点击查看活动详情 降低阅读负担,启发创作心智,轻松学习 JavaScript 技巧,日拱一卒,jym,冲~ 注:本篇可能更 ...

  9. (前端面试题)详解 JS 的 setTimeout 和 setInterval 两大定时器

    程序员面试题库分享 1.前端面试题库 (面试必备)            推荐:★★★★★ 地址:前端面试题库 2.前端技术导航大全      推荐:★★★★★ 地址:前端技术导航大全 3.开发者颜色 ...

  10. Symbol类型

    Symbol 是ES6引入的一种新的原始数据类型,由于Symbol是一个原始类型的值,不是对象,不能添加属性.基本上 是一种类似于字符串的数据类型 概述 Symbol 可以接受一个字符串作为参数,主要 ...