EB8B0


Redhat / Debian package management (recovered from my 2009 page)

1. Applications (yum)

  Redhat           Debian                       Comment

  yum clean        apt-get clean                Clean package
                   apt-get autoclean            database
  yum update       apt-get update               Update database
                   apt-get upgrade              Upgrade packages
                   apt-get dist-upgrade         Upgrade distro
  yum search       apt-cache search             Search
  yum install      apt-get install              Install
  yum remove       apt-get autoremove --purge   Remove with data

2. Package (rpm)

  Redhat           Debian                       Comment

  rpm -qa          dpkg-query --show            Show List
  rpm -e           dpkg -r                      Remove
                   dpkg --purge                 Remove with data
  rpm -ivh         dpkg -i                      Install
  rpm -Uvh         dpkg -Gi                     Upgrade

3. Build from source

  ./configure          check for necessary applications/files
  make                 build
  make install         install
  make clean           remove temporary and builded files
  make mrproper        remove configuration changes as well
  make uninstall       uninstall package

4. Build from source C file(s)

  gcc -o myapp mysource0.c mysource1.c .. -lm -lX11

  -o     define output file name
  -lm    link to math library
  -lX11  link to graphics library

5. Queries to local package database

Linux packaging info

  http://www.pixelbeat.org/docs/packaging.html

show all packages whose names contain the word spell

  rpm -qa '*spell*'
  dpkg -l '*spell*'

show version of package installed

  rpm -q package
  dpkg -l package

show all package metadata

  rpm -q -i package
  dpkg -s package

what package does file belong

  rpm -q -f /path/file
  dpkg -S /path/file

list where files were installed

  rpm -q -l package
  dpkg -L package

list where files would be installed

  rpm -q -l -p package.rpm
  dpkg -c package.deb

list files/packages that package needs

  rpm -q --requires package
  dpkg -s package | grep ^Depends:

list packages that need package (see also whatrequires)

  rpm -q --whatrequires package
  dpkg --purge --dry-run package

leafs (debian)

#!/bin/bash
# discover leafs on the package three

for i in `dpkg-query --showformat='${Package}\n' --show`
do
    dpkg --purge --dry-run $i 2> /dev/null 1| grep "^Would remove or purge"
done

















