debian package manager presenter: lilian wang. install software 先別管 package 了,...
TRANSCRIPT
![Page 1: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/1.jpg)
Debian package managerPresenter: Lilian Wang
![Page 2: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/2.jpg)
Install Software
先別管 package了 , 你有聽過重灌嗎 ?
Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …
Installing many software is annoying.
![Page 3: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/3.jpg)
Install software by source code
Download source and compile wget …/xxx-###.tar Decompress, then look up how to
compile ./configure make make install
It takes some times.
![Page 4: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/4.jpg)
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
easily
![Page 5: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/5.jpg)
Package Manager Package
An archive Binary Control Information
Operation Install Remove Query Upgrade
![Page 6: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/6.jpg)
Package Manager Bas
ePackage
Tool Front end
dpkg
.deb apt apt-getapt-cacheaptitude
rpm .rpm yum rpmyum
![Page 7: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/7.jpg)
Package Repository Package storage server
Packages of several versions Index file Maintained by distributions
/etc/apt/source.list [Homework Q1]
Show how to change package source mirror.
Which command gets new index file?
![Page 8: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/8.jpg)
Type of Packages 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
package c-compiler
![Page 9: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/9.jpg)
Useful commands apt-get
install, remove, upgrade, …
apt-cache show, search, …
aptitude almost all commands of
apt-get/apt-cache
![Page 10: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/10.jpg)
Command:search
aptitude search ^apache2 Search pattern can be regular
expressions Other patterns support: reference
apt-cache search apache2 Also search in description
Flags
![Page 11: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/11.jpg)
Flags Current state flag Action flag Automatic flag
State flag
description
i installed
c config, removed
p purge
v virtual
B broken
u unpacked
C half-configured
H half-installed
![Page 12: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/12.jpg)
Command: show
aptitude show apache2 List the information of package
apache2
![Page 13: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/13.jpg)
Package information
Package name
State installed, not installed, …
Automatically Manage automatically If set, remove package when not
needed
Version [epoch:]upstream_version[-
debian_revision] 2.2.16-6+squeeze7 reference
![Page 14: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/14.jpg)
Package information
Priority required important standard optional extra reference
Maintainer Description Architecture
![Page 15: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/15.jpg)
Package information Dependencies
depends recommends suggests conflicts replaces breaks provides Reference
![Page 16: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/16.jpg)
Command: installremovepurge
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?
![Page 17: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/17.jpg)
Command:upgradedist-upgrade
aptitude upgrade upgrade current packages Does not upgrade some packages
if updating these cause some others packages to be installed/removed.
aptitude dist-upgrade Upgrade all current packages If meets conflict, it will try to
generate solutions to satisfy new dependency.
![Page 18: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/18.jpg)
Practice
Search a database server Install it Remove it
![Page 19: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/19.jpg)
Build a simple meta-package
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
installed
![Page 20: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/20.jpg)
Build a binary 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
![Page 21: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/21.jpg)
Build a binary package
1. Download source code
2. Unpack
3. dh_make
4. Modify control file
5. Add path if needed
6. Build package dpkg-buildpackage
[Homework Q3] (optional) Build a package of “Omnitty”
![Page 22: Debian package manager Presenter: Lilian Wang. Install Software 先別管 package 了, 你有聽過重灌嗎 ? Chrome/Firefox, Office, pietty, Notepad++, PCMan, LOL, …](https://reader033.vdocuments.net/reader033/viewer/2022061512/56649e055503460f94af17c8/html5/thumbnails/22.jpg)
Homework
There are 3 questions, check HW8.pdf
1. Change package source mirror
2. Build nasa-hw meta package
3. Build omnitty package Optional question