This section describes the package system introduced in the Dragora 2.x series.
Dragora's package system was written from scratch making use of the features and advantages of the command language interpreter Bash. It is simply called "pkgsystem".
It contains the command line tools to build, install, remove and upgrade software packages. The files format have the .tlz extension and they use GNU tar for the packaging and Lzip as the compression format in the package redistribution.
The main command of the package system is called `pkg'. It is nothing more than a wrapper to execute the command line tools that belong to the list of commands of pkg.
Within each package - besides the system programs - includes a description in English and Spanish that can be shown on screen at the time of installing or updating the packages.
The format of the package system's database is maintained on plain text files.
Currently, by default, Dragora's package system does not offer automatic dependency resolution, since that would need more code and, in some cases, require complex algorithms. Those are more prone to failure than to resolution.
In summary, we want to refer to the package system as something simple, well done. Something that gives the control and the power to the user. We invite you to read about its usage in the paragraphs below.
To install one or more packages we will use the command `pkg' followed by action we want to perform, in this case add. For instance:
# pkg add pidgin-2.7.11-i486-1.tlz
Installing multiple packages
# pkg add ktsuss-1.4-i486-1.tlz icewm-1.3.7-i486-1.tlz gimp-2.6.11-i486-1.tlz
Installing a package that had been previously installed
# pkg add --force pidgin-2.7.11-i486-1.tlz
- The option -f or --force in add overwrites an installed package.
Inspecting the content of a package
# pkg add --warn xterm-270-i487-1.ltz
- The option -w or --warn in add warns about the files and directories that will be installed or overwritten by the system.
Removing one or more installed packages is fairly easy. To do it, we combine `pkg' with remove.
Removing a package by name
# pkg remove pidgin
It is not necessary to specify the complete name or path of the package. remove can interpret the segments of the name of the package.
Removing a package by name and version
As you can see, with two segments it is possible to remove a package:
# pkg remove pidgin-2.7.11
Removing multiple packages
# pkg remove pidgin ktsuss-1.4 icewm gimp
Inspecting the content that would be removed:
# pkg remove --warn xterm
Removing a package getting rid of the output messages
By default, remove shows the output of what it is removing (files, directories and symbolic links). It's possible to get rid of these messages using the option --quiet:
# pkg remove --quiet xterm
- Use the option -q or --quiet in remove only if you know what you're doing.
# pkg upgrade pidgin-2.8.1-i486-1.tlz
Upgrading many packages
# pkg upgrade ktsuss-1.5-i486-1.tlz icewm-1.3.9-i486-1.tlz gimp-2.8.0-i486-1.tlz
- Just like with add, upgrade requires the complete path or name of the package for it to work.
Upgrading a previously upgraded package
# pkg upgrade -f pidgin-2.8.1-i486-1.tlz
Install a non-installed package, upgrading
# pkg upgrade -i ironsword-6.6.6-i486-1.tlz
- It is possible to install one or more (non-installed) packages on an upgrade.
Upgrading with details
# pkg upgrade -v pidgin-2.8.1-i486-1.tlz
- The option -v activates the verbose mode. This, at most, shows the output of remove.
# pkg upgrade -v -f pidgin-2.8.1-i486-1.tlz
- It forces the upgrade showing in detail what's being removed.
Checking the size
To see the size of the packages we use size. For instance, we type:
# pkg size pidgin-2.7.11-i486-1.tlz
And we get:
Package = pidgin-2.7.11-i486-1.tlz Compressed size = 7.1M Uncompressed size = 36M
- size can accept multiple packages.
The debugging is done through erupt, which decompresses and unpackages the package file, resetting its permissions.
Uncompressing with erupt for debugging purposes:
# pkg erupt xterm-270-i486-1.tlz
If a directory is not specified, erupt decompresses the package in the present working directory. If one is specified, see what happens:
# mkdir /tmp/erupt-xterm # pkg erupt xterm-270-i486-1.tlz /tmp/erupt-xterm
A directory named "erupt-xterm" has been created in t "tmp" directory, and then erupt was called specifying the target directory (/tmp/erupt-xterm) using erupt, where the package was decompressed for debugging purposes.
The following is a description of the directory structure of the database:
|/var/db||Default directory of the database.|
|/var/db/pkg/pre-post||Directory for the pre-post instalation files.|
|/var/db/pkg/post-install||Directory for the post-installation files.|
|/var/db/pkg/description||Directory that contains the descriptions of the packages.|
|/var/db/pkg/removed||Secondary hierarchy where the removed files and directories reside.|
|/var/db/pkg/removed/pre-post||Removed files of pre-post instalation.|
|/var/db/pkg/removed/post-install||Removed files of post-instalation.|
|/var/db/pkg/removed/description||Removed description files.|
There are two important environment variables for add, remove and upgrade. They are:
Indicates the directory where the parts of the database reside, by default: /var/db.
Root variable that can be used to install, remove or upgrade one or more packages in a previously mounted partition. For instance:
# ROOT=/mnt/hd pkg add xterm-270-x86_64-1.tlz