[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: freeing up some space



On Tuesday 11 January 2022 02:25:47 pm Cindy Sue Causey wrote:
> On 1/11/22, Roy J. Tellason, Sr. <roy@rtellason.com> wrote:
> > So I'm poking around with mc,  and happened across /var/cache/apt/archives
> > which has a LOT of *.deb files in it, and which seems to include many
> > versions of the same package,  some of them many years old,  going all the
> > way back to 2013.  I guess I've been running debian a little longer than I'd
> > thought...
> >
> > Is it okay to just delete older versions of these files?  Or should I be
> > doing something using one of the package management tools?  

Apparently the info about what's in this directory is also stored in some database somewhere,  so just going in there and deleting a bunch of stuff will probably break something...

> > I've mostly used synaptic,  but am also aware of apt-get,  apt,  aptitude,  and am not real
> > clear on their comparative capabilities.

Time to read some man pages and some of the docs that also got installed on my system...   :-)

> > I'm looking at over 7500 files amounting to over 9.5GB.
> >
> > I also see /var/cache/dictionaries-common,  which appears to be tied to a
> > spelling checker,  which I don't use here.  And /var/cache/samba,  which I
> > also don't use -- there isn't a windoze machine around here at all.
> >
> > What's the best way to get all of this excess stuff out of the system?
> 
> Just chiming in until someone can respond with recent firsthand
> experience. If you go to e.g. "man apt" or "man apt-get", you'll see
> flag options that are about cleaning up downloaded files. I did this
> once a couple years ago and so can't remember which one worked for
> what you're asking, but it does work. Whichever option it is, it
> leaves the currently installed deb in place and cleanses out anything
> that's no longer in use.

Somebody (maybe more than one somebody) suggested a "clean" option,  but apparently that will get rid of *ALL* of those files.  I'd kinda prefer to keep the most recent of any of them that are still being used.  In perusing the docs for aptitude,  I see that there's an option in there to "clean obsolete files",  which sounds like it'll do just that.  I don't see such an option in apt-get,  or elsewhere (so far).
 
> Thank you to the Developers who have left this as a User CHOICE that
> must be manually addressed if a different option is desired. Users
> have their various reasons for maintaining older install debs. It's
> nice to know they're always safe from sudden, silent deletion.

Yes,  it is nice having a choice about these things.
 
> Afterthought as I write that because of an experience that I
> encountered. There's additionally a value you can define that
> automatically performs the above function every time you update and
> then upgrade your system's packages.

I think that the default for aptitude is to not do what I mention above,  but it also appears that it's possible to make it do that by default by fiddling with a config file.  This would appear to be detailed in the section of the docs entitled "Configuraton File Reference",  which talks about what files are used (and their locations),  and then lists all of the options that are or can be in those files.
 
> Remembering that detail led to a search that didn't find a tip on
> which file contains that changeable value, but I did find the
> following (might need fixed to be one usable line):
> https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_basic_package_management_operations_with_the_commandline
> 
> If that link doesn't bounce partway down the page to the appropriate
> section, CTRL+F (or similar browser find feature) on that "operations
> with the commandline" part of the link should help. It's Section 2.2.2
> that contains those various interesting values.

Yeah.  But the detailed docs for aptitude are a whole lot more interesting and more detailed/explicit.
 
> If anyone test drives those for the first time, especially without
> fully understanding what the notes are saying the options do, PLEASE
> make sure to back up your system first. Been there, done that without
> backing up in the past. It's not pretty..
> 
> Cindy :)

From what I understand I should be able to get the software to show me what it's planning on doing before it actually goes ahead and does it.   :-)

-- 
Member of the toughest, meanest, deadliest, most unrelenting -- and
ablest -- form of life in this section of space,  a critter that can
be killed but can't be tamed.  --Robert A. Heinlein, "The Puppet Masters"
-
Information is more dangerous than cannon to a society ruled by lies. --James 
M Dakin


Reply to: