Debian package m anager
Presenter: Lilian Wang
Install Sof tware
先別管 package 了 , 你有聽過重灌嗎?
Chrome/Firefox, Office, pietty, N otepad++, PCMan, LOL, …
Installing many software is annoy ing.Install sof tware by so
urce code
Download source and compile wget …/xxx-###.tar
Decompress, then look up how to comp ile
./configure
make
make install
It takes some times.
Better way to install and manage
Download binary
Setup script
Dependencies Program A needs library/program B to work
LOL_TW requires 競時通
Gamania games requires beanfun!
Version Upgrade to new release version easil y
Package Man
ager
Package An archive
Binary
Control Information
Operation Install
Remove
Query
Upgrade
Package Man
ager
Base Packa
ge Tool Front end dpk
g .deb apt apt-get apt-cache aptitude rpm .rpm yum rpm
yum
Package Rep
ository
Package storage server Packages of several versions
Index file
Maintained by distributions
/etc/apt/source.list
[Homework Q1] Show how to change package source mi rror.
Which command gets new index file?
Type of Pac
kages
Binary package Includes program binary
Meta package Depends on other packages only
apache2 -> apache2.2-common
Virtual package Not really exists
Other packages “provide” virtual p ackage
c-compiler
Useful comm ands
apt-get install, remove, upgrade, …
apt-cache show, search, …
aptitude almost all commands of apt-get/apt-c ache
Command:
search
aptitude search ^apache2 Search pattern can be regular expres sions
Other patterns support: reference
apt-cache search apache2 Also search in description
Flags
Flags
Current state flag
Action flag
Automatic flagState
flag description
i installed
c config, removed
p purge
v virtual
B broken
u unpacked
C half-configured H half-installed
Command: sh ow
aptitude show apache2 List the information of package apac he2
Package inf ormation
Package
name
State
installed, not installed, …
Automatically
Manage automatically
If set, remove package when not need ed
Version
[epoch:]upstream_version[-debian_rev ision]
2.2.16-6+squeeze7
reference
Package inf
ormation
Priority required important
standard
optional
extra
reference
Maintainer
Description
ArchitecturePackage inf
ormation
Dependencies depends
recommends
suggests
conflicts
replaces
breaks
provides
Reference
Command: in stall
remove purge
apt-get install apache2 Install apache2 package
apt-get remove apache2 Uninstall apache2 package
Config file remains
apt-get purge apache2 Uninstall apache2 package
Delete config file
Is configure file removed?
Command:
upgrade
dist-upgrad e
aptitude upgrade upgrade current packages
Does not upgrade some packages if u pdating these cause some others pac kages to be installed/removed.
aptitude dist-upgrade Upgrade all current packages
If meets conflict, it will try to g enerate solutions to satisfy new de pendency.
Practice
Search a database server
Install it
Remove itBuild a sim ple meta-pa ckage
package/DEBIAN/control You can reference some field aptitude show xxx outputs
dpkg-deb –b package
[Homework Q2] Build a meta-package
Name: nasa
Should always install mysql-server(>
= 5.0)
Should always install apache2(>=2.2)
Should not install when lighttpd ins talled
Build a bin
ary package
Tutorial: http://www.debian.org/doc/manuals/maint- guide/first.en.html
Install packages needed build-essential
dpkg-dev
debhelper
CDBS
dh-make
lintian: check if package has error
Build a bin
ary package 1.
Download source code2.
Unpack3.
dh_make4.
Modify control file5.
Add path if needed6.
Build package dpkg-buildpackage
[Homework Q3] (optional) Build a package of “Omnitty”
Homework
There are 3 questions, check HW8.1.
Change package source mirror2.
Build nasa-hw meta package3.
Build omnitty package Optional question