Is there a way to restore home folder to default?


I’m currently running Fedora 30 Silverblue and a few weeks ago I accidentally executed rm -rf * in my home folder. I realized quickly what I done and stopped it after few seconds, but damage has been done. Till this time, I’m having a strange issues like not working autostart apps, gnome-software not finding rpm-ostree updates and few others.

I want to rebase to F31 soon, but I would like to first solve this issue. Is there a way to restore the default setting of home folder somehow?

The default home folder is in /etc/skel but perhaps you just need to relabel your home directory.

restorecon -R -v /var/home

Thanks for the /etc/skel folder, I didn’t knew about it.

The SELinux context should be fine I’m just missing some files, that should be in home folder.

EDIT: It looks like /etc/skel folder is empty.

Did you ls -la? Most of the files are dotfiles:

$ ls -la /etc/skel/
total 28
drwxr-xr-x.   3 root root   92 Aug 29 10:10 .
drwxr-xr-x. 164 root root 8192 Aug 29 10:15 ..
-rw-r--r--.   1 root root   18 Aug 29 10:10 .bash_logout
-rw-r--r--.   1 root root  141 Aug 29 10:10 .bash_profile
-rw-r--r--.   1 root root  376 Aug 29 10:10 .bashrc
drwxr-xr-x.   4 root root   39 Aug 29 10:10 .mozilla
-rw-r--r--.   1 root root  658 Aug 29 10:10 .zshrc

I tried only ls -l, but I have problem with GNOME applications and it looks like /etc/skel will not help with this.

Probably the best option is to do backup and reinstall Silverblue.

You could create another user and move to it?

Thanks, your advice gave me an idea.

I created a new user (went through gnome init) and moved the missing files back to my existing user.

It looks like everything is working now. :slight_smile: