Search⌘ K
AI Features

Manually Adjust File Locations

Understand how to modify file locations and permissions manually to meet Alpine Linux's Filesystem Hierarchy Standard. Explore using shell tools like sed and install to patch path references and correctly install files within APKBUILD scripts for custom packages.

Preface

While many packages use standardized build systems to correctly compile and install their files, some more straightforward packages don’t offer this comfort. Instead, they usually supply some sort of shell script to install files. Much like Makefiles that we explored previously, these aren’t standardized and differ for each package. Let’s approach this problem with an example.

Example package

For this example, we’ll use the following simple package. It contains one executable shell script that reads a file and prints its contents to the terminal. The executable script is installed to ...