Merge pull request #23978 from geekpi/translating

translated
This commit is contained in:
geekpi 2021-12-02 08:49:26 +08:00 committed by GitHub
commit 3d040d05f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 119 additions and 119 deletions

View File

@ -1,119 +0,0 @@
[#]: subject: "Install apps on Linux with Flatpak"
[#]: via: "https://opensource.com/article/21/11/install-flatpak-linux"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Install apps on Linux with Flatpak
======
Flatpak simplifies the installation of applications on Linux.
![Flatpak][1]
Computer applications consist of many small files that are linked together to perform a set of tasks. Because they get presented as "apps," colorful icons in the menu or on a desktop, most of us think of applications as a single, almost tangible thing. And in a way, it's comforting to think of them that way because they feel manageable that way. If an application is actually the amalgamation of hundreds of little library and asset files scattered throughout your computer, where's the application? And existential crisis aside, what happens when one application needs one version of a library while another application demands a different version? 
In the world of cloud computing, [containers][2] are becoming more and more popular because they offer isolation and consolidation for applications. You can install all the files an application needs in a "container." That way, its libraries stay out of the way of other applications, and the memory it occupies doesn't leak data into the memory space of another. Everything ends up feeling very much like a single, almost tangible _thing_. On the Linux desktop, Flatpak, a cross-distribution, daemon-less, decentralized application delivery system, provides a similar technology.
### Install Flatpak on Linux
Your Linux system may already have Flatpak installed. If not, you can install it from your package manager:
On Fedora, Mageia, and similar distributions:
```
`$ sudo dnf install flatpak`
```
On Elementary, Mint, and other Debian-based distributions:
```
`$ sudo apt install flatpak`
```
On Slackware, Flatpak is available from [SlackBuilds.org][3].
### Select a Flatpak repo
You can install an application as a Flatpak by adding a Flatpak repository to your distribution's software center (such as **Software** on GNOME). Flatpak is a decentralized system, meaning anyone developing software can host their own repository. Still, in practice, [Flathub][4] is the biggest and most popular aggregation of applications in the Flatpak format. To add Flathub to **GNOME Software** or **KDE Discover**, navigate to flatpak.org/setup and find the instructions for your distribution and start with step #2, or just download the [Flatpakrepo][5] file. Depending on your network, it may take a few minutes for your software center to synchronize with Flathub or another Flatpak repository. Flathub has a lot of software, but there's no limit to how many Flatpak repositories you have on your system, so don't be afraid to add a new repository if you find one that has the software you want to try.
![Software Repositories][6]
(Seth Kenlon, [CC BY-SA 4.0][7])
If you prefer to work in the terminal, you can add repositories directly with the `flatpak` command:
```
$ flatpak remote-add --if-not-exists flathub \
<https://flathub.org/repo/flathub.flatpakrepo>
```
### Install an application
As long as you've added a Flatpak repository to your software center, you can browse through applications as usual.
![GNOME Software][8]
(Seth Kenlon, [CC BY-SA 4.0][7])
Click on an application that looks appealing, read up on it, and click the **Install** button when you're ready.
### Installing flatpaks in the terminal
If you prefer to work in the terminal, you can treat Flatpak as a dedicated package manager. You can search for an application using the `flatpak search` command:
```
$ flatpak search paint
Name        Description                         Application ID
CorePaint   A simple painting tool              org.cubocore.CorePaint
Pinta       Edit images and paint digitally     com.github.PintaProject.Pinta
Glimpse     Create images and edit photographs  org.glimpse_editor.Glimpse
Tux Paint   A drawing program for children      org.tuxpaint.Tuxpaint
Krita       Digital Painting, Creative Freedom  org.kde.krita
```
Install with `flatpak install`:
```
`$ flatpak install krita`
```
Once installed, applications appear in your application menu or Activities screen along with all the other applications on your system.
### Apps made easy
Flatpak makes installing applications easy for the user by eliminating version conflicts. They make distributing software easy for developers by targeting just one package format on either a self-hosted platform or a communal one like Flathub. I use Flatpaks on Fedora Silverblue, CentOS, and Slackware, and I can't quite imagine life without it now. Try Flatpak for your next app install!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/11/install-flatpak-linux
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/flatpak-lead-image_0.png?itok=URbhdsDQ (Flatpak)
[2]: https://opensource.com/article/21/7/linux-podman
[3]: http://slackbuilds.org
[4]: http://flathub.org
[5]: https://flathub.org/repo/flathub.flatpakrepo
[6]: https://opensource.com/sites/default/files/uploads/repo.jpg (Software Repositories)
[7]: https://creativecommons.org/licenses/by-sa/4.0/
[8]: https://opensource.com/sites/default/files/uploads/software.jpg (GNOME Software)

View File

@ -0,0 +1,119 @@
[#]: subject: "Install apps on Linux with Flatpak"
[#]: via: "https://opensource.com/article/21/11/install-flatpak-linux"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
用 Flatpak 在 Linux 上安装应用
======
Flatpak 简化了 Linux 上应用的安装。
![Flatpak][1]
计算机应用由许多小文件组成,它们被链接在一起以执行一系列的任务。因为它们以“应用”的形式出现,在菜单或桌面上有彩色的图标,我们大多数人认为应用是一个单一的、几乎是有形的东西。在某种程度上,这样想是令人欣慰的,因为它们感觉是可以管理的。如果一个应用实际上是散落在你的计算机上的数百个小库和资源文件的组合,那么应用在哪里?撇开存在危机不谈,当一个应用需要一个版本的库,而另一个应用需要一个不同的版本时,会发生什么?
在云计算的世界里,[容器][2]正变得越来越流行因为它们为应用提供了隔离和整合。你可以在一个“容器”中安装一个应用需要的所有文件。这样一来它的库就不会受到其他应用的影响它所占用的内存也不会将数据泄露到另一个内存空间。所有的东西最后都感觉非常像一个单一的、几乎是有形的_东西。在 Linux 桌面上Flatpak一个跨发行版、无守护进程、去中心化的应用交付系统提供了一个类似的技术。
### 在 Linux 上安装 Flatpak
你的 Linux 系统可能已经安装了 Flatpak。如果没有你可以从你的包管理器中安装它
在 Fedora、Mageia 和类似的发行版上:
```
`$ sudo dnf install flatpak`
```
在 Elementary、Mint 和其他基于 Debian 的发行版上:
```
`$ sudo apt install flatpak`
```
在 Slackware 上Flatpak 可以从 [SlackBuilds.org][3] 获得。
### 选择一个 Flatpak 仓库
你可以通过在你的发行版的软件中心(如 GNOME 上的**软件**)添加一个 Flatpak 仓库,将一个应用安装为 Flatpak。Flatpak 是一个去中心化的系统,意味着任何开发软件的人都可以托管他们自己的仓库。尽管如此,在实践中,[Flathub][4] 是 Flatpak 格式的最大和最流行的应用集合。要将 Flathub 添加到 **GNOME Software** 或者 **KDE Discover**,请浏览 flatpak.org/setup找到适合你的发行版的说明从第二步开始或者直接下载 [Flatpakrepo][5] 文件。根据你的网络情况,你的软件中心可能需要几分钟的时间来与 Flathub 或另一个 Flatpak 仓库同步。Flathub 有很多软件,但你的系统上有多少个 Flatpak 仓库是没有限制的,所以如果你发现一个有你想尝试的软件,不要害怕添加一个新的仓库。
![Software Repositories][6]
Seth Kenlon, [CC BY-SA 4.0][7]
如果你喜欢在终端工作,你可以用 `flatpak` 命令直接添加到仓库:
```
$ flatpak remote-add --if-not-exists flathub \
<https://flathub.org/repo/flathub.flatpakrepo>
```
### 安装一个应用
只要你在软件中心添加了 Flatpak 仓库,你就可以像往常一样浏览应用了。
![GNOME Software][8]
Seth Kenlon, [CC BY-SA 4.0][7]
点击一个看起来很吸引人的应用,阅读它,当你准备好时点击**安装**按钮。
### 在终端中安装 flatpaks
如果你喜欢在终端工作,你可以把 Flatpak 当作一个专门的包管理器。你可以使用 `flatpak search` 命令来搜索一个应用程序:
```
$ flatpak search paint
Name Description Application ID
CorePaint A simple painting tool org.cubocore.CorePaint
Pinta Edit images and paint digitally com.github.PintaProject.Pinta
Glimpse Create images and edit photographs org.glimpse_editor.Glimpse
Tux Paint A drawing program for children org.tuxpaint.Tuxpaint
Krita Digital Painting, Creative Freedom org.kde.krita
```
`flatpak install` 安装:
```
`$ flatpak install krita`
```
安装后,应用就会与系统中的所有其他应用一起出现在你的应用菜单或活动页上。
### 应用变得简单
Flatpak 通过消除版本冲突,使用户轻松安装应用。他们通过在自我托管的平台或像 Flathub 这样的公共平台上只针对一种软件包格式,使分发软件变得简单。我在 Fedora Silverblue、CentOS 和 Slackware 上使用 Flatpaks我无法想象现在没有它的生活。在你的下一个应用安装中试试 Flatpak 吧!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/11/install-flatpak-linux
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/flatpak-lead-image_0.png?itok=URbhdsDQ (Flatpak)
[2]: https://opensource.com/article/21/7/linux-podman
[3]: http://slackbuilds.org
[4]: http://flathub.org
[5]: https://flathub.org/repo/flathub.flatpakrepo
[6]: https://opensource.com/sites/default/files/uploads/repo.jpg (Software Repositories)
[7]: https://creativecommons.org/licenses/by-sa/4.0/
[8]: https://opensource.com/sites/default/files/uploads/software.jpg (GNOME Software)