Overview of the ipkg package management system
From NAS-Central Buffalo - The Linkstation Wiki
m (→The Client) |
m (→Overview) |
||
| (9 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
| - | {{Template:Articles}}< | + | {{Template:Articles|General|Ipkg|}} |
| - | + | <small><font color=red>This article is based on original work from nix and edited by frontalot from www.linkstationwiki.org</font></small> | |
== Overview == | == Overview == | ||
| - | |||
| - | |||
''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'' (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 | + | ''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 [http://www.openwrt.org OpenWRT] and [http://www.nslu2-linux.org 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. |
=== Advantages === | === Advantages === | ||
| - | * | + | *The ipkg client and libraries are relatively small |
| - | * | + | *The installed meta-data is minimal yet fully functional |
| - | * | + | *Actively maintained |
| - | * | + | *Well developed, active user base''' |
=== Disadvantages === | === Disadvantages === | ||
| - | * | + | *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 | ||
== The Client == | == The Client == | ||
| - | Client Program Name | + | [[Image:Bar.png|frame| '''Client Program Name'''<br> On some platforms the '''ipkg''' client program is named '''ipkg-cl'''. |
| - | + | The ''ipkg'' system 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 [http://ipkg.nas-central.org/ feed], similar to Debian's '''apt-get''' functionality. It can also install packages from a provided '''.ipk''' package file.]] | |
| - | + | [[Image:Bar.png|frame| '''ipkg documentation'''<br>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: | The following is a list of available commands for the '''ipkg''' client: | ||
| Line 43: | Line 40: | ||
| - | Package manipulation sub-commands | + | === 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) | |
| - | + | ;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)) | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | (''flag''='''hold'''|'''noprune'''|'''user'''|'''ok'''|'''installed'''|'''unpacked''' (one per | + | |
| - | + | ||
| Line 63: | Line 55: | ||
| - | + | ;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'' | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| Line 86: | Line 74: | ||
| - | + | ;-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: | ||
| + | :;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 Options === |
| + | These options are used to override a decision ipkg would otherwise make on its own. | ||
| - | + | ;-force-depends:Make failed 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 [[Ipkg on the Linkstation (for end-users)]] 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: | ||
| - | '''/etc/ipkg/''' ''feed-name''.conf | + | ;<nowiki>#</nowiki> ''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: | ||
| + | :;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. | ||
| + | [[Image:Bar.png|frame| '''/etc/ipkg/'''''feed-name''.conf<br> There isn't any official documentation for the contents of ''feed-name''.conf files]] | ||
| + | ;/etc/ipkg/''feed-name''.conf :Defines feed-specific settings for the feed ''feed-name''. | ||
== The Packages == | == The Packages == | ||
| - | |||
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: | 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 [[Construct ipkg packages (for developers)]] for an in-depth discussion of the package format. |
| - | + | ||
| - | + | ||
Latest revision as of 04:22, 28 August 2011
This article is based on original work from nix and edited by frontalot from www.linkstationwiki.org
Contents |
Overview
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.
Advantages
- The ipkg client and libraries are relatively small
- The installed meta-data is minimal yet fully functional
- Actively maintained
- Well developed, active user base
Disadvantages
- 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
The Client
On some platforms the ipkg client program is named ipkg-cl. The ipkg system 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.
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)
- 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))
Informational sub-commands
- 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
Options
- -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:
- 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 Options
These options are used to override a decision ipkg would otherwise make on its own.
- -force-depends
- Make failed 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 Ipkg on the Linkstation (for end-users) 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:
- 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
- Defines feed-specific settings for the feed feed-name.
The Packages
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 Construct ipkg packages (for developers) for an in-depth discussion of the package format.

