I'm using archlinux and i want to make my own packages with my own modification ,

So , how can i create a new archlinux package with source code and how to modify existing one?

and finally, how to download the binary or source code for archlinux packages like :

apt download [package name]


apt source [package name]

in debian or ubuntu package manager?


Arch Linux packages are built with makepkg tool. In order to build a package from scratch you need to create a PKGBUILD file which defines package metadata and build steps. This file is essentially a Bash script.

A very basic PKGBUILD file could look like this:

pkgdesc="Notify all users with X sessions about available updates with a popup."
depends=('libnotify' 'python')

package() {
    cd "$pkgname"
    mkdir -p $pkgdir/usr/bin
    install -D -m755 ./updates.py $pkgdir/usr/bin/$pkgname

It creates a package which installs updates.py file into /usr/bin directory.

For more information see ArchWiki page, which describes in depth how Arch Linux packaging works and how to properly build a package.

There is also an ArchLinux User Repository (AUR) which contains PKGBUILD files created by users. You can choose a package and click view PKGBUILD to get better idea how others write their PKGBUILD files.

You can use pacman to download a package:

pacman -Sw <package_name>

This will download a package with all its dependencies into /var/cache/pacman/pkg.

For more information on using pacman you can also check out corresponding ArchWiki page.

  • You are welcome! Feel free to upvote or "accept" the answer (checkmark on the left) if it answered the question. – zoresvit Dec 1 '16 at 2:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.