Table of Contents
poldek is a full-featured frontend to RPM package manager. Its core features are similar to every modern package updater like apt-get. The features include package installation, upgrading and removal with automatic dependency handling, querying/ search the package database and more.
Features
poldek is easy to learn for users familiar with rpm because the basic command line options and switches are similar in use. Apart from rpm-like command line switches, poldek provides higher level command set ("install", "upgrade", "ls", etc) quite intuitive for those who knows apt-get. A very handy shell-like interface with auto-completion and history is also provided.
poldek has been designed with efficiency and scalability in mind. The native package repository index format is optimized for storage size and loading speed. Dependency processing (dependencies, conflicts, package ordering) is significantly faster and needs less memory than rpmlib-based tools. poldek can handle 20K packages without noticable speed degradation on typical machine.
poldek's native repositories are able to update incrementally. During the update only the incremental files are transferred instead of the complete index. Such files are certainly much smaller, what drastically reduces amout of data need to be retrieved when remote repository was changed a bit.
poldek supports various types of package repositories including apt-get, yum and XML Package Metadata. See the list of supported repository types for details. Support for other types may be easily added.
Before their installation packages are divided into small groups, usually 2-10 items (depending on their reciprocal dependencies). Each group is installed separately, what ensures that unsucessful installation of one of the groups does not influence other ones. Another benefit of this separate installation is that it requires less memory and disk space than the usual one.
Out of the box FTP, HTTP, HTTPS, RSYNC and SMB are supported. This list may be easily extended to other protocols by external scripts.
FTP and HTTP are handled by built-in client designed to retrieve files over slow or unstable network connections -- if a download fails due to a network problem, it will keep trying until the whole file will be downloaded. Download resuming, timestamp checking, proxy support are implemented as well.
poldek provides functionality which helps to manage distribution repositories. Features include:
Detail reports about dependency loops, unmet dependencies, package conflicts, file sharing/conflicts, orphaned directories and missing dependencies.
Division package set to chunks to be placed on removable media with ordering according dependency tree and with priority handling.
Moving packages from one repository to another with full dependency checking.
Suppose you want to: a) use remote repository of Fedora Core 4,
b) prepare your local package directory $HOME/rpm/RPMS
to be available
to poldek.
Source configuration may be placed in your local
$HOME/.poldekrc
or global /etc/poldek/source.conf
. Whatever you choose, put there
something like:
[source] _fcurl = http://download.fedora.redhat.com # macro, just for short name = fc4 # name type = metadata # use xml metadata indexes url = %{_fcurl}/pub/fedora/linux/core/4/i386/os/ [source] name = home path = $HOME/rpm/RPMS
Fedora Core 4 index is ready, we must create one for $HOME/rpm/RPMS
:
$
poldek -nhome
--makeidx
As result several files with package data will be created under
$HOME/rpm/RPMS
.
$
poldek -nhome
--makeidx Creating pndir index of /home/me/rpm/RPMS (type=dir)... Loading [dir]home... 200..400..600..800..1000..1200..1400..1600..1652 Writing /home/me/rpm/RPMS/packages.ndir.gz...
Remember to call this command after every change of
$HOME/rpm/RPMS
's content.
poldek provides two commands: poldek with rpm-like command line interface and ipoldek with interactive mode command interface. Invoking syntax is:
$
poldek [OPTION...] [PACKAGE...]$
ipoldek [OPTION...] [COMMAND] [COMMAND_OPTION...] [PACKAGE...]
For example to install or upgrade Apache HTTP server:
$
poldek -uv apache$
ipoldek install apache
Selection of particular repositories may be done by -n
option:
$
ipoldek -n fc4 ls foo\*$
poldek -n home -uv foo-3.1-2$
ipoldek -n home -s http://foo.bar/RPMS/ install foo-3.1\*
Most used poldek command options are compliant with rpm:
--install
(-i
),
--upgrade
(-u
,-U
),
--erase
(-e
), etc. Their ipoldek equivalents
are: install -IN
(--install), install
(--upgrade)
and uninstall
(--erase). Notice that ipoldek install
command it more general -- equivalent of --install
is
install -IN
.
Extensive help is available for all commands, for poldek by using the --help
switch, for ipoldek by using the help
command and
--help
switch for individual commands:
$
poldek --help$
ipoldek help$
ipoldek install --help
ipoldek provides comfortable shell-like mode which puts you into a readline interface. To enter it, execute ipoldek without any command:
$
ipoldek -n ac Loading [pdir]ac... 10998 packages read Loading [rpmdbcache]/var/lib/rpm... 1751 packages loaded Welcome to the poldek shell mode. Type "help" for help with commands.poldek:/all-avail>
Once you are on poldek's command line, type 'help' and the rest should be, more or less, self-explanatory.
poldek:/all-avail>
help ls [OPTION...] [PACKAGE...] List packages search [OPTION...] PATTERN [PACKAGE...] Search packages get [OPTION...] PACKAGE... Download packages desc [OPTION...] PACKAGE... Display packages info install [OPTION...] PACKAGE... Install packages uninstall [OPTION...] PACKAGE... Uninstall packages cd [PATH] Change current package directory pwd Print name of current directory help Display this help alias Print defined command aliases reload Reload installed packages quit Exit poldek Type COMMAND -? for details.poldek:/all-avail>
Like other packages management tools poldek uses package repositories (sources) to obtain meta-information about available packages. Repository consist of database (package index) of package meta-data (dependencies, files, description, etc) and, of course packages itself. Various types of repositories are supported including apt-get and yum ones.
Supported repositories
Native poldek index format.
Based on tndb (cdb-like) DBM library. Consist of 3 database files: first,
packages.ndir
with essential package meta-data,
second packages.ndir.dscr
with with common (BuildHost,
Distribution, etc) and "C" package descriptions and third,
packages.ndir.dscr.i18n
with all non-English descriptions
(if any)
XML Package Metadata format
Native apt-get and other tools (urpmi AFAIK) index format. Consist of one file (pkglist.%{repository}.bz2, hdlist) with raw, often cut down, RPM package headers.
Aliases: apt
Native yum index format. Consist of one file with list of packages IDs and directory of *.hdr files with raw RPM package headers.
Native poldek index format prior to 0.20 version. Based on custom binary format. Consist of one database file (packages.dir) with all needed package header data.
Dynamic index built by scanning directory with a bunch of packages in it, no indexing required.
Native poldek repositories 'pndir' and 'pdir' have “incremental updates” feature consist in creation of package index delta files with differences between already created and previous package index. Deltas are used later to perform update of local indexes what noticeably reduces amout of data downloaded. In the other words, when repository was changed by adding a few packages, only information about those few packages will be retrieved on update (see Update subsection).
Although repositories can be specified directly at command line, they are usually configured. Every repository has its own configuration section “[source]”, for example:
[source] type = pndir # package index type name = distro # name of the source path = http://my-favourite-distro.org/1.0/RPMS/ # path signed = yes # verify package signatures [source] type = pndir name = distro-updates path = http://my-favourite-distro.org/1.0/updates/ signed = yes [source] type = dir name = home path = ${HOME}/rpm/RPMS auto = no # load on demand only
type
is not obligatory - if not set, then type is
taken from default index type
configuration option value.
For all possible source configuration and extensible option description
see Configuration and
and *source.conf
files supplied with poldek.
poldek is can read apt-get's
/etc/apt/sources.list
directly.
It is controlled by load apt sources list
, to load apt's
sources do:
load apt sources list = yes
poldek loads all configured repositories at startup
Executed without repository selection options poldek
loads all configured repositories at startup, except they which have
auto
turned off.
To use particular repositories use --sn
(-n
) option, for example, to use only home
source, do:
$
poldek -n home
Repository name can be also a glob, to use all sources with “distro” prefix, do:
$
poldek -n distro\*
Non configured repositories can be specified directly at command line
by --source
(-s
) option.
The syntax is:
$
poldek [--st=TYPE] --source=SOURCEPATH [--prefix=PATH]
where TYPE is one of index supported types, and SOURCEPATH is
the path or URL of repository. If package index and packages
are located in different paths/URLs then --prefix
can
be used to point packages location. Examples:
$
poldek -s ~/rpm/RPMS$
poldek --st pdir -s ftp://foo.bar.org/RPMS/$
poldek -s ftp://foo.bar.org/RPMS.index/ --prefix ftp://foo.bar.org/RPMS/$
poldek -s /tmp/packages.ndir.gz --prefix /media/cdrom
To resynchronize the package index from its repository use
--update
(--up
) or
--update-whole
(--upa
):
$
poldek [-s PATH] [-n NAME] --update$
poldek [-s PATH] [-n NAME] --update-whole
With --update
program looks for an index delta files which
can be used to update local package index. If they are unavailable, then whole
index is downloaded.
With --update-whole
program updates whole package index if it is
outdated. It is a good idea to run do updates regularly to keep indexes up to date.
Update requested for local repositories causes verification integrity of indexes.
Examples:
$
poldek --st pdir -s ftp://foo.bar.org/RPMS/ --up$
poldek -s ftp://foo.bar.org/RPMS.index/ --prefix ftp://foo.bar.org/RPMS/ --upa$
poldek -n home --up
To list all configured repositories use
--sl
(-l
):
$
poldek -l
distro http://my-favourite-distro.org/1.0/RPMS/ (sign,type=pndir)
distro-updates http://my-favourite-distro.org/1.0/updates/ (sign,type=pndir)
home /home/me/rpm/RPMS/ (noauto,type=dir)
To list all available repository types, use --stl
:
$
poldek --stl
dir r-- Dynamic index built by scanning directory for packages
(aliases: rpmdir)
hdrl r-u File with raw RPM package headers; used by apt-rpm
(aliases: apt)
pdir rwu Native poldek's index format prior to 0.20 version
(aliases: pidx)
pndir rwu Native poldek's index format
rpmdb r-- RPM package database
yum r-u Yum index format
Legend: r - readable, w - writeable, u - updateable
Creation of poldek's repositories is quite simple, the syntax is:
$
poldek -s PATH --mkidx[=PATH] [--mt=TYPE[,TYPE]...] [--nodesc] [--nocompress] [--nodiff]$
poldek -n NAME --mkidx[=PATH] [--mt=TYPE[,TYPE]...] [--nodesc] [--nocompress] [--nodiff]
what creates package index of repository specified by -n
or -s
and saves it under directory specified by --mkidx
(a package directory by default). Type of created index is the same
as specified by default index type
configuration option.
To make index of the other type or make many indexes of different types at once, use
--mt
option.
For 'pndir' and 'pdir' indexes delta files are created if previous repository index
is different from currently created one. Outdated deltas are automatically removed.
To skip deltas creation use --nodiff
option.
Other related options are: --nodesc
with that package descriptions are not saved to repository index and --nocompress
means that uncompressed index will be created.
Examples:
$
poldek -s ~/rpm/RPMS --mkidx --nodiff$
poldek -s /cdrom/RPMS --mkidx=/tmp$
poldek -n home --mkidx$
poldek -n pld --mkidx --mt=pdir,pndir
By default only package index files are cached. To cache packages too, i.e. keep
them even after successful installation, set keep downloads
configuration option. Default cache directory is
$HOME/.poldek-cache
,
it can be set to different location by cachedir
configuration option. Cached files can be removed by three options:
--clean
remove source index files
--clean-pkg
remove cached packages.
--clean-whole
remove all files from cache directory
In conjunction with -n
or -s
cleannig
may be limited to files belongs to specified repositories only. Examples:
$
poldek -s http://foo.bar/RPMS --clean$
poldek -n foo --clean-whole$
poldek --clean-pkg
poldek operates in two basic modes - the first one is more generic and compliant with rpm (poldek command) and the second, called interactive mode with simplified and intuitive command set.
Interactive mode commands 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.
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.
To install packages in rpm sense, i.e. do not upgrade even if older version is already installed:
$
poldek [OPTION..] --install (command line 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 or upgrade package if older version is already installed:
$
poldek [OPTION..] --upgrade (command line 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 (command line 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")
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. Packages are installed one by one what reduces memory consumption and CPU utilization of CPU and 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
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 (command line 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
Package details, both about installed and available ones can be easily accessed through interactive mode commands: ls, search and desc.
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
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
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.
Although there is not known security problems, it is strongly recommended to use poldek as an ordinary user and use the root privileges for package installation and removal only. It is possible in two ways with help of sudo command.
use sudo
configuration opinion causes
execution of rpm binary through sudo for read-write operations.
The rest works without super user privileges.
Of course it is necessary to configure sudo to allow the user to run rpm binary.
use sudo
is set to "auto" by default, means that
rpm is executed through sudo
when poldek is run by an ordinary user.
There is more automated way of using sudo. Configured by runas
option poldek will automatically switch to an ordinary user if detects being
executed by root. To setup this scenario, set runas
option:
runas = poldek
and configure “poldek” user account. There is
poldekuser-setup.sh
script
which automates user account configuration supplied with poldek.
poldek can be useful for distribution developers and maintainers by make detailed reports about package set consistency, automating move packages from one repository to another and helping to generate CD/DVD ISO images.
poldek can do reports about package set consistency: dependency loops,
unmet dependencies, conflicts between packages, orphaned directories
and missing (not the same as unmet) dependencies. Reports are accessible through
--verify
(-V
) switch with report type as argument.
Avaialble reports:
This report allows to verify if package set contain any unsatisfied dependencies
and requirements (PreReqs) loops (loop makes impossible to
install packages in the right order). This report is called deps
and it is the default one, so it is accessible through --verify
without an argument. Output example:
$
poldek -n home --verify
Verifying dependency loops...
error: PreReq loop: pam <- coreutils <- pam <- SysVinit
error: PreReq loop: xinitrc <- XFree86 <- xinitrc
2 prerequirement loops detected
Verifying dependencies...
error: docbook-utils-0.6.13-7: req perl(Getopt::Long) >= 2.01 version mismatch
eog-2.8.2-1: req libexif.so.10 not found
error: ruby-gnome2-0.11.0-2: req ruby-rbogl not found
3 unsatisfied dependencies found
Report prints all package pairs being in conflict or being obsoleted one another. It lets to verify if all conflicts are needed, what are redundant, and so on. Report is called conflicts. Output example (Obsoletes are printed with asterisk '*'):
$
poldek -n foo --verify=conflicts
Verifying conflicts...
bind-9.2.5-2 -> *maradns-1.1.30-1, *dnsmasq-2.19-1, *pdnsd-1.1.8b1-0.par8.2
maradns-1.1.30-1 -> *bind-9.2.5-2
login-2.12-15 -> *heimdal-login-0.6.3-2
pdnsd-1.1.8b1-0.par8.2 -> *maradns-1.1.30-1, *maradns-zoneserver-1.1.30-1
shadow-4.0.4.1-3 -> pwdutils-2.6.90-3
Report prints all package pairs being in conflict on file level and pairs which share the same file. It lets to verify if all file conflicts are wanted. Report is called file-conflicts:
$
poldek -n foo --verify=file-conflicts
Path: /usr/lib/perl5/vendor_perl/5.8.0/i686-pld-linux-thread-multi/Image
shr perl-base-5.8.6-3(D m40755 s4096) - ImageMagick-perl-6.1.8.9-1(D m40755 s4096)
Path: /var/log/archiv/mail
cnfl syslog-ng-1.6.6-2(D m40755 s4096) <-> zmailer-2.99.56-4(D m40750 s48)
Path: /usr/bin/digest
cnfl perl-XMLDigest-0.1-1(F m100755 s1418) <-> nss-tools-3.1-1(F m100755 s32964)
'<' and '>' mean missing explicit conflict between packages.
Report prints all directories without an owner, i.e. directories not explicit included in packages (a %files section of RPM spec file). In proper package distribution set such directories should not happened. Orphans are created with root's umask and they later cannot be verified by rpm.
Report is called file-orphans:
$
poldek -n foo --verify=file-orphans
error: /etc/X11/dm: orphaned directory from gdm-2.4.4.5-1, gnome-session-2.4.0-1
error: /var/games/phantasia: orphaned directory from bsd-games-2.16-2
Report helps to avoid rather subtle packaging bugs when one package has files in directories owned by other package which is not requied by the first one.
Report is called file-missing-deps:
$
poldek -n foo --verify=file-missing-deps
GConf-1.0.9-11: /etc/gconf: not in required packages (missing Requires: gnome-utils?)
cups-1.1.19-13: /etc/logrotate.d: not in required packages (missing Requires: logrotate?)
Some or all of above reports may be requested at once, --verify
can be fed by comma separated report list, for example:
$
poldek -n foo --verify=deps,file-orphans,file-missing-deps
Package subset can verified too. If it is not desirable to verify whole repository, just give to poldek package list you want to verify:
$
poldek -n foo --verify=deps --pset=packages-minicd.txt$
poldek -n foo --verify=deps glibc poldek
poldek can partition package set for the purpose of placing it on removable media like DVD or CD. Package set is divided in the way that minimize needs of disk changes, i.e if distribution packages fits on 3 CDs, then only 2 changes of CD disk are necessary during installation system from a scratch. The invoking syntax is:
$
poldek --split=SIZE[:FIRST_FREE_SPACE] [--priconf=FILE] [--split-out=PREFIX]
Where SIZE is a size of the chunk in megabytes. Optional FIRST_FREE_SPACE makes the first chunk FIRST_FREE_SPACE MB smaller, useful to save space for installer for example.
Packages are placed in successive chunks in order of their
installation. To reorder packages moving some to higher or lower chunk,
especially on first/ last one, priorities may be assigned to
them. Package priorities are taken from file given by --priconf
.
Format of this file is quite simple, see sample
poldek-pri-sample.conf
supplied with poldek.
Each chunk is written as NAME-EVR.ARCH.rpm
list to
PREFIX.XX file, the default PREFIX
is “packages.chunk”.
A typical scenario during distribution development looks like there is repository for untested packages from where they periodically, when found to be tested enough, are moved to the another repository marked as stable branch.
poldek can help movig packages between repositories through “to repository” installation, i.e. packages are copied from source to destination repository with full dependency checking. Thus this feature allows to move subtree of packages from one repository to another without a risk of break dependencies. The syntax is:
$
poldek ... --dn SOURCE_NAME [--dn SOURCE_NAME] ...
Where SOURCE_NAME is a name of destination repository to which we want to move packages, for example:
$
poldek -n ac-test --dn ac -uv libselinux
Loading [pdir]ac-test...
1161 packages read
Loading [pdir]ac...
Processing dependencies...
libselinux-1.18-1 obsoleted by libselinux-1.22-1
greedy upgrade libselinux-devel-1.18-1 to 1.22-1 (unresolved libselinux = 1.18-1)
libselinux-devel-1.18-1 obsoleted by libselinux-devel-1.22-1
greedy upgrade libselinux-static-1.18-1 to 1.22-1 (unresolved libselinux-devel = 1.18-1)
libselinux-static-1.18-1 obsoleted by libselinux-static-1.22-1
greedy upgrade libselinux-utils-1.18-1 to 1.22-1 (unresolved libselinux = 1.18-1)
libselinux-utils-1.18-1 obsoleted by libselinux-utils-1.22-1
There are 4 packages to install (3 marked by dependencies), 4 to uninstall:
I libselinux-1.22-1
D libselinux-devel-1.22-1, libselinux-static-1.22-1, libselinux-utils-1.22-1
R libselinux-1.18-1, libselinux-devel-1.18-1, libselinux-static-1.18-1, libselinux-utils-1.18-1
Need to get 153.9KB of archives (153.9KB to download).
rm /home/ftp/pub/ac/libselinux-1.18-1.i686.rpm
rm /home/ftp/pub/ac/libselinux-devel-1.18-1.i686.rpm
rm /home/ftp/pub/ac/libselinux-static-1.18-1.i686.rpm
rm /home/ftp/pub/ac/libselinux-utils-1.18-1.i686.rpm
cp libselinux-utils-1.22-1.i686.rpm /tmp/RPMS/libselinux-utils-1.22-1.i686.rpm
cp libselinux-static-1.22-1.i686.rpm /tmp/RPMS/libselinux-static-1.22-1.i686.rpm
cp libselinux-devel-1.22-1.i686.rpm /tmp/RPMS/libselinux-devel-1.22-1.i686.rpm
cp libselinux-1.22-1.i686.rpm /tmp/RPMS/libselinux-1.22-1.i686.rpm
Removing packages from repositories in that safe manner is also possible:
$
poldek --dn ac -e poldek
mark poldek-0.18.8-3
Processing dependencies...
poldek-0.18.8-3 marks libpi-0.1.1-1 (req poldek)
libpi-0.1.1-1 marks libpi-devel-0.1.1-1 (req libpi = 0.1.1-1)
libpi-0.1.1-1 marks pacman-0.1-3 (req libpi)
poldek-0.18.8-3 marks poldex-0.17.4-1 (req poldek)
There are 5 packages to remove (4 marked by dependencies):
R poldek-0.18.8-3
D libpi-0.1.1-1, libpi-devel-0.1.1-1, pacman-0.1-3, poldex-0.17.4-1
Proceed? [y/N]
Sometimes it is not desirable to let poldek to move packages itself. With
--test
and --parsable-tr-summary
switches
easy to parse output is produced, what allows to handle move operation by
external scripts. Example:
$
poldek --dn ac -et poldek --parsable-tr-summary
[cut]
%R poldek-0.18.8-3
%D libpi-0.1.1-1
%D libpi-devel-0.1.1-1
%D pacman-0.1-3
%D poldex-0.17.4-1
--mkidx[=PATH]
Create package index (under SOURCE-PATH by default)
--mt=TYPE[,TYPE]
Set created index type (use --stl to list available values)
--nodesc
Don't put package user-level information (like Summary or Description) into created index.
--nodiff
Don't create index delta files
--nocompress
Create uncompressed index
-s, --source=PATH
Get packages info from repository under PATH
-n, --sn=SOURCE-NAME
Get packages info from repository named SOURCE-NAME
--dn=SOURCE-NAME
Install to source SOURCE-NAME instead to the system
--st=SOURCE-TYPE
Set the source type (use --stl to list available values)
-P, --prefix=PREFIX
Get packages from PREFIX instead of SOURCE
--stl
List available source types
-l, --sl
List configured sources
--update
Update the source and verify it
--update-whole
Update whole index of source
--clean
Remove source index files from cache directory
--clean-pkg
Remove cached packages of the source
--clean-whole
Remove all files belongs to source from cache directory
--hold=PACKAGE[,PACKAGE]...
Prevent packages listed from being upgraded if they are already installed.
If option is not set then packages to hold are taken from hold
configuration option. Held package won't be upgraded with exception if it will
be pointed directly by the user.
Example:
$
poldek --hold=kernel\*,dev ...
Configuration option: hold = PACKAGE[,PACKAGE]...
--nohold
Do not hold any packages. Disables --hold settings.
--ignore=PACKAGE[,PACKAGE]...
Make packages listed invisible to the program. If option is not set then
packages to ignore are taken from ignore
configuration option.
Example:
$
poldek --ignore=kernel\*-smp\*,foo
Configuration option: ignore = PACKAGE[,PACKAGE]...
--noignore
Make invisibled packages visible. Disables --ignore settings.
-Q, --uniq
Remove package duplicates from available package list
--parsable-tr-summary
Print installation summary in parseable form
--force
Install packages ignoring broken dependencies, conflicts, etc
-t, --test
Do not install packages, but tell if it would work or not. Given once causes poldek's checks only, to perform full tests using rpm;, option must be given twice.
-F, --fresh
Upgrade packages, but only if an earlier version currently exists
-N, --nofollow
Don't install packages required by selected ones
--follow[=[yes|no]]
Install packages required by selected ones
--greedy[=[yes|no]]
Automatically upgrade packages which dependencies are broken by uninstalled ones, for example if package foo is upgraded from version 1.0 to 1.2 and package foo-devel is already installed with requirement "foo = 1.0" then foo-devel will be upgraded to version 1.2 too.
Configuration option: greedy = [yes|no]
--fetch[=DIR]
Download packages to DIR (poldek's cache directory by default)instead of install them
-r, --root=DIR
Set top directory to DIR
--nodeps
Install packages with broken dependencies
-m, --mercy
Be tolerant for unmatched versioned dependencies which rpm; tolerates, e.g. package A requires capability foo >= 1.0 while package B provides "foo" without any version. Use with care.
Configuration option: mercy = [yes|no]
--promoteepoch
Promote non-existent requirement's epoch to package's one (rpm; < 4.2.1 behaviour).
Configuration option: promoteepoch = [yes|no]
--dump[=FILE]
Print packages file names to FILE (stdout by default) instead of install them
--dumpn[=FILE]
Print packages names to FILE (stdout by default) instead of install them
--justdb
Modify only the database
--pm-nodeps
Same as --nodeps but applied to PM (rpm) only
--pm-force
Same as --force but applied to PM (rpm) only)
--pmopt=OPTION
Pass option to package manager (rpm) binary. Example:
$
poldek --pmopt=ignoreos
--pmcmd=FILE
Use FILE as PM(rpm) binary
--sudocmd=FILE
Use FILE as sudo binary
--cachedir=DIR
DIR points to directory where all downloaded files will be stored. If not set then $TMPDIR is used. If $TMPDIR is not set then $HOME/.poldek-cache is created and used as cache directory
--cmd
Run in command mode (like ipoldek does by default)
--ask
Confirm packages installation and let user choose among equivalent packages
--noask
Don't ask about anything
--shell
Run in interactive mode (default)
--skip-installed
Don't load installed packages at startup
--conf=FILE
Read configuration from FILE
--noconf
Do not read configuration
--upconf
Update remote configuration files (if any)
--version
Display program version information and exit
--log=FILE
Log program messages to FILE
--runas=USER
Run program as user USER
-O OPTION=VALUE
Can be used to give options in the format used in the configuration file. This is useful for specifying options for which there is no separate command-line flag. Whitespaces in option names may be replaced with underscore '_' or dash '-' there, for example:
$
poldek -O keep-downloads=yes
-v
Be verbose.
-q
Do not produce any output.
The file consists of directives, sections and parameters. A section begins with thename of the section in square brackets and continues until the next section begins ('ini'-like format). Sections contain parameters of the form:
name = value
The file is line-based - that is, each newline-terminated line represents either a comment, a section name or a parameter. Any line beginning with a hash (``#'') character is ignored, as are lines containing only whitespace.
In most string paramameters environment variables are expanded:
path = $HOME/foo
File can be combined from multiple configuration files with %include
directive. Either local and remote HTTP/FTP files can be included, examples:
%include /etc/foo.conf # simply include /etc/foo.conf %include foo.conf # include foo.conf from directory of includer %include http://bar.org/foo.conf # include foo.conf from remote location
Any "[global]" sections from included files are simply ignored.
Remote files are cached, they can be updated using --upconf
switch.
Second directive, %includedir
includes all *.conf files from given directory,
examples:
%includedir repos.d # include all *.conf files from repos.d subdirectory %includedir /etc/repos.d # include all *.conf files from /etc/repos.d
Simple macros are supported. Macros are declared as paramameter with underscore ('_') at beginning:
_foo = /bar
and can be expanded in any following value in %{NAME} form:
path = %{_foo}/dir # path will be '/bar/dir'
Macros are local to file beeing declared, they are not visible in included files as they are not visible to includer.
There are three section types: [global], [source] and [fetcher].
[global]
Section contains global paramameters. May be declared multiple times, in this case content of all global sections are concatenated.
[source]
This section contains poldek's repository configuration. Each section describes one repository.
[fetcher]
Configuration of external file getters. Each section declares one external downloader.
To make things simpler default configuration consists of several files.
Repositories are declared in separate source.conf
and *-source.conf
, file getters are declared in
fetch.conf
. All of them are included by
poldek.conf
.
default index type
This parameter allows to configure the default repository index type.
Default: default index type = pndir
cachedir
Cache directory for downloaded files. NOTE that parent directory of cachedir must exist.
Default: cachedir = $HOME/.poldek-cache
runas
Switch to ordinary user at startup when executed by root
Default: runas =
use sudo
Permits using root privileges for installation only. If set to "auto" then automatically turned on when poldek executed as ordinary user.
Default: use sudo = auto
load apt sources list
Load /etc/apt/sources.list
.
Default: load apt sources list = no
vfile external compress
Handle gzipped indexes externally (needed on RedHat 9 and Fedora Core 1 and 2). This option is a workaround for broken zlib linked into librpm; with enabled 'auto zlib in rpm' poldek tries to detect such case and then enables external *.gz handling automatically.
Default: vfile external compress = no
auto zlib in rpm
Auto detection of zlib linked into librpm. See 'vfile external compress' description.
Default: auto zlib in rpm = yes
autoupa
Automatically download whole index if incremental update fails.
Default: autoupa = yes
exclude path
Do not save given paths into created indexes. This option may significantly reduce index size. Example (notice missing starting '/'):
exclude path = usr/share/doc:usr/share/man:usr/src
pm command
Full path name to a PM (rpm for now) binary.
Default: pm command = /bin/rpm
sudo command
Full path name to sudo binary.
Default: sudo command = /usr/bin/sudo
File downloaders configuration
vfile ftp sysuser as anon passwd
Send ${USER}@${HOSTNAME} as anonymous FTP password (by default
'poldek@znienacka.net'
is sent)
Default: vfile ftp sysuser as anon passwd = no
default fetcher
File getters configuration parameter. By this option URL handlers may be configured. To get file from HTTP and FTP servers poldek uses its internal client (what is recommended), although it can be changedby this option. Others protocols handled by external utilities can be configured also. The syntax is:
default fetcher = PROTOCOL[,PROTOCOL...]:FETCHER_NAME
where FETCHER_NAME is a name of one of the fetcher preconfigured in [fetch]
sections (placed in fetch.conf
in default configuration).
Examples:
default fetcher = ftp,http:internal default fetcher = https:wget default fetcher = http,ftp:aria default fetcher = cdrom:vfjuggle
vfjuggle
is a cdrom getter supplied with poldek.
Default: default fetcher = http,ftp: internal
proxy
Proxies for internal FTP and HTTP client may be configured in usual way, by environment variables ftp_proxy and http_proxy, or by this option. Its syntax is similar to "default fetcher" one:
proxy = PROTOCOL[,PROTOCOL...]:PROXY_URL
Example:
proxy = http: http://w3cache.foo.org:8080
Default: proxy =
noproxy
Comma separated list of hosts or domains which will not be accessed via proxy. Option overrides no_proxy environment variable. Example:
noproxy = localhost, .pl, ftp.foo.bar.org
Default: noproxy =
vfile retries
Internal HTTP and FTP client is stubborn, it retries to retrive file if connection breaks. This option tells it how many times it should try.
Default: vfile retries = 128
Installation options
particle install
Install packages in small groups instead of doing all-or-nothing installations.
Default: particle install = yes
keep downloads
Do not remove downloaded packages after its successful installation.
Default: keep downloads = no
unique package names
Controls visibility of multiple package instances with different EVR. If on, only one, highest version will be visible.
Default: unique package names = no
promoteepoch
Epoch autopromotion during dependency comparision. RPM specific. Set it up if you are using system with rpm prior to 4.2.1 version.
Default: promoteepoch = no
confirm installation
Confirm packages installation.
Default: confirm installation = no
confirm removal
Confirm packages removal.
Default: confirm removal = yes
choose equivalents manually
Let the user select package among equivalents.
Default: choose equivalents manually = yes
hold
Prevent package listed from being upgraded if they are already installed.
hold = kernel* foo*.i686 th-test:* *-smp-* th-ready:bar*.x86_64
Default: hold =
ignore
Ignore package list - packages fits given mask will be invisible.
ignore = *-smp-* foo* ignore = vserver-packages
Default: ignore = vserver-packages
allow duplicates
Conflicts with already installed packages are treated as resolved
if at least one of multiple-installed package satisfies conflict.
rpm doesn't support such cases, so --pm-nodeps
is needed (use with
care).
Default: allow duplicates = yes
RPM specific options
rpmdef
rpm macros can be set by this option. Examples:
rpmdef = _install_langs pl:pl_PL:lt:lt_LT
Do not install any documentation:
rpmdef = _netsharedpath /usr/share/info:/usr/share/man rpmdef = _excludedocs 1
If non-zero, all erasures will be automagically repackaged.
rpmdef = _repackage_all_erasures 1
Default: rpmdef =
Dependency processing settings
Subtle dependency processing options, they should not be changed unless you know what you are doing
auto directory dependencies
RPM 4.4.6 introduces auto dependencies based on package directories. Option controls this feature.
Default: auto directory dependencies = auto
follow
Automatically install packages required by installed ones.
Default: follow = yes
greedy
Greedy upgrades, i.e. upgrade packages which dependencies are broken by being uninstalled ones.
Default: greedy = yes
aggressive greedy
Be yet more greedy; if successor of orphaned package found, and this successor drags no packages then upgrade the package instead of process its dependencies. Option value is implied by 'greedy' one by defalut.
Default: aggressive greedy = yes
mercy
Be tolerant for unmatched versioned dependencies which rpm tolerates, e.g. package A requires capability foo >= 1.0 while package B provides "foo" without any version. Use with care, it may cause weird dependency errors.
Default: mercy = no
suggests
Taking into account package Suggests.
Default: suggests = yes
obsoletes
Taking into account package Obsoletes.
Default: obsoletes = yes
conflicts
Taking into account package Conflicts.
Default: conflicts = yes
This section contains poldek's repository configuration. Every repository is configured in its own [source] section.
name
Unique name of the repository.
group
Group name of the repositories group.
type
Type of repository index. Permitted values are 'pndir', 'pdir', 'apt', 'yum'
and 'dir' as listed by --stl
switch.
original type
This parameter sets index original type i.e type of repository from what this repository is created. Default is 'dir' - means that directory of packages is scanned.
Default: original type = dir
path
Unique name of the repository. May be either path or URL.
prefix
If package index and packages are stored in different locations then prefix stands for packages path.
douniq
Controls visibility of multiple package instances with different EVR. If on, only one, highest version will be visible.
Default: douniq = no
pri
Repository priority. If the same packages (equal names and EVR) are available in more than one source then package from highest prioritized source are taken. Priority is numeric value. Lower number means higher priority, and negative priorities are allowed. Priority is numeric value.
Default: pri = 0
auto
Controling if repository index will be implicit loaded. Set it off if
the index should be loaded on demand only, i.e. if specified directly
by --sn
option.
Default: auto = yes
autoup
Controls if repository index will be implicit updated. Set it off if
the index should be updated on demand only, i.e. if specified directly
by --sn
option.
Default: autoup = yes
signed
Packages PGP/GPG signatures (if any) will be verified before their installation.
Default: signed = no
hold
Have the same meaning as [global] parameter. Example:
hold = kernel* dev
Default: hold = kernel*
ignore
Have the same meaning as [global] parameter. Example:
ignore = kernel*smp* dev
Default: ignore =
exclude path
Parameter have the same meaning as [global] parameter.
exclude path = usr/share/doc:usr/share/man:usr/src
Default: exclude path =
lang
Preferred language of package descriptions. If not set, taken from locale settings. Example:
lang = pl_PL:lt_LT
sources
Make sense for 'group' source type only. A list of names of sources.
This section contains external downloaders configuration. Each section describes one fetcher.
name
Unique name of the fetcher. This is an optional parameter, if not set then name is taken from the "cmd" parameter value as "$(basename $cmd)".
proto
Protocol or protocols supported by fetcher. Name of the protocol can be completely arbitrary, i.e. if you can handle protocol "foo" by writing a script which takes URLs in form 'foo://'.
cmd
Parameter specifies an external command and its invoking syntax. The syntax of "cmd" is:
cmd = COMMAND [ OPTION... ] {%d,%D} {%p,%P}[n]
Where COMMAND is the name or full path of command, OPTION is command specific options. Macro '%d' is replaced with cache directory, '%D' is replaced with 'cache directory/file basename', and '%p' with file basename, %P with file full path (URL). Optional suffix 'n' with %p and %P means that command can be invoked with multiple files at once.
Create an index of ~/rpm/RPMS, its type is taken from default index type
configuration option:
$
poldek -s~/rpm/RPMS
--makeidx
Create an index of configured repository home, its type is defined in configuration:
$
poldek -nhome
--makeidx
Indexes may be created for multiple repositories at once:
$
poldek -nfedora-c2
-nfedora-c2-up
--makeidx
Multiple indexes of different types may be created at once using
--mt
switch:
$
poldek -nhome
--makeidx --mt=pndir,pdir
Install from fedora-c3 repository apache and all its dependencies
under /mnt/chroot
as root directory:
$
poldek -nfedora-c3
--install-dist=/mnt/dest
-vapache
As above but packages listed in minicd.txt
is installed:
$
poldek -nfedora-c3
--install-dist=/mnt/dest
-v --pset=minicd.txt
Do not install, only download packages to /tmp
directory:
$
poldek -nfedora-c3
--install-dist=/mnt/dest
-v --pset=minicd.txt
--fetch=/tmp
Download all packages needs upgrade to /var/tmp
directory:
$
poldek -npld-updates
--upgrade-dist -v --fetch=/var/tmp
Dump filenames of packages needs upgrade to /tmp/uplist.txt
file:
$
poldek -npld-updates
--upgrade-dist -v --dump=/tmp/uplist.txt
Upgrade all packages needs upgrade with logging details to /tmp/poldek.log
file:
$
poldek -npld-updates
--upgrade-dist -v --log=/tmp/uplist.txt
Divide repository packages into 650 MB chunks, first chunk will be 100 MB smaller.
Files with lists of packages placed in chunks will be named cd.XX
:
$
poldek -npld
--split=650:100
--split-out=/tmp/cd
Loading [pdir]pld... 11600 packages read Writing /tmp/cd.00 ( 876 packages, 547.93M, pri min, max = 0, 0) Writing /tmp/cd.01 (1084 packages, 647.46M, pri min, max = 0, 0) Writing /tmp/cd.02 ( 979 packages, 649.92M, pri min, max = 0, 0) Writing /tmp/cd.03 (1454 packages, 648.44M, pri min, max = 0, 0) [cut]
Above with assigned package priorities taken from poldek-pri-sample.conf
.
$
poldek -npld
--split=650:100
--split-out=/tmp/cd
--priconf=poldek-pri-sample.conf
Loading [pdir]pld... 11600 packages read Writing /tmp/cd.00 ( 928 packages, 549.12M, pri min, max = -100, 0) Writing /tmp/cd.01 (1012 packages, 649.36M, pri min, max = 0, 0) Writing /tmp/cd.02 (1283 packages, 646.22M, pri min, max = 0, 0) Writing /tmp/cd.03 ( 650 packages, 563.60M, pri min, max = 0, 0) [cut]
# $Id$ # By default all packages have 0 priority value. Packages specified by mask # only (e.g. quota below) have -1 priority. # # MASK [PRI] quota vim postfix geninitrd kernel FHS gcc xemacs* xmms rpm poldek -100 vim-static -10 # low priorities XFree86* 10 lesstif 10 kde* 100 gnome* 100 Atari800* 200 MHonArc* 100 Glide* 100 *-devel* 2 *-static* 100