You are on page 1of 6

7/29/13

Dragora

Dragora
Package management
Introduction Usage Database Environment variables This section describes the package system introduced in the Dragora 2.x series.

Introduction
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.
www.dragora.org/en/files/2x/pkgm.html 1/6

7/29/13

Dragora

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.

Usage
Installing packages: 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:
#p k ga d dp i d g i n 2 . 7 . 1 1 i 4 8 6 1 . t l z

Installing multiple packages:


#p k ga d dk t s u s s 1 . 4 i 4 8 6 1 . t l zi c e w m 1 . 3 . 7 i 4 8 6 1 . t l zg i m p 2 . 6 . 1 1 i 4 8 6 1 . t l z

Installing a package that had been previously installed:


#p k ga d df o r c ep i d g i n 2 . 7 . 1 1 i 4 8 6 1 . t l z

The option -f or --force in add overwrites an installed package. Inspecting the content of a package:
#p k ga d dw a r nx t e r m 2 7 0 i 4 8 7 1 . l t z

The option -w or --warn in add warns about the files and directories that will be installed or overwritten by the system. Removing packages: Removing one or more installed packages is fairly easy. To do it, we combine `pkg' with remove. Removing a package by name:
#p k gr e m o v ep i d g i n

www.dragora.org/en/files/2x/pkgm.html

2/6

7/29/13

Dragora

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:
#p k gr e m o v ep i d g i n 2 . 7 . 1 1

Removing multiple packages:


#p k gr e m o v ep i d g i nk t s u s s 1 . 4i c e w mg i m p

Inspecting the content that would be removed:


#p k gr e m o v ew a r nx t e r m

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:
#p k gr e m o v eq u i e tx t e r m

Use the option -q or --quiet in remove only if you know what you're doing. Upgrading packages:
#p k gu p g r a d ep i d g i n 2 . 8 . 1 i 4 8 6 1 . t l z

Upgrading many packages:


#p k gu p g r a d ek t s u s s 1 . 5 i 4 8 6 1 . t l zi c e w m 1 . 3 . 9 i 4 8 6 1 . t l zg i m p 2 . 8 . 0 i 4 8 6 1 . t l z

Just like with add, upgrade requires the complete path or name of the package for it to work. Upgrading a previously upgraded package:
#p k gu p g r a d efp i d g i n 2 . 8 . 1 i 4 8 6 1 . t l z
www.dragora.org/en/files/2x/pkgm.html 3/6

7/29/13

Dragora

Install a non-installed package, upgrading:


#p k gu p g r a d eii r o n s w o r d 6 . 6 . 6 i 4 8 6 1 . t l z

It is possible to install one or more (non-installed) packages on an upgrade. Upgrading with details:
#p k gu p g r a d evp i d g i n 2 . 8 . 1 i 4 8 6 1 . t l z

The option -v activates the verbose mode. This, at most, shows the output of remove. Combining options:
#p k gu p g r a d evfp i d g i n 2 . 8 . 1 i 4 8 6 1 . t l z

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:
#p k gs i z ep i d g i n 2 . 7 . 1 1 i 4 8 6 1 . t l z

And we get:
P a c k a g e=p i d g i n 2 . 7 . 1 1 i 4 8 6 1 . t l z C o m p r e s s e ds i z e=7 . 1 M U n c o m p r e s s e ds i z e=3 6 M

size can accept multiple packages. Examining: The debugging is done through erupt, which decompresses and unpackages the package file, resetting its permissions. Uncompressing with erupt for debugging purposes:
www.dragora.org/en/files/2x/pkgm.html 4/6

7/29/13

Dragora

#p k ge r u p tx t e r m 2 7 0 i 4 8 6 1 . t l z

If a directory is not specified, erupt decompresses the package in the present working directory. If one is specified, see what happens:
#m k d i r/ t m p / e r u p t x t e r m #p k ge r u p tx t e r m 2 7 0 i 4 8 6 1 . t l z/ t m p / e r u p t x t e r m

A directory named "erupt-xterm" has been created in the "tmp" directory, and then erupt was called specifying the target directory (/tmp/erupt-xterm) using erupt, where the package was decompressed for debugging purposes.

Database
The following is a description of the directory structure of the database: Directory: /var/db /var/db/pkg/pre-post /var/db/pkg/post-install /var/db/pkg/description /var/db/pkg/removed /var/db/pkg/removed/pre-post Description: Default directory of the database. Directory for the pre-post instalation files. Directory for the post-installation files. Directory that contains the descriptions of the packages. Secondary hierarchy where the removed files and directories reside. 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.

Environment variables
There are two important environment variables for add, remove and upgrade. They are:
www.dragora.org/en/files/2x/pkgm.html 5/6

7/29/13

Dragora

DB= Indicates the directory where the parts of the database reside, by default: /var/db. ROOT= Root variable that can be used to install, remove or upgrade one or more packages in a previously mounted partition. For instance:
#R O O T = / m n t / h dp k ga d dx t e r m 2 7 0 x 8 6 _ 6 4 1 . t l z

09 August 2012, 15:50 | (GNU Free Documentation License | Validate HTML)

www.dragora.org/en/files/2x/pkgm.html

6/6

You might also like