ubuntu系统更换源和apt命令参数
一:问题概述
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命令参数的更多相关文章
- ubuntu apt 命令参数(转)
apt-get是一条linux命令,适用于deb包管理式的操作系统,主要用于自动从互联网的软件仓库中搜索.安装.升级.卸载软件或操作系统. apt-get update 在修改/etc/apt/sou ...
- ubuntu系统更换源
一:问题概述 ubuntu,我们在使用apt新装软件的时候,会使用官方的网站去下载软件,但是会因为国内的转接点太多,而导致下载的速度非常慢 ,我们可以通过换成一些中间的节点来进行下载,比如阿里源,中科 ...
- Ubuntu新手指引-软件包apt命令使用
看到这个博客,你十有八九是刚接触Ubuntu,不知从何下手.Ubuntu社区虽然现在不活跃,但里有很多文,可以帮助你快速上手,比如Ubuntu中文社区新手指引. 软件包的管理常常涉及root权限,普通 ...
- ubuntu下常用的apt-get 命令参数
apt-cache search package 搜索包 apt-cache show package 获取包的相关信息,如说明.大小.版本等 sudo apt-get install package ...
- ubuntu系统 用户进入后命令行只有一个“$” 美元符号
在新添加用户后,切换到该用户下面后: 发现命令行前面只有一个$符号,很不方便. 虽然每次输入一个bash可以解决,但是太麻烦. 如何解决呢? sudo vi /etc/passwd 找到该用户 wan ...
- ubuntu系统普通用户sudo命令执行报错解决方案
通过adduser user1命令创建普通用户,且使该用户具有sudo权限(将该新用户user1添加到sudo或root用户组中,或者修改/etc/sudoer文件),但是依然无法执行sudo指令,会 ...
- Ubuntu系统怎么切换多用户命令界面
ctrl+alt+F2~F6 切换窗口 返回桌面 Ctrl+Alt+F7
- Ubuntu系统下面软件安装更新命令
在ubuntu服务器下安装包的时候,经常会用到sudo apt-get install 包名 或 sudo pip install 包名,那么两者有什么区别呢? 1.区别 pip用来安装来自PyPI( ...
- ubuntu下,apt的参数使用,很实用呦
ubuntu下apt-get 命令参数 常用的APT命令参数 apt-cache search package 搜索包 apt-cache show package 获取包的相关信息,如说明.大小.版 ...
- Ubuntu 清除缓存 apt-get命令参数
整理了Ubuntu Linux操作系统下apt-get命令的详细说明,分享给大家.常用的APT命令参数:apt-cache search package 搜索包apt-cache show packa ...
随机推荐
- 内网安全之:MS14-068 Kerberos 域用户提权漏洞
内网安全之:MS14-068 Kerberos 域用户提权漏洞 目录 内网安全之:MS14-068 Kerberos 域用户提权漏洞 0 漏洞说明 (MS14-068:CVE-2014-6324) 1 ...
- DrCush_082020_血清阴性RA确诊延迟
转自Dr Jack Cush的Twitter (2020-08-20) 梅奥诊所:血清阴性RA的诊断存在延迟-血清阴性的首次关节肿胀距RA确诊为187天,而血清阳性者则为11天(P <.001) ...
- 【译】.NET 7 中的性能改进(八)
原文 | Stephen Toub 翻译 | 郑子铭 Mono 到目前为止,我一直提到 "JIT"."GC "和 "运行时",但实际上在.N ...
- ABAP SORT 递减/递增
排序 DESCENDING(递减) / ASCENDING(递增)只作用前字段 SORT LT_VBAK BY VBELN DESCENDING(递减). SORT LT_VBAK BY VBE ...
- 【5】java之日期处理类
一.Date 类 在 Java 里提供有一个 java.util.Date 类,可以直接获取当前的日期时间. 范例:获取当前的日期时间 public class TestDemo { public ...
- WPF CommandParameter 传递多个参数的方法
1.新建一个按钮内容如下 <Button Name="btnOK" Content="确定" Height="20" Width=&q ...
- Python3中Super函数的使用
Super函数用法 主要用于调用父类函数 代码演示 class A: def __init__(self): self.n = 2 print('此时执行A的自定义函数,self的n值为',self. ...
- vue中vue2-google-maps使用谷歌地图的基础操作
小哥我最近使用谷歌地图做了一个项目,于是乎各种坑就扑面而来,未免下次接着踩坑特留下自己的爬坑记录. 首先我是没用过谷歌地图也不知道靠谱不靠谱,于是乎傻傻的入坑了, 1.首先你要是没有vpn(或者fq工 ...
- linux启用ipv4转发功能
一.临时生效,重启失效1.sysctl -w net.ipv4.ip_forward=12.echo 1 > /proc/sys/net/ipv4/ip_forward二.永久生效修改 /etc ...
- Flask + PyInstaller = 客户端
Flask + PyInstaller = 客户端 有些特殊情况需要开发客户端,Python有几个常用的几个GUI框架,如 PyQt.wxPython等 但使用这些GUI框架往往界面比较丑,而且GUI ...