Nala 是 libapt-pkg 的前端。
Nala is a command-line front-end for libapt-pkg, currently being rewritten in
Rust on top of rust-apt.
The goal is the same as the original Python project: keep APT's package semantics, but present package operations in a way that is easier to inspect before committing changes. The Rust version keeps that focus while adding a more structured command parser, typed configuration, JSON-friendly internal models, and terminal UI paths for high-information workflows.
This repository is in transition from the original Python implementation to the
Rust implementation. The active application code lives under src/. Python-era
source, Poetry metadata, translation files, RST docs, and screenshots are
archived under legacy/python.
list, search, show, and policyinstall, remove, autoremove, update, and
upgrade.deb installation and direct URL package ingestionundo, redo, and targeted or full history clearingnala fetch, including automatic and interactive
TUI modesclap_completeCommon command families:
nala update
nala upgrade
nala install ripgrep
nala remove ripgrep
nala autoremovePackage inspection:
nala list nala
nala search --names apt
nala show nala
nala policy nalaHistory:
nala history
nala history last
nala history undo last
nala history redo 12
nala history clear 12
nala history clear --allMirror selection:
nala fetch
nala fetch --auto
nala fetch --https-only --country USMost transaction commands accept shared safety and behavior flags such as
--download-only, --simple, --update, --no-update, --assume-yes,
--assume-no, --purge, and --allow-unauthenticated.
Automatic removal remains enabled for interactive transactions. Under
--assume-yes, Nala skips implicit autoremove unless --autoremove is also
passed; the explicit autoremove and autopurge commands are unaffected.
Direct URL installs may include a trailing SHA-256 or SHA-512 digest:
nala install 'https://example.org/package.deb:HEX_DIGEST'Nala reads a TOML configuration file. See nala.conf for the
current shape. The built-in defaults are used when the default file is absent;
an existing unreadable or invalid file is reported as an error instead of
being ignored.
Top-level configuration areas:
Nala: transaction behavior such as auto remove, auto update, full upgrade,
showing upgradable packages, simple summaries, and assume-yes defaultsUi: output mode and binary or decimal unit formattingColor: color mode and theme entries for package summaries, progress, and
warningsCommand-line flags override configuration values for the current invocation.
APT options can be passed through with -o KEY=VALUE.
Ui.mode defaults to "Auto", which uses enhanced inline views when the
terminal supports them. "Tui" enables the optional full-screen interfaces,
while "Plain" disables the enhanced terminal UI. --tui selects TUI mode for
the current invocation; --no-tui returns a configured TUI mode to automatic
inline behavior.
The Debian package manages /etc/nala/nala.conf as a conffile. On upgrade,
dpkg replaces an unmodified packaged file automatically and prompts before
replacing local changes. If the old file is kept, compare it with
/etc/nala/nala.conf.dpkg-dist; Nala rejects retired and unknown fields.
The Debian package is the complete installation: it includes Nala's system configuration, manpages, and shell completions. A binary-only canary can also be installed from crates.io on Debian Sid:
sudo apt-get install g++ libapt-pkg-dev pkgconf
cargo install nala --lockedCargo installs only the nala executable. Nala uses its built-in configuration
defaults when /etc/nala/nala.conf is absent.
Install system requirements first:
sudo apt-get install g++ libapt-pkg-dev pkgconf codespellBuild and test:
cargo build
cargo test -- --test-threads 1Useful just targets:
just build
just test
just clippy
just fmt
just checkjust check runs spellcheck, clippy, and nightly rustfmt checking. The
formatter target expects a nightly toolchain with rustfmt installed.
The Rust build script generates manpages from the clap parser through
clap_mangen, keeping command documentation tied to the same parser that
powers the binary.
Package-changing commands require root privileges. Nala checks for root before operations that modify the system, displays planned changes before committing them, records applied transactions to history, and reports when the system marks a reboot as required.
暂无开放 Issues,或尚未同步最近议题。