Overview of the ipkg package management system
ipkg (officially iPKG) is a lightweight, simplistic package management system. A package management system does just that -- it manages precompiled software which has been bundled into modular, interdependent packages.
ipkg was originally designed for embedded systems such as the iPAQ but works equally well for small Linux systems such as the LinkStation. ipkg allows for dynamic installation/removal of software packages and dependency checking, much like Debian's dpkg system. The ipkg system is being used quite successfully by several embedded Linux hacking groups such as [OpenWRT] and [NSLU2-Linux]. Documentation at the official [ipkg home page] is sparse and in some instances inaccurate. We will try to cover as much information as possible here.
- The ipkg client and libraries are relatively small
- The installed meta-data is minimal yet fully functional
- Actively maintained
- Well developed, active user base
- Limited features, e.g., extra scripts are required to set up users or groups
- Documentation is limited and often outdated or inaccurate
- Significant changes in development can cause incompatibilities between versions
- Root access is generally required to build a package and to install a package
- Limited control over owner, group, and access permissions of package contents
Client Program Name | On some platforms the ipkg client program is named ipkg-cl ipkg on the LS is controlled through a single client program, the appropriately named ipkg. It is used to install, remove, and manage packages. ipkg is capable of obtaining packages from a remote server called a [feed], similar to Debian's apt-get functionality. It can also install packages from a provided .ipk package file.
- ipkg documentation | Some ipkg commands and options are not properly documented here. This is due to the fact that ipkg in general comes without any documentation. To understand the exact working of some of the commands the study of the source code is required. Please add documentation for commands and options if you are becoming aware of their working.
The following is a list of available commands for the ipkg client:
usage: ipkg [options...] sub-command [arguments...]
Package manipulation sub-commands:
:update:Update list of available packages :upgrade:Upgrade all installed packages to latest version :install pkg:Download and install pkg (and dependencies)
- The following use of five ' in a row (end italics, start bold) triggers a bug in the wiki formater, we need to move the '.' out of the bold and use it as a separator. I have forwarded this bug to PmWiki's author
:install file.ipk: Install package file.ipk :configure [pkg]:Configure unpacked packages :remove pkg:Remove package pkg :flag flags pkg [=...=]:Flag package(s) pkg (flag=hold|noprune|user|ok|installed|unpacked (one per invocation))
:list:List available packages and descriptions :files pkg:List all files belonging to pkg :search file:Search for a package providing file :info [pkg [field]]:Display all/some info fields for pkg or all :status [pkg [field]]:Display all/some status fields for pkg or all :download pkg:Download pkg to current directory :compare_versions v1 op v2:compare versions using [=<= < > >= = << >>=]) :print_architecture:Prints the architecture :print_installation_architecture:? :whatdepends [-A] [pkgname|pat]+:List all packages that depend on pkgname :whatdependsrec [-A] [pkgname|pat]+:Variation of whatdepends? :whatprovides [-A] [pkgname|pat]+:List all packages that provide' 'pkgname :whatconflicts [-A] [pkgname|pat]+:List all packages that conflict with pkgname :whatreplaces [-A] [pkgname|pat]+:List all packages that replace pkgname
:-A:Query all packages with whatdepends, whatprovides, whatreplaces, whatconflicts :-V level:Set verbosity level to level. If no value is provided increase verbosity by one :[=--=]verbosity=level:Verbosity levels: ::%argStyle2%0:errors only ::1:normal messages (default) ::2:informative messages ::3:debug output :-f conf_file:Use conf_file as the ipkg configuration file :-conf conf_file:Default configuration file location is /etc/ipkg.conf :-d dest_name:Use dest_name as the the root directory for package installation, removal, upgrading :-dest=dest_name:dest_name should be a defined dest name from the configuration file :-o offline_root:Use offline_root as the root directory for offline installation of packages :-offline=offline_root: Use offline_root as the root directory for offline installation of packages :-verbose_wget:More wget messages
:-force-depends:Make dependency checks warnings instead of errors and install/remove package in spite of failed dependencies :-force-defaultsv:Use default options for questions asked by ipkg. This will not prevent package installation scripts from prompting :-force-reinstall:Allow ipkg to reinstall a package :-force-overwrite:Allow ipkg to overwrite files from another package during an install :-force-removal-of-dependent-packages: :-force_space:Install even if there does not seem to be enough space :-noaction:No action -- test only :-nodeps:Do not follow dependencies :-recursive:Allow ipkg to remove package and all that depend on it :-test:No action -- test only :-t tmp-dir:Specify temporary directory :[=--=]tmp-dir=tmp-dir:Specify temporary directory
Please see Articles/GeneralIpkgOnLinkstation for more information on how to use ipkg on the LinkStation.
The Configuration Files
The configuration files control the server(s) from which ipkg update and ipkg get will pull package information and packages. /etc/ipkg.conf Defines destination locations, feeds and global and proxy settings. Each line in the file is either a comment, an empty line (ignored), or consists of a configuration parameter. The following parameters are supported:
::# comment:Comments ::src feed-name feed-url:Name and location of a feed. ::dest dest-name dest-location:Installation destination name and directory. ::option name value:Configuration options. Option names are: :::%argStyle2%http_proxy:Proxy to use for HTTP connections :::ftp_proxy:Proxy to use for FTP connections :::proxy_username:Proxy user name :::proxy_password:Proxy password :::offline_root:Root for offline installation, e.g. into some flash memory.
/etc/ipkg/ feed-name.conf | There isn't any official documentation for the contents of feed-name.conf files /etc/ipkg/ feed-name.conf :Defines feed-specific settings
The software packages are contained in special .ipk files. An .ipk file is a specially constructed ar archive (previous versions of .ipk files were gzipped tar archives, like .deb files - this is a discouraged but still supported format) containing three parts:
./data.tar.gz :Contains the actual files belonging to this package, organized as they should appear after installation
./control.tar.gz :Contains a file describing the package meta-data and any installation/removal scripts for the package
/debian-binary :This file is for comparability with Debian's package system and currently is ignored by ipkg
See Articles/GeneralIpkgBuild for an in-depth discussion of the package format.