解决Debian安装巨慢的问题

文章首发于个人博客

问题及原因

Debian安装过程中会有一个阶段下载特别慢,即便是在安装过程中更换了国内源,仍然是巨慢无比,其根本原因是:更换的源并不包含安全更新部分。

当然,如果是网卡硬件不在默认的安装包驱动范围内,这种情况如果不在安装过程中安装相关驱动,压根也不会遇到下载慢的情况。如果使用的是最新的完整的DVD安装包,可能也不会遇到下载慢的情况。

解决方案

断网安装

最简单的办法就是断网安装,安装完之后再彻底更换,最后再进行更新。这也是比较适合小白的方案。

至于断网的时机,可选择一开始就不联网,也可选择在下载慢的时候断网。建议小白选择后者。

安装过程中彻底更换源

原理

安装过程其实本身就是运行了一个简版的、定制linux系统,只不过整个安装过程是在其中一个终端中(命令终端图形终端)完成的,那么,安装过程中自然可以从别的终端界入并完成更换源,如此即可解决下载过程巨慢的问题,同时,系统安装好之后也无需再考虑更换源的问题。

具体操作

  1. 正常安装进行到选择国内源这一步

  2. Ctrl+Alt+F2Ctrl+Alt+F3进入终端,会有提示,直接回车

注意:

  • Ctrl+Alt+F1为命令行安装终端,图形安装后台也使用该终端

  • Ctrl+Alt+F2Ctrl+Alt+F3为暂未使用的命令行终端

  • Ctrl+Alt+F4为日志输出终端

  • Ctrl+Alt+F5为图形终端

  1. 执行如下命令
sh 复制代码
cat /target/etc/apt/sources.list
# /target 是正在安装的新系统的挂载点

如果第1.步选择完国内源之后没有继续,这里空的,或者只有deb cdrom: [pebian GNu/Linux 12.9.0Bookworm- 0fficial amd64 NETINST with irmware 20250111-10:54]/ bookworm contrib main non-free-firmware;如果第1.步选择完国内源之后继续了,并且此时已经进入下载阶段了,则会看到类似以下的内容:

txt 复制代码
deb cdrom: [pebian GNu/Linux 12.9.0Bookworm- 0fficial amd64 NETINST with irmware 20250111-10:54]/ bookworm contrib main non-free-firmware
deb http://mirrors.ustc.edu.cn/debian/ bookworm main non-free-firmware
deb-src http://mirrors.ustc.edu.cn/debian/ bookworm main non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src htto://security.debian.org/debian-security bookworm-security main non-free-firmware
# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free-firmware
deb-src http://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free-firmware

从中可以看到security.debian.org并没有被替换成国内源的地址。

  1. 执行如下命令,并把security.debian.org替换为国内源的地址
sh 复制代码
nano /target/etc/apt/sources.list
# 没有 vi/vim,只有 nano 可用
  1. 替换完之后,按Ctrl+o保存,再按Ctrl+x退出nano编辑器

  2. Ctrl+Alt+F1Ctrl+Alt+F5回到安装界面,继续安装

相关推荐
belldeep2 天前
WSL 安装 Debian 12 后,Linux 如何安装 curl , quickjs ?
linux·运维·debian·curl·quickjs
l1t2 天前
Debian上安装PostgreSQL的故障和排除
运维·postgresql·debian
后端木木2 天前
一键 Ubuntu、Debian、Centos 换源(阿里源、腾讯源等)
ubuntu·centos·debian
ergevv3 天前
在 RK3588 上通过 VSCode 远程开发配置指南
vscode·debian·ssh·rk3588·远程开发
XMAIPC_Robot4 天前
基于 NXP + FPGA+Debian 高可靠性工业控制器解决方案
运维·人工智能·fpga开发·debian·边缘计算
行之文8 天前
Debian 11之解决daemon.log与syslog文件占用空间过大问题
运维·debian
行之文8 天前
Debian 11 之使用hostapd与dnsmasq进行AP设置
运维·网络·debian
sz66cm12 天前
Docker基础 -- 构建 RK3588 Debian 根文件系统
docker·容器·debian
darkchink12 天前
[BUG]Debian/Linux操作系统中 安装 curl等软件显示无候选安装(E: 软件包 curl 没有可安装候选)
linux·运维·服务器·debian·bug
fengfeng N12 天前
cannot access ‘/etc/mysql/debian.cnf‘: No such file or directory
数据库·mysql·debian