
1. Ubuntu 26.04 LTS 安装后必做8件事刚装完Ubuntu系统就像搬进毛坯房基础功能都有但用着总不顺手。作为从Ubuntu 12.04用到26.04的老用户我总结出这套开箱必做的8项调优20分钟就能让系统脱胎换骨。这些配置不仅提升使用流畅度更能避免日后开发时遇到的坑。1.1 更换国内软件源新系统默认使用国外源更新速度慢如蜗牛。打开终端CtrlAltT执行sudo sed -i s|http://.*archive.ubuntu.com|https://mirrors.aliyun.com|g /etc/apt/sources.list sudo apt update sudo apt upgrade -y这里用阿里云源举例其他推荐源还有清华源https://mirrors.tuna.tsinghua.edu.cn中科大源https://mirrors.ustc.edu.cn注意企业内网需先配置代理才能访问外网源建议咨询IT部门获取内部源地址更新完成后运行apt list --upgradable检查应该显示Listing... Done而非具体包名说明所有更新已安装。1.2 安装必备工具链开发环境的基础依赖一个都不能少sudo apt install -y build-essential git curl wget vim net-toolsbuild-essential包含gcc/g/make等编译工具git代码版本管理curl/wget网络请求工具vim终端编辑器nano党可替换net-tools包含ifconfig等网络工具验证gcc安装gcc --version应显示版本号≥11.4.026.04默认版本1.3 配置中文输入法Ubuntu自带ibus输入框架但词库贫乏推荐安装搜狗输入法sudo apt install -y fcitx libfcitx-qt5 libfcitx-qt6 wget https://ime.sogoucdn.com/dl/index/1793083180/sogoupinyin_4.2.1.145_amd64.deb sudo dpkg -i sogoupinyin_*.deb sudo apt --fix-broken install安装后需打开Settings → Region Language → Manage Installed Languages将Keyboard input method system改为fcitx注销后重新登录在顶部栏fcitx图标中添加Sogou Pinyin常见问题如果候选框不显示执行fcitx-autostart并检查~/.xprofile是否包含export GTK_IM_MODULEfcitx1.4 优化终端环境默认bash功能有限建议配置# 安装zsh和插件 sudo apt install -y zsh autojump sh -c $(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh) git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting # 修改~/.zshrc配置 plugins(git zsh-autosuggestions zsh-syntax-highlighting autojump) ZSH_THEMEagnoster配置完成后按Tab键触发自动补全输入命令前缀后按↑键搜索历史命令输入目录名直接跳转如/usr/l按Tab补全1.5 显卡驱动安装NVIDIA显卡用户务必安装闭源驱动ubuntu-drivers devices # 查看推荐驱动版本 sudo apt install -y nvidia-driver-550 # 以550版本为例安装后验证执行nvidia-smi查看显卡状态运行glxinfo | grep OpenGL renderer确认驱动生效避坑指南如果遇到登录循环CtrlAltF3切到命令行执行sudo apt purge nvidia-*重装1.6 配置SSH服务远程开发必备sudo apt install -y openssh-server sudo systemctl enable --now ssh关键安全配置/etc/ssh/sshd_configPermitRootLogin no PasswordAuthentication no # 推荐用密钥登录 AllowUsers yourname生成密钥对ssh-keygen -t ed25519将~/.ssh/id_ed25519.pub内容添加到服务器authorized_keys1.7 安装Docker引擎容器化开发环境基础sudo apt install -y ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc echo deb [arch$(dpkg --print-architecture) signed-by/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release echo $VERSION_CODENAME) stable | sudo tee /etc/apt/sources.list.d/docker.list /dev/null sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io非root用户使用dockersudo usermod -aG docker $USER newgrp docker # 立即生效验证安装docker run hello-world应显示欢迎信息1.8 系统性能调优最后这些隐藏设置能显著提升流畅度# 禁用不必要的服务 sudo systemctl disable bluetooth.service cups-browsed.service # 调整交换分区策略 echo vm.swappiness10 | sudo tee -a /etc/sysctl.conf # 提升文件打开数限制 echo * soft nofile 65535 | sudo tee -a /etc/security/limits.conf echo * hard nofile 65535 | sudo tee -a /etc/security/limits.conf # 启用TRIMSSD专用 sudo systemctl enable fstrim.timer使用gnome-tweaks工具还可关闭窗口动画设置合盖不休眠启用Always On Top右键菜单2. 进阶配置建议完成基础优化后这些可选配置能让体验更上一层楼2.1 开发环境配置Python环境建议用miniconda管理wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda echo export PATH$HOME/miniconda/bin:$PATH ~/.zshrcVS Code必备插件Remote - SSHPythonDockerGitLens2.2 硬件外设支持打印机配置sudo apt install -y printer-driver-gutenprint system-config-printer # 图形化添加打印机蓝牙设备问题排查sudo dmesg | grep -i blue hciconfig -a # 查看蓝牙适配器状态2.3 系统监控方案安装图形化监控工具sudo apt install -y gnome-system-monitor htop终端监控推荐btop现代化资源监视器nvtopNVIDIA显卡监控iotop磁盘IO监控3. 常见问题速查表问题现象解决方案开机卡在紫色界面在GRUB界面按e编辑启动参数在linux行末尾加nomodeset双系统时间错误sudo timedatectl set-local-rtc 1无法挂载NTFS分区sudo apt install ntfs-3g后重新插拔触摸板失灵sudo modprobe -r psmouse sudo modprobe psmouse耳机没有声音alsamixer中取消Auto-Mute这些优化是我在五台不同设备上实测有效的配置方案特别适合需要稳定开发环境的用户。刚开始用Linux可能会觉得繁琐但一旦配置完成Ubuntu 26.04的稳定性和性能绝对值得这份投入。