debian更换源


使用Debian更换软件源

第一步:备份原有源列表

在更换软件源前,我们需要备份现有的源列表以便在出现问题时可以恢复原有状态。使用以下命令备份源列表:

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

第二步:选择合适的软件源

在更换软件源前,我们需要选择一个适合的软件源,可以去官网查找合适的源或者自己搭建源。这里以阿里源为例:

sudo nano /etc/apt/sources.list

打开后,将现有源列表注释掉,输入以下内容:

deb http://mirrors.aliyun/debian/ buster main contrib non-free

deb-src http://mirrors.aliyun/debian/ buster main contrib non-free

deb http://mirrors.aliyun/debian-security buster/updates main contrib non-free

deb-src http://mirrors.aliyun/debian-security buster/updates main contrib non-free

deb http://mirrors.aliyun/debian/ buster-updates main contrib non-free

deb-src http://mirrors.aliyun/debian/ buster-updates main contrib non-free

deb http://mirrors.aliyun/debian/ buster-backports main contrib non-free

deb-src http://mirrors.aliyun/debian/ buster-backports main contrib non-free

第三步:刷新源列表并进行软件更新

输入以下命令刷新源列表:

sudo apt-get update

等待一段时间,更新源列表,输入以下命令进行软件更新:

sudo apt-get upgrade

这里可能需要一定的时间,取决于你系统中的软件数量和更新内容。

第四步:测试新源是否可用

完成更新和测试后,可以通过输入以下命令查看刚刚选择的新源列表是否可以正常工作:

sudo apt-get install htop

如果更新正常,则会看到类似如下的输出:

The following NEW packages will be installed:

htop

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

Need to get 75.8 kB of archives.

After this operation, 212 kB of additional disk space will be used.

Get:1 http://mirrors.aliyun/debian buster/main amd64 htop amd64 2.2.0-1+b1 [75.8 kB]

Fetched 75.8 kB in 3s (22.9 kB/s)

Selecting previously unselected package htop.

(Reading database … 235805 files and directories currently installed.)

Preparing to unpack …/htop_2.2.0-1+b1_amd64.deb …

Unpacking htop (2.2.0-1+b1) …

Setting up htop (2.2.0-1+b1) …

Processing triggers for man-db (2.8.5-2) …

总结

这是更换Debian源的方法,建议在切换源时仔细查看源配置,选择合适的源。如果更换出现问题,建议恢复原有状态并查找问题所在。祝使用愉快。

《debian更换源》来自互联网同行内容,若有侵权,请联系我们删除!


上一篇:10g免费空间申请

下一篇:我的世界服务器


Copyright © 2002-2019 测速网 www.inhv.cn 皖ICP备2023010105号
测速城市 测速地区 测速街道 网速测试城市 网速测试地区 网速测试街道
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!

热门搜索 城市网站建设 地区网站制作 街道网页设计 大写数字 热点城市 热点地区 热点街道 热点时间 房贷计算器