iptables-persistent not uninstalling

15,595

Files in /etc are config files and are kept around when you remove a package in case you reinstall it in the future. If you want to get rid of them, you have to purge the package:

sudo apt-get remove --purge iptables-persistent
Share:
15,595
Eaten by a Grue
Author by

Eaten by a Grue

Hobbyist and freelance computer-er

Updated on September 18, 2022

Comments

  • Eaten by a Grue
    Eaten by a Grue over 1 year

    I'm running Ubuntu 14.04 and I simply want to uninstall iptables-persistent to test something.

    As suggested here (http://www.installion.co.uk/ubuntu/saucy/universe/i/iptables-persistent/uninstall.html) I tried:

    sudo apt-get remove --auto-remove iptables-persistent
    

    ... but it's still there. I tried again and got the message:

    Package 'iptables-persistent' is not installed, so not removed
    

    But it isn't removed. I rebooted and still am able to run

    /etc/init.d/iptables-persistent save
    

    and /etc/init.d/iptables-persistent is still there. What am I missing? Shouldn't that file be gone after removing it as I did?

  • Eaten by a Grue
    Eaten by a Grue almost 10 years
    thanks. what exactly is the purpose of this package? I added a rule to iptables to ban an ip and it worked. after reboot the rule was gone. Isn't this supposed to keep rules after reboot?
  • Alexander Karatarakis
    Alexander Karatarakis almost 9 years
    Very late, but since I am looking into this anyway... iptables-persistent snapshots the rules at installation time. If you alter edit your rules, you have to manually update the files in /etc/iptables/