# Install logrotate with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper, chocolatey

Rotates, compresses, and mails system logs. Version 3.22.0 via Homebrew; verified from local package data. Also installable with debian: sudo apt install logrotate.

## Install

```sh
sudo av install brew:logrotate
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install logrotate
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install logrotate
```

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

### Linux

- apk (92%):

```sh
sudo apk add logrotate
```

  Evidence: Alpine Linux edge package indexes: logrotate from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install logrotate
```

  Evidence: Debian stable package indexes: logrotate from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install logrotate
```

  Evidence: Fedora Rawhide package metadata: logrotate from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#logrotate
```

  Evidence: nixpkgs package indexes: pkgs/by-name/lo/logrotate/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S logrotate
```

  Evidence: Arch Linux sync databases: logrotate from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz

- zypper (92%):

```sh
sudo zypper install logrotate
```

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

### Windows

- Chocolatey (92%):

```sh
choco install LogRotate
```

  Evidence: Chocolatey community package catalog: LogRotate from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','logexpert'

## Package facts

- **Package key:** brew:logrotate
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/logrotate>
- **Version:** 3.22.0
- **Source summary:** Rotates, compresses, and mails system logs
- **Homepage:** <https://github.com/logrotate/logrotate>
- **Repository:** <https://github.com/logrotate/logrotate>
- **License:** GPL-2.0-or-later
- **Source archive:** <https://github.com/logrotate/logrotate/releases/download/3.22.0/logrotate-3.22.0.tar.xz>
- **Generated:** 2026-08-04T22:13:35+00:00

## Executables

- logrotate (cli)
- logrotate (alias)

## Dependencies

- popt

## Install behavior

- Post-install hook: not defined
- Service: declared
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-08-04
- Package-manager version: 3.22.0
- Local data: ok
- Upstream repository: https://github.com/logrotate/logrotate
- info: No package-manager update timestamp was available.
- info: No cached GitHub release or tag data was available.
## Project history and usage

logrotate is the standard Unix-style utility for rotating, compressing, removing, and optionally mailing log files so long-running systems do not accumulate unbounded logs.

### Project history

The official README describes logrotate as a utility designed to simplify administration of systems that generate many log files. Its manpage documents the traditional cron or systemd timer execution model and the central `/etc/logrotate.conf` configuration file.

The current upstream GitHub changelog shows continuing maintenance through modern 3.x releases. Recent entries include systemd integration hardening, state-file locking, Zstandard compression support, stricter parser behavior, fixes for security-sensitive file handling, and a 2024 3.22.0 release with additional parser, rotation, and timer fixes.

### Adoption history

logrotate is widely packaged across Unix and Unix-like systems. The supplied package metadata records packages in Alpine, Homebrew, Chocolatey, Debian, Fedora/DNF, MacPorts, Nix, Arch, Ubuntu, and openSUSE, reflecting its status as infrastructure plumbing rather than an application-specific tool.

Its adoption has been helped by the simple contract between packages and the host system: applications can install small snippets under a system's logrotate configuration directory, while logrotate centralizes schedule, retention, compression, permissions, and post-rotation hooks.

### How it is used

Administrators define log paths and directives in `/etc/logrotate.conf` or included configuration files. logrotate can rotate hourly, daily, weekly, monthly, after elapsed minutes, or by size; it can compress old logs, create replacement files, move logs to old directories, run scripts, and maintain a state file to avoid repeated rotations.

Package maintainers care about directives such as `create`, `copytruncate`, `missingok`, `compress`, `delaycompress`, `su`, and `postrotate` because they determine whether daemons keep writing safely after logs are moved or truncated.

### Why package nerds care

logrotate is one of the small system tools that package managers quietly depend on. It lets packaged daemons ship predictable log retention behavior without each daemon inventing its own rotation code, and its config snippets are a familiar part of Linux and Unix package post-installation hygiene.

### Timeline

- 2016: 3.11.0 imports systemd service and timer examples and adds new configuration directives.
- 2018: 3.15.0 renames the default example to logrotate.conf and improves systemd timer behavior.
- 2020: 3.17.0 adds state-file locking; 3.18.0 adds Zstandard compression support.
- 2022: 3.20.0 addresses CVE-2022-1348 around state-file handling.
- 2024: 3.22.0 release fixes time calculations, copy/compress edge cases, named-pipe handling, parser ambiguity, and timer behavior.

### Related projects

- cron and systemd timers: common schedulers for running logrotate.
- gzip, xz, zstd, and other compressors: external compression tools commonly used by logrotate configurations.
- syslog and daemon packages: common producers of logs managed by logrotate.

### Sources

- <https://github.com/logrotate/logrotate>
- <https://github.com/logrotate/logrotate/blob/main/ChangeLog.md>
- <https://github.com/logrotate/logrotate/blob/main/logrotate.8.in>
- source_facts.package-manager


## Security Notes

broad file, network, media, or database tool signal. formula declares a Homebrew service.

- **Geiger risk:** orange / medium
- broad file, network, media, or database tool signal
- formula declares a Homebrew service


## 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: /etc/logrotate.conf
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** logrotate
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Debian apt - logrotate - 3.22.0-1: normalized package name match | Debian stable package indexes: logrotate from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Log rotation utility | https://github.com/logrotate/logrotate
- Nix - logrotate: normalized package name match | nixpkgs package indexes: pkgs/by-name/lo/logrotate/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - logrotate - 3.21.0-2build1: normalized package name match | Ubuntu 24.04 LTS package indexes: logrotate from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Log rotation utility | https://github.com/logrotate/logrotate
- apk - logrotate - 3.22.0-r0: normalized package name match | Alpine Linux edge package indexes: logrotate from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Tool to rotate logfiles | https://github.com/logrotate/logrotate
- apk - logrotate-doc - 3.22.0-r0: normalized package name match | Alpine Linux edge package indexes: logrotate-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Tool to rotate logfiles (documentation) | https://github.com/logrotate/logrotate
- apk - logrotate-openrc - 3.22.0-r0: normalized package name match | Alpine Linux edge package indexes: logrotate-openrc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Tool to rotate logfiles (OpenRC init scripts) | https://github.com/logrotate/logrotate
- apk - logrotate-syslog - 3.22.0-r0: normalized package name match | Alpine Linux edge package indexes: logrotate-syslog from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Rotation for the main syslog file | https://github.com/logrotate/logrotate
- dnf - logrotate - 3.22.0-6.fc45: normalized package name match | Fedora Rawhide package metadata: logrotate from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Rotates, compresses, removes and mails system log files | https://github.com/logrotate/logrotate
- pacman - logrotate - 3.22.0-1: normalized package name match | Arch Linux sync databases: logrotate from https://geo.mirror.pkgbuild.com/core/os/x86_64/core.db.tar.gz | Rotates system logs automatically | https://github.com/logrotate/logrotate
- zypper - logrotate - 3.22.0-2.6: normalized package name match | openSUSE Tumbleweed package metadata: logrotate from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Cron service for rotating, compressing, mailing and removing system log files | https://github.com/logrotate/logrotate
- MacPorts - logrotate: normalized package name match | MacPorts ports tree: sysutils/logrotate/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - LogRotate: normalized package name match | Chocolatey community package catalog: LogRotate from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','logexpert'


## Related links

- [Source-control packages](https://pkg.so/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://pkg.so/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Archive and compression packages](https://pkg.so/archive-compression-tools/) - Matched archive or compression metadata.
- [gnu-tar](https://pkg.so/brew/gnu-tar/) - Shares pkgdb curated category or tags: cli, compression, system, unix.
- [ncompress](https://pkg.so/brew/ncompress/) - Shares pkgdb curated category or tags: cli, compression, system, unix.
- [xz](https://pkg.so/brew/xz/) - Shares pkgdb curated category or tags: cli, compression, system.
- [zstd](https://pkg.so/brew/zstd/) - Shares pkgdb curated category or tags: cli, compression, system.
- [lz4](https://pkg.so/brew/lz4/) - Shares pkgdb curated category or tags: cli, compression, system.
- [unzip](https://pkg.so/brew/unzip/) - Shares pkgdb curated category or tags: cli, compression, system.
- [bash](https://pkg.so/brew/bash/) - Shares pkgdb curated category or tags: cli, system, unix.
- [libzip](https://pkg.so/brew/libzip/) - Shares pkgdb curated category or tags: cli, compression, system.
- [log-rotate](https://pkg.so/npm/log-rotate/) - Local package facts share a topical domain. Shared terms: cli, log, log-management, logs, management.
- [fcp](https://pkg.so/brew/fcp/) - Local package facts share a topical domain. Shared terms: cli, management, system, unix.
- [lr](https://pkg.so/brew/lr/) - Local package facts share a topical domain. Shared terms: cli, management, system, unix.

## Combined YAML source

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


## Sources

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