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 
相关推荐
SkyWalking中文站8 小时前
认识 Horizon UI · 5/17:3D 基础设施地图
运维·监控·自动化运维
tntxia1 天前
linux curl命令详解_curl详解
linux
扛枪的书生1 天前
Linux 网络管理器用法速查
linux
SkyWalking中文站1 天前
认识 Horizon UI · 1/17:SkyWalking 新一代可观测性控制台
运维·前端·监控
顺风尿一寸1 天前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
雪梨酱QAQ1 天前
Kubeneters HA Cluster部署
运维
江华森2 天前
Spring Cloud 微服务全栈实战:从 Eureka 到 Docker Compose 一文贯通
运维
江华森2 天前
Matplotlib 数据绘图基础入门
运维
XIAOHEZIcode2 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
江华森2 天前
NumPy 数值计算基础入门
运维