{"id":13610475,"url":"https://github.com/herzrasen/pkghist","last_synced_at":"2026-01-19T01:03:52.000Z","repository":{"id":35270862,"uuid":"202479934","full_name":"herzrasen/pkghist","owner":"herzrasen","description":"Query the local version history of packages","archived":false,"fork":false,"pushed_at":"2023-10-24T11:56:56.000Z","size":125,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-07T16:43:49.612Z","etag":null,"topics":["arch-linux","archlinux","pacman","pkg","pkgbuild","rust","rust-lang"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/herzrasen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-08-15T05:33:26.000Z","updated_at":"2023-10-24T11:55:16.000Z","dependencies_parsed_at":"2022-09-16T21:51:35.380Z","dependency_job_id":"e04d0072-4482-4a51-a1bf-f0b022ee5bbb","html_url":"https://github.com/herzrasen/pkghist","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/herzrasen%2Fpkghist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/herzrasen%2Fpkghist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/herzrasen%2Fpkghist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/herzrasen%2Fpkghist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/herzrasen","download_url":"https://codeload.github.com/herzrasen/pkghist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248642223,"owners_count":21138348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arch-linux","archlinux","pacman","pkg","pkgbuild","rust","rust-lang"],"created_at":"2024-08-01T19:01:45.037Z","updated_at":"2026-01-19T01:03:51.971Z","avatar_url":"https://github.com/herzrasen.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"[![codecov](https://codecov.io/gh/herzrasen/pkghist/branch/master/graph/badge.svg)](https://codecov.io/gh/herzrasen/pkghist)\n[![pkghist](https://img.shields.io/aur/version/pkghist.svg?label=pkghist)](https://aur.archlinux.org/packages/pkghist/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/herzrasen/pkghist/blob/master/LICENSE)\n\n# pkghist\n`pkghist` queries your `Pacman` logfile for the local history of either single packages or your entire installation.\n\n## About\n`pkghist` parses Pacman's logfile (usually located under `/var/log/pacman.log` or specified via `--logfile /path/to/pacman.log`) and outputs version information. \n`pkghist` can list information about currently uninstalled packages using the `--removed-only` or `--with-removed` options. \n\n## Install\nIf you are on Arch, either install `pkghist` using AUR or by building it using makepkg\n\n```bash\ngit clone https://aur.archlinux.org/pkghist.git\ncd pkghist\nmakepkg -si\n```\n## Build\nTo build `pkghist` from source you need a `Rust` installation including it's build tool `Cargo`. \nInstall it either using pacman or [follow the official install guide](https://www.rust-lang.org/tools/install).\n\nOnce `Rust` and `Cargo` are up and running, simply use:\n```bash\ncargo install --path .\n```\n\nThis will build `pkghist` and install it into your cargo bin directory (usually `~/.cargo/bin`).\n\n## Help\n```bash\npkghist 0.6.0\nTrace package versions from pacman's logfile\n\nUSAGE:\n    pkghist [FLAGS] [OPTIONS] [filter]...\n\nFLAGS:\n    -x, --exclude         If set, every filter result will be excluded.\n    -h, --help            Prints help information\n        --no-colors       Disable colored output\n        --no-details      Only output the package names\n    -R, --removed-only    Only output packages that are currently uninstalled\n    -V, --version         Prints version information\n    -r, --with-removed    Include packages that are currently uninstalled\n\nOPTIONS:\n    -a, --after \u003cdate\u003e                     Only consider events that occurred after 'date' [Format: \"YYYY-MM-DD HH:MM\"]\n        --first \u003cn\u003e                        Output the first 'n' pacman events\n        --last \u003cn\u003e                         Output the last 'n' pacman events\n    -L, --limit \u003climit\u003e                    How many versions to go back in report. [limit \u003e 0]\n    -l, --logfile \u003cFILE\u003e                   Specify a logfile [default: /var/log/pacman.log]\n    -o, --output-format \u003coutput-format\u003e    Select the output format [default: plain]  [possible values: json, plain,\n                                           compact]\n\nARGS:\n    \u003cfilter\u003e...    Filter the packages that should be searched for. Use regular expressions to specify the exact\n                   pattern to match (e.g. '^linux$' only matches the package 'linux')\n```\n\n## Usage\n### List all installed packages ordered by install/upgrade date\n```bash\npkghist \n```\n\n### List the last `n` installed / upgraded packages\n```bash\npkghist --last \u003cn\u003e\n```\n\n### Limit the number of versions per package\n```bash\npkghist --limit \u003cn\u003e\n```\n\n### Search for a package by exact name\n```bash\npkghist '^name$'\n```\n\nThis uses regex syntax to describe the pattern to search for.\n\n#### Example\n```bash\npkghist '^zsh$'\n```\nThis return only the package `zsh` and not for example `zsh-syntax-highlighting`.\n\n### Search for all packages containing some string\n```bash\npkghist somestring\n```\n\n#### Example\n```bash\npkghist zsh\n```\nThis returns the package `zsh` as well as for example `zsh-syntax-highlighting`.\n\n### Excluding packages\n```bash\npkghist --exclude somestring\n```\n\n#### Example\n```bash\npkghist --exclude '^[a-e]'\n```\nThis excludes all packages starting with the letters a to e.\n\n### List the package names of all removed packages\n```bash\npkghist --no-details --removed-only\n```\n\n## Regex examples\nThis is a little collection of useful regexes that can be used for filtering.\n\n| Regex          | Explanation                                              |\n|----------------|----------------------------------------------------------|\n| `'^package$'`  | Matches only packages named 'package'                    |\n| `'package'`    | Matches any package containing 'package'                 |  \n| `'^[a-x]'`     | Matches any package starting with the letters 'a' to 'x' |\n| `'[a-x]'`      | Matches any package containing the letter 'a' to 'x'     |\n| `'[^a-x]'`     | Matches any package NOT containing the letters 'a' to 'x'| \n| `'[[:digit:]]'`| Matches any package containing a digit                   |\n\nSometimes using `--exclude` is easier than trying to create an exclusion regex. \n\n## Using pkghist's output as input for pacman\nYou can use the result of a `pkghist` query as input for pacman.\n\nTo create an output in the matching format, use the `--no-colors` and the `--no-details' options in your query. \n\nThe following command installs all packages that have been removed after 2019-10-01 12:00. \n```bash\nsudo pacman -S $(pkghist --no-details --no-colors --removed-only --after \"2019-10-01 12:00\")                                             \n```\n\nThe following command removes all packages that have been installed after 2019-10-02 12:00. \n```bash\nsudo pacman -R $(pkghist --no-details --no-colors --after \"2019-10-02 12:00\")                                                            \n```\n\n## Shell completions\n`pkghist` creates completion scripts for `bash`, `fish` and `zsh`.\nThey are created at build time using the great [clap crate](https://github.com/clap-rs/clap). \nWhen installing using `makepkg` (e.g. using the AUR), they are put into the appropriate location.\nWhen installing manually, you may copy them from [the completions directory](./completions) into the appropriate location.\n\nNote: When using zsh, enable loading of additional completions by adding the following line to your `.zshrc`\n```bash\nautoload -U compinit \u0026\u0026 compinit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fherzrasen%2Fpkghist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fherzrasen%2Fpkghist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fherzrasen%2Fpkghist/lists"}