Debian – How to reinstall a package using ‘apt-get’


It seems that my aptitude is somehow broken:

sudo aptitude update
0% [Working]Segmentation fault

[223282.616599] aptitude[30972]: segfault at 67707f ip 7f954dcfae5d sp 7ffff5a5f950 error 4 in[7f954dca5000+bd000]

So I would like to reinstall aptitude by using apt-get.

Unfortunately it seems apt-get doesn't have a reinstall option.

How could I get aptitude to work again?

It's possible that I found the root cause for aptitude's segfault. Here is how I can reproduce it:

  1. 'ssh' remote login into the Debian machine via Cygwin's rxvt terminal (from a Windows 7 64-bit German edition).
  2. Enlarge the rxvt window so that it spans across two monitors (yes, I have two monitors)
  3. Run aptitude update. Note: when I resize the rxvt terminal to normal then I don't have these segmentation faults!

Best Answer

$ man apt-get | grep reinsta -A2
           Re-Install packages that are already installed and at the newest
           version. Configuration Item: APT::Get::ReInstall.

So, to use it to reinstall aptitude use:

sudo apt-get install --reinstall aptitude
Related Question