Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Removing unnecessary packages in Redhat 5

Posted on 2011-03-03
9
Medium Priority
?
1,343 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 80

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 2000 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

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 80

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Fine Tune your automatic Updates for Ubuntu / Debian
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

886 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