Friday, 17 September 2010

DPKG & APT

In order not to always read mans, I have collected these short tips.

dpkg database: /var/lib/dpkg
Apt cache, that stores packages: /var/cache/apt/archives
To clean this cache:
aptitude clean

Only download package, without installing:
aptitude download package_name

List all installed packages:
dpkg -l
or
apt-cache pkgnames

List all files of the package:
dpkg -L package

What package contains a file?
dpkg -S path_to_file

Print information about package:
dpkg -p package

What packeges are upgradeable?
apt-show-versions -u

Shows what packages are installed partially and suggests, how to correct this situation
dpkg -C

Verify package, showing what files(including configuration) are changed:
debsums -ac package_name

Backup and restore list of installed soft:
dpkg --get-selections > /backup/installed-software.log
dpkg --set-selections < /backup/installed-software.log

Remove package with configuration files:
dpkg -P package

Reinstall package:
aptitude reinstall package

Add CD-ROm to source file
apt-cdrom add

Upgrade the whole distro:


  • Backup everything important

  • Do everything using “screen” command, if you control server via SSH.

  • dpkg --audit

  • Change sources in /etc/apt/sources.list

  • aptitude update

  • aptitude install aptitude

  • aptitude safe-upgrade

  • aptitude full-upgrade




Configure update servers
# apt-setup

Missing key for updates
gpg --keyserver pgpkeys.mit.edu --recv-key  010908312D230C5F
gpg -a --export key_ID |  apt-key add -

Before installing Vmware tools
apt-get install build-essential linux-headers-`uname -r` psmisc

No comments:

Post a Comment

Ping does not work

Today I would like to discuss a banal situation: host A is directly connected to host B, ping from host A to host B does not work. What are...