LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-29-2023, 03:31 AM   #1
poncedeleon
Member
 
Registered: Jul 2021
Location: Patagonia
Distribution: Linux Mint Debian Enhanced LMDE
Posts: 195

Rep: Reputation: Disabled
Cleaning out temp files


Where are the temp files located and how do I get to them to clean them out? What else can one do clean out the cache and other maintenance chores?
 
Old 08-29-2023, 03:57 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,899

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
it always depends on the app, sotrware, os, system, whatever. There is no common way. But anyway there is a dir named /tmp to store temp files. A lot of apps can be configured, so you can tell them where to put those files. Also there is a variable TEMP. Cache is another thing and it always depend on the app which uses/manages it.
 
Old 08-29-2023, 05:00 AM   #3
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,804

Rep: Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203
systemd gives you means to care about temp files.
Code:
man tmpfiles.d
You can create your own conf file in /etc/tmpfiles.d/
or copy an existing system conf file and modify it.
 
1 members found this post helpful.
Old 08-29-2023, 05:02 AM   #4
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,973
Blog Entries: 33

Rep: Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465
poncedeleon,

Some temporary files are located in /tmp.

To delete temporary files:

Code:
cd /tmp
sudo rm -rf *
To clean cache:

Code:
du -sh /var/cache/apt/archives
sudo apt-get clean
In addition, you may wish to check on how much of your root partition is available.

I came across a full root partition on a friend’s Linux Mint PC the other day. This means that when you try to enter your password, nothing happens apart from the same password box being presented repeatedly in a doom loop.

To check how much space is left use the following command:

Code:
df -m /
The root cause (ha, ha,ha!) of the problem was that redundant kernels had filled up the root partition.

NB Please tread very carefully when removing old kernels!!

My latest kernel is 5.15.0-82 (see attached screenshot). Below it is the previous 5.15.0-79.

Below these two are kernels which can be deleted (see instructions below).

See tip #9 at:
https://easylinuxtipsproject.blogspo...lean-mint.html

“Remove old kernels" in the cleaning tips above. This reduced the used space from 96% to 64%.

Removal of specific redundant kernels

9.2. You can also remove a specific redundant kernel. Like this:

a. Launch Update Manager. In the toolbar of Update Manager: View - Linux kernels

This may take some time. Then a warning window pops up. Ignore it and click "Continue" in order to proceed.

b. Ignore the button labelled Remove Kernels... , because that button is meant for mass removal.
Just click on the kernel that you want to delete. Then click on the "Remove" button.

NB: I strongly recommend to leave the latest redundant old kernel in your system, just to be on the safe side!
It never hurts to have a spare kernel that's known to work well.

c. Now reboot your computer.

Automatic removal of old redundant kernels

9.3. The easiest and recommended way to prevent an accumulation of old redundant kernels, is to enable the automatic feature for removing obsolete kernels in Update Manager via Edit > Preferences > Automation > Automatic maintenance > Remove obsolete kernels and dependencies.

I hope this helps.
Attached Thumbnails
Click image for larger version

Name:	Kernels.png
Views:	6
Size:	61.8 KB
ID:	41539  

Last edited by beachboy2; 08-29-2023 at 05:35 AM.
 
Old 08-29-2023, 08:05 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,656

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by poncedeleon View Post
Where are the temp files located and how do I get to them to clean them out? What else can one do clean out the cache and other maintenance chores?
Since you (again) don't tell us version/distro of Linux, we can't give you much. Better question is WHY you ask, because are you actually having a problem??? In the past 20 years, I've NEVER had to manually flush such things due to any system issue.
 
Old 08-29-2023, 08:44 AM   #6
Jan K.
Member
 
Registered: Apr 2019
Location: Esbjerg
Distribution: Windows 7...
Posts: 773

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Bleachbit looks nice?
 
Old 08-29-2023, 10:07 AM   #7
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,152

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Before backing up my home folder I always remove ~/.thumbnails ( it can ge quite big, for instance as of writing this it stands at 640M+ ), also ~/.cache
 
Old 08-29-2023, 04:28 PM   #8
David Roesch
Member
 
Registered: Jul 2022
Location: San Francisco Bay Area
Distribution: Linux Mint (current stable release)
Posts: 30

Rep: Reputation: 11
Re: Bleachbit looks nice?

Agreed. Bleachbit works much in the same way that the "CCleaner" app works in Windows.
 
Old 08-29-2023, 04:37 PM   #9
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
As TB0ne stated, Linux can keep its nose clean without external help. Leave bleaching to wannabe operating systems.
 
1 members found this post helpful.
Old 08-29-2023, 06:41 PM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,235

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
I used to mount /tmp on tmpfs.
 
Old 08-31-2023, 07:04 AM   #11
David Roesch
Member
 
Registered: Jul 2022
Location: San Francisco Bay Area
Distribution: Linux Mint (current stable release)
Posts: 30

Rep: Reputation: 11
Quote:
Originally Posted by Emerson View Post
As TB0ne stated, Linux can keep its nose clean without external help. Leave bleaching to wannabe operating systems.

Not entirely true. If it was true, we wouldn't have the likes of apt's clean and autoclean options, now would we ?

Regardless of the OS in question (*nix systems included) yes- they all gather dustballs in areas where we don't usually look. Despite what others might say, running programs like Bleachbit will at the least free up some space in areas/folders that you might not have known even existed.

Last edited by David Roesch; 08-31-2023 at 07:06 AM.
 
Old 08-31-2023, 07:23 AM   #12
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Quote:
Originally Posted by David Roesch View Post
Not entirely true. If it was true, we wouldn't have the likes of apt's clean and autoclean options, now would we ?
This is true exactly because apt can take care of distfiles and obsolete packages, and it "knows" what it is doing, unlike some external application. Admin can automate apt tasks, run it as weekly or monthly cronjobs. All my desktops/laptops run Gentoo, distfiles are stored in my media server and shared over NFS, this server runs monthly cronjob and cleans out obsolete distfiles. Now tell me I should use bleachbit instead. LOL
Running apt clean (native tool) is no harder than running this bleachbit (third party application I wouldn't trust). Sorry, but you are not making sense to me.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I create "Copy to ~/temp" and "Move to ~/temp" right click options with Caja Actions on MATE? linustalman Linux - Software 0 11-28-2022 12:48 PM
[SOLVED] Cleaning out junk Robert.Thompson Slackware 11 06-17-2011 08:27 AM
lm_sensors cpu temp v.slightly different to MOBO temp on Intel D865GLC sc_3007 Linux - Hardware 5 11-13-2009 12:17 PM
LXer: Cleaning Out the Closet: What to Do With Those Worn-Out Legacy Systems LXer Syndicated Linux News 0 03-04-2009 05:41 PM
Cleaning out wine Maze the Kid Linux - Software 0 01-17-2005 02:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration