From c946fbbf09fcd7dd6f49537bef5e6cf4dc530a8c Mon Sep 17 00:00:00 2001
From: Jan Altenberg <jan@linutronix.de>
Date: Mon, 24 Jan 2011 15:07:13 +0100
Subject: New chapter: Basic introduction to debian package management

---
 .../package-management/pres_packaging_en.tex       | 312 +++++++++++++++++++++
 1 file changed, 312 insertions(+)
 create mode 100644 linux-basics/package-management/pres_packaging_en.tex

(limited to 'linux-basics/package-management/pres_packaging_en.tex')

diff --git a/linux-basics/package-management/pres_packaging_en.tex b/linux-basics/package-management/pres_packaging_en.tex
new file mode 100644
index 0000000..2a402c6
--- /dev/null
+++ b/linux-basics/package-management/pres_packaging_en.tex
@@ -0,0 +1,312 @@
+\documentclass[11pt]{beamer}
+
+%\usepackage{ngerman}
+\usepackage{times}
+\usepackage{graphicx}
+\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps}
+\usepackage{amsmath,amssymb}
+\usepackage[latin1]{inputenc}
+\usepackage{listings,color}
+\definecolor{lbcolor}{RGB}{255,210,150}
+\lstset{
+	language=C,
+	numbers=left,
+	stepnumber=1,
+	numbersep=5pt,
+	numberstyle=\tiny,
+	breaklines=true,
+	breakautoindent=true,
+	postbreak=\space,
+	tabsize=2,
+	basicstyle=\ttfamily\footnotesize,
+	showspaces=false,
+	showstringspaces=false,
+	extendedchars=true,
+	backgroundcolor=\color{lbcolor},
+	keywordstyle=\bf ,
+	commentstyle=\color{green},
+	stringstyle=\color{red}
+}
+
+\mode<presentation>
+{
+	\usetheme{linutronix}
+}
+
+% on the following slides, include icon in the left sidebar
+\def\lximg{/usr/share/lx/icons/fueller.png}
+
+\title{Debian Package Management}
+\institute{Linutronix GmbH}
+
+\begin{document}
+
+\frame{ \titlepage }
+
+% stop displaying 'fueller.png' on the following slides
+\def\lximg{none}
+
+\begin{frame}
+\frametitle{Package Management}
+\begin{itemize}
+\item Dependencies
+\item Updates
+\item Licensing
+\item Managing Repositories
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{Debian Package Management}
+\begin{itemize}
+\item Binary packages (.deb)
+\item dpkg is the base software of the Debian Package Management System
+\end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Using dpkg}
+\begin{verbatim}
+# Install a package
+dpkg -i packagename.deb
+# Get a list of the installed packages
+dpkg -l
+# Get a list of the installed packages
+# which match a specific pattern
+dpkg -l zlib*
+# remove a package
+dpkg -r packagename
+# remove a package
+# (and it's configuration files)
+dpkg -P packagename
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Using dpkg}
+\begin{verbatim}
+# Figure out to which package a
+# file belongs do
+dpkg -S /bin/df
+# Get a list of files
+# which will be installed
+# with a package
+dpkg -L coreutils
+# Get sone informations about an archive
+dpkg -I packagename.deb
+# Reconfigure a package
+dpkg-reconfigure packagename
+\end{verbatim}
+\end{frame}
+
+\begin{frame}
+\frametitle{The \textbf{A}dvanced \textbf{P}ackaging \textbf{T}oolkit}
+\begin{itemize}
+\item DPKG is the mechanism to install the package itself. APT will keep track of
+the dependencies and so on...
+\item Consists of several tools:
+\item apt-get
+\item apt-cache
+\item ...
+\end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{The \textbf{A}dvanced \textbf{P}ackaging \textbf{T}oolkit}
+Repository list is kept in:
+\begin{verbatim}
+/etc/apt/sources.list
+\end{verbatim}
+The repository list looks like:
+\begin{verbatim}
+deb http://debian.tu-bs.de/debian lenny \
+      main contrib non-free
+deb-src http://debian.tu-bs.de/debian lenny \
+      main contrib non-free
+[...]
+\end{verbatim}
+\end{frame}
+
+
+\begin{frame}[fragile]
+\frametitle{The \textbf{A}dvanced \textbf{P}ackaging \textbf{T}oolkit}
+There are several frontends for APT. The most important ones are:
+\begin{itemize}
+\item aptitude
+\item synaptic
+\end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{apt-get}
+\begin{verbatim}
+# Update the package list
+apt-get update
+# Upgrade all packages on your system
+apt-get upgrade
+# Upgrade packages on your system AND
+# and resolves any new dependencies
+apt-get dist-upgrade
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{apt-get}
+\begin{verbatim}
+# Install a package
+apt-get install packagename
+# Remove a package
+apt-get remove packagename
+# Remove a package
+# including its configuration files
+apt-get --purge remove packagename
+# Clean the local apt cache
+apt-get clean
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{apt-cache}
+\begin{verbatim}
+# Looking for a package
+apt-cache search minicom
+# Show dependencies
+apt-cache depends minicom
+# Show a user readable record
+apt-cache show minicom
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{apt-get behind a proxy}
+/etc/apt/apt.conf.d/02proxy:
+\begin{verbatim}
+Acquire::http::Proxy "http://proxy:8080";
+\end{verbatim}
+with user:
+\begin{verbatim}
+Acquire::http::Proxy \
+   "http://user@proxy:8080";
+\end{verbatim}
+with user and password:
+\begin{verbatim}
+Acquire::http::Proxy \
+   "http://user:pass@proxy:8080";
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{aptitude}
+Aptitude has an \textbf{advanced dependency handling} and a graphical front-end. The
+syntax is quite similar to apt-get and apt-cache:
+\begin{verbatim}
+# apt-get install minicom
+aptitude install minicom
+# apt-cache search minicom
+aptitude search minicom
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{apt-get vs. aptitude ;-)}
+apt-get has super cow powers; aptitude does not!! ;-)
+\begin{verbatim}
+$ aptitude moo
+There are no Easter Eggs in this program.
+
+$ apt-get moo
+         (__) 
+         (oo) 
+   /------\/ 
+  / |    ||   
+ *  /\---/\ 
+    ~~   ~~   
+...."Have you mooed today?"...
+\end{verbatim}
+\end{frame}
+
+\begin{frame}
+\frametitle{The .deb file format}
+A Debian archive contains three files:
+\begin{itemize}
+\item debian-binary: Version of the archive formate
+\item control.tar.gz: GZIPPed Tarball containing the archive's control files
+\item data.tar.gz: GZIPPed Tarball containing the archives data files
+\end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Creating .deb packages}
+Directory structure:
+\begin{verbatim}
+hello_pkt/
+  debian/
+    changelog
+    control
+    copyright
+    ...
+  bin/
+    hello
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Creating .deb packages}
+\begin{verbatim}
+# hello_pkt/debian/control
+Package: hello
+Version: 0.0.1
+Section: misc
+Priority: optional
+Architecture: i386
+Depends: libc6 (>= 2.2.4-4)
+Maintainer: Max Mustermann <m@mustermail.de>
+Description: Simple hello world program
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Creating .deb packages}
+\begin{verbatim}
+# Building the package
+dpkg-deb -b hello_pkt
+# dpkg -I hello_pkt.deb
+[...]
+ Version: 0.0.1
+ Section: misc
+ Priority: optional
+ Architecture: i386
+ Depends: libc6 (>= 2.2.4-4)
+ Maintainer: Max Mustermann <m@mustermail.de>
+ Description: Simple hello world program
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Creating .deb packages}
+\begin{verbatim}
+$ ar -tv hello_pkt.deb
+rw-r--r-- 0/0  [...] 2011 debian-binary
+rw-r--r-- 0/0  [...] 2011 control.tar.gz
+rw-r--r-- 0/0  [...] 2011 data.tar.gz
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{dh\_make}
+dh\_make is a helper to create skeletons for the contents in the DEBIAN/
+directory:
+\begin{verbatim}
+$ mkdir hello-0.0.1
+$ cd hello-0.0.1
+$ dh_make -c gpl2 -n -s -e m@mustermann.de
+\end{verbatim}
+\end{frame}
+
+\begin{frame}
+\begin{thebibliography}{1}
+\bibitem{debian} http://www.debian.org
+\end{thebibliography} 
+\end{frame}
+
+\end{document}
-- 
cgit v1.2.3

