FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 02-15-2012, 07:51 PM
Alexander Dalloz
 
Default question on unused directories in /usr/lib and /usr/lib64

Am 15.02.2012 21:30, schrieb Craig Thompson:
> I was working on archiving an old virtual server today and was reminded of how much space is wasted by some of the default installations on CentOS. I think this was a 5.x box.
>
> Anyway, in /usr/lib/64 (and probably /usr/lib on non-64 systems), there were a lot of directories which have no bearing on a basic server. I saw firefox, openoffice and many, many other directories -- replete with enough files to seriously affect backup space over time.
>
> Does anyone have an available script or list of commands for removing most or all of these "generally unused" directories, packages or whatever they are?
>
> I found something a while back for shutting off unused services, but this seems to be a gaping hole in available archives.
>
> Thanks.
>
> CT

You are kidding, are you?

Uninstall unused / unnecessary software cleanly using using yum (or
rpm). *Don't* randomly delete filesystem structures you think they are
pointless or wasting harddrive space.

Alexander
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-15-2012, 08:13 PM
 
Default question on unused directories in /usr/lib and /usr/lib64

Craig Thompson wrote:
> Hardly kidding. But then again, this is early April isn't it? Oh,
> wait...
>
> To "cleanly uninstall unused software," one would need a list of what
> software is ON the system which is unused. Doing a "minimal" install
> pretty much gives you a system which no one can use. Doing the classic

I agree. I just did a minimal install last week, and had all *kinds* of
grief trying to get networking working.

> "server" install loads a lot of this junk which no one ever uses. As
> someone opined on this list, "Why does CentOS install bluetooth
> packages???" I don't want it on my server. I'm trying to find out what
> the commonly UNUSED packages are so they can be removed.

Yup. For that matter, why would I want avahi running on a rackmount server
that's hardwired for gigabit ethernet? But you get that, too, with
"server".
>
> I randomly selected one package "pango" and found it had about 200
> dependencies and uninstalled it. Lucky? But I'm sure there are more.

There are indeed some packages that have a ridiculous set of dependencies.
I can't remember what it was - it's been months, but I wanted to install
some command line tool, and it wanted gnome installed.
<snip>
mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-15-2012, 08:30 PM
Lamar Owen
 
Default question on unused directories in /usr/lib and /usr/lib64

On Wednesday, February 15, 2012 03:30:56 PM Craig Thompson wrote:
> Does anyone have an available script or list of commands for removing most or all of these "generally unused" directories, packages or whatever they are?

Ok, here's a two-step process you can try:
1.) rpm -qf /usr/lib/name/of/file/in/one/of/those/directories
2.) yum remove result-from-step-1-without-version-or-release-but-with-arch. Be sure to check the dependencies yum will want to remove, and think it through at least twice before confirming by pressing 'y.'

This is a diesel piledriver of a solution, but..... do be careful you aren't trying to remove something really important.

As an arbitrary and simple example:
[root@localhost ~]# cd /usr/lib64
[root@localhost lib64]# cd firefox-3.6
[root@localhost firefox-3.6]# ls
application.ini chrome extensions langpacks README.txt
blocklist.xml components firefox LICENSE run-mozilla.sh
browserconfig.properties defaults icons modules searchplugins
[root@localhost firefox-3.6]# pwd
/usr/lib64/firefox-3.6
[root@localhost firefox-3.6]# rpm -qf application.ini
firefox-3.6.26-1.el6.centos.x86_64
[root@localhost firefox-3.6]# cd ..
[root@localhost lib64]# yum remove firefox.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package firefox.x86_64 0:3.6.26-1.el6.centos will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================== ==============================
Package Arch Version Repository Size
================================================== ==============================
Removing:
firefox x86_64 3.6.26-1.el6.centos @updates 17 M

Transaction Summary
================================================== ==============================
Remove 1 Package(s)

Installed size: 17 M
Is this ok [y/N]: n
Exiting on user Command
[root@localhost firefox-3.6]#


Here's a more concrete (if extreme) example, since the python-2.6 directory in a default CentOS system isn't small (do note that I've snipped out several hundred lines of output with points of ellipsis (...) but left in lines that show real dealbreaker issues.....):

[root@localhost lib64]# du . --max-depth=1|sort -g
4 ./audit
4 ./games
4 ./libxslt-plugins
..
19112 ./firefox-3.6
29568 ./xulrunner-1.9.2
39092 ./dri
46536 ./perl5
77424 ./python2.6
141624 ./valgrind
691124 .
[root@localhost lib64]# cd python2.6
[root@localhost python2.6]# ls
_abcoll.py HTMLParser.py sched.pyc
...
htmlentitydefs.pyo runpy.py zipfile.pyc
htmllib.py runpy.pyc zipfile.pyo
htmllib.pyc runpy.pyo
htmllib.pyo sched.py
[root@localhost python2.6]# rpm -qf runpy.py
python-2.6.6-29.el6.x86_64
[root@localhost python2.6]# yum remove python.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package python.x86_64 0:2.6.6-29.el6 will be erased
--> Processing Dependency: python(abi) = 2.6 for package: python-babel-0.9.4-5.1.el6.noarch
--> Processing Dependency: python(abi) = 2.6 for package: authconfig-6.1.12-5.el6.x86_64
...
---> Package yum.noarch 0:3.2.29-22.el6.centos will be erased
--> Processing Dependency: yum >= 3.2.18 for package: yum-plugin-security-1.1.30-10.el6.noarch
--> Processing Dependency: yum >= 3.0 for package: yum-plugin-fastestmirror-1.1.30-10.el6.noarch
---> Package yum-metadata-parser.x86_64 0:1.1.2-16.el6 will be erased
---> Package yum-utils.noarch 0:1.1.30-10.el6 will be erased
--> Running transaction check
...
---> Package cman.x86_64 0:3.0.12.1-23.el6 will be erased
...
--> Processing Dependency: gettext = 0.17-16.el6 for package: gettext-devel-0.17-16.el6.x86_64
--> Processing Dependency: gettext for package: libvirt-client-0.9.4-23.el6_2.4.x86_64
---> Package grub.x86_64 1:0.97-75.el6 will be erased
--> Processing Dependency: grub for package: 1:libguestfs-1.7.17-26.el6.x86_64
...
--> Processing Dependency: /sbin/mount.nfs for package: resource-agents-3.9.2-7.el6.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package resource-agents.x86_64 0:3.9.2-7.el6 will be erased
--> Finished Dependency Resolution
Error: Trying to remove "yum", which is protected
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@localhost python2.6]#

In other words, you can't remove /usr/lib64/python2.6 safely..... unless you want the basic 'yum' command to break....and want to remove the bootloader.... and want the cluster manager (cman) to quit working.....

But python2.6 accounts for over 11% of the space in the /usr/lib64 tree.....
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-15-2012, 08:35 PM
 
Default question on unused directories in /usr/lib and /usr/lib64

John R Pierce wrote:
> On 02/15/12 1:13 PM, m.roth@5-cent.us wrote:
>> I agree. I just did a minimal install last week, and had all*kinds* of
>> grief trying to get networking working.
>
> huh? I did a minimal install of C6 and it came up on DHCP right off the
> bat. I don't even think I had to start sshd (at least, if I did, I
> forgot to record such on my installation notes)

Let me think.... I *think* it might have been on a blade, so there may
have been some oddness.

mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-15-2012, 09:24 PM
 
Default question on unused directories in /usr/lib and /usr/lib64

Craig Thompson wrote:
> Thanks, Lamar. This is the type of helpful response I was looking for.
>
> If anyone has any other practical "lists of junk" please post them.
>
> My goal is to develop my own list, put it in a basic shell script and
> remove them wholesale. I've done this for generally unused services which
> I run upon installation of a basic system, and it works well.
>
> The more community input, the better, IMO.
<snip>
Here's a thought:
yum grouplist | awk '{if ($3 ~ /Groups/ ) { doit = ($1 ~ /Install/ ) ? 1 :
0;} if ( doit ) { print $0; }}'

This will name all the groups that are installed. if you see, say, "Office
Suite and Productivity", you can do a yum remove @"Office Suite and
Productivity"

mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 07:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org