This command will list any package that has "fox" in it's name...
This command will list what is required by the firefox package...
This command will erase the firefox package...
If something depends on a package you are erasing, it will error and tell you what it is. You can then add it to the erase command if you want, or not do anything. (Thunderbird doesn't depend on firefox, that's just an example of erasing two packages at once.)
Code:
rpm -e firefox thunderbird
It's prob'ly not a good idea to run a command that tries to delete all dependencies for a package... In the example above, it lists about 100 dependencies for firefox.
Now, having answered the questions, is there a reason you need / want to use rpm rather than yum? yum is a package manager that uses rpm. yum is also better at handling dependencies than rpm. The commands above would be similar in yum...
Code:
yum list | grep fox
Code:
yum deplist firefox
This command will install GIMP. It will check if there are any dependencies that need to be downloaded and installed, and do so. rpm won't retrieve dependencies, just error when you don't have them.