Flatpak Linuxオペレーティングシステムにソフトウェアパッケージを展開および管理するためのツールです。これは、ユーザーがコンピューターの他の部分に影響を与えることなくアプリケーションを実行できる分離された環境を提供します。
Flatpaksを使用すると、アプリケーションをインストールすることは、それをローカルリポジトリにプルするようなものです。次に、ファイルシステム内の適切な場所からこれらのファイルを見つけることができる場所へのリンクが生成されます。これらのハードリンクは、従来の方法で実行する場合に比べて単純であるため、ディスク容量に対して効率的です。
Debianユーザーの場合、ディストリビューションが新しい機能よりも安定性に重点を置いていることをほとんどの人が知っています。これはDebianで有名ですが、一部のユーザーの場合、Discord、VLC、Spotifyなどのアプリケーションをインストールすることをお勧めします。 Debianで利用可能な場合は、最新のリリースではなく、機能が不足しています。
Flatpaksは、メンテナによってはほとんどの部分が最新であることが常に知られていますが、サードパーティのマネージャーの中で、トップにランクされています。
次のチュートリアルでは、Debian 11にFlatpakをインストールし、FlathubがFlatpakアプリケーションを検索、インストール、保守、または削除できるようにする方法を学習します。
最初のタスクは、インストールを続行する前に、既存のすべてのパッケージが最新であることを確認するためにシステムを更新することです。
sudo apt update && sudo apt upgrade
Flatpakのインストール
Debianは、標準の安定したリポジトリにデフォルトでFlatpakを備えています。インストールを開始するには、次のコマンドを使用します。
sudo apt install flatpak -y
フラットハブ は、気まぐれにインストールできるアプリケーションを検索するための一般的な宛先です。次のコマンドを使用してこれを有効にします。
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Flatpakの使用方法
チュートリアルは、Flatpakを使用して最も一般的なコマンドのいくつかを実行します。
使用する必要のある最初のコマンドは、使用しているオプションの数を理解するためのhelpコマンドです。一部のFlatpakユーザーでさえ、知らないコマンドを見つける可能性があります。
flatpak --help
出力例:
Usage:
flatpak [OPTION…] COMMAND
Builtin Commands:
Manage installed applications and runtimes
install Install an application or runtime
update Update an installed application or runtime
uninstall Uninstall an installed application or runtime
mask Mask out updates and automatic installation
pin Pin a runtime to prevent automatic removal
list List installed apps and/or runtimes
info Show info for installed app or runtime
history Show history
config Configure flatpak
repair Repair flatpak installation
create-usb Put applications or runtimes onto removable media
Finding applications and runtimes
search Search for remote apps/runtimes
Running applications
run Run an application
override Override permissions for an application
make-current Specify default version to run
enter Enter the namespace of a running application
ps Enumerate running applications
kill Stop a running application
Manage file access
documents List exported files
document-export Grant an application access to a specific file
document-unexport Revoke access to a specific file
document-info Show information about a specific file
Manage dynamic permissions
permissions List permissions
permission-remove Remove item from permission store
permission-set Set permissions
permission-show Show app permissions
permission-reset Reset app permissions
Manage remote repositories
remotes List all configured remotes
remote-add Add a new remote repository (by URL)
remote-modify Modify properties of a configured remote
remote-delete Delete a configured remote
remote-ls List contents of a configured remote
remote-info Show information about a remote app or runtime
Build applications
build-init Initialize a directory for building
build Run a build command inside the build dir
build-finish Finish a build dir for export
build-export Export a build dir to a repository
build-bundle Create a bundle file from a ref in a local repository
build-import-bundle Import a bundle file
build-sign Sign an application or runtime
build-update-repo Update the summary file in a repository
build-commit-from Create new commit based on existing ref
repo Show information about a repo
Help Options:
-h, --help Show help options
Application Options:
--version Print version information and exit
--default-arch Print default arch and exit
--supported-arches Print supported arches and exit
--gl-drivers Print active gl drivers and exit
--installations Print paths for system installations and exit
--print-updated-env Print the updated environment needed to run flatpaks
--print-system-only Only include the system installation with --print-updated-env
-v, --verbose Show debug information, -vv for more detail
--ostree-verbose Show OSTree debug information
Flatpakでアプリケーションを検索する方法
Flatpak検索機能はターミナルで便利です。理想的には、名前とアプリケーションIDを検索する必要があります。これはまだターミナルで実行できますが、視覚的にはWebブラウザを使用してIDを直接取得するほど簡単ではありません。
flatpak search discord
出力例:
次に、
を取得できますFlatpakSearchからアプリケーションをインストールする方法
アプリケーションを見つけたら、次のコマンドを使用して、チュートリアルケースのDiscordにインストールできます。
flatpak install discord
Flathubから直接Flatpakを使用してアプリケーションをインストールする方法
アプリケーションをインストールするためのより望ましい方法は、Flathubから直接コマンドを取得することです。
例:
上記のように、端末のコマンドは次のようになります。
flatpak install flathub com.discordapp.Discord
Flatpakアプリケーションの実行方法
ほとんどのユーザーの場合、アプリケーションの表示メニューからFlatpakがインストールされているアプリケーションを実行し、アイコンを選択します。ただし、ターミナルから起動したいユーザーは、以下を使用してください。
例:
flatpak run com.discordapp.Discord
インストールされているFlatpakアプリケーションを一覧表示する方法
Flatpakでインストールしたアプリケーションを忘れがちな場合があります。便利な機能は、listコマンドを使用して、現在端末にインストールされているものを、ビルドバージョン、ブランチ、およびアプリケーションIDとともに印刷することです。
flatpak list
出力例:
Flatpakアプリケーションを更新する方法
デフォルトでは、更新は自動的に処理されますが、手動で確認する場合は、ターミナルを開いて次のコマンドを使用できます。
flatpak update
Flatpakアプリケーションを削除する方法
ターミナルでFlatpakアプリケーションを削除したいユーザーには、次のコマンドを使用してください。
flatpak uninstall --delete-data com.discordapp.Discord
Flatpakを削除(アンインストール)
Flatpakをインストールしたくないユーザーの場合は、次のコマンドを使用して、インストールされているすべてのアプリケーションを最初に削除します。
flatpak uninstall --all
次に、残りのランタイムを削除します。
flatpak uninstall --unused
次に、DebianシステムからFlatpakを直接削除します。
sudo apt autoremove flatpak --purge -y
このプロセスで、Flatpakを完全に削除しました。