The program 'iptables' is currently not installed

24,534

Solution 1

Credit to kraxor's comment on the original question:

You should try reinstalling iptables by executing the following command:

sudo apt-get --reinstall install iptables

Solution 2

Use following command:

sudo apt-get update
sudo apt-get install iptables-persistent

and it will install the iptables-persistent package for you.

Solution 3

try these one by one

sudo apt-get remove iptables

sudo apt-get update

sudo apt-get install iptables

it should work now.

Share:
24,534

Related videos on Youtube

CalBoy386
Author by

CalBoy386

Updated on September 18, 2022

Comments

  • CalBoy386
    CalBoy386 almost 2 years

    I am a newbie, so my apologies up front.

    I am trying to get DansGuardian installed (which I believe I have) and working. To get it working I need to filter IP traffic through the app via iptables. There are appropriate commands in the 'Getting DansGuardian working on Ubuntu' page. My issue is that the system is telling me that iptables is not currently installed - which is wrong. I understand that it is the primary firewall service for Ubuntu.

    I have tried:

    xyzzy@ubuntu:/usr/sbin$ iptables
    
    The program 'iptables' is currently not installed.  
    You can install it by typing:
    sudo apt-get install iptables
    

    So:

    sudo apt-get install iptables
    Reading package lists... Done
    
    Building dependency tree
    
    Reading state information... Done
    
    iptables is already the newest version.
    
    The following package was automatically installed and is no longer required:
    
      thunderbird-globalmenu
    
    Use 'apt-get autoremove' to remove them.
    
    0 upgraded, 0 newly installed, 0 to remove and 342 not upgraded.
    

    Only to be told that the version I am running is the latest.

    ufw is running.

    • kraxor
      kraxor almost 10 years
      Have you tried apt-get --reinstall install iptables?
    • Alaa Ali
      Alaa Ali almost 10 years
      What's in your $PATH variable? What is the output of echo $PATH? Also, what is the output of ls -l /sbin | grep iptables?
    • CalBoy386
      CalBoy386 almost 10 years
      /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr‌​/sbin:/usr/bin:/sbin‌​:/bin:/usr/games
    • CalBoy386
      CalBoy386 almost 10 years
      lrwxrwxrwx 1 root root 13 Jul 26 19:03 iptables-restore -> xtables-multi lrwxrwxrwx 1 root root 13 Jul 26 19:03 iptables-save -> xtables-multi
    • Alaa Ali
      Alaa Ali almost 10 years
      It seems that the iptables executable is not installed for some reason. Try @kraxor's suggestion by reinstalling iptables. You should put a sudo at the beginning of the command he posted, and let us know if it fixes the issue.
    • CalBoy386
      CalBoy386 almost 10 years
      reinstalling worked. Thank you. Odd, this is a new insall of Ubuntu. Not sure how it was corrupted.
    • CalBoy386
      CalBoy386 almost 10 years
      One more silly question, how do I tag this as answered? I do not see the icons next to the replies as described in the site help?
    • Alaa Ali
      Alaa Ali almost 10 years
      @CalBoy386 waw, we need more people like you that actually read the site's help =). What we're typing here are comments. You can only accept answers, not comments. Answers appear in the space below. I waited for kraxor to post an answer because he should take credit, but he still hasn't, so I just posted an answer now. You'll find the "check mark" to mark my answer as accepted to the left of the answer.