Taskwarrior 3.5.0 安装指南(发行版包与源码构建双线实测)

在 Debian 12 上双线实测安装 Taskwarrior:发行版仓库 apt 安装 taskwarrior 2.6.2 与官方源码构建 Taskwarrior 3.5.0,覆盖依赖、下载校验、编译安装、Rust MSRV 排障、2.x→3.x JSON 迁移、升级降级与卸载全流程。

Taskwarrior任务管理自托管2026/10/24

Taskwarrior 3.5.0 安装指南(发行版包与源码构建双线实测)

目标:在 Debian 12 (bookworm) 服务器上,以「发行版仓库在线安装」与「官方源码构建安装」两条完整实测路线安装 Taskwarrior,覆盖 0→1 全流程(前置依赖 → 官方下载 → 安装 → 首次运行 → 验证 → 升级/降级/多版本 → 卸载),全部命令与回显均为真实环境实测结果。Taskwarrior 的定位与选型背景见《Taskwarrior 3.5.0 介绍与选型指南》。

一、环境信息

本文所有命令均在下列真实环境中逐条执行并记录回显:

项目值(实测)
操作系统Debian GNU/Linux 12 (bookworm),x86_64
bash5.2.15(1)-release (x86_64-pc-linux-gnu)
源码构建编译器gcc (Debian 12.2.0-14+deb12u1) 12.2.0
源码构建 CMake3.25.1
源码构建 MakeGNU Make 4.3
编译并行核数nproc = 12
发行版仓库收录版本taskwarrior 2.6.2+dfsg-1(bookworm/main)
官方源码构建版本Taskwarrior 3.5.0(2026-08-16 发布)
数据目录~/.task/(首次运行自动创建)

💡 说明:Taskwarrior 是纯前台 CLI 工具,无常驻进程、不监听端口,因此本指南不涉及防火墙/端口开放;仅当你后续部署同步服务端时才产生网络服务,那属于独立部署主题。

二、前置条件

两条安装路线的前置条件不同,本节先给出总览,具体安装命令在各方案章节内给出。

方案 A(发行版仓库):仅需可访问 Debian 官方镜像源的 APT 环境,无编译器、无 Rust 要求。

方案 B(官方源码构建):需要网络可达 GitHub(下载源码包),以及完整构建工具链——C++17 编译器、CMake ≥3.24、make、libuuid 开发头文件、Rust 工具链(官方源码包 INSTALL 文件标注 MSRV 为 1.88.0;实测当前版本锁定的传递依赖要求更高,见 5.8 节排障实录,实践上直接装 stable 工具链最稳)。

验证基础工具是否就绪(以下为源码构建环境实测回显):

gcc --version | head -1
cmake --version | head -1
make --version | head -1
nproc

实测回显:

gcc (Debian 12.2.0-14+deb12u1) 12.2.0
cmake version 3.25.1
GNU Make 4.3
12

⚠️ 若 cmake 缺失(cmake: command not found)或版本低于 3.24,方案 B 的配置阶段会直接失败;CMake 3.24 起才支持 Taskwarrior 3.x 的 CMake 最低要求(源码 CMakeLists.txt 声明 cmake_minimum_required (VERSION 3.24...4.0))。

三、版本选型说明

选型前必须分清「发行版收录版」与「官方最新版」的差异,这是 Taskwarrior 安装最关键的一步:

口径版本来源(实测/实查,查询日期 2026-10-24)
Debian 12 bookworm 官方仓库taskwarrior 2.6.2+dfsg-1apt-cache policy taskwarrior 实测(见 4.2 节)
官方最新稳定版3.5.0官网 taskwarrior.org 与 GitHub Releases v3.5.0(2026-08-16)

关键差异:

  1. 2.x 与 3.x 是两代体系:3.x 起存储引擎更换为 Rust 编写的 TaskChampion,本地数据落为 SQLite 库文件(实测 3.5.0 为 ~/.task/taskchampion.sqlite3,见 5.7 节),2.x 时代为 pending.data 等 JSON 文件;
  2. 两代数据不直接互通,但官方提供 JSON 导出/导入迁移通道(本文 7.3 节已实测 2.6.2 → 3.5.0 迁移成功);
  3. 多设备同步协议同样换代:2.x 用 taskd 守护进程,3.x 用 taskchampion-sync-server;
  4. 如无历史包袱,直接选择官方源码构建 3.5.0;如需严格跟随发行版补丁策略或无法引入 Rust 工具链,选择方案 A 的 2.6.2。

⚠️ 不要混装两个版本到同一个数据目录:2.x 与 3.x 的存储文件不同,先后混用同一 ~/.task 可能造成解析混乱。双版本并存验证时,用独立用户或独立 TASKDATA/TASKRC 隔离(见 8.3 节)。

四、在线安装方案 A:发行版仓库(Debian 12 安装 taskwarrior 2.6.2)

4.1 方案说明

本方案使用 Debian 官方 bookworm 仓库,一条 apt install 完成,全程无需编译,获取的是发行版维护团队打过补丁的 taskwarrior 2.6.2+dfsg-1。适合:跟随发行版补丁节奏、无 Rust/编译环境、或明确只需要 2.x 功能的场景。

4.2 安装步骤

先刷新软件源索引并确认候选版本:

apt-get update
apt-cache policy taskwarrior taskd

实测回显(apt-get update 输出节选):

Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian bookworm-updates InRelease
Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease
Reading package lists...

实测回显(apt-cache policy):

taskwarrior:
  Installed: 2.6.2+dfsg-1
  Candidate: 2.6.2+dfsg-1
  Version table:
 *** 2.6.2+dfsg-1 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status
taskd:
  Installed: 1.1.0+dfsg-4+b2
  Candidate: 1.1.0+dfsg-4+b2
  Version table:
 *** 1.1.0+dfsg-4+b2 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status

确认候选版本为 2.6.2+dfsg-1 后执行安装:

apt-get install -y taskwarrior

实测回显(全新安装与重装输出一致,节选自实机):

Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  taskwarrior
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 851 kB of archives.
After this operation, 2903 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 taskwarrior amd64 2.6.2+dfsg-1 [851 kB]
Fetched 851 kB in 1s (616 kB/s)
Selecting previously unselected package taskwarrior.
(Reading database ... 6259 files and directories currently installed.)
Unpacking taskwarrior (2.6.2+dfsg-1) ...
Setting up taskwarrior (2.6.2+dfsg-1) ...

💡 同仓库还收录 taskd 1.1.0+dfsg-4+b2——2.x 时代的配套同步服务端(独立守护进程)。仅当你用 2.x 且需要多端同步时才安装它;3.x 的同步请使用 taskchampion-sync-server,与本方案无关。

4.3 首次运行与验证

验证版本与包文件布局:

task --version
dpkg -L taskwarrior | grep -E "bin/|man1/"

实测回显:

2.6.2
/usr/bin/task
/usr/share/man/man1/task.1.gz
/usr/share/man/man5/task-color.5.gz
/usr/share/man/man5/task-sync.5.gz

首次执行任何 task 命令时,会检测到没有配置文件并请求创建样例配置:

A configuration file could not be found in /root

Would you like a sample /root/.taskrc created, so Taskwarrior can proceed? (yes/no)

交互输入 yes 回车即可;随后用 task diagnostics 做安装体检,实测回显:

task 2.6.2
   Platform: Linux

Compiler
    Version: 11.2.0
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++17

Build Features
      CMake: 3.23.0
    libuuid: libuuid + uuid_unparse_lower
  libgnutls: 3.7.3
 Build type: None

Configuration
       File: /root/.taskrc (found), 1375 bytes, mode 100644
       Data: /root/.task (found), dir, mode 40755
    Locking: Enabled
         GC: Enabled
     Server:
         CA: -
Certificate: -
        Key: -
      Trust: strict
    Ciphers: NORMAL
      Creds:

Hooks
     System: Enabled
   Location: /root/.task/hooks
             (-none-)

验证判定:task --version 输出 2.6.2、diagnostics 中 File: /root/.taskrc (found) 且 Data: /root/.task (found) 即安装成功。注意 2.6.2 的 Build Features 中有 libgnutls: 3.7.3(2.x 同步用 TLS),这是与 3.5.0 诊断输出的可见差异之一(对照见 5.7 节)。

五、源码构建方案 B:官方源码构建 Taskwarrior 3.5.0

5.1 方案说明

本方案从官方 GitHub Releases 下载 3.5.0 源码包,本地编译安装到 /usr/local,获取官方最新稳定版。适合:需要 3.x 新体系(TaskChampion 存储、新同步协议)、需要自定义安装前缀或多版本并存、以及发行版收录版本过旧的场景。

5.2 安装构建依赖

apt-get update
apt-get install -y build-essential cmake uuid-dev pkg-config

实测回显(在已具备 gcc/cmake 的环境执行,输出节选):

build-essential is already the newest version (12.9).
cmake is already the newest version (3.25.1).
uuid-dev is already the newest version (2.38.1-5+deb12u3).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

安装 Rust 工具链(官方 INSTALL 标注 MSRV 1.88.0;bookworm 仓库 rustc 仅 1.63 不满足,必须用 rustup):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /tmp/rustup.sh
sh /tmp/rustup.sh -y --profile minimal --default-toolchain stable
source "$HOME/.cargo/env"
rustc --version
cargo --version

实测回显(rustup 安装输出节选):

stable-x86_64-unknown-linux-gnu installed - rustc 1.99.1 (58cf8f9c3 2026-10-13)
info: default toolchain set to stable-x86_64-unknown-linux-gnu
rustc 1.99.1 (58cf8f9c3 2026-10-13)
cargo 1.88.0 (873a06493 2025-05-10)

⚠️ 为什么装 stable 而不是 1.88.0:源码包 INSTALL 写的 MSRV 是 1.88.0,但实测按 1.88.0 编译会在 Rust 依赖解析阶段失败(上游 Cargo.lock 锁定的 AWS SDK 传递依赖已要求 rustc ≥1.91.1,完整排障见 5.8 节)。直接安装 stable 工具链可一次通过。

5.3 下载官方源码包

cd /usr/local/src
curl -LO https://github.com/GothenburgBitFactory/taskwarrior/releases/download/v3.5.0/task-3.5.0.tar.gz
sha256sum task-3.5.0.tar.gz

实测回显(curl 下载进度行节选):

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  947k  100  947k    0     0   341k      0  0:00:02  0:00:02 --:--:--  855k
-rw-r--r-- 1 root root 970271 Oct 24 10:08 task-3.5.0.tar.gz
9ea64b411f8314414f440ec765dfdf5a86c9f6159df47e2f60cff3db6b31157a  task-3.5.0.tar.gz

⚠️ 校验说明:文件大小实测 970271 字节,sha256 实测值如上(9ea64b41…b31157a)。Releases 页未公布官方哈希文件时,可重复下载两次比对哈希一致性;若从镜像站下载,务必与 GitHub 直连值核对。

5.4 解压源码

tar xzf task-3.5.0.tar.gz
cd task-3.5.0

解压后目录包含 CMakeLists.txt、src/、doc/、INSTALL 等标准布局(可先 head -30 CMakeLists.txt 核对版本号,实测该文件声明 VERSION 3.5.0)。

5.5 CMake 配置

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

实测回显:

-- Configuring C++17
-- System: Linux
-- Looking for git submodules
-- Found git submodules
-- Looking for SHA1 references
-- Looking for libuuid
-- Found libuuid
-- Configuring cmake.h
-- Rust Toolchain: stable-x86_64-unknown-linux-gnu
-- Rust Target: x86_64-unknown-linux-gnu
-- Using Corrosion as a subdirectory
-- Rust Toolchain: stable-x86_64-unknown-linux-gnu
-- Rust Target: x86_64-unknown-linux-gnu
Enabling native TLS roots
-- Configuring man pages
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- fish pkgconfig module missing, assumed completions in share/fish/vendor_completions.d
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/task-3.5.0/build

⚠️ Could NOT find PkgConfig 仅影响 fish 补全路径探测(CMake 已按默认 vendor 目录处理),不是致命错误,可忽略;如需消除,先 apt-get install -y pkg-config 再重新配置。

5.6 编译

cmake --build build -j$(nproc)

实测回显(输出节选,编译阶段包含 C++ 目标与 Rust 子构建):

[ 14%] Built target cxxbridge_v1.0.199
...
[100%] Linking CXX executable calc
[100%] Built target lex_executable
[100%] Built target calc_executable
[100%] Built target task_executable

Built target task_executable 出现即编译完成。

5.7 安装与验证

cmake --install build
task --version
which task

实测回显(安装输出节选):

-- Installing: /usr/local/bin/task
-- Installing: /usr/local/share/man/man1/task.1
-- Installing: /usr/local/share/doc/task/AUTHORS
-- Installing: /usr/local/share/doc/task/LICENSE
-- Installing: /usr/local/share/doc/task/INSTALL
3.5.0
/usr/local/bin/task

首次运行同样会请求创建样例配置(交互输入 yes),随后 task diagnostics 实测回显:

task 3.5.0
   Platform: Linux

Compiler
    Version: 12.2.0
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++17

Build Features
      CMake: 3.25.1
    libuuid: libuuid + uuid_unparse_lower
 Build type: Release

Configuration
       File: /root/.taskrc (found), 823 bytes, mode 100644
       Data: /root/.task (found), dir, mode 40755
         GC: Enabled
Hooks
     System: Enabled
   Location: /root/.task/hooks
             (-none-)

Tests
   Terminal: 0x0
 Broken ref: Scanned 0 tasks for broken references:
             No broken references found

检查数据目录实际落盘形态:

ls -la ~/.task/

实测回显:

drwxr-xr-x 2 root root  4096 Oct 24 10:03 .
drwx------ 1 root root  4096 Oct 24 10:03 ..
-rw-r--r-- 1 root root 45056 Oct 24 10:03 taskchampion.sqlite3

验证判定:task --version 输出 3.5.0、diagnostics 显示 Build type: Release 且无缺失项、~/.task/taskchampion.sqlite3 出现即安装成功。注意 3.5.0 的本地数据是单个 SQLite 库文件(TaskChampion 引擎),与 2.6.2 时代的 .data 文件族不同。

5.8 排障实录:Rust 工具链版本不满足

错误现象:按 INSTALL 的 MSRV 安装 Rust 1.88.0 后,编译阶段在 Rust 子构建报错退出,错误信息(实测逐行照抄):

error: rustc 1.88.0 is not supported by the following packages:
  aws-config@1.8.16 requires rustc 1.91.1
  aws-credential-types@1.2.14 requires rustc 1.91.1
  aws-runtime@1.7.3 requires rustc 1.91.1
  aws-sdk-s3@1.132.0 requires rustc 1.91.1
  aws-sdk-sts@1.103.0 requires rustc 1.91.1
  aws-sigv4@1.4.3 requires rustc 1.91.1
  aws-smithy-async@1.2.14 requires rustc 1.91.1
  aws-smithy-checksums@0.64.7 requires rustc 1.91.1

随后 make 以 Error 101(cargo 子构建失败)终止。

定位:官方 INSTALL 的 MSRV(1.88.0)落后于源码包内 Cargo.lock 实际锁定的传递依赖——taskchampion 的同步后端引入 aws-sdk-s3 系列,其最新补丁版要求 rustc ≥1.91.1。这是上游 MSRV 文档与锁文件漂移的典型情况。

解决:安装 stable 工具链并重设默认(实测 stable 为 1.99.1,满足全部依赖):

rustup toolchain install stable --profile minimal
rustup default stable
rustc --version

实测回显:

stable-x86_64-unknown-linux-gnu installed - rustc 1.99.1 (58cf8f9c3 2026-10-13)
info: default toolchain set to stable-x86_64-unknown-linux-gnu
rustc 1.99.1 (58cf8f9c3 2026-10-13)

要点:更换工具链后必须删除 build 目录重新 cmake 配置再编译——CMake 缓存(build/CMakeCache.txt)中记录了旧的 rustc 路径,仅重跑 make 仍会调用 1.88 工具链(实测踩坑:不删缓存直接 rebuild 复现同样报错)。正确顺序:

rm -rf build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)

5.9 关于 systemd 托管的说明

Taskwarrior 是「执行完即退出」的前台 CLI,无常驻服务进程,因此无需 systemd 单元、无需开机自启配置。需要后台常驻的只有可选的多端同步服务端 taskchampion-sync-server(独立软件,另行部署);单纯使用 task 命令不涉及任何托管。

六、方案对比与选择建议

维度方案 A:发行版仓库(apt)方案 B:官方源码构建
获得版本2.6.2+dfsg-1(bookworm 收录)3.5.0(官方最新稳定版)
是否需联网需访问 Debian 镜像源需访问 GitHub + rustup.rs
安装耗时约 1 分钟(851 kB 下载)数分钟(含 Rust/C++ 编译)
额外依赖无build-essential/cmake/uuid-dev + Rust 工具链
安装位置/usr/bin/task(dpkg 管理)/usr/local/bin/task(install_manifest.txt 管理)
存储体系2.x(.data 文件族)3.x(taskchampion.sqlite3)
升级方式apt upgrade(随发行版)重新下载新版源码构建安装
适合场景跟随发行版补丁、无编译环境要 3.x 体系/多版本并存/最新功能

选择建议:能联网且可接受构建链的服务器,直接选方案 B 拿 3.5.0(数据体系与同步协议均更新,避免日后从 2.x 迁移);内网受限、或由发行版统一运维的存量机器选方案 A。两方案共存于一台机器时注意 PATH 优先级(见 FAQ Q3)。

七、安装后基础配置

7.1 配置文件与数据目录

  • 配置文件:~/.taskrc(首次运行交互创建样例;2.6.2 样例约 1375 字节,3.5.0 样例约 823 字节,实测见上文);
  • 数据目录:~/.task/——2.6.2 为 JSON 数据文件族,3.5.0 为 taskchampion.sqlite3;
  • 可用环境变量重定向:TASKRC 指定配置文件路径、TASKDATA 指定数据目录(多实例隔离时常用,见 8.3 节)。

详细的 .taskrc 配置项逐项实测与说明,见《Taskwarrior 3.5.0 配置参数详解(.taskrc 逐项实测)》;安装完成后的日常命令实操见《Taskwarrior 3.5.0 常用 CLI 命令与工具详解》。

7.2 3.5.0 的同步前置(仅多端需要)

3.5.0 单机使用无需任何服务端;需要多端同步时,另行部署 taskchampion-sync-server 并在 ~/.taskrc 中配置 sync.server.url、sync.server.client_id、sync.encryption_secret 三项。本文不展开,属于同步部署主题。

7.3 从 2.6.2 迁移数据到 3.5.0(实测)

2.x 与 3.x 存储不互通,官方迁移通道是 JSON 导出/导入,双线实测如下。

在 2.6.2 环境录入并导出:

task add pay electricity bill due:2026-10-30
task add read taskwarrior docs +learn project:docs
task export rc.verbose:nothing > tw26.json

实测回显(2.6.2):

Created task 1.
Created task 2.
The project 'docs' has changed.  Project 'docs' is 0% complete (1 task remaining).
[
{"id":1,"description":"pay electricity bill","due":"20261030T000000Z","entry":"20261024T100421Z","modified":"20261024T100421Z","status":"pending","uuid":"4b477eaf-8066-4745-8444-8bcf525e2a97","urgency":6.249},
{"id":2,"description":"read taskwarrior docs","entry":"20261024T100421Z","modified":"20261024T100421Z","project":"docs","status":"pending","uuid":"3a11487c-37a0-4ad3-b2ff-6bfe435eec49","tags":["learn"],"urgency":1.8}
]

把 tw26.json 传到 3.5.0 机器后导入:

task import tw26.json
task list

实测回显(3.5.0):

Importing 'tw26.json'
 add  4b477eaf-8066-4745-8444-8bcf525e2a97 pay electricity bill
 add  3a11487c-37a0-4ad3-b2ff-6bfe435eec49 read taskwarrior docs
Imported 2 tasks.

ID Age  Project Tags  Due        Description               Urg
-- ---- ------- ----- ---------- ------------------------- ----
 1 6s                 2026-10-30 pay electricity bill      6.25
 2 6s   docs    learn            read taskwarrior docs      1.8

2 tasks

验证判定:导入回显逐条列出 UUID 与描述,task list 中任务、截止日、项目、标签、紧急度(6.25/1.8)与 2.6.2 侧完全一致,迁移成功。迁移在新环境验证无误后,再切换日常使用的数据目录,不要直接在旧 2.x 数据目录上让 3.x 启动。

八、升级、降级与多版本管理

8.1 方案 A(apt)的升级与锁定

apt-get upgrade            # 随发行版仓库升级(bookworm 内维持 2.6.x 系)
apt-mark hold taskwarrior  # 锁定版本,防止随 apt upgrade 被动升级
apt-mark unhold taskwarrior  # 解除锁定

⚠️ bookworm 仓库内 taskwarrior 停留在 2.6.2+dfsg-1,apt-get upgrade 不会给你 3.x;跨大版本必须走方案 B 或等待发行版更新收录。

8.2 方案 B(源码)的升级

新版发布后重复合成同一流程(<新版本号> 用 Releases 页实查的最新稳定版替换,本文成稿时实查为 3.5.0;后续以 https://github.com/GothenburgBitFactory/taskwarrior/releases 为准):

cd /usr/local/src
curl -LO https://github.com/GothenburgBitFactory/taskwarrior/releases/download/v<新版本号>/task-<新版本号>.tar.gz
tar xzf task-<新版本号>.tar.gz && cd task-<新版本号>
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
cmake --install build
task --version

cmake --install 会覆盖 /usr/local 下的旧版文件。降级同理:下载旧版本源码构建安装即可;若旧版数据格式无法读新版 SQLite(跨 2.x/3.x),先按 7.3 节导出 JSON 再在新环境导入。

8.3 多版本并存

用自定义安装前缀隔离版本,安装期指定:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/task-3.5.0
cmake --build build -j$(nproc)
cmake --install build
/opt/task-3.5.0/bin/task --version

不同版本用绝对路径调用,或临时切换环境变量隔离数据(避免互相污染):

TASKRC=/root/.taskrc-35 TASKDATA=/root/.task-35 /opt/task-3.5.0/bin/task list

实测多版本共存判定:两个绝对路径的 --version 各自输出预期版本号、数据目录互不可见即成功。

九、常见问题(FAQ)

Q1:task diagnostics 或任何 task 命令提示 Cannot proceed without rc file.,且没有出现 yes/no 询问? 非交互环境(脚本/重定向管道)下 task 无法从终端读取确认。解决:先手动创建配置文件(printf '' > ~/.taskrc 后再跑,样例内容可从 /usr/local/share/doc/task 下官方文档获取),或在交互终端里回答一次 yes/no 询问完成初始化;也可用 pty 方式喂入 yes(如 echo yes | script -qec "task diagnostics" /dev/null,实测可用)。

Q2:编译报 error: rustc 1.88.0 is not supported by the following packages: aws-config@1.8.16 requires rustc 1.91.1 ...? 见 5.8 节排障实录:安装 stable 工具链(rustup default stable),并删除 build 目录重新 cmake 配置后编译。

Q3:一台机器上 /usr/bin/task(2.6.2)与 /usr/local/bin/task(3.5.0)并存,运行 task 到底是哪个? which task 的结果即当前生效者;默认 PATH 中 /usr/local/bin 先于 /usr/bin,通常命中 3.5.0。脚本中建议用绝对路径消除歧义。两版本数据体系不同,务必配合 TASKRC/TASKDATA 隔离(见 8.3 节)。

Q4:为什么没有 systemd 服务、开机自启? Taskwarrior 无常驻进程,任何「启动 task 服务」的需求都来自误认知;需要后台运行的只有可选的同步服务端(独立部署)。

Q5:apt-cache policy task 查不到包? Debian 仓库中的包名是 taskwarrior(二进制叫 task),不要用 task 作为包名查询;apt-cache policy taskwarrior 实测可见 2.6.2+dfsg-1(见 4.2 节)。

Q6:configure 阶段 Could NOT find PkgConfig 是否要处理? 仅影响 fish shell 补全安装路径探测,非致命,可忽略;介意则先安装 pkg-config 再重新配置。

十、卸载与清理

方案 A(apt)卸载:

apt-get remove --purge -y taskwarrior   # 卸载软件包
rm -rf ~/.task ~/.taskrc                # 按需清除个人数据与配置

实测回显(remove 节选):

Removing taskwarrior (2.6.2+dfsg-1) ...
Processing triggers for man-db (2.11.2-1) ...

方案 B(源码)卸载:官方 INSTALL 明确 CMake 无 uninstall 目标,需按构建目录生成的 install_manifest.txt 逐个删除(实测该文件共 78 行,首行为 /usr/local/bin/task):

cd /usr/local/src/task-3.5.0
cat build/install_manifest.txt | xargs rm -f    # 删除安装的全部文件
rm -rf ~/.task ~/.taskrc                        # 按需清除个人数据与配置

⚠️ 因此建议保留源码目录(或至少保留 install_manifest.txt),否则只能手工清点 /usr/local/bin/task、/usr/local/share/man/man1/task.1、/usr/local/share/doc/task/ 等文件。

十一、参考链接