fedora下使用"软件(flatpak)"安装的Jetbrains Idea无法访问某些路径的解决方法
关键词:fedora、软件、flatpak、jetbrains、idea、disk
背景
使用系统自带的"软件"APP安装了GoLand 和 Idea,电脑上有多个硬盘,除了系统盘,其他磁盘默认挂载到
/run/media/{USERNAME}/xxxxxx
下面,搭完环境后尝试打开项目时发现,这个路径在GoLand中可以正常访问,而Idea无法读取该路径信息,提示路径不存在,经过排查,最终修改了Idea的应用权限得以解决。
懒得往下看的话,执行这条命令后,重启idea即可解决问题。
shell
flatpak override com.jetbrains.IntelliJ-IDEA-Ultimate --filesystem=host
过程
bash
root@fedora:~# flatpak list
名称 应用程序 ID 版本 分支 来源 安装
Google Chrome com.google.Chrome 131.0.6778.85-1 stable flathub system
GoLand com.jetbrains.GoLand 2024.2.3 stable flathub system
IntelliJ IDEA Ultimate com.jetbrains.IntelliJ-IDEA-Ultimate 2024.3 stable flathub system
Visual Studio Code com.visualstudio.code 1.95.3 stable flathub system
防火墙 org.fedoraproject.FirewallConfig stable fedora system
Fedora KDE 6 Platform org.fedoraproject.KDE6Platform 41 f41 fedora system
Fedora Platform org.fedoraproject.Platform 41 f41 fedora system
Freedesktop Platform org.freedesktop.Platform freedesktop-sdk-24.08.7 24.08 flathub system
Mesa org.freedesktop.Platform.GL.default 24.2.5 23.08 flathub system
Mesa (Extra) org.freedesktop.Platform.GL.default 24.2.5 23.08-extra flathub system
Mesa org.freedesktop.Platform.GL.default 24.2.7 24.08 flathub system
Mesa (Extra) org.freedesktop.Platform.GL.default 24.2.7 24.08extra flathub system
openh264 org.freedesktop.Platform.openh264 2.1.0 2.2.0 flathub system
openh264 org.freedesktop.Platform.openh264 2.4.1 2.4.1 flathub system
Freedesktop SDK org.freedesktop.Sdk freedesktop-sdk-23.08.25 23.08 flathub system
Freedesktop SDK org.freedesktop.Sdk freedesktop-sdk-24.08.7 24.08 flathub system
虚拟系统管理器 org.virt_manager.virt-manager 4.1.0 stable fedora system
Wireshark org.wireshark.Wireshark 4.4.1 stable fedora system
root@fedora:~# flatpak info --show-permissions com.jetbrains.IntelliJ-IDEA-Ultimate
[Context]
shared=network;ipc;
sockets=x11;pulseaudio;ssh-auth;gpg-agent;
devices=all;
filesystems=home;xdg-run/app/com.discordapp.Discord:create;xdg-run/gnupg;xdg-run/docker;xdg-run/podman;xdg-run/keyring;xdg-run/pipewire-0;
[Session Bus Policy]
org.freedesktop.Notifications=talk
org.freedesktop.secrets=talk
[Environment]
IDEA_PROPERTIES=/app/bin/idea.properties
JAVA_HOME=/app/extra/idea-IU/jbr
root@fedora:/var/lib/flatpak/app# flatpak info --show-permissions com.jetbrains.GoLand
[Context]
shared=network;ipc;
sockets=x11;pulseaudio;
devices=all;
features=devel;
filesystems=xdg-run/keyring;xdg-run/gnupg:ro;host;
[Session Bus Policy]
org.freedesktop.Notifications=talk
org.freedesktop.secrets=talk
[Environment]
GOLAND_JDK=${FLATPAK_DEST}/goland/jbr/
root@fedora:~# flatpak override com.jetbrains.IntelliJ-IDEA-Ultimate --filesystem=host
命令释义
bash
# 查看应用对应的ID是什么
flatpak list
# 分别查看这两个应用的权限信息
flatpak info --show-permissions com.jetbrains.IntelliJ-IDEA-Ultimate
flatpak info --show-permissions com.jetbrains.GoLand
#将idea的文件系统权限设置为host
flatpak override com.jetbrains.IntelliJ-IDEA-Ultimate --filesystem=host