Dpkg and APT First...What Is a Package? ● a Collection of Files That Is Installed on a Linux System
Total Page:16
File Type:pdf, Size:1020Kb
Package management: dpkg and APT First...what is a package? ● a collection of files that is installed on a Linux system ● usually distributed as compressed single files ○ tarballs ○ zip files ● the way software is distributed, installed, updated on a Linux system jboydt :: csci 26 | dpkg, apt And what is package management? ● a system for tracking all information about a software package ○ all of the files associated with the package ○ dependencies (such as specific versions of specific files) of the package ○ checksums to verify the validity of package files ○ a way to upgrade packages ○ a way to uninstall packages ● a system for obtaining software in its original source code form ○ then, building it and installing it on a specific machine jboydt :: csci 26 | dpkg, apt Package management on popular distros ● RedHat -- rpm/yum ○ also CentOS, SUSE ● Debian -- apt/aptitude ○ also Ubuntu ● ArchLinux -- pacman ● BSDs -- each its own ○ FreeBSD -- pkgng jboydt :: csci 26 | dpkg, apt dpkg jboydt :: csci 26 | dpkg, apt What is dpkg? ● the core of the Debian package management system ● requires .deb packages on local machine ● does not manage dependencies between packages jboydt :: csci 26 | dpkg, apt using dpkg ● common dpkg command options: ○ -i install ○ -r remove, leave config files ○ -P remove, remove config files ○ -p print information about an installed package ○ -l PATTERN list packages whose names match PATTERN * dpkg OPTION PACKAGE_NAME (add .deb to PACKAGE_NAME on install) jboydt :: csci 26 | dpkg, apt APT jboydt :: csci 26 | dpkg, apt What is APT? ● Advanced Packaging Tool ● advancements over dpkg ○ can fetch remote packages ■ remote targets configured in /etc/apt/sources.list ○ can manage package dependencies ○ can manage package upgrades ● a set of tools ○ apt-cache ○ apt-get ● one of the best things about Debian! jboydt :: csci 26 | dpkg, apt apt-cache ● apt-cache showpkg PACKAGE_NAME ○ display info about PACKAGE_NAME ● apt-cache stats ○ how many packages are installed, et al. ● apt-cache search PATTERN ○ search all available packages for package that begins with PATTERN ● apt-cache depends PACKAGE_NAME ○ show info about PACKAGE_NAME dependencies ● apt-cache pkgnames [PATTERN] ○ without PATTERN, show all installed packages ○ with PATTERN, show installed packages that begin with PATTERN jboydt :: csci 26 | dpkg, apt apt-get ● /etc/apt/sources.list ● apt-get OPTION [PACKAGE_NAME] ○ install PACKAGE_NAME ■ to install PACKAGE_NAME and whatever it depends upon ○ update ■ to update information about available packages from the repositories listed in /etc/apt/sources.list ○ upgrade ■ upgrade all installed packages to newest versions ○ remove PACKAGE_NAME ○ clean ■ clear out information about downloaded files (good to run from time- to-time) jboydt :: csci 26 | dpkg, apt Frontends for APT ● Synaptic ● aptitude ● many others... jboydt :: csci 26 | dpkg, apt jboydt :: csci 26 | dpkg, apt .