Linux Ubuntu 18.04 换源

2023-05-16

在安装好Ubuntu后,你会发现软件下载安装速度非常慢,甚至会出错,因为Ubuntu官方的源在国内访问的速度非常慢,但是我们可以更改系统的源为国内的一些源来提高速度(国内各大网站的源会定期和官方的源进行同步更新)

换源步骤

1.打开虚拟终端
快捷键:alt + ctrl + t
2.进入etc/apt文件夹
cd /etc/apt
3.备份sources.list文件
sudo cp sources.list sources.list.bak
4.编辑sources.list文件
sudo vi sources.list

文件内未修改的官方源↓

#deb cdrom:[Ubuntu 18.04.2 LTS _Bionic Beaver_ - Release amd64 (20190210)]/ bionic main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic universe
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse

将文件内容替换为文章末任意源即可

键入gg光标移动到第一行
命令模式下键入 :.,$d 删除当前行至末行,即删除全部内容

别忘记复制国内源至该文件
insert模式下↓
复制:ctrl+insert
粘贴:shift+insert

5.保存退出
:wq
6.更新源
sudo apt-get update
sudo apt-get upgrade

update 命令会访问源列表中的每个网址,并读取软件列表,然后保存在我们的电脑上
upgrade 命令将本地安装的软件与软件列表中的进行对比,提示更新软件

OS 均为 Ubuntu 18.04

1. 清华源:链接
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
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
2.阿里源:链接
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src 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-backports main restricted universe multiverse
3.网易源:链接
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
4.中科大源:链接
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-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-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
## Not recommended

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

Linux Ubuntu 18.04 换源 的相关文章

随机推荐

  • C++扑克牌发牌

    自动发扑克牌 52张牌无大小王随机发给4个玩家 poker cpp 自动发扑克牌 52张牌无大小王随机发给4个 loaction src poker cpp include lt assert h gt include lt iostrea
  • ArchLinux下i3wm简单配置和美化

    先show下自己配置的截图 简单弄了下 xff0c 凑合用 本文默认你已经安装了基本的archlinux系统 xff0c 只是没有配置桌面环境 所以跳过前面archlinux的基础安装过程 ArchLinux的具体安装请参见我的博客 htt
  • CentOS8下编译配置nginx+rtmp,搭建推流服务器

    一 环境 服务器操作系统 xff1a CentOS Linux release 8 2 2004 Core nginx 版本 https nginx org download nginx 1 18 0 tar gz RMTP模块 xff1a
  • CentOS7网络配置(ping不同的原因及解决方法)

    这是配置好的CentOS7 xff0c 刚开始在Vmware里装CentOS7后是没有ip的 xff0c 原因是CentOS7默认不启动网卡的 xff0c 网卡不启用还ping个毛 进入 etc sysconfig network scip
  • SpringBoot-JPA进行多表连接查询

    通过JPA进行简单的 内 连接查询 1 准备 1 1开发工具Intellij Idea 1 2数据库mysql 1 3新建Spring Initializr项目 xff0c 勾选web mysql rest jpa依赖 2 开始 2 1项目
  • 响应式导航栏-利用纯css实现

    思路 xff1a 当屏幕为移动设备时 xff0c 隐藏导航栏列表项目 xff0c 显示菜单按钮 给菜单按钮 xff08 电脑时隐藏 xff09 加入hover 或者checked选择器实现 xff0c 当hover或者checked的触发时
  • BTRFS文件系统安装ArchLinux

    layout post title BTRFS文件系统安装ArchLinux date 2017 10 02 categories Linux 主要为以下步骤 xff1a 1 下载ArchLinux安装镜像并 制作U盘启动工具 2 开机进入
  • JSP文件上传

    JSP文件上传 网上的方法几乎都是使用的org apache commons fileupload的jar包 xff0c 需要手动下载导入commons fileupload jar和commons io jar 其实tomcat自带的or
  • ORPALIS PDF Reducer Pro(免费pdf压缩器工具)官方正式版V4.0.1 | pdf免费压缩软下载 | 怎样将pdf压缩得很小?

    ORPALIS PDF Reducer Pro 是一款优秀实用的离线单机版pdf免费压缩软件 xff0c 也就是大家说的免费pdf压缩器工具 xff0c 内置多种超高压缩比的PDF压缩算法和创新的页面布局分析以及自动颜色检测机制 xff0c
  • ubuntu系统文件夹作用

    opt 文件夹 用户级的程序目录 xff0c 可以理解为D Software xff0c opt有可选的意思 xff0c 这里可以用于放置第三方大型软件 xff08 或游戏 xff09 xff0c 当你不需要时 xff0c 直接rm rf掉
  • rhel7安装GUI

    check the rank of starting system systenmctl get default not found startx 查看光盘是否挂载 df 挂载 yum mount dev sr0 mnt mount dev
  • org-mode Properties-and-Columns翻译

    https orgmode org manual Properties and Columns html Properties and Columns 文章目录 属性属性语法特殊属性属性查询属性继承 Column View 列视图定义列列定
  • python利用ffmpeg进行rtmp推流直播

    思路 xff1a opencv读取视频 gt 将视频分割为帧 gt 将每一帧进行需求加工后 gt 将此帧写入pipe管道 gt 利用ffmpeg进行推流直播 pipe管道 xff1a 啥是pipe管道 xff1f 粗略的理解就是一个放共享文
  • 电脑环境PCL配置及VS2019环境配置

    VS2019配置pcl 1 12 0 前言 对于 3D 点云处理来说 xff0c PCL 完全是一个的模块化的现代 C 43 43 模板库 其基于以下第三方库 xff1a Boost Eigen FLANN VTK CUDA OpenNI
  • java算法--兔子繁殖问题

    java算法 兔子繁殖问题 题目 xff1a 古典问题 xff1a 有一对兔子 xff0c 从出生后第 3 个月起每个月都生一对兔子 xff0c 小兔子长到第四 个月后每个月又生一对兔子 xff0c 假如兔子都不死 xff0c 问每个月的兔
  • Linux配置Wifi模块

    linux终端无线网卡连接wifi xff1a 扫描可用连接wifi nmcli dev wifi 添加一个wifi的连接 nmcli dev wifi con 无线网络名称 password 无线网络密码 name 任意连接名称 xff0
  • Paho MQTT 嵌入式c客户端研究笔记

    最近做物联网设备 xff0c 需求长连接推送功能 当前物联网有一个标准协议是MQTT xff0c 对应有很多开源服务端 xff0c 如何快速接入这个服务呢 有两种接入方案 xff1a 1 自己clone 代码修改维护 2 找第三方服务 xf
  • Paho MQTT 嵌入式c客户端研究笔记 (二)

    paho mqtt embedded c master MQTTPacket samples xff0c 这个目录里面封装了发布消息 订阅消息的示例 运行pub0sub1 xff0c 这个示例里面会去订阅主题消息 发布主题消息 并且订阅和发
  • Android App 架构设计

    简介 本文是对谷歌原生文档的翻译 xff0c 仅供学习参照 原文链接 此文档写给希望学习最优编程实践和架构以开发健壮 高质量APP的开发者 开发者常遇到的问题 传统的桌面程序大多数使用场景是有一个启动入口 xff0c 作为一个独立进程运行
  • Linux Ubuntu 18.04 换源

    在安装好Ubuntu后 xff0c 你会发现软件下载安装速度非常慢 xff0c 甚至会出错 xff0c 因为Ubuntu官方的源在国内访问的速度非常慢 xff0c 但是我们可以更改系统的源为国内的一些源来提高速度 xff08 国内各大网站的