debian12 笔记
前言
最近在win10通过wsl安装了debian linux子系统(wsl2安装报错了。。所以改成了wsl),没想到安装的还是最新的debian12 (Bookworm)。的确和ubuntu有些不一样,现在把一些使用情况记录下来,以备参考。
正文
1. 更换国内源
# 切换到sudo
sudo su
# 备份原文件
cd /etc/apt
cp sources.list sources.list_bak
使用nano注释掉sources.list中的原来的源,插入国内源
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free
# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free
# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free
# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free
deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free
# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free
在这里,一开始找到的源是https开头的,更换完毕后apt update报错:Certificate verification failed: The certificate is NOT trusted.
后来参考:apt命令报证书错误的解决方法------- Certificate verification failed: The certificate is NOT trusted.,把https改为http就可以了
2. 把当前用户设置为sudoer
# 这种可能比较笨重
echo "你的用户名 ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
3. 命令自动补全
sudo su
apt install bash-completion
修改/etc/bash.bashrc
找到自动补全相关的注释行,去掉注释
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
退出bash或debian,重新进入即可
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律