obsolete files

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
chazb
Level 5
Level 5
Posts: 713
Joined: Wed Nov 30, 2016 2:56 am
Location: Oklahoma

obsolete files

Post by chazb »

What comand do I use in terminal to purge obsolete, un-needed, un-used , old files. In LinuxMint 17.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat

Re: obsolete files

Post by WharfRat »

What is your criteria for identifying obsolete, un-needed, un-used , old files :?:

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

Re: obsolete files

Post 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 Windows. There is no registry. Unless you're running out of hard drive space, you shouldn't need to 'clean' anything.
Last edited by Jaydemir on Fri Oct 13, 2017 9:36 am, edited 1 time in total.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: obsolete files

Post 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.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
minitux

Re: obsolete files

Post 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
bob466
Level 6
Level 6
Posts: 1151
Joined: Mon May 15, 2017 5:23 am
Location: Australia

Re: obsolete files

Post by bob466 »

I don't use anything either...I did use ccleaner in Windows but this isn't Windows...thank God for that. :D
Linux For Ever...Windows Never. Image
The Freedom To Choose Your Own Avatar Without Victimisation.
User avatar
Pjotr
Level 24
Level 24
Posts: 20129
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: obsolete files

Post 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.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
minitux

Re: obsolete files

Post 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..
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: obsolete files

Post 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.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
revian

Re: obsolete files

Post 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.
minitux

Re: obsolete files

Post 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
revian

Re: obsolete files

Post 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.
minitux

Re: obsolete files

Post 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
Ricardo Vieira

Re: obsolete files

Post 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.
User avatar
BG405
Level 9
Level 9
Posts: 2508
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: obsolete files

Post 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.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
jsb
Level 3
Level 3
Posts: 166
Joined: Sat Feb 11, 2017 11:20 am

Re: obsolete files

Post 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.
minitux

Re: obsolete files

Post 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
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: obsolete files

Post 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 LSPKG (https://github.com/terminalforlife/Perl ... urce/lspkg) to get a tidy, descriptive list (apt-cache search style) of all the packages you have installed (according to '/var/lib/dpkg/status'), which will help give you an idea of what you do or don't need. Or, if you prefer, run this: dpkg -l
Last edited by Termy on Thu Apr 07, 2022 12:35 pm, edited 3 times in total.
I'm also Terminalforlife on GitHub.
minitux

Re: obsolete files

Post by minitux »

Yes, the purge of a program does not remove the user configurations, they must be removed manually
Locked

Return to “Beginner Questions”