Disaster after cleaning [SOLVED]

Questions about applications and software
Forum rules
Before you post please read how to get help
Stefano_IT
Level 2
Level 2
Posts: 70
Joined: Tue Jul 09, 2019 8:53 am
Location: Italy

Re: Disaster after cleaning

Post by Stefano_IT »

pbear wrote:
Thu Sep 19, 2019 12:53 pm
Stefano_IT wrote:
Thu Sep 19, 2019 12:12 pm
I was a victim of Google Translate ...: - /
Sorry for all the inconvenience and loss of time.
Perhaps the most important lesson to be learned from this disaster is the importance of data file backups. There are many ways to do that, e.g., Back in Time or Grsync. Timeshift is NOT suitable. Set up a mechanism for regular data backups as soon as possible. Frankly, you should have had one all along.
Thanks for the suggestion on the programs
I will go to see them ..
Ironically, last night I was going to make a backup of those text files on USB stick but I sent it back today because I was tired.
I felt very confident about my Mint, my hardware is new and the operating system is very stable.
I did not consider human error
Linux Mint 20.1 Ulyssa - Xfce
Stefano_IT
Level 2
Level 2
Posts: 70
Joined: Tue Jul 09, 2019 8:53 am
Location: Italy

Re: Disaster after cleaning

Post by Stefano_IT »

I was very quick to reinstall and customize Mint 18.3
Before putting "resolved" to this discussion I would like to ask something.

I have problems re-installing VLC (Flathub) - Telegram and Avidemux

The problem is that the installation of these programs is not successful "Installation of additional dependencies in progress" this message lasts a long time.

I've already tried rebooting more than once but with these programs the problem reoccurs.

Could it be a connection problem with Flathub?
In the past the installation has always been immediate.

Edit post:After sending my message, all three programs completed the installation.
Problem solved !
Linux Mint 20.1 Ulyssa - Xfce
HaveaMint
Level 5
Level 5
Posts: 809
Joined: Fri Feb 02, 2018 9:56 pm
Location: Somewhere in the USA
Contact:

Re: Disaster after cleaning [SOLVED]

Post by HaveaMint »

You may want to start a new thread on this new problem and Title it
Problems with Flathub
This way people that are familiar with flathub will see it and help.
"Tune for maximum Smoke and then read the Instructions".
User avatar
ricardogroetaers
Level 5
Level 5
Posts: 635
Joined: Sat Oct 27, 2018 3:06 am
Location: Rio de Janeiro, Brasil

Re: Disaster after cleaning [SOLVED]

Post by ricardogroetaers »

Note:
Translations made through google translator can give the words a completely different meaning. Imagine in a command.
User avatar
smurphos
Level 17
Level 17
Posts: 7289
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Disaster after cleaning

Post by smurphos »

Pjotr wrote:
Thu Sep 19, 2019 12:03 pm
Good that it's solved. :)

Needless to say, but for the sake of completeness: don't copy terminal commands from a translated web page any more (Google Translate or any other translation engine). :wink:
There must be a way to tell the Google Translate API not to translate certain site content - maybe https://cloud.google.com/translate/faq# ... _questions
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
Pjotr
Level 22
Level 22
Posts: 16157
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Disaster after cleaning

Post by Pjotr »

smurphos wrote:
Fri Sep 20, 2019 2:10 am
Pjotr wrote:
Thu Sep 19, 2019 12:03 pm
Good that it's solved. :)

Needless to say, but for the sake of completeness: don't copy terminal commands from a translated web page any more (Google Translate or any other translation engine). :wink:
There must be a way to tell the Google Translate API not to translate certain site content - maybe https://cloud.google.com/translate/faq# ... _questions
Interesting.... I'll test that a bit. Thanks.
Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
Pierre
Level 20
Level 20
Posts: 11445
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Disaster after cleaning [SOLVED]

Post by Pierre »

Hi Stefano_IT,
it's never any inconvenience, for us to assist someone.
:)

& we've all learnt something about using Google Translate.


non è mai un inconveniente per noi aiutare qualcuno.
:)

abbiamo tutti appoggiato qualcosa sull'uso di Google Translate.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Stefano_IT
Level 2
Level 2
Posts: 70
Joined: Tue Jul 09, 2019 8:53 am
Location: Italy

Re: Disaster after cleaning [SOLVED]

Post by Stefano_IT »

@Pierre
Thanks
Yesterday I was particularly unlucky, the translator "created" commands that, instead of being unsuccessful, killed my system.
To end the beautiful day before going to sleep a Kingston USB pen died, she was 3 or 4 years old but chose just yesterday to stop working :(
Linux Mint 20.1 Ulyssa - Xfce
mzee1934
Level 1
Level 1
Posts: 27
Joined: Tue Aug 28, 2018 6:21 pm

Re: Disaster after cleaning [SOLVED]

Post by mzee1934 »

Why not use 'Bleachbit'? There are two versions. One runs as Root, and deals with system rubbish, and the other user rubbish. I have been using them for a two years now, and had no problems. They are both in the Software Manager.
Stefano_IT
Level 2
Level 2
Posts: 70
Joined: Tue Jul 09, 2019 8:53 am
Location: Italy

Re: Disaster after cleaning [SOLVED]

Post by Stefano_IT »

mzee1934 wrote:
Fri Sep 20, 2019 7:21 am
Why not use 'Bleachbit'? There are two versions. One runs as Root, and deals with system rubbish, and the other user rubbish. I have been using them for a two years now, and had no problems. They are both in the Software Manager.
Yes, I know this software, I used it years ago on Ubuntu.
But I've always read controversial opinions, some users say it can do damage and others don't.
Probably cleaning alone is not harmful but some advanced features of this program could be.
I had (and lost) a text file where I had copied some commands taken from Piotr's site.
I don't remember them now but one was the cache / thumbnails, the others were something like: apt-get clean and autoclean (I only vaguely remember) - I ran them periodically without problems.
Now I have to find these commands exactly and memorize them again.

Edit post:
I found with a web search
were these:
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
Linux Mint 20.1 Ulyssa - Xfce
athi
Level 6
Level 6
Posts: 1459
Joined: Sun Mar 30, 2014 10:15 am
Location: USA

Re: Disaster after cleaning [SOLVED]

Post by athi »

To quote Moem on use of Bleachbit from another post:
Moem -
There are users who come fresh off the Windows cruise ship and think they need a cleaner because they've used them in Windows and don't realise yet that Linux doesn't shit the bed quite as badly as Windows does.
Mint Mate 19.1. Main rig is HP 800G2 I5 6500 16GB ram, 120GB boot drive, 2x3TB, 1x4TB data drives. Oldest rig is Mate 18.3 on Dell D620 with 32bits core duo.
User avatar
catweazel
Level 19
Level 19
Posts: 9875
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Disaster after cleaning [SOLVED]

Post by catweazel »

Stefano_IT wrote:
Fri Sep 20, 2019 7:48 am
But I've always read controversial opinions, some users say it can do damage and others don't.
It can do damage if you don't know what you're doing. I've used it for several years and never had an issue but I use very conservative settings.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
DAMIEN1307
Level 11
Level 11
Posts: 3745
Joined: Tue Feb 21, 2017 8:13 pm
Location: Alamogordo, New Mexico, USA

Re: Disaster after cleaning [SOLVED]

Post by DAMIEN1307 »

hi stefano...below are some of the more useful terminal commands for Linux MInt and other Ubuntu/Debian based Distros...DAMIEN

Auto Clean/Auto Remove

sudo apt autoclean

sudo apt autoremove

sudo apt autoremove --purge


Update The Update Manager

sudo apt update


Clear the Thumbnail Cache

rm -rf ~/.cache/thumbnails/*


Clear DNS Cache

sudo systemd-resolve --statistics

sudo systemd-resolve --flush-caches


Kernel and other Cleanups after Deletions

sudo apt autoremove

do these one at a time, dont worry if the first "dpkg -l" says error etc...just means nothing is there to remove is all...

dpkg -l | grep '^rc' | awk '{print $2}' | sudo xargs dpkg --purge

dpkg -l | grep '^rc' | awk '{print $2}' | xargs sudo apt-get purge

dpkg --get-selections | grep linux-headers && dpkg --get-selections | grep linux-image
ORDO AB CHAO
"I refuse to be assimilated, I refuse to become one with the Borg Collective"
Stefano_IT
Level 2
Level 2
Posts: 70
Joined: Tue Jul 09, 2019 8:53 am
Location: Italy

Re: Disaster after cleaning [SOLVED]

Post by Stefano_IT »

@Damien
Thanks also to you for these suggestions.
To remove old Kernel I use the function integrated in the update manager.
Linux Mint 20.1 Ulyssa - Xfce
User avatar
majpooper
Level 6
Level 6
Posts: 1423
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: Disaster after cleaning [SOLVED]

Post by majpooper »

Stefano_IT wrote:
Fri Sep 20, 2019 4:34 pm
@Damien
Thanks also to you for these suggestions.
To remove old Kernel I use the function integrated in the update manager.
I like the remove kernel function in the update manager as well.

Several years ago I created a little cleaner script that I run from /home so I can run it as root.
I put it in root's crontab so it runs every night at midnight.
I really just did it to learn a little about writting bash scripts and about crons.

Code: Select all

sudo crontab -e
# m h  dom mon dow   command
0 0 * * * /home/mintcleaner.sh
Here is the script - I have never had a problems with it - but because I am the proverbial "monkey with a machine gun" when it comes to linux I would not suggest anyone use unless and until some of the more expert users on this forum critique it.

Code: Select all

#!/bin/bash

#check if this script actually kicks off
echo "Cron ran mintcleaner.sh at $(date)" >> /home/majpooper/crntest.txt
# clean and update pkg
apt autoclean
apt update
# empty trash
rm -rf /home/*/.local/share/Trash/*/** &> /dev/null
rm -rf /root/.local/share/Trash/*/** &> /dev/null
# clean logs
rm -r -v -f /var/log/* 
# clean /tmp
m -r -v -f /tmp/* &> /dev/null
# clean cache
rm -rf ~/.cache/*
Oh yeah just in case anyone is curious - I delete crntest,txt every Sunday night

Code: Select all

# m h  dom mon dow   command
0 23 * * 0 rm -r /home/majpooper/crntest.txt
DAMIEN1307
Level 11
Level 11
Posts: 3745
Joined: Tue Feb 21, 2017 8:13 pm
Location: Alamogordo, New Mexico, USA

Re: Disaster after cleaning [SOLVED]

Post by DAMIEN1307 »

hi guys...take note that
Kernel and other Cleanups after Deletions
is not JUST kernel cleanup but also applicable for other deletions that are already made but didnt delete other dependencies associated with those deletions which may also include other things that the update manager didnt delete when you deleted kernels via the update manager method...i havent used it myself but it is possible that "gm10" may have this particular already covered in his ppa for his vastly improved update manager for linux mint applications, the only reason why im hesitant to use his ppa is because im running mostly Peppermint 9, 9 respin and Peppermint 10 systems on my home computers and do not yet know if they will also run on Peppermint...yes Peppermint is using the LM update manager but it lingers in the back of my mind that Peppermint appears to be more or less geared to Ubuntu's way of doing things rather than LM's ways...DAMIEN

PS...It will not hurt anything to also use the terminal commands under the "kernel and OTHER cleanups after deletions" just to see if indeed there are leftovers that have been left behind...Just try them out and let us know that indeed there WERE things left behind that you may have been unaware of..."caring is sharing".

The last line of code in that sequence will just tell you what kernels are left...ideally you should just have the current kernel running as well as the last known good kernel just in case you need to retreat from a newer "borked" kernel...its rare but it does happen from time to time.
ORDO AB CHAO
"I refuse to be assimilated, I refuse to become one with the Borg Collective"
rene
Level 16
Level 16
Posts: 6673
Joined: Sun Mar 27, 2016 6:58 pm

Re: Disaster after cleaning [SOLVED]

Post by rene »

majpooper wrote:
Fri Sep 20, 2019 6:03 pm
apt autoclean
apt update
"autoclean" (and possible additionally "autoremove --purge") are fine, but while it doesn't hurt anything either, "update" is handled by Update Manager.
majpooper wrote:
Fri Sep 20, 2019 6:03 pm
rm -rf /home/*/.local/share/Trash/*/** &> /dev/null
rm -rf /root/.local/share/Trash/*/** &> /dev/null
bash only expands ** differently from * if the "globstar" option is set which it normally isn't. Even if it were, rm -r means to recursively remove subdirectories already so a single * is all that's useful here. Personally I wouldn't direct output to /dev/null but install a local MTA and let output be mailed to me: viewtopic.php?f=213&t=279203#p1537513. Inconsequential, but given that you explicitly use bash anyway, might as well employ brace expansion to combine the two as rm -rf /{root,home/*}/.local/share/Trash/*/*.
majpooper wrote:
Fri Sep 20, 2019 6:03 pm
rm -r -v -f /var/log/*
Supposedly missing a /dev/null redirect but I'd not recommend this in the first place. The cron-scheduled logrotate manages /var/log under control of /etc/logrorate.conf which you'd preferably tweak if you feel its settings now not good enough; man logrotate. Logs can be very useful...
majpooper wrote:
Fri Sep 20, 2019 6:03 pm
m -r -v -f /tmp/* &> /dev/null
Missing initial "r", but I'd other than that most definitely not do that. /tmp contains runtime information and should only be emptied on (re)boot. du -sh /tmp will very likely not show as to size relevant usage anyway. The -v (verbose) is at odds with the here present /dev/null redirect.
majpooper wrote:
Fri Sep 20, 2019 6:03 pm
rm -rf ~/.cache/*
This removes /root/.cache/* whereas I expect it may have been intended to remove your user's ~/.cache/*; root's is generally not significant. Would by the way also not generally recommend, but, whatever.
majpooper wrote:
Fri Sep 20, 2019 6:03 pm
0 23 * * 0 rm -r /home/majpooper/crntest.txt
The -r is not useful when deleting a single file; I expect you may have wanted -f there, as in "do not complain if it does not exist".
User avatar
smurphos
Level 17
Level 17
Posts: 7289
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Disaster after cleaning [SOLVED]

Post by smurphos »

A few to add to the list

Timeshift doesn't seem to ship a logrotate config - this get rid of any logs older than 28 days.

Edit to add - I've since discovered that Timeshift will trim it's own logs when there are more than 500

Code: Select all

sudo find /var/log/timeshift/ -type f -mtime +28 -name '*.log' -delete
Same for flatpak update caches. Depending on version of flatpak in use these can balloon

Code: Select all

sudo find /var/tmp/ -type d -mtime +28 -name 'flatpak-cache*' -exec rm -rv {} +
Last edited by smurphos on Mon Sep 30, 2019 1:25 am, edited 1 time in total.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
Pjotr
Level 22
Level 22
Posts: 16157
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Disaster after cleaning [SOLVED]

Post by Pjotr »

smurphos wrote:
Fri Sep 20, 2019 11:51 pm
A few to add to the list

Timeshift doesn't seem to ship a logrotate config - this get rid of any logs older than 28 days.

Code: Select all

sudo find /var/log/timeshift/ -type f -mtime +28 -name '*.log' -delete
Same for flatpak update caches. Depending on version of flatpak in use these can balloon

Code: Select all

sudo find /var/tmp/ -type d -mtime +28 -name 'flatpak-cache*' -exec rm -rv {} +
I didn't know that... These are actually grave shortcomings of Timeshift. :shock:

All the more reason for limiting the number of retained snapshots to 2, I think. That's probably the easiest way of preventing Timeshift to gobble up your hard disk.
Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Stefano_IT
Level 2
Level 2
Posts: 70
Joined: Tue Jul 09, 2019 8:53 am
Location: Italy

Re: Disaster after cleaning [SOLVED]

Post by Stefano_IT »

mzee1934 wrote:
Fri Sep 20, 2019 7:21 am
Why not use 'Bleachbit'? There are two versions. One runs as Root, and deals with system rubbish, and the other user rubbish. I have been using them for a two years now, and had no problems. They are both in the Software Manager.
Yesterday I used Bleachbit on a laptop where I always have Mint 18.3.
I used it only to remove useless locations (I left only English and Italian) and it freed up a lot of space.
I realized however that the version proposed by the application manager is very old.
On the Bleachbit website they propose a specific version for this system
https://www.bleachbit.org/download/file ... tu1604.deb
Trying to install it, a generic warning appears that generally the old versions are better supported.

I wonder which of the two would be more correct to use.
Linux Mint 20.1 Ulyssa - Xfce
Post Reply

Return to “Software & Applications”