Page 1 of 2

obsolete files

Posted: Thu Oct 12, 2017 11:29 pm
by chazb
What comand do I use in terminal to purge obsolete, un-needed, un-used , old files. In LinuxMint 17.

Re: obsolete files

Posted: Thu Oct 12, 2017 11:34 pm
by WharfRat
What is your criteria for identifying obsolete, un-needed, un-used , old files :?:

I hope you're not referring to system files :?

Re: obsolete files

Posted: Thu Oct 12, 2017 11:35 pm
by Jaydemir
Not sure what the general opinion 'here' is, but I use [Suggestion removed for your safety :P] to spring clean (being very careful not to get rid of anything critical, and I NEVER use it in superuser mode for that reason)..

That being said, this isn't Windoze. There is no registry. Unless you're running out of hard drive space, you shouldn't need to 'clean' anything.

Re: obsolete files

Posted: Thu Oct 12, 2017 11:57 pm
by MintBean

Re: obsolete files

Posted: Fri Oct 13, 2017 2:45 am
by catweazel
Jaydemir wrote:I use BleachBit
WARNING newcomers to linux should not be advised to use bleachbit. It can and does b0rk systems very quickly, in seconds flat.

Re: obsolete files

Posted: Fri Oct 13, 2017 2:54 am
by minitux

Code: Select all

sudo apt-get clean

Code: Select all

sudo apt-get autoremove

Code: Select all

dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge

Re: obsolete files

Posted: Fri Oct 13, 2017 4:13 am
by bob466
I don't use anything either...I did use ccleaner in Windoze but this isn't Windoze...thank God for that. :D

Re: obsolete files

Posted: Fri Oct 13, 2017 4:42 am
by Pjotr
These are safe ways of cleaning your system:
https://sites.google.com/site/easylinuxtipsproject/4

The only practically relevant cleaning is getting rid of old kernels, though. In Mint 18.2 the average Mint user will probably install more "kernel updates" (i.e. new kernels) than he used to, which can add up after a while. Especially on small drives and on systems with a separate /boot.

Re: obsolete files

Posted: Fri Oct 13, 2017 4:54 am
by minitux
I use this graphic script, here is the .deb.tar.gz

viewtopic.php?f=65&t=249707#p1365194

Requires yad, in Mint 18 it automatically installs with gdebi installing the extracted .deb

In Mint 17 yad is not in the repository, you have to install yad first, you download from here

https://www.ubuntuupdates.org/package/w ... n/base/yad

Forse your system architecure, and then install the extracted .deb (from .tar.gz) with gdebi.

The script remove old kernel and leave the two latest ( the kernel in use and the penultimate) , clean the apt cache, make autoremove, remove residual configurations and others feature, like cache of browser, thumbnails etc..

Re: obsolete files

Posted: Fri Oct 13, 2017 2:18 pm
by Hoser Rob
catweazel wrote:
Jaydemir wrote:I use BleachBit
WARNING newcomers to linux should not be advised to use bleachbit. It can and does b0rk systems very quickly, in seconds flat.
+1. I don't even lknow of any reasonably knowledgeable Windows users who'll touch crap like that, and at least in WIndows there's some excuse for using it.

Re: obsolete files

Posted: Fri Oct 13, 2017 2:28 pm
by revian
You shouldn't need to clean much, except maybe, as Pjotr mentioned, old kernels. I try not to touch much of anything outside my $HOME directory. I've been using Mint for years and I've never run out of space due to system files.

Re: obsolete files

Posted: Fri Oct 13, 2017 2:52 pm
by minitux
if you keep your system for years and do not clean the apt cache you find yourself with many busy GBs and if you do not have a proper root partition do not go a long way

Aniway, I have always used the commands that I have previously posted and removed the old kernels or used the script I posted and for so many years that i use ubuntu and derivations ever had problems

Re: obsolete files

Posted: Fri Oct 13, 2017 3:18 pm
by revian
minitux wrote:if you keep your system for years and do not clean the apt cache you find yourself with many busy GBs and if you do not have a proper root partition do not go a long way

Aniway, I have always used the commands that I have previously posted and removed the old kernels or used the script I posted and for so many years that i use ubuntu and derivations ever had problems
Ah, yes, those apt-get commands you previously posted are very helpful.. I use those once a month or so.

Re: obsolete files

Posted: Fri Oct 13, 2017 3:29 pm
by minitux
revian wrote:Ah, yes, those apt-get commands you previously posted are very helpful.. I use those once a month or so.
I do not understand this
revian wrote:You shouldn't need to clean much, except maybe, as Pjotr mentioned, old kernels. I try not to touch much of anything outside my $HOME directory. I've been using Mint for years and I've never run out of space due to system files.
those things remove things out of $HOME remove from the system

Re: obsolete files

Posted: Fri Oct 13, 2017 4:04 pm
by Ricardo Vieira
Pjotr wrote:These are safe ways of cleaning your system:
https://sites.google.com/site/easylinuxtipsproject/4

The only practically relevant cleaning is getting rid of old kernels, though. In Mint 18.2 the average Mint user will probably install more "kernel updates" (i.e. new kernels) than he used to, which can add up after a while. Especially on small drives and on systems with a separate /boot.
I hope LM 19 or 19.1 will run by using LTS kernel. Updating kernels has been traumatic for me. I always use your very good tips, since 4 years ago, yesterday on Ubuntu, now on LM.

Sorry for my bad English.

Re: obsolete files

Posted: Sat Oct 14, 2017 8:49 am
by BG405
Linux software isn't full of bloat the way a lot of Windows software is .. and Windows itself for that matter, I think Vista was the worst offender in this respect at about 25GB!

All I do is clear out old kernels from time to time.

Re: obsolete files

Posted: Sat Oct 14, 2017 11:57 am
by jsb
Didn't really need to free up space, but since consensus seemed to be they are safe to use, I tried these, just out of curiosity:
minitux wrote:

Code: Select all

sudo apt-get clean

Code: Select all

sudo apt-get autoremove

Code: Select all

dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge
Freed up 4 GB.

Then followed these suggestions: https://sites.google.com/site/easylinuxtipsproject/4 (except I did not want to empty trash at this time, I already do that from time to time)

This freed up another 2 GB. So total recovered from doing things that I don't normally do was 6 GB. I had done a clean install of Mint 18.x about 9-10 months ago.

Re: obsolete files

Posted: Sat Oct 14, 2017 1:00 pm
by minitux
Nice :D

in addition to those commands, in addition to those commands, this
https://sites.google.com/site/easylinux ... ld-kernels

or this
https://sites.google.com/site/easylinux ... one-stroke

and you are right

Re: obsolete files

Posted: Sat Oct 14, 2017 1:10 pm
by Termy
I think the command for what to delete entirely depends on what you count as useless junk.

In most installations, I get rid of maaaaaany packages which for me are useless, but I wouldn't recommend a Linux beginner go doing that unless they know what they need.

In Mint alone there are so, so many packages installed that most people would never use it all. For one thing, I doubt too many people here need braille support, which accounts for a fair number of packages. There are many bluetooth packages which most probably don't need. Then there are maaany printer drivers, CUPS, and all sorts of other printing-related packages quite a few people may not use nor need.

Getting rid of what I considered useless saved me around a whopping 1GB in Mint 18.2 with I think Mate, consisting of around 270 packages, and something similar in distros like Ubuntu. I appreciate why Mint is like that, but for me, it's overkill, but then I'm not exactly the normal target for Mint. If you do decide to go this route, be very careful because it's easy to bork something if you don't know what you're doing, to put it bluntly.

The /tmp directory is by default cleared on reboot, so there's typically little need to do anything with that. There can be cases where /tmp isn't cleared on boot, but by default in most distros (Mint included) it's blown away into nothingness.

There's some stuff in $HOME/.cache you could clear out, such as thumbnails and the Firefox cache. That stuff can and does take up several gigs easily.

Purging programs (using dpkg --purge, or, what I would say to be preferable: apt-get purge) is all very well and wonderful (and it is!) but it ignores your $HOME configuration files. So go look at hidden files (files prefixed with a dot) within $HOME/ and see if you can find configuration files for programs you don't have installed anymore. DO NOT do this if you don't know what you're doing, though.

If, for example, you uninstalled Firefox and switched over to Chrome (please don't :P), then you no longer need $HOME/.mozilla and $HOME/.cache/mozilla becomes redundant. Unless of course you wish to migrate some Firefox stuff over to Chrome, or need to keep those files around in-case you return to the wonders of Firefox.

There are many more ways to save space or to just clear out files you don't need nor care for.

If you like, you could run lspkgs (https://github.com/terminalforlife/lspkg) to get a tidy, descriptive list (apt-cache search style) of all the packages you have installed (seen by dpkg), which will help give you an idea of what you do or don't need. Or, if you prefer, run this: dpkg -l

Re: obsolete files

Posted: Sat Oct 14, 2017 1:23 pm
by minitux
Yes, the purge of a program does not remove the user configurations, they must be removed manually