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,重新进入即可

posted @   BrianSun  阅读(757)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示