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 
相关推荐
sxstj39 分钟前
Ubuntu 完整安装并启用 Flatpak 教程
linux·运维·ubuntu
国际云,接待41 分钟前
Nginx 后面接负载均衡,502/504 到底该先查哪里?
运维·nginx·负载均衡
天疆说1 小时前
Ubuntu 26.04 下 Intel Meteor Lake 核显 + NPU 驱动配置与 PyTorch NPU 推理实测
linux·pytorch·ubuntu
mounter6252 小时前
突破单点限制:BPF 多跟踪点高效附加机制与新 ftrace 架构解析
linux·ebpf·linux kernel·kernel·ftrace
刘某的Cloud2 小时前
Galera Cluster部署 mariadb 节点down机,log sequence number恢复
linux·运维·数据库·负载均衡·mariadb·集群·高可用
小此方2 小时前
Re:Linux系统篇(五十四)线程篇 · 七:互斥锁的底层实现原理:从硬件上下文、原子交换指令(Swap)到并发封装实战
linux·运维·驱动开发
meilindehuzi_a2 小时前
TypeScript面试题:interface 与 type:相同点、核心区别与选择指南
java·ubuntu·typescript
郭涤生2 小时前
rootfs 详解与裁剪优化记录
linux·c++·bsp
铁锚3 小时前
解决Ubuntu执行sudo时 unable to resolve host 报错问题
linux·数据库·ubuntu
二宝哥3 小时前
CentOS 7.9 离线安装 Nginx 并配置openssl1.1.1
linux·nginx·centos