0

0

更新Ubuntu软件源

星夢妙者

星夢妙者

发布时间:2025-07-18 11:36:15

|

968人浏览过

|

来源于php中文网

原创

大家好,欢迎再次相聚,我是你们的朋友全栈君。

Ubuntu软件源的原始配置文件路径是/etc/apt/sources.list,其内容如下:

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.deb http://archive.ubuntu.com/ubuntu/ focal main restricted# deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted## Major bug fix updates produced after the final release of the## distribution.deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted# deb-src http://archive.ubuntu.com/ubuntu/ focal-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://archive.ubuntu.com/ubuntu/ focal universe# deb-src http://archive.ubuntu.com/ubuntu/ focal universedeb http://archive.ubuntu.com/ubuntu/ focal-updates universe# deb-src http://archive.ubuntu.com/ubuntu/ focal-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://archive.ubuntu.com/ubuntu/ focal multiverse# deb-src http://archive.ubuntu.com/ubuntu/ focal multiversedeb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse# deb-src http://archive.ubuntu.com/ubuntu/ focal-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://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse# deb-src http://archive.ubuntu.com/ubuntu/ focal-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 focal partner# deb-src http://archive.canonical.com/ubuntu focal partnerdeb http://security.ubuntu.com/ubuntu/ focal-security main restricted# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricteddeb http://security.ubuntu.com/ubuntu/ focal-security universe# deb-src http://security.ubuntu.com/ubuntu/ focal-security universedeb http://security.ubuntu.com/ubuntu/ focal-security multiverse# deb-src http://security.ubuntu.com/ubuntu/ focal-security multiverse

要备份原有的软件源,可以使用以下命令:

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

接下来,您需要修改sources.list文件的内容。可以使用以下指令进行编辑:

vi /etc/apt/sources.list

sources.list的内容修改为以下内容:

# 清华源deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiversedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiversedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiversedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse# 阿里源deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

修改后的sources.list内容如下:

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiversedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiversedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiversedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

更新Ubuntu软件源

jQuery水平布局软件版本更新信息时间轴代码
jQuery水平布局软件版本更新信息时间轴代码

jQuery水平布局软件版本更新信息时间轴代码

下载

完成sources.list的更新后,使用以下命令进行更新:

apt-get update

更新的结果显示如下:

# 显示结果Get:1 http://mirrors.aliyun.com/ubuntu bionic InRelease [242 kB]Get:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease [88.7 kB]Get:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB]Get:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease [242 kB]Get:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease [74.6 kB]Get:6 http://mirrors.aliyun.com/ubuntu bionic/multiverse Sources [216 kB]Get:7 http://mirrors.aliyun.com/ubuntu bionic/restricted Sources [5823 B]Get:8 http://mirrors.aliyun.com/ubuntu bionic/main Sources [1063 kB]Get:9 http://mirrors.aliyun.com/ubuntu bionic/universe Sources [11.5 MB]Get:10 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial InRelease [247 kB]Get:11 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-updates InRelease [99.8 kB]Get:12 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-backports InRelease [97.4 kB]Get:13 http://mirrors.aliyun.com/ubuntu bionic/multiverse amd64 Packages [186 kB]Get:14 http://mirrors.aliyun.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]Get:15 http://mirrors.aliyun.com/ubuntu bionic/main amd64 Packages [1344 kB]Get:16 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 Packages [11.3 MB]Get:17 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security InRelease [99.8 kB]Get:18 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial/main amd64 Packages [1558 kB]Get:19 http://mirrors.aliyun.com/ubuntu bionic-security/multiverse Sources [8784 B]Get:20 http://mirrors.aliyun.com/ubuntu bionic-security/universe Sources [365 kB]Get:21 http://mirrors.aliyun.com/ubuntu bionic-security/main Sources [331 kB]Get:22 http://mirrors.aliyun.com/ubuntu bionic-security/restricted Sources [26.8 kB]Get:23 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 Packages [2628 kB]Get:24 http://mirrors.aliyun.com/ubuntu bionic-security/multiverse amd64 Packages [21.1 kB]Get:25 http://mirrors.aliyun.com/ubuntu bionic-security/restricted amd64 Packages [829 kB]Get:26 http://mirrors.aliyun.com/ubuntu bionic-security/universe amd64 Packages [1478 kB]Get:27 http://mirrors.aliyun.com/ubuntu bionic-updates/universe Sources [598 kB]Get:28 http://mirrors.aliyun.com/ubuntu bionic-updates/restricted Sources [30.2 kB]Get:29 http://mirrors.aliyun.com/ubuntu bionic-updates/multiverse Sources [18.2 kB]Get:30 http://mirrors.aliyun.com/ubuntu bionic-updates/main Sources [655 kB]Get:31 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 Packages [3067 kB]Get:32 http://mirrors.aliyun.com/ubuntu bionic-updates/universe amd64 Packages [2256 kB]Get:33 http://mirrors.aliyun.com/ubuntu bionic-updates/multiverse amd64 Packages [29.0 kB]Get:34 http://mirrors.aliyun.com/ubuntu bionic-updates/restricted amd64 Packages [863 kB]Get:35 http://mirrors.aliyun.com/ubuntu bionic-proposed/multiverse Sources [2053 B]Get:36 http://mirrors.aliyun.com/ubuntu bionic-proposed/main Sources [95.0 kB]Get:37 http://mirrors.aliyun.com/ubuntu bionic-proposed/universe Sources [9634 B]Get:38 http://mirrors.aliyun.com/ubuntu bionic-proposed/restricted Sources [14.4 kB]Get:39 http://mirrors.aliyun.com/ubuntu bionic-proposed/main amd64 Packages [236 kB]Get:40 http://mirrors.aliyun.com/ubuntu bionic-proposed/universe amd64 Packages [20.8 kB]Get:41 http://mirrors.aliyun.com/ubuntu bionic-proposed/restricted amd64 Packages [171 kB]Get:42 http://mirrors.aliyun.com/ubuntu bionic-proposed/multiverse amd64 Packages [2329 B]Get:43 http://mirrors.aliyun.com/ubuntu bionic-backports/main Sources [5862 B]Get:44 http://mirrors.aliyun.com/ubuntu bionic-backports/universe Sources [7129 B]Get:45 http://mirrors.aliyun.com/ubuntu bionic-backports/universe amd64 Packages [12.6 kB]Get:46 http://mirrors.aliyun.com/ubuntu bionic-backports/main amd64 Packages [11.6 kB]Get:47 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial/restricted amd64 Packages [14.1 kB]Get:48 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial/universe amd64 Packages [9827 kB]Get:49 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial/multiverse amd64 Packages [176 kB]Get:50 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-updates/multiverse amd64 Packages [26.2 kB]Get:51 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-updates/main amd64 Packages [2560 kB]Get:52 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-updates/universe amd64 Packages [1544 kB]Get:53 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-updates/restricted amd64 Packages [16.4 kB]Get:54 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-backports/universe amd64 Packages [12.7 kB]Get:55 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-backports/main amd64 Packages [10.9 kB]Get:56 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security/multiverse amd64 Packages [8820 B]Get:57 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security/main amd64 Packages [2051 kB]Get:58 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security/restricted amd64 Packages [15.9 kB]Get:59 http://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security/universe amd64 Packages [984 kB]Fetched 59.6 MB in 41s (1446 kB/s)Reading package lists... Done

更新Ubuntu软件源

完成Ubuntu软件源的更换操作。如果您在Docker中更换源(不使用vim),可以使用以下命令:

echo "">/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted">>/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted">>/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe">>/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe">>/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse">>/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse">>/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse">>/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted">>/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe">>/etc/apt/sources.listecho "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse">>/etc/apt/sources.listecho "deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse">>/etc/apt/sources.listecho "deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse">>/etc/apt/sources.listecho "deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse">>/etc/apt/sources.listecho "deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse">>/etc/apt/sources.listecho "deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse">>/etc/apt/sources.listecho "deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse">>/etc/apt/sources.listecho "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse">>/etc/apt/sources.listecho "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse">>/etc/apt/sources.listecho "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse">>/etc/apt/sources.listecho "deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse">>/etc/apt/sources.list

发布者:全栈程序员栈长,转载请注明出处:https://www.php.cn/link/a97c37ca1941f04c8822733923adb673

相关专题

更多
html版权符号
html版权符号

html版权符号是“©”,可以在html源文件中直接输入或者从word中复制粘贴过来,php中文网还为大家带来html的相关下载资源、相关课程以及相关文章等内容,供大家免费下载使用。

616

2023.06.14

html在线编辑器
html在线编辑器

html在线编辑器是用于在线编辑的工具,编辑的内容是基于HTML的文档。它经常被应用于留言板留言、论坛发贴、Blog编写日志或等需要用户输入普通HTML的地方,是Web应用的常用模块之一。php中文网为大家带来了html在线编辑器的相关教程、以及相关文章等内容,供大家免费下载使用。

655

2023.06.21

html网页制作
html网页制作

html网页制作是指使用超文本标记语言来设计和创建网页的过程,html是一种标记语言,它使用标记来描述文档结构和语义,并定义了网页中的各种元素和内容的呈现方式。本专题为大家提供html网页制作的相关的文章、下载、课程内容,供大家免费下载体验。

470

2023.07.31

html空格
html空格

html空格是一种用于在网页中添加间隔和对齐文本的特殊字符,被用于在网页中插入额外的空间,以改变元素之间的排列和对齐方式。本专题为大家提供html空格的相关的文章、下载、课程内容,供大家免费下载体验。

245

2023.08.01

html是什么
html是什么

HTML是一种标准标记语言,用于创建和呈现网页的结构和内容,是互联网发展的基石,为网页开发提供了丰富的功能和灵活性。本专题为大家提供html相关的各种文章、以及下载和课程。

2895

2023.08.11

html字体大小怎么设置
html字体大小怎么设置

在网页设计中,字体大小的选择是至关重要的。合理的字体大小不仅可以提升网页的可读性,还能够影响用户对网页整体布局的感知。php中文网将介绍一些常用的方法和技巧,帮助您在HTML中设置合适的字体大小。

505

2023.08.11

html转txt
html转txt

html转txt的方法有使用文本编辑器、使用在线转换工具和使用Python编程。本专题为大家提供html转txt相关的文章、下载、课程内容,供大家免费下载体验。

312

2023.08.31

html文本框代码怎么写
html文本框代码怎么写

html文本框代码:1、单行文本框【<input type="text" style="height:..;width:..;" />】;2、多行文本框【textarea style=";height:;"></textare】。

425

2023.09.01

PS使用蒙版相关教程
PS使用蒙版相关教程

本专题整合了ps使用蒙版相关教程,阅读专题下面的文章了解更多详细内容。

23

2026.01.19

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
Kotlin 教程
Kotlin 教程

共23课时 | 2.7万人学习

C# 教程
C# 教程

共94课时 | 7.1万人学习

Java 教程
Java 教程

共578课时 | 48万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号