• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

makepkg Command Examples in Linux

by Deepika

“makepkg” is a command line tool for building packages for the Arch Linux package manager, “pacman”. It is used to create a package file (with a “.pkg.tar” extension) from a source code archive, along with the build instructions specified in the PKGBUILD file.

A PKGBUILD file is a shell script that contains the information necessary to build a package, including:

  • Package name, version, and description
  • Source code location and checksums
  • Build dependencies and other required packages
  • Compilation flags and build instructions

By using makepkg, a user can build a package from source code, including downloading and verifying the source code, building the package, and creating the package file. This is useful for:

  • Building packages for systems with limited internet access, since the package and its dependencies can be installed from a local package file.
  • Customizing packages by modifying the PKGBUILD file to include different build options.
  • Creating packages from source code that is not available in the official Arch Linux repository.
Note: When using makepkg, it is important to verify the authenticity of the source code and PKGBUILD file, as malicious code could be included that could compromise the system.

makepkg Command Examples

1. Make a package:

# makepkg

2. Make a package and install its dependencies:

# makepkg --syncdeps

3. Make a package, install its dependencies then install it to the system:

# makepkg --syncdeps --install

4. Make a package, but skip checking the source’s hashes:

# makepkg --skipchecksums

5. Clean up work directories after a successful build:

# makepkg --clean

6. Verify the hashes of the sources:

# makepkg --verifysource

7. Generate and save the source information into `.SRCINFO`:

# makepkg --printsrcinfo > .SRCINFO

Filed Under: Linux

Some more articles you might also be interested in …

  1. dlv: Debugger for the Go programming language
  2. ember: The Ember.js command-line utility
  3. rofi Command Examples in Linux
  4. csvstat: Print descriptive statistics for all columns in a CSV file
  5. nethogs: command not found
  6. lxterminal: command not found
  7. assimp: Command-line client for the Open Asset Import Library
  8. How to Install gulp-tslint software package in NPM Packages
  9. compgen: A built-in command for auto-completion in Bash, which is called on pressing TAB key twice
  10. sar Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright