플랫팩 사용#

This page provides an introduction to the flatpak command line interface, and explains essential technical conventions as well as the most common commands.

End users shouldn’t generally need to use this page or the Flatpak command line interface, since Flatpak can be easily used through graphical software management tools, though they are of course free to use the command line if they prefer!

The flatpak command#

flatpak is the primary Flatpak command, to which specific commands are appended. For example, the command to install something is flatpak install and the command to uninstall is flatpak uninstall.

Identifiers#

Flatpak identifies each application and runtime using a unique three-part identifier, such as com.company.App. The final segment of this address is the object’s name, and the preceding part identifies the developer, so that the same developer can have multiple applications, like com.company.App1 and com.company.App2.

Identifier triples#

Typically it is sufficient to refer to objects using their ID. However, in some situations it is necessary to refer to a specific version of an object, or to a specific architecture. For example, some applications might be available as a stable and a testing version, in which case it is necessary to specify which one you want to install.

Flatpak allows architectures and versions to be specified using an object’s identifier triple. This takes the form of name/architecture/branch, such as com.company.App/i386/stable. (Branch is the term used to refer to versions of the same object.) The first part of the triple is the ID, the second part is the architecture, and the third part is the branch.

Identifier triples can also be used to specify just the architecture or the branch, by leaving part of the triple blank. For example, com.company.App//stable would just specify the branch, and com.company.App/i386// just specifies the architecture.

The Flatpak CLI provides feedback if the architecture or branch of an object needs to be specified.

System versus user#

Flatpak commands can be run either system-wide or per-user. Applications and runtimes that are installed system-wide are available to all users on the system. Applications and runtimes that are installed per-user are only available to the users that installed them.

The same principle applies to repositories - repositories that have been added system-wide are available to all users, whereas per-user repositories can only be used by a particular user.

Flatpak commands are run system-wide by default. If you are installing applications for day-to-day usage, it is recommended to stick with this default behavior.

However, running commands per-user can be useful for testing and development purposes, since objects that are installed in this way won’t be available to other users on the system. To do this, use the --user option, which can be used in combination with most flatpak commands.

Commands behave in exactly the same way if they are run per-user rather than system-wide.

Basic commands#

This section covers basic commands needed to install, run and manage Flatpak applications. For the full list of Flatpak commands, run flatpak --help or see the 플랫팩 명령어 레퍼런스.

저장소 목록#

시스템에 설정되어 있는 원격 저장소들의 목록을 나열하려면 다음과 같이 입력한다:

$ flatpak remotes

시스템에 추가된 저장소들의 목록이 출력되며, 사용자단위(per-user) 인지 시스템단위(system-wide) 인지도 표시된다.

저장소 추가#

The most convenient way to add a remote is by using a .flatpakrepo file, which includes both the details of the remote and its GPG key:

$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

위 명령행에서 flathub 은 해당 저장소를 편리하게 호칭하려고 로컬 단말에서 붙이는 별명이다. 뒤쪽의 URL은 저장소의 .flatpakrepo 파일의 경로이다. —if-not-exists 옵션은 동일한 저장소가 이미 존재할 때의 에러 메시지 표시를 생략하기 위한 것이다.

저장소 제거#

저장소 제거를 위해서는 아래와 같이 실행하면 된다

$ flatpak remote-delete flathub

이 경우, flathub 은 바로 위에서 언급한 것과 동일한 저장소의 별명이다.

응용프로그램 설치#

응용프로그램을 설치하기 위해, 아래와 같이 실행한다:

$ flatpak install flathub org.gimp.GIMP

위 명령행에서 flathub 은 설치할 응용프로그램을 제공하는 저장소의 이름이며, org.gimp.GIMP 는 응용프로그램의 ID이다.

때때로, 응용프로그램이 특정 런타임을 필요로할 경우, 응용프로그램 설치 전에 시스템에 설치되어야 한다.

설치할 응용프로그램의 상세정보는 .flatpakref 파일에서 제공한다. .flatpakref 파일은 저장소에 있을 수도 있고, 로컬 단말에 있을 수도 있다. 저장소나 응용프로그램 ID를 수동으로 입력하는 대신 다음과 같이 .flatpakref 을 지정할 수 있다:

$ flatpak install https://flathub.org/repo/appstream/org.gimp.GIMP.flatpakref

만일 .flatpakref 파일에 포함된 응용프로그램이 아직 추가하지 않은 저장소로부터 설치되어야 한다면, 응용프로그램 설치 전, 사용자에게 추가 여부 확인한다.

Since Flatpak 1.2, the install command can search for applications. A simple:

$ flatpak install gimp

will confirm the remote and application and proceed to install.

응용프로그램 실행#

응용프로그램이 설치되고나면, run 명령을 실행할 때 응용프로그램 ID를 지정하여 실행할 수 있다.

$ flatpak run org.gimp.GIMP

업데이트#

설치한 모든 버전을 새 버전으로 업데이트하려면 다음과 같이 실행한다:

$ flatpak update

설치된 응용프로그램 목록#

설치한 응용프로그램 및 런타임 목록을 나열하려면 다음과 같이 실행한다:

$ flatpak list

설치된 응용프로그램만을 나열하려면 다음과 같이 입력한다:

$ flatpak list --app

응용프로그램 제거#

설치한 응용프로그램을 제거하기 위한 플랫팩 명령은 다음과 같다:

$ flatpak uninstall org.gimp.GIMP

Troubleshooting#

Flatpak has a few commands that can help you to get things working again when something goes wrong.

To remove runtimes and extensions that are not used by installed applications, use:

$ flatpak uninstall --unused

To fix inconsistencies with your local installation, use:

$ flatpak repair

Flatpak also has a number of commands to manage the portal permissions of installed apps. To reset all portal permissions for an app, use flatpak permission-reset:

$ flatpak permission-reset org.gimp.GIMP

To find out what changes have been made to your Flatpak installation over time, you can take a look at the logs (since 1.2):

$ flatpak history