r/linuxmint • • 24d ago

SOLVED Is there a program that selects and deletes all orphaned files?

I'm a person who HATES unused storage. Because I know leftover files build quickly, I try my best not to install anything I know I won't use. But there are occasions where I do test something like a fix. I tried deborphan but that gets rid of the entire DE (and I'm almost certain I've used it improperly). I'm annoyed having to do a fresh install every time I notice my storage has significantly decreased from before the packages/apps to after uninstallation.

0 Upvotes

53 comments sorted by

•

u/AutoModerator 24d ago

Please Re-Flair your post if a solution is found. How to Flair a post? This allows other users to search for common issues with the SOLVED flair as a filter, leading to those issues being resolved very fast.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

5

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 24d ago

If I understand correctly (not sure about hating unused storage but leftover files maybe)...

Have you tried using apt purge someApp instead of apt remove someApp? It might do a better job removing any config files it created. (mostly in $HOME/.config/ and /etc/ maybe )

And follow that up with apt autoremove. That should remove no longer needed leftover dependencies of someApp.

If you use timeshift you can create a snapshot right before experimenting and then restore when finished. ("a fix" might better be undone like this unless you keep good track of all changes so you can undo)

I use identical mirrored instances of Mint. One master, one slave. When I'm thinking, I use the slave instance for testing. If I'm not and want to make sure I'm back to where I was, I boot slave and mirror back to master. That's just me though.

Have fun and good luck.

2

u/Inquisitive-Mind-A 24d ago

I mistyped. I mean space that could be ysed for something else 8nstead of being a waste.

1

u/Inquisitive-Mind-A 24d ago

Yeah, I use autopurge but even that leaves config files. But some programs still leave things in the root directory. But that is a good idea. How is the timeshift stored? Is it like in a cloud service? I've never thought of using it before.

1

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 24d ago edited 24d ago

I haven't used it in awhile but by default I believe it uses the top level of your root drive for the snapshot. Personally, I don't like that. I prefer targeting a secondary drive for snapshots so they don't fill up my root drive. But I'm on a desktop with room for extra drives; on my single drive laptop I probably wouldn't use it unless maybe for a single on-demand snapshot. You can even target an external device.

The nice thing about the snapshot is that it's easily browsable making it easy to retrieve individual files as well as being able to restore the whole thing. (restoring is easy but requires a reboot if I remember correctly)

This is while creating an on-demand (no auto schedule), using my backup drive as a target:

Good luck.

Edit: spelling/grammar.

2

u/Inquisitive-Mind-A 24d ago

Okay then. I think I'd only need one snapshot anyway. Thank you!

2

u/jr735 Linux Mint 22.1 Xia | IceWM 24d ago

Timeshift will save where you wish it to save, but as I recall, it looks for some sane defaults. I don't know if it works with any cloud services and I have not tried that.

6

u/zuccster 24d ago

This feels like something you should work on with a therapist rather than an Mint issue.

2

u/Inquisitive-Mind-A 24d ago

Is it wrong to maximize your use of something? I don't think so.

2

u/rcentros LM 21/22 | Cinnamon 24d ago

sudo apt autoremove should help. There's a man page on "apt autoremove." It looks like there is also a "purge" option -- but I haven't gotten too deeply into this. I just run sudo apt autoremove from time to time.

2

u/Inquisitive-Mind-A 24d ago

I'll start using autoremove. The root directory is one of my main concerns though.

2

u/rcentros LM 21/22 | Cinnamon 24d ago

sudo apt autoremove purges unused files in the root directories as well. I mostly use it to clear out old kernels.

2

u/Inquisitive-Mind-A 24d ago

I didn't know that. The recommendations made it seem like autopurge was the all-in-one orphan file remover.

1

u/sineout 24d ago

sudo apt purge packagename to completely erase a package (including configuration files and the like except for those in your home directory, those you'll need to look for manually), then sudo apt autoremove to remove any orphaned dependencies

1

u/Inquisitive-Mind-A 24d ago

Thank you, I usually use autopurge. Many videos said it was guaranteed to remove everything associated with that package, but none of them mentioned there may be lwftover files in the root directory.

1

u/_Lost-In-The-Weeds_ LMDE7 Cinnamon 24d ago

In the future when removing software use 

sudo apt purge ProgramName 

That will remove the program and it's configuration files, I don't know how to do that after the fact other than manually hunting things down. 

But I suspect that is the small end of your drive space issue, logs can be an issue, as can ~/.cache 

Spend some time with the disk usage analyzer and figure out where your space is going. 

My / partition is pretty trim, 7.62GB at the moment and that includes /home but none of my data. Also I am using lz4 disk compression.

 

1

u/Inquisitive-Mind-A 24d ago

Is purge better than autopurge?

2

u/kudlitan 24d ago

autopurge removes everything left over by any package, purge is used for a specific package.

2

u/jr735 Linux Mint 22.1 Xia | IceWM 24d ago

Note that neither will remove configuration files from your home directory - the dotfiles.

1

u/_Lost-In-The-Weeds_ LMDE7 Cinnamon 24d ago edited 24d ago

I am not familiar with autopurge,

CLI does not seem fault it though

dad@RatRod:~$ sudo apt autopurge --dry-run

Summary:                        
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0

Did you mean Autoremove?

dad@RatRod:~$ sudo apt autoremove
Summary:                        
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0

or

dad@RatRod:~$ sudo apt autoremove --purge
Summary:                        
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0

That removes orphaned dependencies you do not need anymore. the --purge option works similarly to apt purge

snipit from man apt

Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed package will restore its function as before in that case. On the other hand you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration stored in your home directory.

Again I think this is the small end of your issue unless you are working in a very small drive.

3

u/JoeLinux247 LM 22.3 C 24d ago

Also for your consideration ...

How to Clean Linux Mint Safely
https://easylinuxtipsproject.blogspot.com/p/clean-mint.html

2

u/nisitiiapi Linux Mint 22.3 Zena | Cinnamon 24d ago

Others have already noted apt purge <package_name> and apt --purge autoremove. But, if you want to check for any "lingering" config files from when you did not use purge, there are some options:

  • By cli, you can see if there are any residual configs with dpkg -l | grep "^rc" and remove them with aptitude purge ~c.
  • Synaptic will show a section of residual configs and let you remove them.
  • Ubuntu Cleaner (there's a ppa) works well on Mint and provides a gui to not only clear apt cache, remove unused packages, and remove old kernels, but also to list and clean residual config files.

0

u/Due-Result7928 24d ago edited 24d ago

https://czkawka.org/#download

It is just very good.

otherwise you can safely type

sudo apt autoremove (in a terminal).

Of course a blockhead down cast...It was AI..it is just working well.

3

u/Inquisitive-Mind-A 24d ago

This seems to be exactly what I need. I'll see if it works when I get home. Thank you!

2

u/Due-Result7928 24d ago

Be careful when you use it. It is extremely powerful.

2

u/Inquisitive-Mind-A 24d ago

Thanks for the warning!

2

u/Unwiredsoul 24d ago

Be careful with that website.

1

u/Due-Result7928 24d ago

Need some training ? You should review your DNS...if you know something about DNS...Morse code in your country ?

2

u/Unwiredsoul 24d ago edited 24d ago

0

u/Due-Result7928 24d ago

From the software creator

So, to be clear: this site is not connected to me and I haven’t found any malware on it. The biggest concern is that it could become a malware distribution point in the future, especially since I found several other sites made with what looks like the exact same template..so there is NO malware.

So I would treat it with skepticism. Everyone should stick to the official GitHub repo or use unofficial builds from trusted

Call your doctor sir.

0

u/Due-Result7928 24d ago

Forget about comments by u/Unwiredsoul going left and right panicking, insulting me..f.ck off...nice... There is NO malware. Address I gave you is a copy of the git site. It is harmless and do not contain a virus,

From the software creator

So, to be clear: this site is not connected to me and I haven’t found any malware on it. The biggest concern is that it could become a malware distribution point in the future, especially since I found several other sites made with what looks like the exact same template..so there is NO malware.

So I would treat it with skepticism. Everyone should stick to the official GitHub repo or use unofficial builds from trusted

You can use the git site located at

https://github.com/qarmin/czkawka

Program is using Rust and I was using the Krokiet GUI interface. It help me a lot to clean up a huge number of pictures, photos and so on. Software is comparing content very useful and very quick

Krokiet in Polish is a food's name for dog...

3

u/Inquisitive-Mind-A 24d ago

Yes, I do see that. I hadn't realized it is from github originally. With that said, I would appreciate if the link was to the source and not to a non-affiliated website. Just for people to reducw blame on your part. I'm not saying you did that on purpose but people may be wary. Just a tip to preserve or build your reputation. I'm not picking sides.

1

u/Due-Result7928 24d ago

https://github.com/qarmin/czkawka/releases/

download link

do not care about blame or reputation...it is Reddit.

There is no need to install Rust.

2

u/Inquisitive-Mind-A 24d ago

Okay. I appreciate you trying to help though!

2

u/Unwiredsoul 24d ago edited 24d ago

The link you shared takes you to a website with a litany of bad links.

But here you are still throwing around insults about other people down "cast" (it's downvote) instead of owning your continuing bad behavior.

1

u/Due-Result7928 24d ago

Not at all. I am using it without any problem and u/Inquisitive-Mind-A also...May be you need some basic training....Please go back to your hut. Strange nobody is missing you.

I used the software before.

2

u/Inquisitive-Mind-A 24d ago

How do you two know each other?

2

u/Unwiredsoul 24d ago edited 24d ago

u/Due-Result7928 is a troll. Look at the history. Oh wait, it's hidden.

I'm not a troll, so you can see my history, and if you look back a couple weeks, you'll see where I first interacted with this person. I dared recommend BleachBit to someone, and u/Due-Result7928 went on misinformation and personal attack campaign.

The developer of BleachBit showed up to the thread to correct the misinformation. being spread by u/Due-Result7928. It was ironically about whether that software was too dangerous to use.

Sadly, the mods are MIA here, so we get 3rd-world idiots like u/Due-Result7928 coming in here, pretending they know it all, and attacking people that disagree.

Again, here are the facts: https://github.com/qarmin/czkawka/issues/1583

0

u/Due-Result7928 24d ago

He is just dropping comments about a web site and complaining about bad links ...

1

u/Inquisitive-Mind-A 24d ago

Well the link works on my phone. I still haven't been home yet.

2

u/Unwiredsoul 24d ago edited 24d ago

Huh. Try it with a real browser since you won't be running it on your phone.

I'm not saying anything about the software. I'm pointing out that the website link that was shared is a malware site.

Here's the story on GitHub:

https://github.com/qarmin/czkawka/issues/1583

3

u/Inquisitive-Mind-A 24d ago

Thank you for showing me this! It's a good thing I haven't tried it yet.

2

u/Unwiredsoul 24d ago

Now, I hope you understand why I'm so passionate with my comments here.

This is a recurring problem with the user I've called out, and the moderators do not exist for this sub. It's effectively abandoned. I'd never heard of this troll until a story from a couple weeks ago that I explain in an earlier comment.

Again, my history is wide open. You're welcome to see that I have contributed respectfully here, but that I have a reasonable reason to believe u/Due-Result7928 should be banned.

If he were to unhide his history, the case would be even more easily made for that.

2

u/Inquisitive-Mind-A 24d ago

How can I search for just those conversations? I don't use reddit much.

→ More replies

1

u/Due-Result7928 24d ago

So, to be clear: this site is not connected to me and I haven’t found any malware on it. The biggest concern is that it could become a malware distribution point in the future, especially since I found several other sites made with what looks like the exact same template..so there is NO malware...and when you quote something at least be honest...

So I would treat it with skepticism. Everyone should stick to the official GitHub repo or use unofficial builds from trusted sources.

0

u/Due-Result7928 24d ago

Have a life sir, leave your keyboard.

1

u/Due-Result7928 24d ago

Me too. May be he needs some training. Saw nothing dangerous and I was using the software before to suppress duplicate pictures and photos in multiple folders. Software is analyzing content to detect identical items. very practical.

Made in Rust using AI.

2

u/Unwiredsoul 24d ago

Yes, please provide me training, sir.

2

u/Unwiredsoul 24d ago edited 24d ago

Did you even look at the website you shared? Yes, the link you shared goes to a malware site. Own your bad advice.

1

u/Due-Result7928 24d ago

You should call your doctor sir. Site is ok and I was using the software.

2

u/Unwiredsoul 24d ago edited 24d ago

Yes, please train me, sir.

You may have used the software but the website you shared is malware central.

Oh, and unhide your history if you aren't ashamed of your bad behavior.