[info] "system unusable?" can be -> /home/userbox is broken? -> reset/restore a messed home to a default brand new

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
User avatar
harrykar
Posts: 164
Joined: Fri Dec 22, 2023 6:49 pm

[info] "system unusable?" can be -> /home/userbox is broken? -> reset/restore a messed home to a default brand new

#1 Post by harrykar »

Update:
Before do anything try to rename .cache dir, logout and re-login and see if things return in normality.
If .cache folder is the culprit you can safely with no long term detrimental effects remove it (better after you have investigate on the cause)


I thought write an informative post about a problem that happens to me can facilitate a new user to do a local forum search here when needed instead be lost in Internet's crawlers high waters
  • For every eventuality logout from the GUI session and from there login in a textual one
    Note:
    In a typical Linux box we've available seven independent login sessions where a user (or more users one at a time) can login into system. Typically(In MXLinux too) the seventh is the GUI(graphical) session the others six are text only based sessions(called Virtual Terminals aka VTs).
    To pass from a GUI login session(seventh) to a text login session use: CTRL + ALT + F[1..6].
    To pass from a text login session to another one or to GUI login session use: ALT+F[1..6] or ALT+F7 correspondingly
  • Rename the hidden folders (.local, .cache, .conky, .config , regard the hidden files ,profile, .bash_logout, .inputrc, .bashrc renaming is not necessary because as you will see below they're protected from cp's -b(i.e. backup) option) e.g. for .local

    Code: Select all

    mv  .local .local.bak
  • And finally copy in home the entire skeleton structure

    Code: Select all

    cp  -rb  /etc/skel/.??*  ~/
    
    two words about glob symbols and why is necessary use that sequence .??* instead of simply * as I did in a first try and got

    Code: Select all

    cp: cannot stat '/etc/skel/*': No such file or directory
    
    As you can read in WP's article * not catch hidden files(files that start with a point e.g. .file),
    on the other hand .* catch:
    every file in the current dir that starts with point (hidden files) followed(that's mean *) by 0 or more characters: and that's ok for our search but also catch:
    . (that's an alias for the current dir) and even worst catch:
    .. (alias for the parent directory) that's absolutely not ok (cause -r aka recursive in cp's command we end up to copy the entire tree (from /skel back to to / (root) directory ) into our home dir)
    So we must use .??* : mean every file that starts with point(i.e. is hidden) and have almost 2 other characters in sequence, that's why we've 2 ?? symbols followed(that's mean *) by 0 or more characters.
    That's the way to exclude the parent directory(aka ..).
    Parent directory of what? of the directory we're actually in (called also current or working directory)
The same method can be followed to restore individual point(hidden) files(erroneously removed or for some reason corrupted) from the skeletal structure e.g.

Code: Select all

cp  -b  /etc/skel/.bashrc   ~/
Important: After a copy a file(indifferent of his original(aka source) uid, gid) inherits the privileges corresponding of the user who did the copy. If you copy a file via root user, you need to manually change ownership and file permission afterwards.

PS: the aforementioned method is not destructive but if for every eventuality you intend firstly to do an integral copy(backup) of your home take a glance here
Last edited by harrykar on Sun Feb 04, 2024 9:12 am, edited 16 times in total.
*Hardware and software are logically equivalent:K.Panetta's dicit: ‘‘Hardware is just petrified software’’
*Remember: the beauty of CS lies not in the diversity of its details but in the unity of its concepts

User avatar
j2mcgreg
Global Moderator
Posts: 6536
Joined: Tue Oct 23, 2007 12:04 pm

Re: [info] "system unusable?" can be -> /home/userbox is a mess? -> reset/restore a messed home to a default brand new

#2 Post by j2mcgreg »

I moved your topic to Tips and Tricks which is the more appropriate location.
HP 15; ryzen 3 5300U APU; 500 Gb SSD; 8GB ram
HP 17; ryzen 3 3200; 500 GB SSD; 12 GB ram
Idea Center 3; 12 gen i5; 256 GB ssd;

In Linux, newer isn't always better. The best solution is the one that works.

User avatar
harrykar
Posts: 164
Joined: Fri Dec 22, 2023 6:49 pm

Re: [info] "system unusable?" can be -> /home/userbox is broken? -> reset/restore a messed home to a default brand new

#3 Post by harrykar »

j2mcgreg wrote: Tue Jan 30, 2024 11:27 am I moved your topic to Tips and Tricks which is the more appropriate location.
Thank you very much @j2mcgreg :number1: I'm not still accustomed to forum's sections
*Hardware and software are logically equivalent:K.Panetta's dicit: ‘‘Hardware is just petrified software’’
*Remember: the beauty of CS lies not in the diversity of its details but in the unity of its concepts

Post Reply

Return to “Tips & Tricks by users”