Debian12获取sudo权限和更新互联网源
一、用户获取sudo权限
Debian12安装完以后,用户不具备sudo权限。为此,要通过修改/etc/sudoers获取相应权限。具体如下:
su
输入root密码,获取root权限。
nano /etc/sudoers
找到root ALL=(ALL:ALL) ALL
在下一行添加:
用户名 ALL=(ALL:ALL) ALL
ctrl+o保存,ctrl+x退出。
然后su 用户名进入用户环境。
二、更新源
通过介质提供的源不支持互联网更新,所以要通过修改sources.list使其支持互联网更新。
具体如下:
sudo rm -rf /etc/apt/sources.list #删除原有源
sudo nano /etc/apt/sources.list
将下面源复制进去:
deb https://mirrors.cloud.tencent.com/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.cloud.tencent.com/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.cloud.tencent.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.cloud.tencent.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.cloud.tencent.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.cloud.tencent.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.cloud.tencent.com/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.cloud.tencent.com/debian-security bookworm-security main contrib non-free non-free-firmware
ctrl+o保存,ctrl+x退出。
接下来就可以sudo apt-get update,sudo apt-get upgrade了!