Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

To remove iptables i used yum :

# yum remove iptables -y

But this removed a lot of packages :

Remove      262 Package(s)

Installed size: 710 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Erasing    : xorg-x11-drivers-7.3-13.4.el6.x86_64                                                                                                                                                                    1/262 
  Erasing    : ipa-client-3.0.0-37.el6.x86_64                                                                                                                                                                          2/262 
  Erasing    : firstboot-1.110.15-1.el6.x86_64                                                                                                                                                                         3/262 
  Erasing    : system-config-date-docs-1.0.11-1.el6.noarch                                                                                                                                                             4/262 
  Erasing    : system-config-date-1.9.60-2.el6.centos.noarch                                                                                                                                                           5/262 
  Erasing    : system-config-kdump-2.0.5-15.el6.noarch                                                                                                                                                                 6/262 
  Erasing    : system-config-network-tui-1.6.0.el6.2-1.el6.noarch                                                                                                                                                      7/262 
  Erasing    : dmraid-1.0.0.rc16-11.el6.x86_64                                                                                                                                                                         8/262 
  Erasing    : dmraid-events-1.0.0.rc16-11.el6.x86_64                                                                                                                                                                  9/262 
  Erasing    : compiz-gnome-0.8.2-24.el6.x86_64                                                                                                                                                                       10/262 
  Erasing    : gnome-disk-utility-2.30.1-2.el6.x86_64                                                                                                                                                                 11/262 
  Erasing    : compiz-0.8.2-24.el6.x86_64                                                                                                                                                                             12/262 
  Erasing    : xorg-x11-drv-ati-7.1.0-3.el6.x86_64                                                                                                                                                                    13/262 
  Erasing    : pulseaudio-module-bluetooth-0.9.21-14.el6_3.x86_64                                                                                                                                                     14/262 
  Erasing    : gnome-bluetooth-2.28.6-8.el6.x86_64                                                                                                                                                                    15/262 
  Erasing    : bluez-4.66-1.el6.x86_64                                                                                                                                                                                16/262 
  Erasing    : gnome-power-manager-2.28.3-7.el6_4.x86_64                                                                                                                                                              17/262 
  Erasing    : rhythmbox-0.12.8-1.el6.x86_64                                                                                                                                                                          18/262 
  Erasing    : xorg-x11-glamor-0.5.0-6.20130401git81aadb8.el6.x86_64                                                                                                                                                  19/262 
  Erasing    : mesa-libEGL-9.2-0.5.el6.x86_64                                                                                                                                                                         20/262 
  Erasing    : kexec-tools-2.0.0-273.el6.x86_64                                                                                                                                                                       21/262 
  Erasing    : xorg-x11-drv-modesetting-0.5.0-1.el6.x86_64                                                                                                                                                            22/262 
  Erasing    : 1:xorg-x11-drv-nouveau-1.0.1-4.el6.x86_64                                                                                                                                                              23/262 
  Erasing    : xorg-x11-drv-synaptics-1.6.2-13.el6.x86_64                                                                                                                                                             24/262 

A lot of packages are lost and i can no more connect to this system using ssh ! What was wrong in my command line?

share|improve this question
well it seems that removing iptable is link in a way to rhythmbox and dozens of other packages. – Kiwy Mar 27 '14 at 12:19
Why did you remove iptables? It's not really a removable item. You can disable it, service iptables stop. You'll likely need to reinstall to recover from this or you'll need a disk w/ the key missing RPMs so that you can install them locally, not over the network. yum localinstall <rpm1> <rpm2> .... – slm Mar 27 '14 at 12:33
next time you have the brilliant idea of removing very system package try not to use -y at the first time ;-) – Kiwy Mar 27 '14 at 12:39
Running repoquery --whatrequires --installed --recursive iptables on a clean system shows that yes, very many things depend on iptables. – Eero Aaltonen Mar 27 '14 at 13:05
@Kiwy Yes i learned the lesson in the rough way :-) – Slyx Mar 27 '14 at 14:59

1 Answer 1

up vote 13 down vote accepted

What was wrong in my command line?

Nothing. It did what you asked it to do -- removed iptables and, by inference, everything that depends on it. And everything that depends on those things and so on.

As Kiwy points out, it is pretty reckless to run a remove -y without having first considered what might happen. I'm sensing some frustration in the back story here with regard to iptables? Anyway, for future reference, as far as I can recall iptables comes installed by default but without any rules defined, so if you don't want to screw with it, just don't do anything, and it won't either.

Raising the question, "Why is it a dependency for so many things?", to which I don't have an answer; I do not think it is because of real necessity, but since it is by default toothless and considered a piece of standard basic equipment on any normal linux system, perhaps there were some advantages to doing it this way.

repoquery --whatrequires iptables

Takes a minute or two (while dependencies are part of normal package metadata, "dependents" aren't, so this query requires some work) and reveals a pretty substantial list (~50 packages for me on Fedora 20). Considering the chain of things further attached to those things ("Remove 262 Package(s)..."), it's unsurprising that your system be left in a semi-crippled state.

Anyway, you can re-install many of these things by starting with a high level package. Helpful in this regard are commands like yum search, yum provides, and repquery --list. To get back your ssh client back:

yum install openssh-clients

Of course you'll need another way to access the system, hopefully it is not on a farm in Iceland or you'll have to make some phone calls. You've also lost X by the looks of things, so don't be surprised by that when you plug in a screen and keyboard.

We all do stupid things from time to time, inadvertently.

share|improve this answer

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.