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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. finch Command Examples in Linux
  2. Example of using getnstimeofday in Linux kernel
  3. How to Install Apache, MariaDB, and PHP (FAMP) stack on FreeBSD 11
  4. How to uninstall fail2ban on Ubuntu
  5. hwclock: command not found
  6. CentOS / RHEL : How to find the creation time of LVM volume
  7. mkfs.xfs: command not found
  8. balena Command Examples (Interact with the balenaCloud, openBalena and the balena API from the command-line)
  9. Linux OS Service ‘psacct’
  10. How to install zip/unzip package in Linux CentOS/RHEL 7 and 8

You May Also Like

Primary Sidebar

Recent Posts

  • dig: DNS lookup utility
  • diffstat: Create a histogram from the output of the diff command
  • diffoscope: Compare files, archives, and directories
  • diff-pdf: Tool for comparing two PDFs

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright