Install Packer on Arch Linux

Packer on Arch Linux

Packer is a wrapper for Pacman that allows installing packages from Arch User Repository (AUR). Just like Yaourt it makes life easier by eliminating the need to manually compile packages available on AUR. Once the package is downloaded from git and compiled it can be installed with Pacman like any other package.

 

Install Packer

Install required dependencies.

sudo pacman -S wget git expac jshon

 

Create a temporary directory for the installation.

mkdir packer

 

Change current directory to the temporary installation directory.

cd packer

 

Download the package build script from AUR.

sudo wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=packer

 

Rename the downloaded file.

mv PKGBUILD?h=packer PKGBUILD

 

Compile the package using PKGBUILD.

makepkg

 

Install the newly created package.

sudo pacman -U packer-20150808-1-any.pkg.tar.xz

The -U option specifies a package that is not from the Pacman repositories. Check the exact name of the created package with the ls command and replace the name if needed after the -U option.

 

Navigate out of the temporary installation directory.

cd ..

 

Clean up by removing the temporary installation directory.

sudo rm -dR packer

 

Use Packer

Packer can be used to install NZBDrone / Sonarr on Arch Linux, install Emby / Media Browser on Arch Linux or many other packages available on AUR.

  • Chris A

    Hi, thanks for the guides. I am new to Linux (minor past experience) and now getting around to setting up a Pogoplug with Arch Linux already installed on it. When I follow the guide above I get this error ” Running makepkg as root is not allowed as it can cause permanent,
    catastrophic damage to your system.” when running Makepkg. Does that mean I need to create another used id besides root to proceed?

    • Hey. Since not so long ago packer can no longer be run as root and no surprise that makepkg gives an error too so yes you should create a another user. This is something you should do anyways as root should only be used for administration and system services because of security issues. Ideally you should run each non system service under it’s own username and each human user should also have their own account.

  • I use the following installation script:


    #!/usr/bin/env bash

    # packer dependencies
    sudo pacman -S git fakeroot jshon expac base-devel

    pushd
    cd /tmp
    mkdir packer
    cd packer
    wget https://aur.archlinux.org/packages/pa/packer/PKGBUILD
    makepkg
    sudo pacman -U $(ls | grep packer-)
    popd
    rm -rf /tmp/packer

    • What’s the advantage of using this script? At least in my experience once packer is installed you can forget about it 🙂

      • Yes I know it’s a “install once enjoy forever” thing but I work in multiple systems and I have several scripts that set my working environment (almost) automatically. Plus the script doesn’t care about which version of packer you built, it just searches for a file that contains “packer-” in the directory and installs it

        • Ah yes, that is useful for more than 1 machine. Is it just a bunch of scripts in a directory that get executed by another script one by one?

          • Nah, they are just a bunch of `.sh` installation scripts that are hooked in a heavily modified version of the Mathias Bynens’ dotfiles bootstrapper (depending on the OS ofc). I doubt there is a point in being more detailed in this, at least for my usecase.

  • prinny

    the guide doesnt work now, it return 404 on the wget part.

    what I did is install it via yaourt by executing this

    yaourt -S packer

    it will ask you first to edit the source, just choose no, then the rest press enter, you must be login as non-root user to install this.

    • Thanks for letting me know. I updated the post and it should work now. The link may change again in the near future though as AUR is being updated…

  • Patrick Cole

    worked great. thanks.