Format:Conda package
| Magic | PK\x03\x04 (ZIP) for .conda; BZh for .tar.bz2 |
|---|---|
| Extensions | .conda, .tar.bz2 |
| On this wiki | Facts · Code · Notes · Topics |
Conda package: the current .conda format is an uncompressed-container ZIP with metadata.json (conda_pkg_format_version 2) and two Zstandard-compressed tars, info-<id>.tar.zst (the info/ directory) and pkg-<id>.tar.zst (the files); the legacy format is one .tar.bz2 with an info/ directory.
From conda-package-handling conda_fmt.py (BSD-3-Clause):
.conda (format version 2)
- A ZIP written with
ZIP_STORED(members are not deflated; the compression is inside the members). - First member
metadata.jsoncontaining{"conda_pkg_format_version": 2}. - Then
pkg-<file_id>.tar.zst(all files that are not underinfo/) andinfo-<file_id>.tar.zst(paths equal toinfoor starting withinfo/), where<file_id>is the file name without.conda. Both are tar streams compressed with Zstandard, default level 19. Members are written with ZIP64 and tar headers are anonymized (owner and time normalized). - Splitting info from payload lets a tool read only the metadata by fetching the info member (conda-package-streaming streams a component from a URL).
Legacy .tar.bz2
A bzip2-compressed tar whose root contains the installed files and an info/ directory with the package metadata (conda-package-handling lists .tar.bz2 as a supported extension). Unverified: info/index.json (name, version, build, depends), info/paths.json and info/files describe the content; conda-package-handling only references info/paths.json in the lines read (api/streaming extraction code), the other names are from memory.
Where code runs
Unverified: conda packages may include link scripts (bin/.<name>-post-link.sh, Scripts\.<name>-post-link.bat, pre-link and pre-unlink) that conda runs at install; this was not checked in the handler source.
Code & repositories
- https://github.com/conda/conda-package-handling @
5c484fb56e16cee2ce77daf4e06c94e6357d6d02· license: BSD-3-Clause (declared by the contributor for the files used; GitHub reports BSD-3-Clause (read from LICENSE; GitHub's API was busy) for the repository)
Reads and writes .conda and .tar.bz2 conda packages (conda_fmt.py).
Tested on: source read, not run · checked 2026-10-19