APT
From openSUSE
Contents |
APT - Advanced Package Tool
APT is a package manager, primarily used by Debian based distributions, which makes installation and removal of packages very easy. It automates the process of downloading and installation of required packages along with their dependency requirements.
Installing APT
APT is not included with the latest OpenSuSE Linux 10.3 so we will need to install it. AFAIK, apt is part of openSUSE, even for openSUSE_11.0. Adjust article accordingly, please. Simply open up YAST and go to the Software Repositories module. Click Add to add a new installation source and click the button to specify the repository URL. Enter http://download.opensuse.org/repositories/home:/rbos/openSUSE_10.3/ as the URL address and save this repository source. Next, open the Software module of YAST and type apt-beta in the search box. This will install the latest version of APT as well as the required libraries. You may also wish to search for synaptic. This will install the Synaptic program, which is the graphical installer for APT. Once APT and Synaptic are installed, you need to edit /etc/apt/sources.list with your favourite text editor. This file contains a list of all package repositories. To start with, you can look at an example of my personal OpenSuSE 10.3 file below:
# A very basic sources.list file. # # Fastest repository comes first, with netselect it is possible to determine # the fastest repository easily. # # Visit http://software.opensuse.org/download/ to determine which additional # components are available. Some examples are given below, just uncomment # the line to enable it. # # The apt format: # repomd http://download.opensuse.org/distribution/10.3/repo/oss/suse/ / # # Notice from the example above that repomd is the repository type for OpenSuSE YAST repositories. # This data type is followed by the URL of the repository. # The directory URL should be the directory path to the folder that is directly above the repodata folder on the server. # In other words, the http://download.opensuse.org/distribution/10.3/repo/oss/suse/ folder contains the repodata folder. # The line is ended with a space and another / to indicate that our repodata is located in this folder. # # Have a lot of fun with APT! #Main 10.3 Repository repomd http://ftp5.gwdg.de/pub/opensuse/distribution/10.3/repo/oss/suse/ / repomd http://ftp5.gwdg.de/pub/opensuse/distribution/10.3/repo/non-oss/suse/ / #VideoLAN repomd http://download.videolan.org/pub/vlc/SuSE/10.3/ / #NVIDIA repomd http://download.nvidia.com/opensuse/10.3/ / #Packman repomd http://packman.unixheads.com/suse/10.3/ / #APT for RPM repomd http://download.opensuse.org/repositories/home:/rbos/openSUSE_10.3/ /
After editing the text file with your chosen repositories, use apt-get update to fetch a list of all available packages. apt-get -f install can be used to resolve all broken dependencies in case a particular installation attempt failed.
Automatic Update
To automatically refresh the list of available packages daily, edit /etc/sysconfig/autoupdate to include
AUTOUPDATE_ENABLE=yes
Using APT
APT can be used on command line or you can use the graphical interface synaptic. You can either use the command line as described below or use Synaptic.
APT has 2 main commands, apt-get and apt-cache. Once you have installed apt, you can search for a package by using apt-cache search. But before you search for a package you need to fetch the list of all available packages from the net. To do that, run apt-get update. Note: apt-get update does not install anything, it just fetches a list of all available packages. Since this list is constantly updated, I recommend you run this command once a week.
zero:~ # apt-get update Get:1 http://ftp.gwdg.de SuSE/9.1-i386 release [12.4kB] Fetched 12.4kB in 3s (3539B/s) Get:1 http://ftp.gwdg.de SuSE/9.1-i386/suser-guru pkglist [265kB] Get:2 http://ftp.gwdg.de SuSE/9.1-i386/suser-guru release [135B] Get:3 http://ftp.gwdg.de SuSE/9.1-i386/packman pkglist [199kB] Get:4 http://ftp.gwdg.de SuSE/9.1-i386/packman release [132B] Get:5 http://ftp.gwdg.de SuSE/9.1-i386/packman-i686 pkglist [68.3k] .............. Get:16 http://ftp.gwdg.de SuSE/9.1-i386/security-prpm release [138B] Fetched 1746kB in 2m56s (9887B/s) Reading Package Lists... Done Building Dependency Tree... Done
Packages can be installed by apt-get install. For example if you want to search for gaim, you can use the following command.
zero:~ # apt-cache search gaim bitlbee - An IRC to other chat networks gateway gaim-devel - Development environment for gaim gaim-guifications - Guifications plugin for Gaim gaim-perl - Perl bindings for gaim gaim-tcl - Tcl/Tk bindings for gaim OpenOffice_org - A Free Office Suite (the Language Independent part) gaim - A multi-protocol Instant Messenger client gaim-vv - Gaim is Compatible with the AOL Instant Messenger linphone-im - A modified version of Linphone
Output of apt-cache search is a list of all matching package names with a short description. Now suppose you want to install gaim-guifications. Use the following command.
zero:~ # apt-get install gaim-guifications Reading Package Lists... Done Building Dependency Tree... Done The following NEW packages will be installed: gaim-guifications 0 upgraded,aptnewly installed, 0 removed and 354 not upgraded. Need to get 150kB of archives. After unpacking 520kB of additional disk space will be used. Get:1 http://ftp.gwdg.de SuSE/9.1-i386/suser-guru gaim-guifications 2.8-1.guru.suse91 [150kB] Fetched 150kB in 8s (17.6kB/s) Committing changes... Preparing... ########################################### [100%] 1:gaim-guifications ########################################### [100%]
When you use apt-get install, it checks if a package is already installed or not. If it is already installed, it will check if some new version is available or not. If yes, it will automatically fetch and install all required packages. For example to install mplayer:
zero:~ # apt-cache search mplayer kplayer - KDE Media Player based on MPlayer mplayerplug-in - MPlayer Plugin for Netscape/Mozilla xine-skins - Skins for xine-ui MPlayer - Movie Player libpostproc - The postproc library of MPlayer live - live.com librarys transcode - a linux video stream processing utility libvisual-plugins - sound visualisation library plugins MPlayer-suite - A virtual package to obtain MPlayer and many of the plugins xmms-mplayer - Use xmms as a frontend for MPlayer mpav - MPlayer Audio Visualization xmmsmplayer - XMMS MPlayer Input Plugin kmenc15 - Kde frontend to mencoder zero:~ # apt-get install MPlayer-suite Reading Package Lists... Done Building Dependency Tree... Done MPlayer-suite is already the newest version. 0 upgraded, 0 newly installed, 0 removed and 354 not upgraded.

