APT (en): Unterschied zwischen den Versionen

Aus Gemini-Wiki
Zur Navigation springen Zur Suche springen
Zeile 106: Zeile 106:
  
 
== Install local saved packages ==
 
== Install local saved packages ==
Packages (e.g. skin, plugin, etc.) which are offered e.g. in the IhaD board, but are not available on the [http://en.wikipedia.org/wiki/Software_repository feed], can be installed very easily with the package management system. We won't use the [Manual_installation_of_an_.ipk_file_via_the_software_manager|Software Manager]], the [[GP3_File_Browser_(en)|GP3 File Browser]] nor the [[GP3.2_eCommander_(en)|eCommander]], but we'll install the package via [[Telnet (en)|telnet]] or [[SSH (en)|SSH]].
+
Packages (e.g. skin, plugin, etc.) which are offered e.g. in the IhaD board, but are not available on the [http://en.wikipedia.org/wiki/Software_repository feed], can be installed very easily with the package management system. We won't use the [[Manual installation of an .ipk file via the software manager|Software Manager]], the [[GP3_File_Browser_(en)|GP3 File Browser]] nor the [[GP3.2_eCommander_(en)|eCommander]], but we'll install the package via [[Telnet (en)|telnet]] or [[SSH (en)|SSH]].
  
 
{{Warnung|Beachtet bitte, dass Fremdpakete das System beschädigen können!}}
 
{{Warnung|Beachtet bitte, dass Fremdpakete das System beschädigen können!}}

Version vom 11. November 2014, 19:15 Uhr

Deutsch.png - auf Deutsch English.png - in English

APT (short for Advanced Packaging Tool) is a package management system which finds it origin in the Debian GNU/Linux operating system, and is based on the dpkg package management.

APT was introduced in the Deambox world since OE 2.2. (For dreamboxes with OE 1.6 or OE 2.0, OPKG is used.)

The package management in the shell is a powerful tool for the Dreambox, and offers far more possibilities compared to the package management with the remote control. Of course, using the remote control is easy and most of the time adequate. But maybe this article can convince you to give it a try via Telnet or SSH.


Compared to the older Package Management Systems, IPG or OPKG, there is not only one command for the manipulation of packages. Several commands are possible, e.g.:

  • apt-get - This command installs packages from the available sources. It considers the dependencies for the installed packages. Of course the can also be used to uninstall packages and many more manipulations.
  • apt-cache - This command will not change the system. It's used to analyze (e.g. search) the package cache. The cache stores the meta-data for all available packages of the software feed
  • dpkg - Is used for the manual installation / uninstall of packages. Keep in mind, dpkg is considering the dependencies during the installation / uninstall.


This article explains how to search / install / remove packages and some more interesting commands which offers APT. Additional interesting features of the commands can be obtained over the option --help.

apt-get --help
apt-cache --help
dpkg --help


Install packages from the internet

Before the installation the packages sources defined in /etc/apt/sources.list.d, need to be updated with the following command:

apt-get update
Ambox warning.png Be careful with integrating 3rd party sources. If the repository is not available, or not up to date, this can cause problems with updating the firmware, installing packages or even damage the operating system!

Installation

The installation of a package is done with the following command.

apt-get install $package_name

Replace $package_name with the correct name. E.g. if you want to install WebAdmin, the command is:

root@dm7080:~# apt-get install enigma2-plugin-extensions-webadmin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  enigma2-plugin-extensions-webadmin
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 221 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://dreamboxupdate.com/opendreambox/2.2/unstable/r0/dm7080/deb/mips32el/ ./ enigma2-plugin-extensions-webadmin 4.2.0+git25+93609ff651-r0.0 [221 kB]
Fetched 221 kB in 1s (211 kB/s)                              
Selecting previously unselected package enigma2-plugin-extensions-webadmin.
(Reading database ... 10348 files and directories currently installed.)
Preparing to unpack .../enigma2-plugin-extensions-webadmin_4.2.0+git25+93609ff651-r0.0_mipsel.deb ...
Unpacking enigma2-plugin-extensions-webadmin (4.2.0+git25+93609ff651-r0.0) ...

If additional packages are required, the installation needs to be confirmed with y. If n is pressed, the installation will be aborted. To perform the installation without confirmation, the option -y can be used, e.g.:

apt-get install -y $package_name

Now you wonder how to get the correct package name. The names can be found in the articles here in the wiki, or in the board. But you can also search with the package management system, as described below.

Ambox notice.png If the command results in an error, the package is not available on the feed (Unable to locate package...), or some required dependencies are missing.

Search package

To search a package, the command apt-cache with the option search can be used. The search term parses the package cache and checks the names and the descriptions.

apt-cache search $search_term

Filter the package search

If you know the structure of the package names for plugins, skins etc. you can use the search to get to the wanted result. The following examples of search terms might help to filter the corresponding package from the sources.

  • gemini → shows the different GP3 Addons
  • gp-skin → all available GP3 Skins
  • gp-icons → lists the different GP3 Icon packages
  • enigma2-plugin-systemplugins → lists Enigma2 system plugins
  • enigma2-plugin-extensions → shows Enigma2 addons

Deinstallation

The deinstallation of a package, can be done with the following command.

apt-get remove $package_name

The $package_name must be the correct name. E.g. if you want to remove WebAdmin, the command is:

root@dm7080:~# apt-get remove enigma2-plugin-extensions-webadmin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  enigma2-plugin-extensions-webadmin
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y

Confirm the deinstallation with y. If n is pressed, the deinstallation will be aborted. To perform the deinstallation without confirmation, use the following command:

root@dm7080:~# apt-get remove -y enigma2-plugin-extensions-webadmin

Install local saved packages

Packages (e.g. skin, plugin, etc.) which are offered e.g. in the IhaD board, but are not available on the feed, can be installed very easily with the package management system. We won't use the Software Manager, the GP3 File Browser nor the eCommander, but we'll install the package via telnet or SSH.

Ambox warning.png Beachtet bitte, dass Fremdpakete das System beschädigen können!
Ambox attention.png Benutzt die korrekte Paketarchitektur, für die verschiedenen Dreamboxen und verwendeten OpenEmbedded Versionen! Für OE 2.2 werden *.deb Pakete benötigt.
Ambox notice.png Der Befehl dpkg löst keine Abhängigkeiten zu anderen Paketen automatisch auf!

Installation eines Pakets

Installiert das Paket mit dem folgenden Befehl.

dpkg -i /tmp/$Dateiname_des_Pakets

Beachtet bitte, dass der komplette Dateiname angegeben werden muss. Wenn z.B. der Skin gp-skin-holo-black_gp33-20141107-r586_all.deb installiert wird, dann ist der Befehl wie folgt. Benutzt hier TAB um den Dateinamen automatisch zu vervollständigen.

dpkg -i /tmp/gp-skin-holo-black_gp33-20141107-r586_all.deb

Man kann natürlich auch das Sternchen Symbol (Asterisk) verwenden als Platzhalter, damit man nicht den ganzen Namen schreiben muss, z.B. so.

dpkg -i /tmp/gp-skin*

Erscheint nach der Installation ein Fehler wie z.B. folgender,

dpkg: error processing package gp-skin-holo-black (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
gp-skin-holo-black

dann werden weitere Abhängigkeiten benötigt, um einen reibungslosen Betrieb des Paketes zu gewährleisten. Abhängigkeitsprobleme könnt ihr mit dem folgenden Befehl anzeigen lassen:

root@dm7080:~# apt-get check
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
gp-skin-holo-black : Depends: enigma2 (>= 4.2.0r15) but 4.2.0r11-dm7080-r0.0 is installed
                     Depends: enigma2-plugin-skincomponents-eventlist but it is not installed
                     Depends: enigma2-plugin-skincomponents-eventposition but it is not installed
                     Depends: enigma2-plugin-skincomponents-extcomponents but it is not installed

Das Problem zu anderen Abhängigkeiten, kann einfach gelöst werden, sofern die Pakete auf dem Softwarefeed liegen. Benutzt den folgenden Befehl, um die Paketlisten zu aktualisieren und die fehlenden Abhängigkeiten zu installieren.

apt-get update && apt-get -f install

Bestätigt die Abfrage zu der Installation der Abhängigkeiten mit der y.

Installation mehrerer Pakete

Die Installation von mehreren Pakete ist auch sehr einfach, wenn alle via FTP in das /tmp Verzeichnis der Dreambox kopiert worden sind. Gebt den folgenden Befehl ein, um die Pakete zu installieren. Funktioniert übrigens auch für die Installation von einem Paket ;)

dpkg -i /tmp/*.deb

Fehlen hier Abhängigkeiten, dann benutzt bitte den folgenden Befehl, um dies zu korrigieren:

apt-get update && apt-get -f install

Deinstallation

Das deinstallieren von einem Paket, erfolgt wieder über den Paketnamen (ohne der Version und der Endung deb) und dem folgenden Befehl.

dpkg -r $paketname

Für $paketname muss natürlich der korrekte Name eingegeben werden. Wenn ihr den gp-skin-holo-black Skin entfernen möchtet, dann wäre der Befehl wie folgt, um ein Paket zu entfernen.

dpkg -r gp-skin-holo-black
(Reading database ... 10258 files and directories currently installed.)
Removing gp-skin-holo-black (gp33-20141107-r586) ...

Ist das zu deinstallierende Paket eine Abhängigkeit, die von anderen Paketen benötigt werden, bricht die Deinstallation ab, wie in der folgenden Ausgabe ersichtlich ist. Das Paket kann nicht entfernt werden in dem folgenden Beispiel, da es vom Skin gp-skin-holo-black benötigt wird.

root@dm7080:~# dpkg -r enigma2-plugin-skincomponents-eventposition
dpkg: dependency problems prevent removal of enigma2-plugin-skincomponents-eventposition:
gp-skin-holo-black depends on enigma2-plugin-skincomponents-eventposition.

Besser ist es den Befehl apt-get -r zu benutzen. Dieser berücksichtigt die Abhängigkeiten zwischen den Paketen. Also z.B mit dem Befehl:

apt-get remove enigma2-plugin-skincomponents-eventposition

Bestätigt die Abfrage der Deinstallation mit der Taste y.

Ambox attention.png Pakete welche das zu deinstallierende Paket benötigen (als Abhängigkeit), werden auch entfernt.

Update / Upgrade

Update

To update the package list, use following command:

apt-get update

Upgrade

To update the installed software, use following command:

apt-get upgrade

or

apt-get dist-upgrade

Update and Upgrade together

All in one go:

apt-get update && apt-get upgrade

or

apt-get update && apt-get dist-upgrade

Other useful commands

The missing dependencies can be checked with the following command:

apt-get check

install missing dependencies:

apt-get -f install

the cache (the downloaded install files) can be deletes with following command:

apt-get clean

search package

apt-cache search $package_name

or

apt-cache search . | grep $package_name