← 返回命令列表

Linux command

flatpak-run 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run

flatpak run [com.example.app]

Example

flatpak run --branch=[stable|beta|master] [com.example.app]

Example

flatpak run --command=sh [com.example.app]

Example

flatpak run --runtime-version=[24.08] [com.example.app]

Example

flatpak run --runtime=[org.freedesktop.Sdk] [com.example.app]

Example

flatpak run --filesystem=[home] [com.example.app]

Example

flatpak run --sandbox [com.example.app]

说明

Flatpak run executes applications or opens shells within Flatpak's sandboxed environment. The sandbox provides isolation with the runtime mounted at /usr, application at /app, and a writable /var directory for persistent data. When running an application, extra arguments pass through to the application. For runtimes, the command opens a shell for development and testing purposes. The sandbox automatically adjusts environment variables including PATH, LD_LIBRARY_PATH, and graphics-related variables to ensure proper isolation and prevent interference with sandbox functioning.

参数

--user
Use per-user installation
--system
Use system-wide installation
--arch _arch_
Target specific architecture
--branch _branch_
Use specific branch (stable, beta, master)
--command _command_
Run specified command instead of default
--runtime _runtime_
Use a different runtime
--runtime-version _version_
Use specific runtime version
--sandbox
Run with minimal permissions (strip extras)
--share _subsystem_
Share subsystem with host (network, ipc)
--unshare _subsystem_
Unshare subsystem from host
--socket _socket_
Expose well-known socket (x11, wayland, pulseaudio)
--nosocket _socket_
Don't expose socket
--filesystem _path_
Grant filesystem access (home, host, /path)
--nofilesystem _path_
Revoke filesystem access
--env _var=value_
Set environment variable
--device _device_
Expose device to application (dri, input, usb, kvm, shm, all)
--devel
Use the devel runtime specified in the application metadata
--die-with-parent
Kill the application when the launching process dies

FAQ

What is the flatpak-run command used for?

Flatpak run executes applications or opens shells within Flatpak's sandboxed environment. The sandbox provides isolation with the runtime mounted at /usr, application at /app, and a writable /var directory for persistent data. When running an application, extra arguments pass through to the application. For runtimes, the command opens a shell for development and testing purposes. The sandbox automatically adjusts environment variables including PATH, LD_LIBRARY_PATH, and graphics-related variables to ensure proper isolation and prevent interference with sandbox functioning.

How do I run a basic flatpak-run example?

Run `flatpak run [com.example.app]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --user do in flatpak-run?

Use per-user installation