百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

nala

> 编程语言
开源

Nala 是 libapt-pkg 的前端。

1.9K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Nala 是 libapt-pkg 的前端。

Nala

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.

Status

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.

Features

  • Package discovery commands: list, search, show, and policy
  • Transaction commands: install, remove, autoremove, update, and upgrade
  • Upgrade modes for normal, safe, and full upgrades
  • Exclusion support for upgrades with glob-style package patterns
  • Local .deb installation and direct URL package ingestion
  • Parallel package downloader with per-domain connection limits
  • Hash verification for package downloads before installation
  • Proxy support through APT acquire configuration
  • Transaction summaries in full, simple, plain, or TUI-backed views
  • Transaction history stored as per-entry JSON records
  • History inspection, undo, redo, and targeted or full history clearing
  • Mirror selection through nala fetch, including automatic and interactive TUI modes
  • Machine-readable output for package info and policy views
  • TOML configuration for Nala behavior, UI mode, units, color mode, and theme
  • Shell completion integration through clap_complete
  • Generated manpage and Markdown command documentation from the Rust CLI

Commands

Common command families:

bash
nala update
nala upgrade
nala install ripgrep
nala remove ripgrep
nala autoremove

Package inspection:

bash
nala list nala
nala search --names apt
nala show nala
nala policy nala

History:

bash
nala history
nala history last
nala history undo last
nala history redo 12
nala history clear 12
nala history clear --all

Mirror selection:

bash
nala fetch
nala fetch --auto
nala fetch --https-only --country US

Most 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:

bash
nala install 'https://example.org/package.deb:HEX_DIGEST'

Configuration

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 defaults
  • Ui: output mode and binary or decimal unit formatting
  • Color: color mode and theme entries for package summaries, progress, and warnings

Command-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.

Cargo Installation

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:

bash
sudo apt-get install g++ libapt-pkg-dev pkgconf
cargo install nala --locked

Cargo installs only the nala executable. Nala uses its built-in configuration defaults when /etc/nala/nala.conf is absent.

Development

Install system requirements first:

bash
sudo apt-get install g++ libapt-pkg-dev pkgconf codespell

Build and test:

bash
cargo build
cargo test -- --test-threads 1

Useful just targets:

bash
just build
just test
just clippy
just fmt
just check

just check runs spellcheck, clippy, and nightly rustfmt checking. The formatter target expects a nightly toolchain with rustfmt installed.

Generated Files

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.

Safety Notes

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.

Links

  • Official repository: https://gitlab.com/volian/nala
  • Issues: https://gitlab.com/volian/nala/-/issues

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言