The program 'iptables' is currently not installed
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.
Related videos on Youtube
CalBoy386
Updated on September 18, 2022Comments
-
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 almost 10 yearsHave you tried
apt-get --reinstall install iptables
? -
Alaa Ali almost 10 yearsWhat's in your $PATH variable? What is the output of
echo $PATH
? Also, what is the output ofls -l /sbin | grep iptables
? -
CalBoy386 almost 10 years/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
-
CalBoy386 almost 10 yearslrwxrwxrwx 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 almost 10 yearsIt seems that the
iptables
executable is not installed for some reason. Try @kraxor's suggestion by reinstallingiptables
. You should put asudo
at the beginning of the command he posted, and let us know if it fixes the issue. -
CalBoy386 almost 10 yearsreinstalling worked. Thank you. Odd, this is a new insall of Ubuntu. Not sure how it was corrupted.
-
CalBoy386 almost 10 yearsOne 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 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.
-