• Create a personal list of apps (a meta package)!


    Do you have several Antergos machines, but their apps are not the same?
    Would you like to to have the same apps on all your machines? Including virtual machines?
    So you find it hard to have your favorite apps easily installed?

    There’s an answer: meta packages!

    Meta packages are simple definitions of a list of packages. They are easy to create, mainly list the apps you’d like to install in a PKGBUILD file and create a meta package with a single command.

    The PKGBUILD file is very simple a bash file with a certain format. The following example shows what you need to write in your PKGBUILD file:

    # Contents of a PKGBUILD example file.
    # Comments start with a '#' character (and end on the same line).
    
    pkgname=my-meta-package   # give a desired name here
    pkgver=1.0                # version info
    pkgrel=1                  # additional version info
    pkgdesc='My meta package' # simple description
    url='http://www.antergos.com' # give a web address
    arch=('any')              # architecture, 'any' will do
    license=('GPL3')
    
    depends=(                 # Here's YOUR list of apps! This is just an example.
            # Useful stuff
            atril
            audacity
            avidemux-qt
            clamav
            code
            diffuse
            dkms
            emacs
            encfs
            gufw
            gparted
            kaffeine
            linux-headers
            linux-lts
            linux-lts-headers
            meld
            qterminal
            rcs
            simple-scan
            solaar
            terminator
            thunderbird
            unison
            yay
    
            # The following apps are from my repos.
    
            # antergos-maur
            bashdb
            ccrypt
            inxi
    
            # antergos-mup
            downgrade
            dropbox-latest
            yad
    
            # antergos-m
            antergos-customcfg
            remirror
    )
    

    Note that the PKGBUILD above may not be directly suitable for you, so modify it as you wish.

    When you have a great PKGBUILD file, you can make it a package with this terminal command:

    makepkg
    

    You need to be in the same directory as the PKGBUILD file.

    Note that when running makepkg you probably get (many) error messages like:

    $ LANG=C makepkg
    ==> Making package: my-meta-package 1.0-1 (Sun May 12 21:56:57 2019)
    ==> Checking runtime dependencies...
    ==> Missing dependencies:
      -> atril
    ==> Checking buildtime dependencies...
    ==> ERROR: Could not resolve all dependencies.
    

    That simpy says you haven’t installed those packages yet. To solve it, install the missing dependencies (or modify your PKGBUILD!) and try again.

    When makepkg finishes successfully, you have the meta package:
    my-meta-package-1.0-1-any.pkg.tar.xz

    If you have only
    my-meta-package-1.0-1-any.pkg.tar

    you can create the final package with command

    xz my-meta-package-1.0-1-any.pkg.tar
    

    Once you have the meta package, you can install it with

    sudo pacman -U /path/to/my-meta-package-1.0-1-any.pkg.tar.xz
    

    on any Antergos machine you have. It will install the depedencies (= your apps!) too, if not yet installed.

    Tip: note that you can create many different meta packages for different purposes. Simply copy the PKGUILD file to a different folder, change the pkgname and modify the apps list.

  • @manuel
    Nice one! Seems easier to install all packages a person like using meta package than using a .txt file… Off course needs a constant update since we’re always discovering new packages and abandoning some (just like a .txt file needs update too).

    I’ll give it a try soon!

    Thanks for this!

  • @fernandomaroto
    Yeah, and the meta package manages the dependencies automatically too.

    It is actually quite amazing what can be done with the PKGBUILD files… Like creating a totally personalized installation.

  • @manuel

    And if you:

    Add post_install function at .INSTALL when creating PKGBUILD of metapackages

    something like
    post_install() {
    pacman -Rdd metapackage
    }

    Would this way install all necessary packages and uninstall meta_package automatically?

  • @manuel I’ve been thinking about it for months, and I’m still too lazy. Maybe it’s a good idea on how to spend the Sunday evening? :)

  • you have to review it carefully, is not you must over bloath the meta files… ?

  • As long as we find an elegant (and invisible) way to handle the metapackage after installing something, then metapackages won’t be a beast to be afraid of.

  • @fernandomaroto said in Create a personal list of apps (a meta package)!:

    … afraid of.

    yes needs only someone (some intelligence human or not) to take care that deps can be fulfilled …

package7 personal2 meta1 Posts 9Views 122
Log in to reply
Bloom Email Optin Plugin

Looks like your connection to Antergos Community Forum was lost, please wait while we try to reconnect.