Debian source_list首次踩坑

安装

首次安装使用Debain,下载了最新的Debain安装镜像;下载地址,下载了文件debian-12.8.0-amd64-DVD-1.iso;

而后通过,VMWare安装了虚拟机。

账号配置

安装过程中,会提示配置root账号及自定义账号xxxx,但是默认不能使用root账号,自定义的xxxx账号也没有sudo权限,所以需要通过recover模式登录root账号,然后将xxxx账号加入sudo组。

usermod -aG sudo xxxx

配置软件源

通过百度得知需要配置的软件源如下:

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

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

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

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

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

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

安装软件

因为默认安装中不包含gcc和g++,所以通过sudo apt install gcc g++的方式安装。命令开始执行但是提示有libc6-dev存在冲突,导致安装失败。

而后通过百度搜索,提示首先安装aptitude,而后尝试通过aptitude install g++,来解决该问题,尝试了很多次发现依然未能解决问题;

当中以为是提前安装了某些软件,导致了冲突,视图重新安装操作系统,在全新的环境进行apt install gcc g++依然存在问题。

后面,换了DeepSeek查询Debian的阿里云镜像源,得到的镜像列表如下:

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

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

deb http://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free

deb-src http://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free

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

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

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

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

同时其也给出了其他镜像源的列表,如下:

不难发现,之前配置的镜像源事实上是Debian 11所匹配的镜像源,而我实际安装的是Debian 12;从而导致了意想不到的问题。

把镜像源修改为bookworm,对应的镜像源后,使用apt install gcc g++后就都很容易就成功了。

总结

个人首次使用Debian,对镜像源的各个字段含义其实不是很清晰,通过百度AI引擎拿到答案后,就直接用了;出现问题后,依然是继续搜索,发现进入了死胡同。换了一个思路后,恰好找到了解决方案,也算是运气好了,要不然会花费更多的时间进行处理。

事实上,在发现apt install g++失败后,我也是使用了DeepSeek进行提问,查找答案的;给出的答案是使用aptitude install进行解决(确实是常用技能);但事实上更深层次的问题竟然是起始配置的错误。

感想:

1:百度AI训练的实时性,可能已经落后了;

2:如果一开始就使用了最新的DeepSeek搜索拿到的镜像源,估计软件安装会顺畅很多;(不过,如果不犯这个错误,可能我也会对镜像源中的名字字段的含义不会有过多的关注了)

相关推荐
重生之高冷汉堡包28 分钟前
家庭住宅IP是什么?机房住宅与普通住宅有什么区别
运维·服务器·网络·网络协议·tcp/ip·用户运营
Thneonl30 分钟前
git reset --hard 之后先别哭:reflog 里存着你刚弄丢的那个分支
运维·后端
见闻小天地35 分钟前
液冷直流负载:AI 算力中心带载测试的关键设备
运维·业界资讯
迪康软件zz40 分钟前
从 PHP 高危漏洞看纵深防御:资产盘点、补丁管理与端点防护实践
运维·安全·自动化运维
智能运维指南1 小时前
2026 年可观测平台选型对比:混合 IT 架构下企业运维监控产品怎么选
运维·可观测·嘉为蓝鲸·运维监控产品对比
Fnetlink11 小时前
Fnet 云网安 261023
运维·开发语言·网络·人工智能·安全·web安全·php
可爱系程序猿1 小时前
nvcuvid.dll 加载失败定位:CUDA 视频解码、驱动接口与进程位数逐项核查
运维·服务器·程序人生·电脑·音视频
郝亚军1 小时前
在win11上用openssl生成私钥、再从私钥导出公钥、...
linux·运维·服务器
智能运维指南1 小时前
企业 IT 管理软件如何选型?先理清监控、服务管理、配置与自动化能力
运维·自动化·自动化运维·嘉为蓝鲸
ESDWAN1 小时前
SD-WAN 主备切换为什么仍会断网?从检测、切换到会话恢复分析
运维·开发语言·网络·php