Linux Debian13安装后更换为国内镜像源,解决执行sudo命令提示用户名不在sudoers文件中问题

选择Linux Debian作为服务器操作系统和桌面操作系统最佳Linux的理由:

Linux Debian是面向程序员的最古老,最出色的Linux发行版之一,Linux Debian极度稳定性,更适合于作为服务器的操作系统,作为桌面操作系统也很出色,Linux Debian提供了具有.deb软件包管理兼容性的超稳定发行版,Linux Debian是开发人员友好的操作系统 ,对于系统管理员和高级程序员而言,Linux Debian是最好的选择。

Debian更适合于作为服务器的操作系统,它比Ubuntu要稳定得多。Debian整个系统基础核心非常小,不仅稳定,而且占用硬盘空间小,占用内存小。128M的VPS即可以流畅运行Debian,而Ubuntu则会略显吃力。

Linux Debian下载地址:

Debian官网:

bash 复制代码
https://www.debian.org/

阿里云镜像站:

bash 复制代码
https://mirrors.aliyun.com/debian-cd/

华为开源镜像站:

bash 复制代码
https://mirrors.huaweicloud.com/debian-cd/

Lnux Debian13安装后需要进行一些配置。

1.Linux Debian13切换root用户方法

输入su命令后再输入root密码

bash 复制代码
su

2.解决用户名不在sudoers文件中

出现这个提示,就是这个用户没法得到超级用户权限。怎么办?变成超级用户:

2.1切换到root用户

bash 复制代码
su

2.2编辑/etc/sudoers文件,添加用户名 ALL=(ALL:ALL) ALL

bash 复制代码
vi  /etc/sudoers

在root ALL=(ALL:ALL) ALL下面添加:

bash 复制代码
用户名 ALL=(ALL:ALL) ALL

3.Linux Debian13镜像更新为国内镜像源

3.1切换到root用户

bash 复制代码
su

3.2备份当前镜像源文件

bash 复制代码
cp /etc/apt/sources.list /etc/apt/sources.list.bak

3.3编辑/etc/apt/sources.list文件

bash 复制代码
vi  /etc/apt/sources.list

替换为国内镜像源站
阿里云镜像站

bash 复制代码
deb https://mirrors.aliyun.com/debian/ trixie main contrib non-free non-free-firmware
deb-src https://mirrors.aliyun.com/debian/ trixie main contrib non-free non-free-firmware

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

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

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

3.4运行命令升级

bash 复制代码
apt  update    #取回更新的软件包列表信息
bash 复制代码
apt  upgrade   #进行一次升级
bash 复制代码
apt  clean   #删除所有已下载的包文件

相关推荐
05大叔1 小时前
网络基础知识 域名,JSON格式,AI基础
运维·服务器·网络
安当加密1 小时前
无需改 PAM!轻量级 RADIUS + ASP身份认证系统 实现 Linux 登录双因子认证
linux·运维·服务器
内卷焦虑人士2 小时前
Windows安装WSL2+Ubuntu 22.04
linux·windows·ubuntu
woho7788993 小时前
不同网段IP的网络打印机,打印、扫描设置
运维·服务器·网络
耗子会飞3 小时前
小白学习固定VM虚拟机的centos服务器的IP
运维·服务器·centos
dddddppppp1233 小时前
qemu模拟的一个内核驱动 io口中断
linux
程序员老赵3 小时前
超全 Docker 镜像源配置指南|Windows/Mac/Linux一键搞定,拉镜像再也不卡顿
linux·后端·容器
门豪杰4 小时前
Ubuntu下安装Claude Code
linux·运维·ubuntu·claude·claude code
总要冲动一次4 小时前
离线安装 percona-xtrabackup-24
linux·数据库·mysql·centos
桌面运维家4 小时前
Windows/Linux双启动:BIOS/UEFI多配置桌面创建指南
linux·运维·windows