sudo apt-get remove does not remove config files

130,163

Solution 1

Use sudo apt-get purge <program> instead, to remove config files as well.

Solution 2

You're looking for purge:

sudo apt-get purge vsftpd

will also delete the config files. You can do this even after you've already removed the package.

Share:
130,163

Related videos on Youtube

Daniel
Author by

Daniel

Updated on September 18, 2022

Comments

  • Daniel
    Daniel almost 2 years

    I'm new to Linux/Ubuntu - and I'm wondering if the behaviour I'm seeing is as designed. I have installed vsftpd:

     sudo apt-get install vsftpd
    

    Then I remove:

     sudo apt-get remove vsftpd
    

    However, looking in /etc I can see that vsftpd.conf is still present. Can someone explain why this is happening (I am assuming the remove would remove all files relating to vsftpd) ?

    • Dr_Bunsen
      Dr_Bunsen about 12 years
      I thought you had to purge it
    • Gabriel Staples
      Gabriel Staples over 6 years
      Ah! So that's how you remove something without removing config files! That's what I want to do...just in case I decide to reinstall later.
  • codeling
    codeling about 12 years
    I believe there is even some option of dpkg to list all the packages that were once installed but removed...? Ah yes, see here: ascending.wordpress.com/2007/04/10/…
  • sal
    sal over 11 years
    @asymptotically Yes. Quoting the apt-get man page: "remove --purge is equivalent to the purge command". If you want to know everything about the apt-get command, run man apt-get.
  • Oliver Williams
    Oliver Williams over 7 years
    I did notice that a file /etc/vsftpd.conf.save is created and remains after the purge. This should be the accepted answer.