The createrepo command is a utility in Linux that is used to create a package repository. A package repository is a collection of software packages that are stored in a central location and can be easily accessed and installed by users. Package repositories are commonly used in Linux distributions to provide a centralized location for software packages and to allow users to easily install and update packages on their systems.
To use the createrepo command, you will need to specify the directory that contains the package files that you want to include in the repository. The createrepo command will then process the package files and generate the necessary metadata and index files for the repository.
Here is an example of using the createrepo command:
# createrepo REPO_DIRECTORY
This will create a package repository in the specified directory, using the package files that are located in that directory.
If you encounter the below error while running the command createrepo:
createrepo: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install createrepo |
Ubuntu | apt-get install createrepo |
Kali Linux | apt-get install createrepo |
CentOS | yum install createrepo |
Fedora | dnf install createrepo |
Raspbian | apt-get install createrepo |
createrepo Command Examples
1. Initialize a basic repository in a directory:
# createrepo path/to/directory
2. Initialize a repository, exclude test RPMs and display verbose logs:
# createrepo -v -x test_*.rpm path/to/directory
3. Initialize a repository, using SHA1 as the checksum algorithm, and ignoring symbolic links:
# createrepo -S -s sha1 path/to/directory