• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1349
  • Last Modified:

Removing unnecessary packages in Redhat 5

I have many servers where the admin used the default Redhat install. About 3000 packages were installed as a just in case we need them way of thinking. Is there anyway via scripting that I can uninstall selected packages while leaving the necessary package files in place? Also how would I deal with dependency issues?
0
drei22
Asked:
drei22
  • 4
  • 3
  • 2
1 Solution
 
arnoldCommented:
rpm -e <list of packagenames to be removed>

Packages will not be removed if there is another package that relies on it.

Are the extra packages besides taking space affect the performance of the system?

You probably can remove all the graphical/X11, Gnome, etc. packages but I found that their existance on the system helps at times when a graphical tool can be exported via an SSH tunnel back to an X-Server or a graphical workstation.
0
 
drei22Author Commented:
What happened is that we have two sites. Site A are the production the baseline servers which are fine.  Site B is where the backup servers are but they have a ton of unnecessary packages installed. I would like to get the Site B servers to match site A servers without having to rebuild the servers in site B. Actually management is insisting that we don't rebuild but but fix as rebuilding only makes sense to us Admins.
0
 
farzanjCommented:
If you have enabled RedHat satellite server, you can do it very easily.

In any case, you need to know the packages you need and the ones you don't.  I would suggest that you should first test on a test box as to the number of packages you need.  If you want to start uninstalling on a production machine, well, it is risky.

Once you have accomplished that, you need to write a trivial script, that does

rpm -e  --nodeps << EOF
chatx
extra
EOF

Note that there are no version numbers or release etc.
This way you will not have to reboot the machines.  However, rebooting would be a good idea because you would know whether it still runs after the uninstall.

Extreme caution is required.  Planning part is most important.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
drei22Author Commented:
Wow. Now that really sucks as I'll have to basically manually go through 3000+ packages and decide what needs to be removed.
0
 
farzanjCommented:
Unfortunately yes.  Planning deployment itself is a big thing.  The other solution is to reinstall with the correct packages, which would not be possible on production systems.  I have been doing deployments for a long time now and you have to very carefully plan the functionality you want and then packages are chosen, kickstart is created and deployment is automated.  Once you are using the systems, you would not like everything to break just because of one minor package.
0
 
drei22Author Commented:
Thanks Farzanj! You're information has been very helpful indeed to a new admin.
0
 
drei22Author Commented:
I'm new to Linux administration and this was very helpful.
0
 
farzanjCommented:
You are most welcome
0
 
arnoldCommented:
run rpm -qa on the baseline servers. and store the data in a file.

then run rpm -qa on the other servers.
use comm or anyother mechanism to get the listing of the extra packages and then remove them.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now