Advanced 2: Packages
George Lee
(Based on slides from Harrison Kuo)
Overview
What is a package?
Package Management
DPKG vs APT
APT commands
apt update
Grabs a new list (catalogue) of what packages are available.
apt install [packagename]
Installs the package.
apt remove [packagename]
Uninstalls the package.
APT commands (Con’t)
apt upgrade
Updates the packages.
apt search [searchterm]
Searches for the package in the catalogue
apt depends [packagename]
Lists the dependencies for the package
APT Commands (Con’t)
apt policy [packagename]
Lists potential versions that are available to install
apt -t [releasetarget] install [packagename]
Installs package according to a specified release target
DPKG commands
dpkg -i packagefilename
Installs the local .deb file.
dpkg --remove packagename
Removes the package.
dpkg -I packagefilename
Inspects the package.
DPKG commands (Con’t)
dpkg --configure -a
Configures all packages which have been unpacked but have not completed installing. Run this if your install is interrupted and your installation becomes corrupted.
Example: Installing a package
What just happened
What just happened (Con’t)
2. apt install then:
Troubleshooting Packages
Usually you will encounter problems with packages in three ways:
Example: Installing a package with missing dependencies
What just happened?
Example: Debugging packages with mismatched versions
What just happened
The Structure of a Package
/usr
/usr/share
Documentation/Etc
/usr/bin
Executables/Binaries
/usr/lib
Libraries
/usr/include
Header Files
.deb
Metadata
version#, name, etc
Example: Creating a package
What just happened?
What just happened? (Con’t)
3. The folder was packaged, using fpm, into a .deb file
Thanks!
The assignment will be up after you get your VMs!
Remember to sign in at:
decal.ocf.berkeley.edu/signin
Magic Word is?