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   #删除所有已下载的包文件

相关推荐
木心月转码ing8 分钟前
WSL+Cpp开发环境配置
linux
Rockbean21 小时前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
茶杯梦轩1 天前
CompletableFuture 在 项目实战 中 创建异步任务 的核心优势及使用场景
服务器·后端·面试
崔小汤呀1 天前
最全的docker安装笔记,包含CentOS和Ubuntu
linux·后端
何中应1 天前
vi编辑器使用
linux·后端·操作系统
何中应1 天前
Linux进程无法被kill
linux·后端·操作系统
何中应1 天前
rm-rf /命令操作介绍
linux·后端·操作系统
何中应1 天前
Linux常用命令
linux·操作系统
葛立国1 天前
从 / 和 /dev 说起:Linux 文件系统与挂载点一文理清
linux
海天鹰2 天前
【免费】PHP主机=域名+解析+主机
服务器