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
When you merge a package from a repository,
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:
Package modifications can be done easily
In the result of connection loss, Glacier can still be used
And also some disadvantages:
Security risks may surface if the repository is not kept updated or an unauthorized party makes changes to packages
The
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:
GLACIER_REPO - The repository which will be downloaded byglacier-update-pkgdb GLACIER_ARCH - The CPU's architectureGLACIER_TARGET - The compilation tripletGLACIER_SYSTEM_PROFILE - The name of the system profile
The following system profiles are available:
x86_64-musl
The following system profiles are planned for the future:
x86_64-glibc x86_64-musl-nomultilib x86_64-glibc-nomultilib
5 - Included programs
3.1 gpkg
3.2 syspkg
3.3 glist
3.4 gquery
3.5 gpc
3.6 glacier-mkprofile
3.7 glacier-update-pkdgb
6 - Frontends
Frontends, or wrappers, may provide additional functionality to Glacier.
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
If you understand these risks, and wish to use
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
6.2 Using gpkg
To update a package:
(root)# gpkg -u pkg
6.3 Using syspkg
As mentioned above,
However,
- Updating a system program WITHOUT pulling a new release from Git
- Fixing urgent security vulnerabilities
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
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
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:
- Download the package file with
gpkg -d - Edit the package file with a text editor of your choice
- Install the locally modified package with
gpkg -fl pkg
8.2 Custom package repository
If Glacier's standard package repository is not sufficient, you can use a custom one.
Ensure the repository you wish to migrate to supports your system profile. For example, if your profile is
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
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:
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.
export GLACIER_ALLOW_SERVICES="true"
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:
#!/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
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.
PACKAGE_NAME="nano"
PACKAGE_VER="7.2"
PACKAGE_DESC="The GNU nano text editor"
MAINTAINER="liamwaldron@everestlinux.org"
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
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
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
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
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'.