2

Ubuntu 22.04 LTS asked me for an update which I did and apparently everything went ok but upon restarting all my home folders appeared in my Desktop.

Looking into my home folder I found out that home/user/Desktop and Public folders show as: Type Link (broken) (inode/symlink). The rest of user folders have different permissions ("Create and delete files") but this file only gives me the options of "Read and write" an "Read-only".

By doing ls -lid to these files as suggested by Raffa, I get:

1334600 lrwxrwxrwx 1 user user 19 ago 19 11:40 Desktop -> /home/user/Desktop

and

1334614 lrwxrwxrwx 1 user user 18 ago 19 11:40 Public -> /home/user/Public

How can I fix this?

I'm currently on 22.04.3 LTS.

  • 1
    The output of ls -lid /home/$USER/{Desktop,Public} might help us see part of the picture. – Raffa Aug 20 '23 at 17:28
  • Thanks, added that output to the question. – Ventolinmono Aug 20 '23 at 18:55
  • 1
    I applied an UBUNTU UPDATE yesterday and this morning I rebooted my system and found all my home folders as desktop icons. I never have DESKTOP ICONS displayed. I downloaded the Extension Manager app and was able to hide these desktop icons and then I noticed the same thing that is indicated on this ticket. Any help/direction would be appreciated. Thank you. – Melinda Aug 22 '23 at 13:37
  • I have exactly the same problem. Is there any update? – Gigiux Aug 30 '23 at 05:25
  • 1
    Actually, it looks like the Desktop is now pointing at the Home directory. – Gigiux Aug 30 '23 at 08:56
  • @Gigiux Is there a way to fix that? – Ventolinmono Aug 30 '23 at 16:29
  • I don't know, I was hoping you knew... – Gigiux Aug 31 '23 at 05:31

2 Answers2

4

I solved it this way:

As suggested by https://forums.linuxmint.com/viewtopic.php?t=198238 I checked that typing

cat $HOME/.config/user-dirs.dirs | grep DESKTOP

showed

XDG_DESKTOP_DIR="$HOME/"

instead of

XDG_DESKTOP_DIR="$HOME/Desktop"

Then I followed this solution How to set the desktop to $HOME/Desktop?

  1. First I deleted all the broken folders
rm Desktop Templates Public Music Videos
  1. I created new folders
mkdir Desktop Templates Public Music Videos
  1. Then I edited configuration file: Typing in the terminal
gedit ~/.config/user-dirs.dirs

I added the missing folders to make it look like this:

XDG_DESKTOP_DIR="$HOME/Desktop" 
XDG_DOWNLOAD_DIR="$HOME/Download"  
XDG_TEMPLATES_DIR="$HOME/Templates"  
XDG_PUBLICSHARE_DIR="$HOME/Public"  
XDG_DOCUMENTS_DIR="$HOME/Documents"  
XDG_MUSIC_DIR="$HOME/Music"  
XDG_PICTURES_DIR="$HOME/Pictures"  
XDG_VIDEOS_DIR="$HOME/Videos"
  1. Save the configuration file, and after logging out and in the problem was solved
sotirov
  • 3,169
pcc
  • 186
  • 1
    Worked for me too. Thank you! – Gigiux Sep 01 '23 at 13:37
  • 1
    Thank you very much. Did this and everything is back to normal :) – Ventolinmono Sep 02 '23 at 20:32
  • Further on this: the link go back to broken at log-out even if ~/.config/user-dirs.dirs is fine. So I need to remove and recreate the folder over and over... – Gigiux Sep 08 '23 at 13:58
  • Actually, in one machine, the user-dirs.dirs file erases Desktop and Public each time I log out... – Gigiux Sep 12 '23 at 09:43
  • I did this, but later on restart, the link was broken again as before. Any idea which program is resetting these folders? – hkbharath Sep 19 '23 at 09:14
  • 1
    I changed the permissions of user-dirs.dirs to allow other users read only access chmod o+rw ~/.config/user-dirs.dirs and set the owner to root chown root:root ~/.config/user-dirs.dirs. You could try that @hkbharath – NotoriousPyro Oct 31 '23 at 08:44
  • Now I also lost Downloads – Gigiux Jan 20 '24 at 06:44
2

Adding this as an answer, as I cannot comment yet.

I bumped into the same issue, and I was lucky enough to remember that the only change I made to my system today was to install Okular (as a Snap via the Ubuntu Software app).

The fix above works fine, as long as I don't open Okular. If I do, and then reboot, I am back to square one.

Note that another user is suggesting that adding hidden files to the folders prevents this from happening.

I cannot find any mention of this bug in the KDE bug tracker, so maybe I'll try to add a new one in the coming days. I hope this helps.

Gabe
  • 45