A software repository, or repo for short, is a storage location for software packages. Often a table of contents is also stored, along with metadata. A software repository is typically managed by source or version control, or repository managers. Package managers allow automatically installing and updating repositories, sometimes called "packages".
Many software publishers and other organizations maintain servers on the Internet for this purpose, either free of charge or for a subscription fee. Repositories may be solely for particular programs, such as CPAN for the Perl programming language, or for an entire operating system. Operators of such repositories typically provide a package management system, tools intended to search for, install and otherwise manipulate software packages from the repositories. For example, many Linux distributions use Advanced Packaging Tool (APT), commonly found in Debian based distributions, or Yellowdog Updater, Modified (yum) found in Red Hat based distributions. There are also multiple independent package management systems, such as pacman, used in Arch Linux and equo, found in Sabayon Linux.
As software repositories are designed to include useful packages, major repositories are designed to be malware free. If a computer is configured to use a digitally signed repository from a reputable vendor, and is coupled with an appropriate permissions system, this significantly reduces the threat of malware to these systems. As a side effect, many systems that have these abilities do not need anti-malware software such as antivirus software. [1]
Most major Linux distributions have many repositories around the world that mirror the main repository.
At client side, a package manager helps installing from and updating the repositories.
A package management system is different from a package development process.
A typical use of a package management system is to facilitate the integration of code from possibly different sources into a coherent stand-alone operating unit. Thus, a package management system might be used to produce a distribution of Linux, possibly a distribution tailored to a specific restricted application.
A package development process, by contrast, is used to manage the co-development of code and documentation of a collection of functions or routines with a common theme, producing thereby a package of software functions that typically will not be complete and usable by themselves. A good package development process will help users conform to good documentation and coding practices, integrating some level of unit testing.
The following table lists a few languages with repositories for contributed software. The "Autochecks" column describes the routine checks done.
| Language, purpose | Package development process | Repository | Install methods |
|---|---|---|---|
| C/C++ | vcpkg | ||
| Conan | |||
| Common Lisp | Quicklisp [2] | ||
| D | DUB | dlang.org | dub add <package> |
| Dart | Flutter | pub.dev | flutter pub get <package> |
| Fortran | Fortran Package Manager (fpm) | ||
| Go | go | pkg.go.dev | go get <package> |
| Haskell | Common Architecture for Building Applications and Libraries [3] | Hackage | Cabal |
| Java, Kotlin, Scala, Groovy, Clojure, etc. | Maven [4] | Maven, Apache Ivy, Gradle, sbt | |
| JavaScript, TypeScript, Node.js | node | npm registry [5] | npm install <package> yarn add <package> |
| Bower | bower install <package> | ||
| Julia [6] | |||
| .NET | NuGet | NuGet [7] | dotnet add package <package> |
| Ocaml | OPAM | ||
| Perl | CPAN | PPM [8] | |
| PHP | PEAR, Composer | PECL, Packagist | composer require <package> pear install <package> |
| PowerShell | PowerShell Gallery | PSResourceGet | |
| Python | Setuptools, Poetry [9] | PyPI | pip, EasyInstall, PyPM, Poetry, uv |
| Conda | |||
| R | R CMD check process [10] [11] | CRAN [12] | install.packages [13] remotes [14] |
| Ruby | RubyGems | RubyGems [15] | RubyGems, [15] Bundler [16] |
| Rust | Cargo [17] | crates.io [18] | Cargo [17] |
| Swift | Swift Package Manager | ||
| TeX, LaTeX | CTAN |
(Parts of this table were copied from a "List of Top Repositories by Programming Language" on Stack Overflow [19] )
Notable repositories with limited scope include:
Package managers help manage repositories and the distribution of them. If a repository is updated, a package manager will usually allow a user to update that repository through the manager. It also helps to manage things such as dependencies between other repositories. Examples of managers include:
| Package manager | Description |
|---|---|
| npm | Manager for Node.js [20] |
| pip | Installer for Python [21] |
| APT | Manager for Debian [22] |
| Homebrew | Installer for macOS, allows installing packages that Apple did not [23] |
| vcpkg | Manager for C, C++ [24] [25] |
| yum and DNF | Manager for Fedora, Red Hat Enterprise Linux [26] |
| Pacman | Manager for Arch Linux [27] |
| Composer | Manager for PHP |
So-called "universal" package managers are also known as binary repository managers. [28]
In an enterprise environment, a software repository is usually used to store artifacts, or to mirror external repositories which may be inaccessible due to security restrictions. Such repositories may provide additional functionality, like access control, versioning, security checks for uploaded software, cluster functionality etc. and typically support a variety of formats in one package, so as to cater for all the needs in an enterprise, and thus aiming to provide a single point of truth. One example is Sonatype Nexus Repository. [29]
At server side, a software repository is typically managed by source control or repository managers. Some of the repository managers allow to aggregate other repository location into one URL and provide a caching proxy. When doing continuous builds many artifacts are produced and often centrally stored, so automatically deleting the ones which are not released is important.
As part of the development lifecycle, source code is continuously being built into binary artifacts using continuous integration. This may interact with a binary repository manager much like a developer would by getting artifacts from the repositories and pushing builds there. Tight integration with CI servers enables the storage of important metadata such as:
Artifacts and packages inherently mean different things. Artifacts are simply an output or collection of files (ex. JAR, WAR, DLLS, RPM etc.) and one of those files may contain metadata (e.g. POM file). Whereas packages are a single archive file in a well-defined format (ex. NuGet) that contain files appropriate for the package type (ex. DLL, PDB). [30] Many artifacts result from builds but other types are crucial as well. Packages are essentially one of two things: a library or an application. [31]
Compared to source files, binary artifacts are often larger by orders of magnitude, they are rarely deleted or overwritten (except for rare cases such as snapshots or nightly builds), and they are usually accompanied by much metadata such as id, package name, version, license and more.
Metadata describes a binary artifact, is stored and specified separately from the artifact itself, and can have several additional uses. The following table shows some common metadata types and their uses:
| Metadata type | Used for |
|---|---|
| Versions available | Upgrading and downgrading automatically |
| Dependencies | Specify other artifacts that the current artifact depends on |
| Downstream dependencies | Specify other artifacts that depend on the current artifact |
| License | Legal compliance |
| Build date and time | Traceability |
| Documentation | Provide offline availability for contextual documentation in IDEs |
| Approval information | Traceability |
| Metrics | Code coverage, compliance to rules, test results |
| User-created metadata | Custom reports and processes |