[poldek home]

4. Managing packages

poldek operates in two basic modes - the first one is more generic and compliant with rpm (poldek command) and second interactive mode with simplified and more intuitive command set.

Interactive mode is available from both command line (ipoldek command) and shell like interface with auto-completion and history. To enter shell interface execute ipoldek without any "command" options like "install", "erase", etc. See also an example.

4.1. Specifying packages

Packages can be specified in five ways:

  • as package Name[-[Epoch:]Version-Release] mask, e.g.

    $ poldek ... apache
    $ poldek ... apache-1.3.31-2
    $ poldek ... apache-2:1.3.31-2
    $ poldek ... 'apache-1.3*'
    $ poldek ... 'apache-mod_*pam*'
         

  • as packages files, e.g:

    $ poldek ... apache-1.3.31-1.i386.rpm
         

  • as Name#Version[-Release] string, e.g.:

    $ poldek ... apache#1.3.31
    $ poldek ... apache#1.3.31-1
         

  • by package capability (Provides):

    $ poldek ... --caplookup webserver
    $ poldek ... --caplookup smtpdaemon
         

    --caplookup is available in command line mode only.

  • as list read from file, e.g.:

    $ poldek ... --pset ~/.package-sets/tiny-system
    $ poldek ... --pset http://foo.bar.com/package-sets/tiny-system.txt
         

    Syntax of file passed as --pset argument is very simple. Each package is specified in separated line in following syntax:

         NAME [EVR] | @VIRTUAL [DEFAULT_NAME [DEFAULT_EVR]]
         

    '@' specifies virtual package. Hashed lines are treated as comments. Example:

    FHS 2.1 
    basesystem
    pdksh
    @bootloader lilo 2.1
    @smtpdaemon exim
         

    --pset is available in command line mode only.

4.2. Installing packages

To install packages in rpm sense, i.e. do not upgrade even if older version is already installed:

$ poldek  [OPTION..] --install                 (rpm mode)
$ ipoldek [OPTION..] install -IN               (interactive mode)

It is useful when installation of multiple instance of package is needed (kernel for example). Example:

$ poldek -iv kernel-2.6.11 
Processing dependencies...
There are 1 package to install:
I kernel-2.6.11-2
Need to get 13.4MB of archives (13.4MB to download).
After unpacking 15.2MB will be used.
Retrieving ac::kernel-2.6.11-2.i686.rpm...
.............................. 100.0% [13.4MB (2M/s)]
Executing sudo /bin/rpm --install -vh --root / --noorder...
Preparing...                ########################################### [100%]
   1:kernel                 ########################################### [100%]

To install package or upgrade it if older version is already installed:

$ poldek  [OPTION..] --upgrade                 (rpm mode)
$ ipoldek [OPTION..] install                   (interactive mode)

This is most used installation type. Example:

$ ipoldek install vim
Loading [pdir]ac...
10998 packages read
Processing dependencies...
vim-6.2.479-1 obsoleted by vim-6.3.067-1
vim-6.3.067-1 marks vim-rt-6.3.067-1 (cap vim-rt = 4:6.3.067-1)
  vim-rt-6.2.479-1 obsoleted by vim-rt-6.3.067-1
    greedy upgrade gvim-gtk-6.2.479-1 to 6.3.067-1 (unresolved vim-rt = 4:6.2.479-1)
      gvim-gtk-6.2.479-1 obsoleted by gvim-gtk-6.3.067-1
    greedy upgrade vim-ispell-6.2.479-1 to 6.3.067-1 (unresolved vim-rt = 4:6.2.479-1)
      vim-ispell-6.2.479-1 obsoleted by vim-ispell-6.3.067-1
There are 4 packages to install (3 marked by dependencies), 4 to uninstall:
I vim-6.3.067-1
D gvim-gtk-6.3.067-1, vim-ispell-6.3.067-1, vim-rt-6.3.067-1
R gvim-gtk-6.2.479-1, vim-rt-6.2.479-1, vim-6.2.479-1, vim-ispell-6.2.479-1
Need to get 4.5MB of archives (4.5MB to download).
After unpacking 14.0MB will be used.

Retrieving ac::vim-ispell-6.3.067-1.i686.rpm...
.............................. 100.0% [526.3K (56.4K/s)]                      
Retrieving ac::vim-6.3.067-1.i686.rpm...
.............................. 100.0% [518.0K (62.5K/s)]                      
Retrieving ac::gvim-gtk-6.3.067-1.i686.rpm...
.............................. 100.0% [679.2K (69.1K/s)]                      
Retrieving ac::vim-rt-6.3.067-1.i686.rpm...
.............................. 100.0% [2.9M (56.4K/s)]                       

Executing sudo /bin/rpm --upgrade -vh --root / --noorder...
Preparing...                ########################################### [100%]
   1:vim-rt                 ########################################### [ 25%]
   2:gvim-gtk               ########################################### [ 50%]
   3:vim                    ########################################### [ 75%]
   4:vim-ispell             ########################################### [100%]

To upgrade packages, i.e. install only if older version is already installed:

$ poldek  [OPTION..] --upgrade --fresh         (rpm mode)
$ ipoldek [OPTION..] upgrade                   (interactive mode)

Example:

$ poldek -uvF 'apache*'

To upgrade all packages need upgrade --upgrade-dist can be used, or, in interactive mode '*' may be specified as package mask. Examples:

$ poldek -v --upgrade-dist

$ ipoldek -v upgrade '*'    
$ ipoldek -v install -F '*' (the same, "upgrade" is just an alias for "install -F")

4.3. Installation system from a scratch

poldek can be used as system installer, to install system from scratch use --install-dist option. The syntax is:

$ poldek --install-dist=DIR [PACKAGE...]

All unmet dependencies will be satisfied by marking additionall packages. In this type of installation packages are installed one by one what, because of reduction of memory consumption and utilization of CPU, permits to install the system on older machines.

As example, command which installs system under /mnt/dest might looks like:

$ poldek -s ftp://foo.bar/RPMS --install-dist=/mnt/dest --pset ftp://foo-bar/package-sets/myset.txt

4.4. Removing packages

poldek removes packages with its reverse-dependent ones by default. Packages are removed in the right order following Requires(un) rpm requirements.

To remove installed packages:

$ poldek  [OPTION..] --erase                      (rpm mode)
$ ipoldek [OPTION..] uninstall [ERASE_OPTION...]  (interactive mode)

Examples:

$ poldek -e apache 
$ poldek -e kernel-2.6.11.5-3
$ poldek -e kernel-3:2.6.11.5-3
$ ipoldek uninstall kernel-2.6.11.5-3

4.5. Obtaining information about packages

Package details, both about installed and available ones can be easily accessed through interactive mode commands: ls, search and desc.

4.5.1. ls - package listing

ls like system ls, list packages in different ways. Type "ls --help" to see all available options. Output example:

poldek:/installed> ls -O *gimp*
gimp-2.0.0-1
    The GNU Image Manipulation Program
gimp-print-lib-4.2.6-1
    gimp-print library

4.5.2. search - search packages

Package repositories may be easily searched by many criteria like package description, summary, group, requirements, etc. Type "search --help" to see all available options. Syntax of command is:

search [OPTION...] PATTERN [PACKAGE...]

Where PATTERN is a glob or, with --perlre, Perl regular expression. For instance to find the packages that contains /usr/sbin/ab file:

$ ipoldek search -l /usr/sbin/ab
2 package(s) found:
apache-2.0.53-4
apache1-tools-1.3.33-4

Try to find something for audio files manipulation:

$ ipoldek search --perlre /audio.+editor/
3 package(s) found:
ecawave-0.6.1-3
piave-0.2.4-2
rezound-0.11.1-0.beta.2

4.5.3. desc - show package details

Command gives access to all package information: package description and summary, group, vendor, build time,requirements, capabilities and conflicts, full file list, etc. Type "desc --help" to see all available options. Example:

poldek:/all-avail> desc apache
Package:        apache-2.0.53-4
Summary:        The most widely used Web server on the Internet
Group:          Networking/Daemons
Vendor:         PLD
License:        Apache Group License
Arch/OS:        i686/linux
URL:            http://httpd.apache.org/
Built:          2005/03/14 22:02 at i686.ac.pld-linux.org
Size:           2.4 MB (2516798 B)
Package size:   1.0 MB (1097448 B)
Path:           http://ftp.pld-linux.org/dists/ac/PLD/i686/PLD/RPMS
File:           apache-2.0.53-4.i686.rpm
Description:
Apache is a powerful, full-featured, efficient and freely-available
Web server. Apache is also the most popular Web server on the Internet.