Ubuntu 新装后常用设置

导航

  • [1 免密提权(根据情况设置)](#1 免密提权(根据情况设置))
  • [2 安装SSH 及 更新](#2 安装SSH 及 更新)
  • [3 更换国内源](#3 更换国内源)
  • [4 常用工具](#4 常用工具)

1 免密提权(根据情况设置)

bash 复制代码
sudo visudo

#
当前用户名 ALL=(ALL) NOPASSWD: ALL

2 安装SSH 及 更新

bash 复制代码
sudo apt update && sudo apt install -y openssh-server

sudo systemctl start ssh && sudo systemctl enable ssh && sudo apt upgrade -y && sudo apt autoremove -y

3 更换国内源

  • 命令行更换
bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

#echo重写
sudo tee /etc/apt/sources.list << EOF
deb http://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
EOF

#更新
sudo apt update && sudo apt upgrade -y
  • 图形化设置
    选择 软件和更新


    选择其他

    1、选择最佳服务器:系统测速自动选择最佳的。
    2、手动选择 mirrors.aliyun.com 阿里云源。

4 常用工具

  • build-essential:包含编译工具 (gcc, make 等),很多软件依赖它。
  • git:版本控制必备。
  • htop:一个更好看的交互式进程查看器,比系统自带的好用。
  • ncdu:磁盘空间分析神器,可以快速找出是哪个文件夹占用了大量空间。
  • curl、wget、unzip
bash 复制代码
sudo apt install -y build-essential git htop ncdu curl wget unzip 
相关推荐
@LuckY BoY1 小时前
deepin 系统的导航栏或任务栏不见了
运维·服务器
哼?~1 小时前
Socket编程准备
linux·网络
羌俊恩2 小时前
Vim modeline 命令执行漏洞(CVE-2026-34714)修复指导
linux·编辑器·vim·漏洞·cve-2026-34714
吴烦恼的博客2 小时前
WSL迁移指南
ubuntu·wsl·系统移植
wang09072 小时前
Linux性能优化之中断
linux·运维·性能优化
bukeyiwanshui2 小时前
20260410 系统启动原理
linux
huanmieyaoseng10032 小时前
Linux 安装配置 Tomcat超详细2026新(附安装包)
linux·运维·tomcat
tianyuanwo2 小时前
Kickstart 自动化安装中的密码管理:rootpw 与 chpasswd 完全指南
运维·自动化·kickstart
Black蜡笔小新2 小时前
花屏/蓝屏/黑屏/画面抖动/冻结/模糊检测,聊聊EasyCVR的视频质量诊断插件,解决运维人的实际烦恼
运维·音视频