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 
相关推荐
未济2 天前
linux 配置环境变量
linux
傲世仙尊2 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
虎头金猫2 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
_艾伦 耶格尔.2 天前
进程间通信
linux
AI职业加油站2 天前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
Liuqy-052 天前
Linux IO编程——静态库、动态库
linux
此冬歌咏2 天前
K8s 节点故障实战:优雅驱逐 31 秒,硬故障 331 秒,以及那个永远 Pending 的 Pod
运维·k8s
彧azz2 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅2 天前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK2 天前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid