Ubuntu 22.04 安装 bottom 0.14.9 指南
Ubuntu 22.04 从零安装终端监控 bottom 0.14.9:官方 deb(主推)/rpm/tar.gz/cargo 四路径实测安装与验证,含升级降级、多版本管理、卸载清理与排障实录。
Ubuntu 22.04 安装 bottom 0.14.9 指南
目标:在 Ubuntu 22.04 服务器上从零安装终端系统监控工具 bottom(命令
btm),覆盖官方 deb 包(主推)、rpm 包、tar.gz 通用二进制、cargo 源码编译四条路径的完整安装与验证,并给出升级/降级/多版本管理、卸载清理与常见问题排障实录。全部命令与回显均在 Ubuntu 22.04.5 LTS(x86_64)环境实测通过。
一、环境信息
- 操作系统:Ubuntu 22.04.5 LTS(x86_64),内核 6.8.0-138-generic
- 硬件参照:12 核 CPU(
nproc实测),32 GB 内存(free -m实测 total 32050 MB),系统盘容量约 844 GB(btm Disks 组件实测显示 Total 844GB) - 目标软件:bottom 0.14.9(官方最新稳定版,2026-08-27 发布;版本信息于 2026-10-23 经 GitHub Releases 实查)
- 安装产物:
/usr/bin/btm(deb/rpm 路径)或~/.cargo/bin/btm(cargo 路径) - 官方 deb 包:
bottom_0.14.9-1_amd64.deb(约 1.5 MB),sha256 实测值见 4.2 节
二、前置条件
bottom 是 Rust 编译的静态单二进制工具,官方 deb 包对依赖的要求极低:
- 系统版本:Ubuntu 22.04(本篇实测环境);官方支持的 Linux 架构为 x86_64、i686、aarch64(官方文档 support/official.md,2026-10-23 查证)。
- 依赖包:deb 包无额外依赖(
dpkg -i直接装成,实测未触发任何 apt 依赖安装);仅 tar.gz 解压需要系统自带tar。 - 终端环境:btm 是前台 TUI 程序,安装后运行需要真实终端(TTY)。cron/CI 等无终端场景运行会报错(实测回显见第十一章 Q3)。
- 网络:安装包托管在 GitHub Releases,国内网络下载慢或失败时走代理(排障实录见 Q1)。
- 不需要 systemd 托管:bottom 无守护进程、无服务形态,安装即完成,不需要注册 systemd 服务——这与 MySQL/Redis 等服务型软件的安装流程不同,属正常现象。
三、版本选型说明
bottom 只有「稳定版 + Nightly 构建」两条版本线,无 LTS 概念:
| 版本线 | 获取方式 | 适用人群 | 实测说明 |
|---|---|---|---|
| 稳定版 0.14.9 | GitHub Releases(deb/rpm/tar.gz) | 绝大多数用户 | 本篇全部实测基于此版本 |
| Nightly(如 2026-10-04) | GitHub Releases 的 tag/1.9.20261004 形式产物 | 想尝鲜新特性、帮官方测 bug | 走 tar.gz 安装方式同理,替换下载 URL 即可 |
glibc 兼容性细分(x86_64 Linux 的 tar.gz 有两个变体,选错会报 glibc 版本错误):
| 变体 | 下载文件名 | 适用 |
|---|---|---|
| 标准 gnu 构建 | bottom_x86_64-unknown-linux-gnu.tar.gz | Ubuntu 20.04+/Debian 11+ 等较新 glibc 系统 |
| 老系统兼容构建 | bottom_x86_64-unknown-linux-gnu-2-17.tar.gz | CentOS 7 等 glibc 2.17 的老系统 |
musl 静态构建:deb/rpm 资产清单中另有 bottom-musl_0.14.9-1_amd64.deb、bottom_x86_64-unknown-linux-musl.tar.gz,完全静态链接,适合 Alpine 等无 glibc 的最小化系统。
💡 说明:Ubuntu 22.04 官方 apt 仓库没有收录 bottom(实测
apt-cache madison bottom无任何仓库版本输出),不要指望apt install bottom;安装一律走下面的四条路径。
四、安装方案 A:官方 deb 包安装(Ubuntu 推荐)
4.1 方案说明
从 GitHub Releases 下载官方打包的 deb(包名 bottom,版本号 0.14.9-1),用 dpkg 安装,产物落 /usr/bin/btm。这是 Ubuntu 上最干净、可升级、可卸载的路径,本篇主推。
4.2 下载 deb 包并校验
cd /root
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.14.9/bottom_0.14.9-1_amd64.deb
ls -lh bottom_0.14.9-1_amd64.deb
sha256sum bottom_0.14.9-1_amd64.deb
实测回显:
-rw-r--r-- 1 root root 1.5M Oct 23 03:10 bottom_0.14.9-1_amd64.deb
e8312526746c1190c3433e6ce0843f64c6e0c501003ee377552745c040dc6d56 bottom_0.14.9-1_amd64.deb
⚠️ 注意:官方 Release 资产清单中没有提供统一的 checksums 汇总文件(2026-10-23 实查 0.14.9 资产列表确认),上述 sha256 为本机实测值,读者可作为参照基线;安全性要求高的场景建议核对 GitHub Release 页面展示的资产信息。
⚠️ 排障实录(资产命名陷阱):bottom 的 deb 资产命名是带版本号的
bottom_0.14.9-1_amd64.deb。若按一些老教程使用不带版本号的bottom_x86_64-unknown-linux-gnu.deb,GitHub 会返回 404,curl 落盘只有 9 字节的占位文件(实测 sha2560019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5)。下载后务必ls -lh看体积(正常约 1.5 MB)再安装。
4.3 安装
dpkg -i /root/bottom_0.14.9-1_amd64.deb
实测回显:
Selecting previously unselected package bottom.
(Reading database ... 4973 files and directories currently installed.)
Preparing to unpack .../root/bottom_0.14.9-1_amd64.deb ...
Unpacking bottom (0.14.9-1) ...
Setting up bottom (0.14.9-1) ...
全程无依赖报错,无需 apt -f install 补依赖。
4.4 验证
command -v btm && btm -V
实测回显:
/usr/bin/btm
bottom 0.14.9
进一步做一次「能启动」验证:在终端直接运行 btm,应进入六组件仪表盘(CPU / Memory / Temperatures / Disks / Network / Processes),按 q 退出。若想不进界面先确认包内容,可查包清单:
dpkg -L bottom | head -8
实测回显:
/usr
/usr/bin
/usr/bin/btm
/usr/share
/usr/share/doc
/usr/share/doc/bottom
/usr/share/doc/bottom/changelog.gz
/usr/share/licenses
五、安装方案 B:官方 rpm 包安装(RHEL 系,AlmaLinux 9 实测)
5.1 方案说明
官方同步发布 rpm 包(bottom-0.14.9-1.x86_64.rpm),适配 RHEL/CentOS Stream/Rocky/AlmaLinux/Fedora。本节在 AlmaLinux 9(x86_64)上完整实测,供 RHEL 系读者直接照做。
5.2 下载并安装
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.14.9/bottom-0.14.9-1.x86_64.rpm
ls -lh bottom-0.14.9-1.x86_64.rpm
rpm -ihv bottom-0.14.9-1.x86_64.rpm
实测回显( AlmaLinux 9):
-rw-r--r-- 1 root root 1.6M Oct 23 03:29 bottom-0.14.9-1.x86_64.rpm
Updating / installing...
bottom-0:0.14.9-1 ########################################
5.3 验证
command -v btm && btm -V
rpm -qi bottom | head -6
实测回显:
/usr/bin/btm
bottom 0.14.9
Name : bottom
Epoch : 0
Version : 0.14.9
Release : 1
Architecture: x86_64
5.4 rpm 路径的升级与卸载
rpm -Uvh bottom-<新版本>-1.x86_64.rpm # 升级(-U 会替换旧版)
rpm -e bottom # 卸载
实测卸载回显(AlmaLinux 9):
$ rpm -e bottom
$ command -v btm || echo "btm 已移除"
btm 已移除
$ ls /usr/bin/btm
ls: cannot access '/usr/bin/btm': No such file or directory
六、安装方案 C:官方 tar.gz 通用二进制安装
6.1 方案说明
适合三种场景:没有 root 权限装到用户目录、Alpine 等非 deb/rpm 系统(选 musl 变体)、需要多版本并存(解压到独立目录互不干扰)。tar 包内含 btm 主程序与 bash/zsh/fish/elv/nu/powershell 六种 shell 的补全脚本。
6.2 下载、解压与安装
mkdir -p /opt/bottom-tar
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.14.9/bottom_x86_64-unknown-linux-gnu.tar.gz
tar -xzf bottom_x86_64-unknown-linux-gnu.tar.gz -C /opt/bottom-tar
先看包内结构再安装:
tar -tzf bottom_x86_64-unknown-linux-gnu.tar.gz | head -5
实测回显:
btm
completion/
completion/btm.bash
completion/btm.elv
completion/_btm.ps1
放入 PATH(系统级安装):
cp /opt/bottom-tar/btm /usr/local/bin/btm
6.3 验证
btm -V
实测回显(解压目录内直跑):
bottom 0.14.9
6.4 补全脚本安装(可选)
cp /opt/bottom-tar/completion/btm.bash /etc/bash_completion.d/btm # bash 补全
💡 说明:tar.gz 路径不受包管理器追踪,升级 = 重新下载新版 tar 包覆盖
btm二进制;卸载 = 删除对应文件。多版本并存时解压到/opt/bottom-<版本>/各自独立运行。
七、安装方案 D:cargo 源码编译安装
7.1 方案说明
适合已在使用 Rust 工具链、或需要针对本机 CPU 优化编译(如 RUSTFLAGS="-C target-cpu=native")的环境。从 crates.io 拉取源码全量编译,实测在本环境(12 核、Rust 1.99.1 stable、--locked 锁定依赖)约 2 分钟完成。
7.2 安装 Rust 工具链
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /root/rustup.sh
sh /root/rustup.sh -y --profile minimal
source /root/.cargo/env
rustc -V
实测回显:
rustc 1.99.1 (58cf8f9c3 2026-10-13)
⚠️ 排障实录:rustup 装完后若直接跑
cargo install报error: rustup could not choose a version of cargo to run,说明默认工具链未配置(安装被中断或--profile minimal场景),执行rustup default stable修复;若提示工具链损坏(this may happen if the toolchain installation was interrupted),先rustup toolchain uninstall stable再rustup toolchain install stable --profile minimal,两条命令均实测有效。
7.3 编译安装
cargo install bottom --locked
实测回显(输出节选,实测首尾):
Compiling nvml-wrapper v0.12.1
Compiling ratatui-widgets v0.3.2
Compiling ratatui-crossterm v0.1.2
Compiling ratatui v0.30.2
...(大量依赖编译行省略)...
Compiling bottom v0.14.9
Installing /root/.cargo/bin/btm
Installed package `bottom v0.14.9` (executable `btm`)
7.4 验证
source /root/.cargo/env
ls -lh /root/.cargo/bin/btm
btm -V
实测回显:
-rwxr-xr-x 1 root root 5.0M Oct 23 03:31 /root/.cargo/bin/btm
bottom 0.14.9
⚠️ 注意:cargo 安装的
btm在~/.cargo/bin(非/usr/bin),与 deb 路径并存时以 PATH 靠前者为准;crates.io 的 crates 发布由官方维护,版本与 GitHub Releases 同步(0.14.9 实测一致)。国内网络拉取 crates.io 索引慢时,可先执行export http_proxy=<代理地址> https_proxy=<代理地址>再cargo install(实测走代理正常完成编译)。
八、方案对比与选择建议
| 维度 | A deb 包 | B rpm 包 | C tar.gz | D cargo 编译 |
|---|---|---|---|---|
| 目标系统 | Ubuntu/Debian | RHEL 系 | 任意 Linux | 装有 Rust 的任意系统 |
| 是否需联网 | 下载期需要 | 下载期需要 | 下载期需要 | 需(crates.io) |
| 安装耗时 | 秒级 | 秒级 | 秒级 | 实测约 2 分钟(12 核) |
| 包管理器追踪 | 有(dpkg) | 有(rpm) | 无 | 有(cargo) |
| 产物路径 | /usr/bin/btm | /usr/bin/btm | 自定(/usr/local/bin 或解压目录) | ~/.cargo/bin/btm |
| 多版本并存 | 需换包重装 | 需换包重装 | 天然支持(分目录) | 可 --version 切换 |
| 适用建议 | Ubuntu 首选 | RHEL 系首选 | 无包管理器/多版本/无 root | 需定制编译参数者 |
选择建议:Ubuntu 22.04 用方案 A;RHEL 系用方案 B;环境受限(Alpine、无 root、多版本并存)用方案 C;已在维护 Rust 工具链或需要本机优化编译用方案 D。
九、配置说明
bottom 安装后无需任何配置即可运行,本节只说明配置文件的落点与生成机制:
- 配置文件路径(Linux):
~/.config/bottom/bottom.toml;也可用btm -C <路径>指定其他位置。 - 首跑自动生成:首次运行
btm(或带-C指定路径)时,若配置文件不存在会自动创建一份全量注释掉的默认配置。实测在 Ubuntu 22.04 上执行btm -C /root/.config/bottom/bottom.toml后自动生成 511 行、15.9 KB 的默认配置文件。 - 配置文件含
[flags](等价命令行参数)、[processes]、[disk]、[disk.name_filter]、[disk.mount_filter]、[temperature]、[network_graph]、[styles]、[[row]](布局)等段,逐项含义与实测生效示例见《bottom 0.14.9 配置参数详解》。
验证配置文件已生成:
ls -lh /root/.config/bottom/bottom.toml
实测回显:
-rw-r--r-- 1 root root 15946 Oct 23 03:18 bottom.toml
十、升级、降级与多版本管理
10.1 升级(deb 路径)
下载新版 deb 后直接 dpkg -i,dpkg 会原地替换。实测 0.10.1 → 0.14.9 回升级行为:
Unpacking bottom (0.14.9-1) over (0.10.1-1) ...
Setting up bottom (0.14.9-1) ...
10.2 降级(deb 路径)
dpkg 原生允许跨版本往回装,无需额外参数。实测 0.14.9 → 0.10.1:
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.10.1/bottom_0.10.1-1_amd64.deb
dpkg -i bottom_0.10.1-1_amd64.deb
btm -V
实测回显:
Unpacking bottom (0.10.1-1) over (0.14.9-1) ...
Setting up bottom (0.10.1-1) ...
bottom 0.10.1
10.3 多版本管理
- tar.gz 分目录并存(最干净):
/opt/bottom-0.14.9/btm、/opt/bottom-0.10.1/btm各自独立,按需调用。 - cargo 固定版本:
cargo install bottom --version 0.10.1 --locked可装指定版本(会替换~/.cargo/bin/btm)。 - dpkg 锁版本:降级后执行
apt-mark hold bottom可防止后续自动升级。
十一、常见问题(含排障实录)
Q1:GitHub 下载极慢或失败怎么办?
实测现象:受限网络环境内 wget 直连 GitHub Releases 报退出码 4(网络失败)。定位:GitHub 域名连通性差。解决:为 curl/wget 显式指定代理重试,实测成功:
curl -L -x http://192.168.1.62:7897 -o bottom_0.14.9-1_amd64.deb \
https://github.com/ClementTsang/bottom/releases/download/0.14.9/bottom_0.14.9-1_amd64.deb
(代理地址按自身网络替换;wget -x 参数部分老版本 wget 对 https 代理兼容性差,实测失败后换 curl 稳定。)
Q2:下载的文件只有 9 字节?
见 4.2 节排障实录:URL 用错(旧资产命名无版本号),GitHub 返回 404 占位文件。改用带版本号的正确资产名即可。
Q3:运行 btm 报 Error: No such device or address (os error 6)?
实测回显:
Warning: bottom is not being output to a terminal. Things might not work properly.
If you're stuck, press 'q', 'Q', or 'Ctrl-c' to quit the program.
Error: No such device or address (os error 6)
原因:btm 是 TUI 程序,必须运行在真实终端(TTY)上;在 cron、CI、无 -t 的远程执行等场景没有终端可渲染。解决:进入交互式 shell/SSH 会话再运行(SSH 场景实测见《bottom 0.14.9 常用 CLI 命令与工具详解》)。
Q4:apt install bottom 找不到包?
Ubuntu 22.04 官方仓库未收录 bottom(实测 apt-cache madison bottom 无输出)。走本篇方案 A–D 任一路径安装。
Q5:温度(Temperatures)组件显示 No data?
温度读取依赖硬件传感器(Linux 下 sysfs 传感器接口)。无传感器暴露的虚拟机/部分云主机上温度表为空属正常现象,CPU/内存/磁盘/网络组件不受影响(本篇实测环境即如此,Disks 与进程表数据正常)。
Q6:老系统(CentOS 7)上运行报 glibc 版本错误?
标准 gnu 构建依赖较新 glibc。改用老系统兼容构建 bottom_x86_64-unknown-linux-gnu-2-17.tar.gz(glibc 2.17 兼容)或静态 musl 构建。
十二、卸载与清理
deb 路径卸载(Ubuntu):
dpkg -r bottom
实测回显:
(Reading database ... 6125 files and directories currently installed.)
Removing bottom (0.14.9-1) ...
实测残留检查:/etc/bottom 不存在,包卸载干净;但用户配置文件会保留(属用户数据,符合预期):
$ ls /root/.config/bottom/
bottom.toml
如需彻底清理,手动删除:
rm -rf /root/.config/bottom
其他路径:rpm 用 rpm -e bottom(实测见 5.4 节);tar.gz 删除解压目录与拷出的二进制;cargo 用 cargo uninstall bottom。
十三、参考链接
- bottom Releases(0.14.9):https://github.com/ClementTsang/bottom/releases/tag/0.14.9
- 官方安装与平台支持文档:https://clementtsang.github.io/bottom-stable/
- crates.io 页面:https://crates.io/crates/bottom
- 站内本组件系列:《bottom 介绍与选型指南》、《bottom 0.14.9 配置参数详解》、《bottom 0.14.9 常用 CLI 命令与工具详解》