Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got myself into trouble with mysql on debian lenny (details).

I tried these commands:

  • dpkg-reconfigure mysql
  • dpkg --purge mysql-server
  • apt-get install mysql-server
  • mysql_install_db

and variants of these in different order using killall mysql and killall mysqld and had no luck whatsoever. I even deleted every mysql folder listed in whereis mysql.

How do I properly reinstall a package? Because the above is not working for me.

share|improve this question
What do you mean by “not working”? What did you expect to happen, and what actually happened? The commands you give reinstall the software (binaries and configuration files). They won't give you your database back. – Gilles Feb 12 '11 at 21:54

The preferred way is via apt:

apt-get install --reinstall packageNameGoesHere
share|improve this answer

On Ubuntu one can go into synaptics and search for the software to remove. When right-clicking to see the contextual menu, one can see and select the option called "Mark for removal" (or "Mark for complete removal" if you want to purge the downloaded installer as well)

share|improve this answer
I have no gui, its a remote server. and its debian which is close to ubuntu but still no synaptics on it. – acidzombie24 Feb 12 '11 at 6:22
ok ,well i see you have aptitude (apt)..so you can use the option sudo apt-get --purge remove <package name> to completely remove something prior to re-installing it.. apt-get --purge reinstall <package> could be something to try first to see if this would fix the problem ...you can refer to this man page for all other options used by apt-get.. linux.die.net/man/8/apt-get – marc-andre benoit Feb 12 '11 at 7:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.