Template for writing scripts that create and install custom metapackages, written by Henrik Franciscus Leppä (HFL).
APT is a great package manager, but it lacks a few things:
-
It does not keep track of which packages have been installed by the user, and why.
-
In particular, there are times when you need to install packages for the sake of other packages, without the packages being coded as dependencies.
-
Being able to record why a package was installed makes it easier to keep the number of packages in check, and thus make the package list more manageable.
-
-
While there are tools to backup and restore your packages, these tools are only meant to for the entire setup, without a possibility to compartmentalize.
-
In particular, there are times when you want to install certain packages on all your computers, but others on only some.
-
Additionally this script allows the packages of multiple computers to be kept in sync with fairly little hassle.
-
This script template is meant to address these shortcomings and more.
When executed, the script based on this template:
- Ensures that PPAs listed on the script (if any) are set up.
- Creates temporary a metapackage that has the packages on the script as dependencies.
- Installs the temporary metapackage, along with its dependencies.
- POSIX-compliant shell (
/bin/sh
) - Root privileges
apt-get
commandadd-apt-repository
commandequivs-build
commandgdebi
command
Note: The script will check for the required commands itself, and install the last three if needed, so you do not have to.
- Make a copy of template and name it in the form:
install-__METAPACKAGE_NAME__-metapackage
- Open the copy using a plain text editor.
- Replace every word that starts and ends with two underscores (
__
) with something appropriate.- If you are unsure what to do, take example from the example scripts.
- Save the copy.
- Execute the copy in terminal, supplying it a root password.
- Once the metapackage has been installed, you can review it with a command in
the form:
...or using a software manager application.
apt-cache show __METAPACKAGE_NAME__
Note: List of PPAs is not necessary for the script, see
install-hfl-boinc-metapackage
for an example of a script that does not
include PPA handling.
This software and associated documentation files are licensed under the MIT License.
You are also allowed to make modified copies of template use them as you wish as long as it contains the lines:
Based on: [HFL Custom APT Metapackage Installer 1.0.0 by Henrik Franciscus
Leppä](https://github.com/henrik-leppa/hfl-custom-apt-metapackage-installer)
Automated tests are done using shUnit2 and ShellCheck.
- Install ShellCheck 0.7.0.
- Run:
./test