Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

A friend of mine partitioned his ubuntu system with /usr on a separate partition. That partition is now full. He can't use apt to install new software. Is there anything in /usr that he can safely delete (i.e. delete with rm, not apt-get remove)?

Since he can't install new software he can't install something like dpigs (the tool for checking which packages is taking up space)

share|improve this question
add comment

6 Answers

up vote 1 down vote accepted

Have you tried "sudo apt-get clean", "apt-get autoclean", and "apt-get autoremove"? If you use "man apt-get" that will describe what each does and may free some space.

share|improve this answer
2  
clean only deletes stuff in /var. –  womble Nov 23 '09 at 14:39
    
As @womble said, clean only deletes things in /var. However autoremove will delete things in /usr, so it might save something –  Rory Nov 23 '09 at 15:30
    
Whoops...didn't hurt to try it though :-) Looks like autoremove may give wanted results. It may have given some direction in which to look though. –  Bart Silverstrim Nov 24 '09 at 12:06
add comment
/usr/share/doc
/usr/src
share|improve this answer
    
/usr/share/doc is the best place to purge. /usr/src can contain locally-built stuff that can't be easily replaced. –  womble Nov 23 '09 at 14:40
    
yes, but sometimes it conain vanilla kernel and standard sources what easily can be restored from internet –  vlad Nov 24 '09 at 11:03
    
/usr/share/doc is a good one to clean up, however, using apt-get to delete the files would be a better way. Is there some easy way to remove those files using apt? –  Rory Dec 21 '09 at 10:28
add comment

I had a similar problem. First step was to find the top ten space hogs:

# cd /usr/share
# du -sm * | sort -rn | head -10

/usr/share/doc was 759MB on my system. Space that could be useful for other purposes. With *nix you can move things around without breaking things. In my case I had plenty of free space on /home which was on a different partition:

# mkdir -p /home/share/doc
# mv /usr/share/doc/* /home/share/doc
# rmdir /usr/share/doc
# ln -s /home/share/doc /usr/share/doc 

If you are really desparate, you can always mount an external hard drive and perform a similar relocation process. The thing to watch for in that case is that you don't move anything critical to the system startup to the external drive. /usr/src is another candidate, but I wouldn't move /usr/lib, too risky.

share|improve this answer
add comment

An ugly hack would be to try uninstalling GNOME and get something lightweight instead. Presumably this shall save some space.

share|improve this answer
add comment

Another option not explored is to resize the partitions with the gparted livecd. Backup your critical data first though and be prepared to loose the lot just in case. I have done a resize a few times before and not had an issue so it's quite a robust procedure.

Another extension to this is that he could move everything from /usr to another larger partition linking it with a symbolic link to the new location. Then using gparted you can remove the old /usr partition and merge /usr into the other partition.

Personally, I don't see the need to separate partitions for /usr /home etc like the old days. It often results in more issues than it solves (i.e. running out of space). Still, that's just my opinion.

share|improve this answer
add comment

I like the solution by CyberFonic best, however when creating the symlink I had to give it the option for 'no dereference' since it's a directory. Otherwise i would get errors when installing anything that tried to add a doc file, since /usr/share/doc wasn't being seen as a directory. I couldn't cd to /usr/share/doc until I did the symlink like so:

sudo ln -sfn /home/usr/share/doc /usr/share/doc

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.