Solved

Removing unnecessary packages in Redhat 5

Posted on 2011-03-03
9
1,300 Views
Last Modified: 2012-05-11
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
Comment
Question by:drei22
  • 4
  • 3
  • 2
9 Comments
 
LVL 77

Expert Comment

by:arnold
ID: 35027757
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
 

Author Comment

by:drei22
ID: 35027792
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
 
LVL 31

Accepted Solution

by:
farzanj earned 500 total points
ID: 35027795
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:drei22
ID: 35027922
Wow. Now that really sucks as I'll have to basically manually go through 3000+ packages and decide what needs to be removed.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35027999
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
 

Author Comment

by:drei22
ID: 35028053
Thanks Farzanj! You're information has been very helpful indeed to a new admin.
0
 

Author Closing Comment

by:drei22
ID: 35028079
I'm new to Linux administration and this was very helpful.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35028082
You are most welcome
0
 
LVL 77

Expert Comment

by:arnold
ID: 35029074
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question