LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Safe things to delete from / (https://www.linuxquestions.org/questions/slackware-14/safe-things-to-delete-from-4175411266/)

Noway2 06-13-2012 01:08 PM

Safe things to delete from /
 
I have a system based upon Slackware64-current. I have been running this a while and periodically performed upgrades. It is on a multi-booted laptop with separate home and / partitions. The / partition has filled up to where it is reporting 100% utilization and I don't have a lot of room left on the drive to allocate more to it. BTW, it is an older PATA notebook drive and while I can get a 320 GB drive, I am not sure I want to invest ~$100 into this laptop, at least anytime soon.

I am looking for things that I can safely delete from the system and my question is for recommendations. It looks like a lot of space is being taken up in the package cache, under /var/cache and if I delete this I can recover almost 20% of the drive space, but I loose the ability to update the system or install or remove packages. Other options include removing the Linux Kernel Sources, and removing applications. Previously I tried uninstalling applications, but apparently removed a critical library and couldn't start KDE anymore. This has left me hesitant to go down this road, at least so aggressively anymore.

As it stands, I have had to re-image the drive with DD after killing the system a few times. At one point, I formatted this partition and reinstalled, with the new system taking up less than 40% of the space, which tells me that it is file creep-age. Unfortunately, the upgrade to -current bombed and I reverted the system back via the backup.

So, this leaves me wondering what things would be safe to remove to gain some space while not killing the system?

Kustom42 06-13-2012 01:12 PM

You can remove your package cache with the package manager utility, with yum the command is yum clean all. Won't do any damage. You can also remove any old log files in /var/log that you do not need and if /tmp/ is on that same partition basically anything in there can be removed without worry.

sycamorex 06-13-2012 01:23 PM

Have a look at the /tmp file [edit: of course I meant 'directory' not 'file']. If you don't clean it regularly, there might be some unnecessary stuff there (delete it automatically on boot).

If you're using sbopkg, there'll probably be quite big /tmp/SBo and /var/cache/sbopkg directories. You can safely remove them.

Keith Hedger 06-13-2012 02:31 PM

Have a look at ~/.thumbnails I always remove this folder before doing a backup as it can hold a LOT of files.

Also have a look at what you can thwow a way from the ~/.mozilla folder ( the variaous cache files ) at the moment my .mozilla folder stands at over 120M - while I'm at it might as clean out my own one!

Didier Spaier 06-13-2012 03:40 PM

/usr/doc and /usr/share/doc are pretty heavy.

piratesmack 06-13-2012 03:44 PM

Slax had a script called prepare-crippled-kernel-sources.sh that would remove a lot of the kernel source but leave enough to allow building of extra kernel modules.
Code:

cd /usr/src/linux
# remove a lot of stuff
rm -Rf Documentation drivers fs net sound firmware
ls -1d arch/* | grep -v x86 | xargs rm -Rf
ls -1d include/* | grep asm- | grep -v x86 | grep -v generic | xargs rm -Rf

You will have to reinstall the kernel source package if you want to recompile your kernel though.

You can also remove some extra packages with:
Code:

slackpkg clean-system

Keith Hedger 06-14-2012 03:19 AM

Quote:

Originally Posted by piratesmack (Post 4702464)
...
You can also remove some extra packages with:
Code:

slackpkg clean-system

Be Careful! this will remove ALL third party packages ie anything that is not in the official install.

Noway2 06-14-2012 04:47 AM

A warm thank you to everybody for their suggestions.

I cleared out the tmp directory. I thought, though it goes back well over a year, that I followed the suggestion by Genek in his Adventures in Slackware to add the command to clear out this folder. That reduced the usage down to 86%. The thumbnails folders did have some space on it. I cleared out the one under /root. For right now, I have decided to leave the /doc folders, but this is a good suggestion. I did remove a couple of packages that I manually installed and don't need and removed an older linux kernel that I had both a bz2 of and the directory. This one is my recovery boot, so I don't mess with it much but don't develop on it. I ran the crippled kernel clean up and that gained a few more percentage. All told, I reduced the utilization down to 70%, which I can likely improve upon by removing a few packages, e.g. calligra which was installed in a recent update.

etienne 06-14-2012 05:18 AM

Quote:

Originally Posted by Keith Hedger (Post 4702899)
Be Careful! this will remove ALL third party packages ie anything that is not in the official install.

Unless these packages are blacklisted...

Keith Hedger 06-14-2012 11:44 AM

Quote:

Originally Posted by etienne (Post 4702980)
Unless these packages are blacklisted...

Yes I should have mentioned that, nice catch!

piratesmack 06-14-2012 05:01 PM

Quote:

Originally Posted by Keith Hedger (Post 4702899)
Be Careful! this will remove ALL third party packages ie anything that is not in the official install.

True, but it gives you a chance to deselect the ones you want to keep first.

hba 06-14-2012 10:36 PM

A suggestion, if you feel the size of your / is little at this moment, you can safely resize it with something like http://www.sysresccd.org, it's a live cd with the GParted program. Lets say you want to give some space from /home to /. It has some other programs/features so i would recommend it for those situations when you need to rescue a linux/windows system.

ReaperX7 06-14-2012 10:37 PM

There is a cleanup utility included with KDE that you can use. Sweeper(?) should be able to clean up and dispose of files you no longer need.


All times are GMT -5. The time now is 07:38 PM.