当前位置:首页 > 技术 > 正文内容

debian 安装完毕添加sudo及更换更新源

Dongbin2个月前 (02-08)技术108

Debian安装完毕,未安装sudo,切换到root用户

su

输入密码,切换为root用户

Debian12默认的更新源为光盘源或国外源,速度保障都差强人意。所以安装完系统的第一步就是把源更换为国内源。

备份/etc/apt/sources.list

cp /etc/apt/sources.list /etc/apt/sources.list.bak

编辑/etc/apt/sources.list

nano /etc/apt/sources.list

更换为阿里云镜像源:

deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib

更换为腾讯云镜像源:

deb https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.tencent.com/debian-security/ bookworm-security main
deb-src https://mirrors.tencent.com/debian-security/ bookworm-security main
deb https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib

更换为清华镜像源:

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware

更换为中科大镜像源:

deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware

退出保存后执行:

apt-get update
apt-get upgrade

安装sudo

apt-get install sudo

安装完成后,退出root用户

exit

编辑sudoers文件

nano /etc/sudoers

在root    ALL=(ALL:ALL) ALL后添加

username ALL=(ALL:ALL) ALL

username替换为你的用户名,保存退出


扫描二维码推送至手机访问。

版权声明:本文由Eilib Studio发布,如需转载请注明出处。

本文链接:https://eilib.xyz/?id=14

分享给朋友:
返回列表

上一篇:LEDE 插件选择

没有最新的文章了...

“debian 安装完毕添加sudo及更换更新源” 的相关文章

Adguard Home DNS设置

推荐上游DNS设置#阿里DNS <10ms 223.5.5.5 223.6.6.6 https://dns.alidns.com/dns-query tls://dns.alidns.com #百度DNS <40ms 180.76.76.76 #腾讯DN...

LEDE 插件选择

选择samba 4 替换ksmbdExtra packages  --->        <*> autosamba..............................