debian12 笔记

发布时间 2023-11-21 11:04:42作者: BrianSun

前言


最近在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