Ubuntu 更换apt-get源

2023-05-16

Ubuntu最初的apt-get源在国外网站,因此很多时候通过apt-get安装软件速度会很慢。我们可以将apt-get源更换成国内镜像源,来解决速度慢的问题。

更换apt-get源主要有以下四个步骤:

1.备份sources.list文件

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

2.打开sources.list文件

sudo gedit /etc/apt/sources.list

3.删除原内容,选择下列镜像源中的一个,添加至文档内

①清华源

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

②中科大源

#中科大源
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse 
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse 
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse 
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main universe restricted 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main universe restricted

③阿里云源

#阿里云源
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

4.保存sources.list文件,然后更新apt-get

sudo apt-get update

更新完成后就可以解决apt-get速度慢的问题。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Ubuntu 更换apt-get源 的相关文章

随机推荐

  • OpenStack配置网络并安装且配置控制器节点

    OpenStack配置网络 右击以管理员模式启动 点击编辑 xff0c 选择启动启动虚拟网络编辑器 如上图所示 xff0c 如果出现桥接模式则是操作正确 下面进入虚拟机中 用户名为 xff1a root 密码 xff1a 123456 进入
  • 疑难杂症:Intellig IDEA启动Tomcat,控制台输出中文乱码(2018.3版本亲测可用)

    找到 IntelliJ IDEA 安装目录下bin目录下 xff0c 修改idea exe vmoptions和idea64 exe vmoptions两个文件 xff0c 在最后一行添加 Dfile encoding 61 UTF 8 修
  • 21.通用型1602液晶显示屏操作方法

    第7章通用型1602液晶显示屏操作方法 7 1液晶概述 液晶显示屏的主要原理是以电流刺激液晶分子产生点 线 面并配合背部灯管构成画面 液晶通常是按照显示字符的行数或液晶点阵的行 列数来命名的 xff0c 比如1602的意思是每行显示16个字
  • 外文文献检索网站

    1 Google scholar 网址 xff1a https scholar google com hk hl 61 zh CN 如今搜索论文的首选 xff0c 可以在这里查看论文统计和引用参考文献 xff0c 还能通过关注作者或者论文获
  • shell-awk的BEGIN和END

    文章目录 一 Awk 的两个特殊模式实例 xff1a 二 Awk高级应用1 if单分支语句2 if双分支语句3 for循环4 while循环 SHELL awk两个特殊模式 xff08 BEGIN 和 END xff09 及awk高级应用
  • HTML5基础知识

    目录 一 初识HTML 二 网页基本标签 2 1标题标签 2 3换行标签 2 4水平线标签 2 5字体样式标签 2 6注释和特殊符号 三 图像 xff0c 超链接 xff0c 网页布局 3 1图像标签 3 2链接标签 3 3块元素和行内元素
  • SQL Server 调用程序集(dll文件)

    1 生成对应的dll项目文件 如下图所示 xff08 示例 xff09 xff1a 2 打开SQL SERVER数据库 xff0c 创建程序集 xff0c 如下操作 找到 程序集 61 右击选中 新建程序集 点击 常规 xff0c 操作如下
  • 树莓派3b+镜像的安装以及常用的登录方式及树莓派换源

    安装镜像 1 xff0c 格式化内存卡用第一个工具 2 xff0c 把镜像写道内存卡中用第二个工具 登录 串口登录 因为树莓派默认的是蓝牙连接 xff0c 我们要断开蓝牙连接 xff0c 打开串口连接 将安装好的sd卡文件夹下的 cmdli
  • 通过kettle工具实现数据清洗与转换(实例)

    一 对文件merge csv进行完全去重 1 使用Kettle工具创建转换repeat transform xff0c 并添加 CSV文件输入 控件 唯一行 xff08 哈希值 xff09 控件以及Hop跳连接线 2 配置 CSV文件输入
  • JavaWed开发环境与搭建

    一 jdk下载与安装 1 下载 xff1a 进入官网 xff08 http www oracle com xff09 下载对应版本即可 2 设置环境变量 需要设置环境变量如下 xff08 JDK安装的位置 xff09 二 TomCat下载与
  • 【树莓派问题】树莓派python虚拟环境无法安装scipy库

    目录 问题描述 问题解决方法 报错关键字 xff1a Building wheel for numpy PEP 517 started Building wheel for numpy PEP 517 still running pip s
  • Codeblocks修改字体

    右上角settings editor general settings choose 选择好之后一路确定OK就可以了 但是大家谨慎改 xff0c 因为20 03版本的会报错 xff0c 就像我这样 xff0c 不知道其他版本修改后会不会有问
  • 论文阅读 MAML (Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks)

    Model Agnostic Meta Learning for Fast Adaptation of Deep Networks MAML 论文阅读 摘要介绍模型不可知元学习元学习问题定义模型不可知元学习算法 MAML种类监督回归和分类强
  • RIPV2动态路由协议—网络基础

    RIPV2动态路由协议 一 实验题目1 IP地址规划2 拓扑搭建3 配置IP地址与环回接口4 RIPV2的配置5 RIP的扩展配置 xff1a 6 成果展示 二 动态路由1 动态路由协议 xff1a 2 动态路由协议的缺点 xff1a 3
  • VC6.0 MFC 单文档 贪吃蛇游戏 基础入门

    贪吃蛇游戏 一 整体思路 1 贪吃蛇对大家来说并不陌生 xff0c 既然要设计贪吃蛇 xff0c 那么我们首先要定义蛇和食物这样两个对象 xff0c 并给它们添加一些成员变量 2 添加虚函数OnInitialUpdate 做一些初始化工作
  • 启动错误求助

    org springframework beans factory UnsatisfiedDependencyException Error creating bean with name 39 userController 39 Unsa
  • C++ 入门(编写第一个C++程序)

    第一章 遇见C 43 43 欢迎进入C 43 43 世界 xff01 1 1 C 43 43 介绍 C 43 43 是在C语言的基础上添加了面向对象和泛型编程的支持 xff0c 它是21世纪最重要的编程语言之一 xff0c C 43 43
  • yield和return的区别-- 超详细

    首先比较下return 与 yield的区别 xff1a return xff1a 在程序函数中返回某个值 xff0c 返回之后函数不在继续执行 xff0c 彻底结束 yield 带有yield的函数是一个迭代器 xff0c 函数返回某个值
  • Linux修改登录密码

    root 权限修改用户名密码 执行 xff1a passwd root 按照提示输入新的密码两次 如果用xshell连接的情况下 xff0c 需要重新验证新的密码 非root 权限修改用户名密码 执行 xff1a passwd userna
  • Ubuntu 更换apt-get源

    Ubuntu最初的apt get源在国外网站 xff0c 因此很多时候通过apt get安装软件速度会很慢 我们可以将apt get源更换成国内镜像源 xff0c 来解决速度慢的问题 更换apt get源主要有以下四个步骤 xff1a 1