#Permission denied even with sudo

90 messages · Page 1 of 1 (latest)

vital anchor
#

I'm trying to do a simple copy of contents of one file to another and I'm getting permission denied even with sudo? I'm in /usr/local/share/applications if that makes a difference. The command I'm trying to run is sudo cat Gale.desktop > Obsidian.desktop. Also attempted with >>. Output is: bash: Obsidian.desktop: Permission denied

Also inexplicably my file browser stopped displaying file extensions as part of file names on this reboot. ls shows obsidian.desktop but my file browser shows Obsidian? idk wtf is happening. I've done all this in this directory before and it was definitely not like this. I can't even delete files here.

Ok a further update: I deleted a file from the terminal and it was successful. File browser still displays it even after closing and reopening it.

Rebooted and now successfully deleted a file here. I still feel like I'm losing my mind, please help lol

And now I've made my desktop file through other methods, run update-desktop-database and the entry simply isn't showing up. The .desktop file is set up the same as other working ones

main pawn
#

For the "extension" thing, it's because the file browser automaticaly interpret content of .desktop files then shows the "Name" variable (as written in the .desktop file) instead of the real file name.
For the permission problem, I don't know, maybe a problem with the '>' operator, more than a true permission problem

#

Also take care that Linux is case sensitive, maybe your "permission" issue has something to do with that...

sonic holly
#

perhaps the > or >> operation is run as your user. Use tee: cat ... | sudo tee /path/to/destination.desktop

#

tee reads from stdin and writes to the file path supplied, the pipe redirects cat's output to tee's stdin

vital anchor
#

ah ok. I had tried tee but didn't realize I needed sudo after the pipe.

#

Any thoughts on the fact that the desktop entry is not showing up now?

sonic holly
#

log out

#

log back in

#

Cinnamon updates the menu entries every time it initializes

#

or when you do update-desktop-database

vital anchor
#

I thought update-desktop-database was supposed to handle that

sonic holly
#

yes

vital anchor
#

yeah. i did that. will try logging out now though

vital anchor
# main pawn bad syntax (empty ?)...

nope. cat obsidian.md reports

[Desktop Entry]
Version=1.0
Type=Application
Categories=Office;
Comment=Obsidian
Exec=/home/maeve/Applications/Obsidian.AppImage
StartupWMClass=obsidian
Icon=/home/maeve/desktop-entries/obsidian.png
Name=Obsidian
MimeType=x-scheme-handler/obsidian;```
#

brb relog

sonic holly
#

What's stopping you from using the distro package or the Flatpak?

main pawn
#

.md ?

vital anchor
#

no dice

sonic holly
#

entries should end in .desktop

vital anchor
#

yea that was an error only in discord message

main pawn
#

The goal is to create a new menu entry ?

vital anchor
#

yup. i've done it with other applications in the exact same way

sonic holly
#

do sudo mv /usr/share/applications/[entryfile] /home/$USER/.local/share/applications

#

iirc that's where custom ones are kept

#

in /usr/share/applications only system ones are kept

main pawn
#

There is a Menu editor you know ? Also, I checed, I don't have usr/share/applications directory on my system...

vital anchor
vital anchor
#

I'll give this a go

main pawn
#

maybe the permission problem come from that mistake ?

sonic holly
main pawn
vital anchor
sonic holly
vital anchor
#

will it still work from a subdirectory?

sonic holly
#

probably not

#

i don't think Cinnamon devs would bother to implement recursive scanning for something that simple

vital anchor
#

keeping track of installed software feels like such a mess on linux. i'm glad to be off windows but this is ridiculous

sonic holly
#

that's why package managers exist

vital anchor
#

so many directories to achieve the same things, it feels like

main pawn
#

however I don't know where it put flatpacks

sonic holly
#

flatpak app data is stored at /home/$USER/.var/

#

Mint installs flatpaks system-wide so binaries themselves are around the root filesystem

sonic holly
#

it is simple organization

#

it does create confusion at first

vital anchor
sonic holly
#

i don't have a linux filesystem reference atm

#

i'm on my phone

main pawn
#

All /usr is system-wide by definition, not intended to be "customized"...

sonic holly
#

but anyways, did you move the .desktop file to the directory in home?

vital anchor
#

but now obsidian.desktop is in /home/$USER/.local/share/applications. I ran update-desktop-database and its still not showing up. guess i'll relog again. but this doesn't make sense. other desktop files in /usr/loca/share/applications worked, why wouldn't this one?

sonic holly
#

maybe even reboot

main pawn
#

(why not using the Menu Editor, which exist for that purpose ?)

vital anchor
sonic holly
main pawn
vital anchor
#

still no desktop entry

sonic holly
#

can you ls -a ~/.local/share/applications?

vital anchor
#
 .
 ..
 audacity-url-handler.desktop
'Baba Is You.desktop'
 defaults.list
'Dicey Dungeons.desktop'
 discord-402572971681644545.desktop
 discord-747154846817452045.desktop
 gale-handler.desktop
'Hardspace Shipbreaker.desktop'
 io.itch.itch.desktop
 Itch.cinnamon-generated.desktop
'Metal Hellsinger.desktop'
 mimeinfo.cache
 ModOrganizer-steamtinkerlaunch-dl.desktop-off
 net.lutris.battlenet-1.desktop
 obsidian.desktop
'Proton Experimental.desktop'
 steam.desktop
'Steam Linux Runtime 3.0 (sniper).desktop'
 Superflight.desktop
 userapp-audacity-linux-3.7.1-x64-20.04.AppImage-T3A5C3.desktop
'userapp-Firefox Developer Edition-UP9LQ2.desktop'
 userapp-MuseScore-Studio-4.5.2.251141401-x86_64.AppImage-TXQ1D3.desktop
'Vintage Story 1.21.6.desktop'
 Vintagestory_url_connect.desktop
 Vintagestory_url_mod.desktop
 vortex-steamtinkerlaunch-dl.desktop
 vortex-steamtinkerlaunch-dl.desktop-off
 wine
 wine-extension-application.desktop
 wine-extension-appref-ms.desktop
 wine-extension-chm.desktop
 wine-extension-hlp.desktop
 wine-extension-msp.desktop
 wine-extension-vbs.desktop
 wine-extension-xaml.desktop
 wine-extension-xbap.desktop
 wine-protocol-battlenet.desktop
 wine-protocol-blizzard.desktop
 wine-protocol-Blizzard.URI.Battlenet.desktop
 wine-protocol-Blizzard.URI.Blizzard.desktop
 wine-protocol-Blizzard.URI.Heroes.desktop
 wine-protocol-Blizzard.URI.SC2.desktop
 wine-protocol-heroes.desktop
 wine-protocol-mailto.desktop
 wine-protocol-starcraft.desktop```
#

its such a mess

main pawn
#

(I suggest visiting the Menu Editor... )

vital anchor
#

and the file browser doesn't recognize the desktop entry either. shows the filename unlike the other ones

sonic holly
#

now cat ~/.local/share/applications/obsidian.desktop

vital anchor
#
Version=1.0
Type=Application
Categories=Office;
Comment=Obsidian
Exec=/home/maeve/Applications/Obsidian.AppImage
StartupWMClass=obsidian
Icon=/home/maeve/desktop-entries/obsidian.png
Name=Obsidian
MimeType=x-scheme-handler/obsidian;```
main pawn
#

is the ending ';' in Categories normal ?

sonic holly
#

Do Exec and Icon actually exist?

sonic holly
#

not sure if trailing semicolon is fine though

#

remove it to be sure

vital anchor
#

shoot I forgot to rename the appimage hold on

main pawn
#

yes, but since it alone... but i don't know much the .desktop syntax

sonic holly
vital anchor
#

it was both that and the semicolon. working now. semicolon came in the .desktop packaged inside the appimage, why'd they do me dirty like this 😭

#

thanks y'all

main pawn
#

(The Menu Editor prevent create launcher without valid Exec path)

#

(you shoud take a look at the Menu Editor)

sonic holly
#

is it a built-in cinnamon tool?

vital anchor
#

oh i just remembered there's a desktop-file-validate command too

main pawn
#

right-click menu button > Edit Menu...

#

if not in the menu, it may be in the first page of "Configure..."

vital anchor
#

oh ok. I won't be using that primarily but that's super nice to know about, thanks. was having trouble locating the files associated with some entries, and this does that

#

also: confirming that a subdirectory does in fact work