# Install htslib with Homebrew, apt, dnf, MacPorts, Nix, zypper

C library for high-throughput sequencing data formats. Version 1.23.1 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:htslib
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install htslib
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install htslib
```

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

### Linux

- Debian apt (92%):

```sh
sudo apt install htslib-test
```

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

- dnf (92%):

```sh
sudo dnf install htslib
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#htslib
```

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

- zypper (92%):

```sh
sudo zypper install bgzip
```

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

## Package facts

- **Package key:** brew:htslib
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/htslib>
- **Version:** 1.23.1
- **Source summary:** C library for high-throughput sequencing data formats
- **Homepage:** <https://www.htslib.org/>
- **Repository:** <https://github.com/samtools/htslib>
- **Upstream docs:** <https://github.com/samtools/htslib#readme>
- **License:** MIT AND BSD-3-Clause
- **Source archive:** <https://github.com/samtools/htslib/releases/download/1.23.1/htslib-1.23.1.tar.bz2>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- annot-tsv (cli)
- bgzip (cli)
- htsfile (cli)
- ref-cache (cli)
- tabix (cli)
- annot-tsv (alias)
- bgzip (alias)
- htsfile (alias)
- ref-cache (alias)
- tabix (alias)

## Dependencies

- libdeflate
- xz

## Uses from macOS

- bzip2
- curl

## Install behavior

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

## Freshness

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

HTSlib is the C library layer of the Samtools family, providing shared reading and writing support for high-throughput sequencing formats such as SAM, BAM, CRAM, VCF, and BCF. It matters beyond a single command-line package because many genomics tools build on the same file-format and indexing behavior.

### Project history

The Samtools site describes the project as three related repositories: Samtools for alignment manipulation, BCFtools for variant data, and HTSlib as the common C library. Its download page preserves the split in historical context, noting that before HTSlib was introduced, Samtools and BCFtools were shipped together in a single samtools-0.1.x source package.

The annotated 1.0 tag in the official GitHub repository, dated 2014-08-15, describes the first HTSlib release as supporting SAM, BAM, CRAM, VCF, and BCF. Later release notes show the library continuing to absorb format, indexing, threading, remote-I/O, and ABI changes that affect downstream tools.

### Adoption history

HTSlib's adoption is tightly coupled to the Samtools ecosystem: the Samtools site says Samtools and BCFtools use HTSlib internally, while HTSlib is also distributed separately for developers writing programs against its API. Packaging across Homebrew, Debian-family distributions, Fedora, MacPorts, Nix, and openSUSE reflects its role as a build-time and runtime dependency rather than only an end-user utility.

### How it is used

Package users often encounter HTSlib through utilities installed with the library, especially bgzip, htsfile, tabix, ref-cache, and annot-tsv. Developers use the C API for compressed genomic files, indexes, region queries, remote access, and format detection in sequencing and variant-analysis workflows.

### Why package nerds care

HTSlib is package-nerd significant because it is both a library ABI and a bundle of small Unix-style genomics tools. Changes such as the 2019 1.10 release's SAM header API, multi-threaded SAM I/O, on-the-fly indexing, S3 updates, and 64-bit reference-position support are the sort of low-level package events that can ripple through many bioinformatics builds.

### Timeline

- 2012: The samtools/htslib repository was created on GitHub.
- 2014: The 1.0 tag marked the first HTSlib release, supporting SAM, BAM, CRAM, VCF, and BCF.
- 2019: Release 1.10 added a SAM header API, multi-threaded SAM reading and writing, on-the-fly indexing, and S3 interface updates.
- 2026: Release notes for 1.23.1 documented CRAM decoder security fixes and related build updates.

### Related projects

- Samtools and BCFtools are the closest sibling projects, both using HTSlib internally. Related file-format work includes the SAM, BAM, CRAM, VCF, BCF, BGZF, and tabix indexing formats that HTSlib reads, writes, or helps index.

### Sources

- Samtools project site, HTSlib download notes, GitHub repository metadata, and official release/tag metadata.


## Security Notes

library-like package without higher-risk signals.

- **Geiger risk:** green / low
- library-like package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** htslib
- **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 - htslib-test - 1.21+ds-1: normalized package name match | Debian stable package indexes: htslib-test from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Test data for HTSlib | https://github.com/samtools/htslib
- Debian apt - libhts-dev - 1.21+ds-1: normalized package name match | Debian stable package indexes: libhts-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | development files for the HTSlib | https://github.com/samtools/htslib
- Debian apt - libhts3t64 - 1.21+ds-1: normalized package name match | Debian stable package indexes: libhts3t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | C library for high-throughput sequencing data formats | https://github.com/samtools/htslib
- Debian apt - tabix - 1.21+ds-1: normalized package name match | Debian stable package indexes: tabix from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | generic indexer for TAB-delimited genome position files | https://github.com/samtools/htslib
- Nix - htslib: normalized package name match | nixpkgs package indexes: pkgs/by-name/ht/htslib/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - htslib-test - 1.19+ds-1.1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: htslib-test from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Test data for HTSlib | https://github.com/samtools/htslib
- Ubuntu apt - libhts-dev - 1.19+ds-1.1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: libhts-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | development files for the HTSlib | https://github.com/samtools/htslib
- Ubuntu apt - libhts3t64 - 1.19+ds-1.1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: libhts3t64 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | C library for high-throughput sequencing data formats | https://github.com/samtools/htslib
- Ubuntu apt - tabix - 1.19+ds-1.1build3: normalized package name match | Ubuntu 24.04 LTS package indexes: tabix from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | generic indexer for TAB-delimited genome position files | https://github.com/samtools/htslib
- dnf - htslib - 1.23.1-2.fc45: normalized package name match | Fedora Rawhide package metadata: htslib from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | C library for high-throughput sequencing data formats | http://www.htslib.org
- dnf - htslib-devel - 1.23.1-2.fc45: normalized package name match | Fedora Rawhide package metadata: htslib-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Development files for htslib | http://www.htslib.org
- dnf - htslib-tools - 1.23.1-2.fc45: normalized package name match | Fedora Rawhide package metadata: htslib-tools from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Additional htslib-based tools | http://www.htslib.org
- MacPorts - htslib: normalized package name match | MacPorts ports tree: science/htslib/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- zypper - bgzip - 1.21-1.3: installed executable or alias match | openSUSE Tumbleweed package metadata: bgzip from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Block compression/decompression utility from the HTSlib project | https://github.com/samtools/htslib/
- zypper - htsfile - 1.21-1.3: installed executable or alias match | openSUSE Tumbleweed package metadata: htsfile from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Identify high-throughput sequencing data files from the HTSlib project | https://github.com/samtools/htslib/
- zypper - tabix - 1.21-1.3: installed executable or alias match | openSUSE Tumbleweed package metadata: tabix from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Generic indexer for TAB-delimited genome position files from the HTSlib project | https://github.com/samtools/htslib/


## Related links

- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Database and data packages](https://www.automicvault.com/pkg/database-data-tools/) - Matched database, SQL, migration, or data-store metadata.
- [Scientific computing packages](https://www.automicvault.com/pkg/scientific-computing-tools/) - Matched scientific computing metadata.
- [libdeflate](https://www.automicvault.com/pkg/brew/libdeflate/) - Runtime dependency declared by Homebrew.
- [xz](https://www.automicvault.com/pkg/brew/xz/) - Runtime dependency declared by Homebrew.
- [augustus](https://www.automicvault.com/pkg/brew/augustus/) - Popular package that depends on this formula.
- [bcftools](https://www.automicvault.com/pkg/brew/bcftools/) - Popular package that depends on this formula.
- [freebayes](https://www.automicvault.com/pkg/brew/freebayes/) - Popular package that depends on this formula.
- [jellyfish](https://www.automicvault.com/pkg/brew/jellyfish/) - Popular package that depends on this formula.
- [samtools](https://www.automicvault.com/pkg/brew/samtools/) - Popular package that depends on this formula.
- [stringtie](https://www.automicvault.com/pkg/brew/stringtie/) - Popular package that depends on this formula.
- [tabixpp](https://www.automicvault.com/pkg/brew/tabixpp/) - Popular package that depends on this formula.
- [vcflib](https://www.automicvault.com/pkg/brew/vcflib/) - Popular package that depends on this formula.
- [bbtools](https://www.automicvault.com/pkg/brew/bbtools/) - Shares av.db curated category or tags: bioinformatics, cli, genomics, science, sequencing.
- [bowtie2](https://www.automicvault.com/pkg/brew/bowtie2/) - Shares av.db curated category or tags: bioinformatics, cli, genomics, science, sequencing.
- [fgbio](https://www.automicvault.com/pkg/brew/fgbio/) - Shares av.db curated category or tags: bioinformatics, cli, genomics, science, sequencing.
- [picard-tools](https://www.automicvault.com/pkg/brew/picard-tools/) - Shares av.db curated category or tags: bioinformatics, cli, genomics, sam-bam-cram, science.
- [sambamba](https://www.automicvault.com/pkg/brew/sambamba/) - Shares av.db curated category or tags: bioinformatics, cli, genomics, science, sequencing.
- [abpoa](https://www.automicvault.com/pkg/brew/abpoa/) - Shares av.db curated category or tags: bioinformatics, c-library, cli, science.
- [abricate](https://www.automicvault.com/pkg/brew/abricate/) - Shares av.db curated category or tags: bioinformatics, cli, genomics, science.

## Combined YAML source

View the package source record on GitHub. [combined/htslib.yml](https://github.com/automic-vault/db/blob/main/combined/htslib.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
