Вы находитесь на странице: 1из 4

3/14/2008

In the beginning there was the .tar.gz. Users had to


compile each program that they wanted to use on their
GNU/Linux systems. When Debian was created, it was
Package management deemed necessary that the system include a method of
Advanced package management managing the packages installed on the machine. The
name dpkg was given to this system. Thus the famous
'package' first came into being on GNU/Linux, a while
before Red Hat decided to create their own 'rpm' system.
A new dilemma quickly took hold of the minds of the
makers of GNU/Linux. They needed a rapid, practical, and
efficient way to install packages that would manage
dependencies automatically and take care of their
configuration files while upgrading. Here again, Debian
led the way and gave birth to APT, the Advanced
Packaging Tool, which has since been ported by Conectiva
for use with rpm and has been adopted by some other
distributions."

Linux Packages

 Linux strengths allowed this operating system to gain  In more widespread linux distributions, programs are
a central place in the IT market distributed in binary RPM, DEB or modified TGZ
 Package management played an important role in this formats
process
 The Linux system’s coherency is assured maintaining  RPM (RedHat Package Management) packages are
databases of installed files. In this way installing or used on RedHat, Mandrake, Suse, Conectiva
removing programs gets an easy task
 DEB are used on the open source distribution Debian
 Nowadays only few programs are installed using and its forks
source files
 Modified TGZ are used on SlackWare

3 4

Dependencies What is apt?

 Dependencies management is a very useful feature of apt is a Debian tool used to manage packages in such a way
package management software that when the user asks for a package to be installed the
system also installs (or upgrades) all the necessary packages
 They keep systems in a consistent state and
to make the package work.
guarantee the applications to run in the expected way
 rpm or dpkg commands have limited dependencies
management features
 They can report which library a package relies on,
but the library can itself relies on other packages…

5 6

1
3/14/2008

APT

 APT is a system created in the Debian community to Command-line package management with APT
automatically manage the packages dependencies
 APT can install, remove and upgrade packages, If you are comfortable using the Terminal, you can use apt
managing dependencies and downloading the (Advanced Packaging Tool) to install or remove software.
packages You need administrative access to use apt.
 It’s a frontend to other tools, and it uses the
underlying package management system, like the
rpm or dpkg commands
 It’s able to fetch packages from several media
(cdrom, ftp, http, nfs), and it can be used to create
ad-hoc software repositories
7 8

Some solutions

 RPM– RedHat To update the local list of packages, enter in a Terminal:


 RedCarpet – Ximian
sudo apt-get update
 YOU (YaST Online Update) – Suse
 YUP (YellowDog Updater) – YellowDog PPC
 Urpmi – Mandrake
 YUM (YellowDog Updater Modified)
 APT (Advanced Packaging Tool) – Debian (and rpm...)

9 10

To install all available updates: To search for a package:


sudo apt-get upgrade apt-cache search package

11 12

2
3/14/2008

APT – Using (1/3) Examples

[root]@[/] # apt-get install nautilus


To install a package:
Reading Package Lists... Done
sudo apt-get install package
Building Dependency Tree... Done
The following extra packages will be installed:
bonobo libmedusa0 libnautilus0
The following NEW packages will be installed:
bonobo libmedusa0 libnautilus0 nautilus
0 packages upgraded, 4 newly installed, 0 to remove and 1 not
upgraded.
Need to get 8329kB of archives. After unpacking 17.2MB will be
used.
Do you want to continue? [Y/n]
13 14

Removal
•apt-get remove packagename - removes a installed package
(configfiles remain)
To remove a package:
sudo apt-get remove package •apt-get --purge remove packagename - removes a installed package
(configfiles will also be removed)
•A special trick: if you want to remove package “foo” and install
package “bar” in one step: apt-get --purge remove foo bar+.

•apt-get autoremove packagename - removes a installed package and


dependencies

15 16

APT – Using (2/3) APT – Using (3/3)

[root]@[/] # apt-get remove gnome-panel [root]@[/] # apt-cache search pdf


Reading Package Lists... Done kghostview - PostScript viewer for KDE
Building Dependency Tree... Done tetex - The TeX text formatting system.
xpdf - A PDF file viewer for the X Window System
The following packages will be REMOVED:

gnome-applets gnome-panel gnome-panel-data gnome-session
0 packages upgraded, 0 newly installed, 4 to remove and 1 not [root]@[/] # apt-cache show xpdf
upgraded. …
Need to get 0B of archives. After unpacking 14.6MB will be freed. Filename: xpdf-1.00-3.i386.rpm
Do you want to continue? [Y/n] Description: A PDF file viewer for the X Window System.
Xpdf is an X Window System based viewer for Portable Document
Format (PDF) files. Xpdf is a small and efficient program which
uses standard X fonts.

17 18

3
3/14/2008

The /etc/apt/sources.list file APT – repository source.list

 As part of its operation, APT uses a file that lists the he entries in this file normally follow this format:
'sources' from which packages can be obtained. This file is
/etc/apt/sources.list. deb http://host/debian distribution section1 section2 section3
deb-src http://host/debian distribution section1 section2 section3

Of course, the above entries are fictitious and should not be used. The
first word on each line, deb or deb-src, indicates the type of archive:
whether it contains binary packages (deb), that is, the pre-compiled
packages that we normally use, or source packages (deb-src), which
are the original program sources plus the Debian control file (.dsc) and
the diff.gz containing the changes needed for `debianizing' the program.
19 20

Do not forget to run


apt-get update
The two last lines are commented out (with a `#' in after modifying the
front), so apt-get will ignore them. These are deb-src
lines, that is, they point to Debian source packages. If /etc/apt/sources.list
you often download program sources for testing or file You must do this to let APT obtain the
recompiling, uncomment them. package lists from the sources you specified.

21 22

APT - Benefits

 Apt simplifies package management on rpm based


distributions, even on RedHat, most used distribution
in HEP environments
 Systems update is possible with only two commands:
# apt-get update; apt-get -y upgrade
 Using a local repository is possible to upgrade
machines using no external links
 It is possible to include non standard packages in
local repositories...

23

Вам также может понравиться