# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper, scoop, winget 安装 lnav

查看 lnav 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:lnav
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install lnav
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install lnav
```

  证据: MacPorts ports tree: sysutils/lnav/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add lnav
```

  证据: Alpine Linux edge package indexes: lnav from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install lnav
```

  证据: Debian stable package indexes: lnav from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install lnav
```

  证据: Fedora Rawhide package metadata: lnav from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#lnav
```

  证据: nixpkgs package indexes: pkgs/by-name/ln/lnav/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S lnav
```

  证据: Arch Linux sync databases: lnav from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install lnav
```

  证据: openSUSE Tumbleweed package metadata: lnav from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/lnav
```

  证据: Scoop official bucket manifest trees: bucket/lnav.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id tstack.lnav -e
```

  证据: Windows Package Manager source index: tstack.lnav from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:lnav
- **软件包管理器:** Homebrew
- **版本:** 0.14.0
- **来源摘要:** Curses-based tool for viewing and analyzing log files
- **主页:** <https://lnav.org/>
- **仓库:** <https://github.com/tstack/lnav>
- **最后更新:** 2026-06-22T14:05:13-07:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- lnav (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.14.0
## 项目历史与用法

lnav, short for The Logfile Navigator, is a terminal log viewer that combines pager-like navigation with log-format detection, time merging, filtering, highlighting, histograms, and SQLite queries. It sits in the Unix tradition of tail, grep, and less, but packages those workflows into an interactive curses-style tool.

### 项目历史

The upstream GitHub repository was created in September 2009 and remains maintained by Tim Stack under the tstack/lnav project. The README presents lnav as a source repository backed by lnav.org and the Read the Docs manual, with static binaries and package-manager installation as first-class distribution channels.

Over time lnav accumulated features that moved it beyond a simple viewer: automatic decompression, format detection, chronological merge across files, follow mode for files and directories, JSON-lines pretty-printing, regex and SQLite filtering, and a SQL prompt over indexed log data. The official docs describe separate UI, command, SQLite, log-format, session, and performance sections, reflecting that growth.

### 采用历史

lnav has become a familiar package in Unix-like developer and operations environments because it solves a common local debugging problem without requiring a server, web UI, or log aggregation stack. The GitHub repository shows broad interest for a terminal utility, and the input package facts show distribution across Homebrew, Debian, Fedora, Nix, MacPorts, pacman, Scoop, winget, and other package managers.

The project also maintained an approachable adoption path: lnav.org offers a high-level overview and an SSH playground, while the README documents Homebrew, FreeBSD, static release binaries, and source builds. That combination made it easy for developers to try lnav during incident debugging or local log exploration.

### 使用方式

Typical use is to point lnav at log files or directories and let it identify, collate, and index messages. The documentation says files can be passed on the command line or opened later, directories can be monitored, archives can be extracted when libarchive support is available, and piped input can be captured.

Inside the TUI, users navigate like a pager, jump between errors, search and highlight with regular expressions, filter with expressions, inspect histograms, and run SQL queries against parsed log data. It is also commonly used with systemd by piping journalctl output into lnav.

### 为什么软件包爱好者会关心

lnav is significant because it is a single CLI package that absorbs a surprising amount of operational log-analysis workflow. It gives package-manager users an immediate local alternative to stitching together tail, grep, awk, less, jq, and ad hoc scripts.

For maintainers, lnav is interesting because it packages a real TUI application with many native dependencies, including SQLite, PCRE2, libarchive, compression libraries, and terminal handling. Its availability across Unix package sets and Windows package managers reflects demand for local-first log analysis.

### 时间线

- 2009: The tstack/lnav GitHub repository is created.
- 2010s: lnav grows from a terminal log viewer into a log-analysis TUI with format detection and SQL support.
- 2020s: The project documents releases through GitHub, publishes static binaries, and maintains Read the Docs documentation.
- 2026: The repository shows v0.14.x releases and continued development.

### Related projects

- tail, grep, less, and journalctl are common adjacent tools in the workflows lnav replaces or complements.
- SQLite is central to lnav's analysis model because lnav exposes parsed log data through SQL.
- Angle-grinder is named by the lnav README as another command-line log slicing and analysis tool.

### 来源

- <https://api.github.com/repos/tstack/lnav>
- <https://docs.lnav.org/en/latest/formats.html>
- <https://docs.lnav.org/en/latest/usage.html>
- <https://github.com/tstack/lnav>
- <https://lnav.org/>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.lnav/config.json, ~/.config/lnav/config.json, /etc/lnav/configs/*/*.json, /etc/lnav/formats/*/config.*.json
## 其他软件包管理器记录

- Debian apt - lnav - 0.12.4-1+deb13u1: normalized package name match | Debian stable package indexes: lnav from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | ncurses-based log file viewer | https://lnav.org
- Nix - lnav: normalized package name match | nixpkgs package indexes: pkgs/by-name/ln/lnav/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - lnav - 0.11.2-1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: lnav from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | ncurses-based log file viewer | https://lnav.org
- apk - lnav - 0.14.0-r0: normalized package name match | Alpine Linux edge package indexes: lnav from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Advanced log file navigator and viewer | https://lnav.org
- apk - lnav-doc - 0.14.0-r0: normalized package name match | Alpine Linux edge package indexes: lnav-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Advanced log file navigator and viewer (documentation) | https://lnav.org
- dnf - lnav - 0.14.0-3.fc45: normalized package name match | Fedora Rawhide package metadata: lnav from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Curses-based tool for viewing and analyzing log files | http://lnav.org
- pacman - lnav - 0.14.0-1: normalized package name match | Arch Linux sync databases: lnav from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A curses-based tool for viewing and analyzing log files | http://lnav.org/
- zypper - lnav - 0.14.0-1.4: normalized package name match | openSUSE Tumbleweed package metadata: lnav from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Logfile Navigator | https://lnav.org
- MacPorts - lnav: normalized package name match | MacPorts ports tree: sysutils/lnav/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/lnav: normalized package name match | Scoop official bucket manifest trees: bucket/lnav.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - tstack.lnav: normalized package name match | Windows Package Manager source index: tstack.lnav from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/lnav.yml](https://github.com/mxcl/pkgdb/blob/main/combined/lnav.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
