Debian Apt Package Management Hints (.deb packages) ------------------------------------------------------------------------------- Apt See http://www.debian.org/doc/manuals/apt-howto/index.en.html Finding... Source Archives... vim /etc/apt/sources.list # Where to get sources from apt update # get package information lists apt list # packages apt list *mongo* # can take a glob apt-cache search 'string' # Search for package apt-cache show {package} # Full information about a package # (both installed and in repos) apt-cache showpkg {package} # more general info (dependancys) apt-cache depends {package} # just dependancys Installed Packages Only... dpkg --search {file} # what package provides this file # (relative or absolute path) dpkg -l # packages installed on system dpkg -L {package} # what files are in this package # apt-get apt-file #apt-file update # do this first #apt-file search {file} # what installed package is file part of #apt-file list {package} # what files are in this package Install/Upgrade... Install package apt-get install {package} or apt-get remove {package}+ Remove package and packages depanding on it. There is NO way to remove package and NOT the dependanys. apt-get remove {package} or apt-get install {package}- --purge completely remove package configuration too Upgrade (-u shows complete list of all packages which will be upgraded) apt-get -u upgrade Upgrade to new distribution apt-get dist-upgrade If a package is NOT upgraded (kept back) then run apt-get -u install {package} to see what the 'conflict' is. As to way a package can not be removed during an dist upgrade... apt-get -o Debug::pkgProblemResolver=yes dist-upgrade Curses Interface Upgrade (see http://www.debian.org/doc/ddp) Select new packages using... dselect Then upgrade using... apt-get -u dselect-upgrade Reinstall damaged package apt-get --reinstall install {package} Public Keys apt-key list what keys are known To update key see top-level page http://ftp-master.debian.org/ wget -O - http://ftp-master.debian.org/archive-key-4.0.asc |\ apt-key add - Miscellanious apt-show-versions -p {package} whats the latest version of a package. apt-show-versions -u upgradable packages apt-get clean|autoclean clear out /var/cache/apt/archives/ apt-cdrom add a cdrom to the /etc/apt/sources.list file apt-get -f install Run these two command to dpkg --configure -a clear locks and inconstancies. Equivelence.... Install a package from source, but tell the systen that it is equivelent to a specific version... see http://www.debian.org/doc/manuals/apt-howto/ch-helpers.en.html ------------------------------------------------------------------------------- Building Packages... http://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.en.html get build dependancys apt-get build-dep imagemagick Download the source package .dsc apt-get source imagemagick Build directly apt-get -b source imagemagick Build after downloading dpkg-buildpackage -uc -b install build .deb package dpkg -i imagemagick.deb NOT FINISHED... ImageMagick apt-get source imagemagick d=`echo imagemagick-*dfsg1` s=`r -n magick 'ls -t /var/ftp/pub/ImageMagick/ImageMagick-*.tar.gz'|head -1` cpdir -vP magick:$s . s=`basename $s` f $s cd ImageMagick-6.3.6 mkdir debian cp ../d/debian/rules debian cp ../d/debian/control debian cp ../d/debian/changelog debian #remove most of changelog - set current version #edit control and set current version ------------------------------------------------------------------------------- Repositories dpkg-scanpackages *.deb Packages.gz dpkg-scansources *.orig.tar.gz *.dsc *.diff.gz Sources.gz -------------------------------------------------------------------------------