• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved Is it safe to clean /var/db/freebsd-update/files ?

ljboiler

Well-Known Member

Thanks: 85
Messages: 305

#1
I've got 107954 files taking up almost 2G of space in the /var/db/freebsd-update/files directory, which I'm assuming are leftovers from performing freebsd-update during the various FreeBSD 10-RC upgrades. Is it safe to remove these? With the ability to rollback an upgrade (using freebsd-update rollback), I'm guessing that this is where that rollback information is saved. I don't see a need to keep all that if I'm past the point of ever wanting to rollback. Perhaps a "cleanup" command needs to be added to freebsd-update.
 

ShelLuser

Daemon

Thanks: 806
Messages: 2,012

#2
It's all in the freebsd-update(8) manualpage ;-)

Yes, the directory you're referring to here is the so called working directory, which you can also specify yourself by using the -d commandline parameter. As you guessed yourself; this is the place where temporary files and downloaded updates go. So if everything went well it should be safe to simply clean this one out.

As to your idea; I'd suggest to create a Problem Report (PR) for that, if one doesn't exist yet (seems that it doesn't). Just be sure to be precise and descriptive with your suggestion and also mark it as a request for change.
 

Oclair

New Member


Messages: 8

#3
I also desire to have freebsd-update keep it's self tidy

I checked man freebsd-update and there was no mention of a clean function
 

Sevendogs

Active Member

Thanks: 32
Messages: 176

#4
I stumbled on this thread from the main menu of the site (right side) and noticed I also have 1.8 gb of files in this directory. Interestingly enough rm could not remove them because there were too many files so I ended up deleting the /var/db/freebsd-update/files directory itself then re-creating it and setting the appropriate permissions. Apparently rm has a parameter limit ;)
 

PacketMan

Aspiring Daemon

Thanks: 107
Messages: 773

#6
Apparently rm has a parameter limit ;)
When I expereince that I just modify my parameter, and do a rm a few times. Something like this for example:
rm a*
rm b*
rm c*


or for example
rm 201609*
rm 201610*
rm 201611*


I'm guessing there is a way that you don't need to do that, but that is what I do, and its a good way to practice syntax with wild-cards.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,503
Messages: 25,687

#7
A little slow but works: find /var/db/freebsd-update/files/ -type f -delete
 

rustyx

New Member

Thanks: 2
Messages: 11

#9
Why remove just files when the whole directory can be cleaned?

rm -r /var/db/freebsd-update/*

Works great.

==EDIT==

I see it now - you wanted to keep the rollback data. But I don't plan on rolling back so my way works fine for me.