---
arch-wiki: https://wiki.archlinux.org/title/Makepkg
obj: application
---

# makepkg
makepkg is a tool for creating [pacman](Pacman.md) packages based on [PKGBUILD](PKGBUILD.md) files.

## Usage
Make a package:
```shell
makepkg
```

Make a package and install its dependencies:
```shell
makepkg --syncdeps
```

Make a package, install its dependencies then install it to the system:
```shell
makepkg --syncdeps --install
```

Make a package, but skip checking the source's hashes:
```shell
makepkg --skipchecksums
```

Clean up work directories after a successful build:
```shell
makepkg --clean
```

Verify the hashes of the sources:
```shell
makepkg --verifysource
```

## Options
| Option             | Description                                                                                                                                                                                                                                                                                                                                                    |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-A, --ignorearch` | Ignore a missing or incomplete arch field in the build script                                                                                                                                                                                                                                                                                                  |
| `-c, --clean`      | Clean up leftover work files and directories after a successful build                                                                                                                                                                                                                                                                                          |
| `-d, --nodeps`     | Do not perform any dependency checks. This will let you override and ignore any dependencies required. There is a good chance this option will break the build process if all of the dependencies are not installed                                                                                                                                            |
| `-e, --noextract`  | Do not extract source files or run the prepare() function (if present); use whatever source already exists in the $srcdir/ directory. This is handy if you want to go into $srcdir/ and manually patch or tweak code, then make a package out of the result. Keep in mind that creating a patch may be a better solution to allow others to use your [PKGBUILD](PKGBUILD.md). |
| `--skipinteg`      | Do not perform any integrity checks (checksum and [PGP](../../tools/GPG.md)) on source files                                                                                                                                                                                                                                                                                         |
| `--skipchecksums`  | Do not verify checksums of source files                                                                                                                                                                                                                                                                                                                        |
| `--skippgpcheck`   | Do not verify [PGP](../../tools/GPG.md) signatures of source files                                                                                                                                                                                                                                                                                                                   |
| `-i, --install`    | Install or upgrade the package after a successful build using [pacman](Pacman.md)                                                                                                                                                                                                                                                                                           |
| `-o, --nobuild`    | Download and extract files, run the prepare() function, but do not build them. Useful with the `--noextract` option if you wish to tweak the files in $srcdir/ before building                                                                                                                                                                                 |
| `-r, --rmdeps`     | Upon successful build, remove any dependencies installed by makepkg during dependency auto-resolution and installation                                                                                                                                                                                                                                         |
| `-s, --syncdeps`   | Install missing dependencies using [pacman](Pacman.md). When build-time or run-time dependencies are not found, [pacman](Pacman.md) will try to resolve them. If successful, the missing packages will be downloaded and installed                                                                                                                                                       |
| `-C, --cleanbuild` | Remove the $srcdir before building the package                                                                                                                                                                                                                                                                                                                 |
| `--noarchive`      | Do not create the archive at the end of the build process. This can be useful to test the package() function or if your target distribution does not use [pacman](Pacman.md)                                                                                                                                                                                                |
| `--sign`           | Sign the resulting package with [gpg](../../tools/GPG.md)                                                                                                                                                                                                                                                                                                                            |
| `--nosign`         | Do not create a signature for the built package                                                                                                                                                                                                                                                                                                                |
| `--key <key>`      | Specify a key to use when signing packages                                                                                                                                                                                                                                                                                                                     |
| `--noconfirm`      | (Passed to [pacman](Pacman.md)) Prevent [pacman](Pacman.md) from waiting for user input before proceeding with operations                                                                                                                                                                                                                                                                |
