Difference between revisions of "Opkg command options"
(→Install packages via internet) |
(→Tips and Tricks) |
||
(One intermediate revision by the same user not shown) | |||
Line 12: | Line 12: | ||
opkg update | opkg update | ||
− | |||
− | |||
=== Installation === | === Installation === | ||
Line 187: | Line 185: | ||
With following command it's possible to create a list of installed packages, and write the list in a text file. | With following command it's possible to create a list of installed packages, and write the list in a text file. | ||
− | The list with the name '''e2plugins''' can be found in the directory <code>/home/root</code>. This file can be used to show the installed packages, and reinstall the plugins after a new image was flashed. Of course you have to copy the list from the | + | The list with the name '''e2plugins''' can be found in the directory <code>/home/root</code>. This file can be used to show the installed packages, and reinstall the plugins after a new image was flashed. Of course you have to copy the list from the HOST on your computer (e.g. using [[FTP (en)|FTP]]). |
opkg list-installed *extensions* | awk '{ print $1 }' > /home/root/e2plugins | opkg list-installed *extensions* | awk '{ print $1 }' > /home/root/e2plugins | ||
Line 197: | Line 195: | ||
An other method to install multiple packages is described in the chapter [[OPKG (en)#Install multiple packages from the feeds|other interesting commands]]. But you need to know the names of the packages. | An other method to install multiple packages is described in the chapter [[OPKG (en)#Install multiple packages from the feeds|other interesting commands]]. But you need to know the names of the packages. | ||
− | opkg update && opkg install $ | + | opkg update && opkg install $packetname $packetname $packetname $packetname |
Latest revision as of 10:46, 27 January 2020
OPKG (short for Open PacKaGe Management) is a leightweight package management system for embedded systems. OPKG is a fork of IPKG.)
The package management in the shell is a powerful tool, and offers many possibilities.
This article explains how to search / install / remove packages and some more interesting commands which offers OPKG. If you want to learn all options of OPKG, enter following command in the Terminal:
opkg
Contents
- 1 Install packages via internet
- 2 Install local packages
- 3 Other interesting commands
- 3.1 Update sources
- 3.2 Upgrade Firmware
- 3.3 Chain commands
- 3.4 Install multiple packages from the feeds
- 3.5 Deinstall multiplpe packages
- 3.6 Show all available packages from the feeds
- 3.7 Show all installed packages
- 3.8 Show installed package
- 3.9 Show upgradable packages
- 3.10 Show packages page by page
- 3.11 Install packages from a website
- 3.12 Download package from the feed
- 3.13 Show package information
- 3.14 Show package dependencies
- 3.15 Show packages which require the package as dependency
- 3.16 Simulate package installation
- 3.17 Deinstall package with all dependencies
- 3.18 Set package on hold
- 3.19 Release package
- 3.20 List the compatible package architectures
- 4 Tips and Tricks
Install packages via internet
To be able to install a package, the feed defined in the /etc/opkg, should be updated. If this is not done, the installation will be terminated with the error message: Unknown package ..... Always enter the following command before installing:
opkg update
Installation
The installation of a package is done with the following command:
opkg install $package_name
Search package
There are different ways to search a package. First of all the package management offers the option search, but unfortunately this option doesn't work quite well.
opkg list | grep search_term
It's also possible to use an asterisk symbol as wildcard in the search term.
opkg list *webadmin*
Deinstallation
Removing a package is done like this:
opkg remove $package_name
Install local packages
Uupdate the package lists, this way the dependencies (if required) for the package will be resolved and installed. The command is:
opkg update
Installation of one package
Use the following command for the installation.
opkg install /tmp/$file_name_of_the_package
Installation of multiple packages
The installation of multiple packages is also easy, once all files are copied with FTP in the directory
opkg install /tmp/*.ipk
Deinstallation
The removal of a package is also done with the package name (without the version and the extention ipk) and the following command:
opkg remove $package_name
Other interesting commands
Update sources
Always update the sources before any package manipulation (e.g. installation, search, download of packages), with the command:
opkg update
Upgrade Firmware
With the following command it's possible to install all available updates for your Dreambox.
opkg upgrade
Chain commands
With two "and" symbols (&&) it's possible to chain commands. This way the second command is executed, as soon as the first is succesfully performed. The following command is very often used, to update the sources and the firmware.
opkg update && opkg upgrade
Install multiple packages from the feeds
opkg install $package_name $package_name $package_name $package_name
Deinstall multiplpe packages
opkg remove $package_name $package_name $package_name $package_name
Show all available packages from the feeds
opkg list
Show all installed packages
opkg list-installed
Show installed package
The following command can be used to search for an installed package. If the package is installed the name is shown with the version number. If no output is displayed, the package is not installed ot the name of the package is wrong.
opkg list-installed $package_name
Show upgradable packages
opkg list-upgradable
Show packages page by page
Packages can be shown with the command more
. Use the Template:Taste or Template:Taste to continue.
opkg list | more opkg list-installed | more opkg list-upgradable | more
Install packages from a website
Packages can be installed directly from a web adress, e.g. with following command.
opkg install http://www.yyy.com/zzzz/$package_name.ipk
Download package from the feed
opkg download $package_name
Show package information
opkg info $package_name
Show package dependencies
Lists packages which are mandatory for an installation.
opkg depends $package_name
Show packages which require the package as dependency
Shows the packages which have the $package_name
as required dependency.
opkg whatdepends $package_name
Simulate package installation
Loads the package and simulates the installation. Ideal to check if an installation would be performed succesfully.
opkg --noaction $package_name
Deinstall package with all dependencies
Removes a package and all installed dependencies.
opkg --autoremove $package_name
Set package on hold
Prevent an update of a package (using the flag hold
).
opkg flag hold $package_name
Release package
Release a package which is on hold
.
opkg flag user $package_name
List the compatible package architectures
Shows the content of the file /etc/opkg/arch.conf
.
opkg print-architecture
Tips and Tricks
Proxy Server
When using a Proxy Server to install packages, edit the configuration file /etc/opkg/opkg.conf
. The entries should be self explaining ;)
Unpack IPK packages
Packages can be unpacked on a home computer. With Linux no extra tools are required, for Windows users the programm 7-Zip can be used. And for MAC users BetterZIP.
Write text file with list of installed packages
With following command it's possible to create a list of installed packages, and write the list in a text file.
The list with the name e2plugins can be found in the directory /home/root
. This file can be used to show the installed packages, and reinstall the plugins after a new image was flashed. Of course you have to copy the list from the HOST on your computer (e.g. using FTP).
opkg list-installed *extensions* | awk '{ print $1 }' > /home/root/e2plugins
Install the content of the list is possible with following command. Make sure the text file is in the directory /home/root
. And of course the packages should be available on the feeds.
opkg update && opkg install $(cat /home/root/e2plugins)
An other method to install multiple packages is described in the chapter other interesting commands. But you need to know the names of the packages.
opkg update && opkg install $packetname $packetname $packetname $packetname