everest-logo Home About Install Packages Downloads Docs Errata Git ↗

1 - Introduction

Glacier is the package management system for Glacier. All users should be familiar with how it works.

2 - Package Indexes

On an Everest system, packages are stored in an "index", of which there are two, the system index and the user index.

The system index is located in /glacier/index, and the user index is localed in /usr/glacier/index.

When you merge a package from a repository, gpkg will retrieve the file, execute the relevant instruction sets, and store the package in the user index. syspkg will operate on the system index instead. On update, gpkg will retrieve the package from the user index and execute the relevant instruction sets. The package will then be moved back into the user index. On removal, the package will be moved to /tmp oncde the removal instructions have been executed.

3 - Repositories

Unlike most distributions, Everest installations include a copy of the package repository on the local system. Rather than downloading packages from a remote server, Glacier clones a package from the local repository.

This presents some advantages:

And also some disadvantages:

The glacier-update-pkgdb program can be used to update the local repository. This should be done regularly (at least once a week) to ensure the newest and most secure packages are available.

4 - The System Profile

An Everest installation includes a system profile. In simple terms, this is a series of environment variables and configurations that tell Glacier which packages it can install. The system profile should not change unless the user intends to migrate profiles.

The following environment variables are defined by the system profile:

The following system profiles are available:

The following system profiles are planned for the future:

5 - Included programs

3.1 gpkg

gpkg is the program most users will be interacting with. It handles the downloading, installation, and logging of packages.

3.2 syspkg

syspkg is like gpkg, except it operates on the system index, rather than the local index. End users should not use this unless instructed to.

3.3 glist

glist lists all installed packages, allowing the user to filter by name.

3.4 gquery

gquery queries information on a package.

3.5 gpc

gpc checks if the syntax of a package is correct. This can be used to troubleshoot a package refusing to install, but is mainly intended for package developers.

3.6 glacier-mkprofile

glacier-mkprofile makes changes to the system-wide profile. Users should not interact with this unless needed.

3.7 glacier-update-pkdgb

glacier-update-pkgdb syncs the local package database with the remote server. This command should be run periodically to ensure you have the most up-to-date packages.

6 - Frontends

Frontends, or wrappers, may provide additional functionality to Glacier.

WARNING:

Third party frontends and wrapper scripts are not supported. Use them at your own risk.

7 - Merging packages

5.1 Using gpkg

To merge a package from a repository:

(root)# gpkg -f pkg

For instance, to install 'vim':

(root)# gpkg -f vim

5.2 Using syspkg

Using syspkg is not recommended for end users because all changes to the global package index will be overwritten when pulling a new update.

If you understand these risks, and wish to use syspkg anyways, you are acknowledging that things may break.

To merge a package:

(root)# syspkg -f pkg

8 - Updating packages

6.1 Introduction

When merging a package into any index, the package file is retained in said index. This provides most information needed to keep track of the package, however, when updating, an updated package file will need to be downloaded. Old package files will be retained as pkgname.old.

6.2 Using gpkg

To update a package:

(root)# gpkg -u pkg

6.3 Using syspkg

As mentioned above, syspkg is intended for system development, and NOT for end users.

However, syspkg -u has some use cases for end users. These include:

To update a package:

(root)# syspkg -u pkg

9 - Removing packages

7.1 Introduction

When removing a package, the package info file is moved from the appropriate index to /tmp, and saved as pkgname.rm. This means it will be wiped after the next reboot.

7.2 Using gpkg

To remove a package:

(root)# gpkg -x pkg

If a package is a dependency for another, you will be shown the following error:

[x] Could not remove (package_name): is a dependency for (package_name)

7.3 Using syspkg

WARNING:

Removing packages that shipped with the system images WILL cause catastrophic damage. You have been warned.

If you wish to proceed anyways, you can remove a package with:

(root)# syspkg -x pkg

10 - Advanced usage

8.1 Patching packages

Patching packages is the act of editing a package file to change compile options, optimizations, etc. It is very useful if used correctly.

The officially tested and verified method for patching is as follows:

8.2 Custom package repository

If Glacier's standard package repository is not sufficient, you can use a custom one.

WARNING:

Ensure the repository you wish to migrate to supports your system profile. For example, if your profile is x86-musl, the new repository should offer packages compatible with x86-musl.

Errors will occur if this is not taken into account.

To use a custom repository once, to merge a package:

(root)# GREPO=http://some-repo.org gpkg -f repo/pkg

To make the changes persistent, change the GREPO variable in /etc/glacier.conf:

FILE: /etc/glacier.conf

export GREPO="https://some-repo.org

8.3 Compile flags

When an operation is performed on a package, 'gpkg' invokes the system's C compiler, which can take flags for compilation.

'MAKEFLAGS', 'CFLAGS', 'CXXFLAGS', and 'LDFLAGS' can be set in '/etc/make.conf'.

It is highly recommended to keep '-static' in 'CFLAGS' and 'LDFLAGS'.

8.4 Using syspkg

'syspkg' is intended for development use and not for end users. That being said, 'syspkg' can be used for fixing security vulnerabilities without pulling in a new release from git.

Note that all changes to the global package index ('/glacier/index') will be overwritten during an update, where the user invokes 'git pull' on '/'.

8.5 Whitelisting licenses

Certain license types can be whitelisted or blacklisted. This is useful for controlling which software is installed on your system.

This setting is stored in /etc/glacier.conf, in a simple Bash array. By default, it should look something like this:

FILE: /etc/glacier.conf

export GLACIER_ALLOWED_LICENSES=("GPL v3" "GPL v2" "GPL" "MIT" "BSD" "APACHE")

8.6 Services

Glacier services are small programs that can do certain tasks within Glacier, such as updating the local package database.

Services must be enabled in /etc/glacier.conf before they can be used.

FILE: /etc/glacier.conf

export GLACIER_ALLOW_SERVICES="true"

WARNING:

Services can present a security risk to your system if not used properly. Ensure you review each service, its functions, and only use services made by users you trust.

Services can be configured to run at three different times: run (when an operation is started), pkg (when a package is installed), and end (when all pending operations have finished).

Create 3 files in /etc/glacier:

(root)# touch /etc/glacier/{call-srv,pkg-srv,end-srv}

There should be a directory in /etc/glacier containing service files. If not, create it now:

(root)# mkdir /etc/glacier/services

Now you can add services to the previously created files. For instance:

FILE: /etc/glacier/end-srv

#!/bin/bash

 

GLACIER_SRV_DIR="/etc/glacier/services"

$GLACIER_SRV_DIR/update-pkgdb.hook

11 - Querying packages

9.1 Introduction

Glacier packages, in ther simplest form, are text files, containing instructions on how the package is built, who made it, what it's called, and what files it includes.

9.2 Querying files

All files belonging to a package can be listed with:

(user)$ gquery -f pkg

9.3 Querying info

Package info can be listed with:

(user)$ gquery -i pkg

12 - Writing packages

NOTE:

This section is outdated as of 9/17/2024

Reason: Glacier v4 changes the package format

10.1 Introduction

As mentioned before, Glacier packages are simply text files. This makes them very easy to write and maintain.

If you have previous experience writing PKGBUILDs for the AUR, writing Glacier packages should feel very similar.

In this page, 'nano' will be used as an example.

10.2 Metadata

Package files start with metadata, which tells Glacier who made the package, what its called, as well as other information.

Double check that all of this information is correct before submitting a package.

FILE: $(pwd)/nano

PACKAGE_NAME="nano"

PACKAGE_VER="7.2"

PACKAGE_DESC="The GNU nano text editor"

MAINTAINER="[email protected]"

LICENSE="GPL v3"

ARCH="x86"

INCLUDED_FILES=("/usr/bin/nano" "/usr/bin/rnano")

Hopefully, most of these options are self explanatory.

For INCLUDED_FILES, ensure you DON'T include documentation (manpages, etc).

10.3 Integrity information

FILE: $(pwd)/nano

SHA256SUMS="86f3442768bd2873cec693f83cdf80b4b444ad3cc14760b74361474fc87a4526"

All packages must include their checksums. When merging a package, 'gpkg' will check the provided checksum against the actual checksum of the package, and if they don't match, the operation will be cancelled.

To get the checksum of a package:

(user)$ sha256sum package

10.4 Dependency information

FILE: $(pwd)/nano

DEPENDS=("")

CONFLICTS=("")

Dependency information is extremely important. It allows 'gpkg' to install any dependencies. It also warns the user when a package conflicts with another.

This should be fairly easy to figure out. Most projects will have this listed in their README. If you're the developer, you'll probably already know the dependencies your package requires.

10.5 Source information

FILE: $(pwd)/nano

PACKAGE_SRC="https://nano-editor.org/dist/v7/nano-7.2.tar.xz

SOURCES=("nano-7.2.tar.xz" "nano-7.2"

PACKAGE_SRC shows Glacier where the sources for the program can be downloaded from.

SOURCES shows Glacier what PACKAGE_SRC downloads.

9.6 Functions

FILE: $(pwd)/nano

getsource() {}

buildpkg() {}

installpkg() {}

installpkg_system() {}

removepkg() {}

removepkg_system() {}

updatepkg() {}

updatepkg_system() {}

Inside of the brackets, enter the commands that are needed to perform each function.

Anything prefixed with "system" refers to the use of 'syspkg'.