Merge branch 'LCTT:master' into master

This commit is contained in:
Donkey 2022-09-07 20:07:37 +08:00 committed by GitHub
commit 44f70eb53d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 1557 additions and 465 deletions

View File

@ -3,78 +3,83 @@
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "Return7g"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
对比Ubuntu和Manjaro比较不同的Linux发行版体验
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15006-1.html"
Ubuntu 和 Manjaro比较两种不同的 Linux 发行版体验
======
![](https://img.linux.net.cn/data/attachment/album/202209/06/215515o89v2xu8v05rv759.jpg)
Ubuntu 是基于 Debian 最流行的桌面和服务器 Linux 发行版。
Manjaro 是基于 Arch 量身定制的 Linux 发行版。
两者在用户体验以及功能上都大相径庭。
然而,在比较Manjaro的GNOME版和Ubuntu时其中一个共同点是[桌面环境][1]。
然而,将 Manjaro 的 GNOME 版和 Ubuntu 放到一起比较时,其中一个共同点是 [桌面环境][1]。
但它们之间的差异到底在哪? Manjaro 的包管理器会更好用吗Ubuntu 和 Manjaro 上的软件生态怎么样?
但它们到底有什么不同Manjaro 的包管理器会更好用吗Ubuntu 和 Manjaro 上的软件生态怎么样?
接下来,我们来看看两个 Linux 发行版在某些关键问题上的差异。
### 发行周期
Ubuntu根据你选择的版本不同提供了两个发行周期。如果你选择的是长期发行版本Long Term Support LTS那么你在至少未来五年内都会收到安全维护更新。
假如你安装了 Ubuntu 22.04 ,那么你在**2027 年 4 月**之前都能获取更新。
Ubuntu 根据你选择的版本不同提供了两个发行周期。如果你选择的是<ruby>长期支持版本<rt>Long Term Support</rt></ruby>LTS那么你在至少未来五年内都会收到安全维护更新。
假如你安装了 Ubuntu 22.04 ,那么你在 **2027 年 4 月** 之前都能获取更新。
![ubuntu22 04 lts about][2]
因此我们更推荐普通用户使用 LTS 版本。
因此我们更推荐普通桌面用户使用 LTS 版本。
如果你想要更新更好的体验,你可以选择每**九个月**更新一次的非 LTS 版本。例如 Ubuntu 21.04, Ubuntu 21.10, Ubuntu 22.10。
如果你想要更新更好的体验,你可以选择每**九个月**更新一次的非 LTS 版本。例如 Ubuntu 21.04、 Ubuntu 21.10、Ubuntu 22.10。
需要注意的是,非 LTS 版本涉及的更改可能会影响你的工作流程以及用户体验。因此并不推荐所有人都去使用非 LTS 版本。
选择 Manjaro Linux 时你将会获得滚动发行时间表,因此你不必担心对你使用版本的支持。它会通过定期更新升级到最新的可用版本。
选择 Manjaro Linux 时你将会获得滚动发布的更新,因此你不必担心对你使用版本的支持过期。它会通过定期更新升级到最新的可用版本。
![manjaro about][3]
由于滚动发行周期的原因你可以快速获取到最新的软件包。因此如果你想使用某个软件的历史版本Manjaro 或许并不适合你。
### 桌面环境
Ubuntu 有 GNOME 版本桌面的定制版。它可能不是最新的,但如果你使用较新的 Ubuntu 版本,它可能包含最新的 GNOME 桌面环境。
Ubuntu 特别提供了一个定制版的 GNOME 桌面。它可能不是最新的,但如果你使用较新的 Ubuntu 版本,它基本上包含的就是最新的 GNOME 桌面环境。
![ubuntu 22 04 wallpaper][4]
Canonical Ubuntu 背后的公司)并不提供其它桌面环境
CanonicalUbuntu 背后的公司)并不提供其它桌面环境
但如果你想在 Ubuntu 上使用其它桌面环境,你可以选择官方的[Ubuntu 风格][5] KDE, Budgie, LXQt, MATE 以及 XFCE 作为桌面环境。与具有其他桌面环境的非官方或更新版本的 Ubuntu 相比,它们是经过良好测试且稳定的 Ubuntu Linux 发行版。
但如果你想在 Ubuntu 上使用其它桌面环境,你可以选择包含了 KDE、Budgie、LXQt、MATE 以及 XFCE 等桌面环境的 Ubuntu 官方 <ruby>[风味版][5]<rt>Flavour</rt></ruby>。与提供了其他桌面环境的非官方版或更新的<ruby>特色版<rt>Spin</rt></ruby>的 Ubuntu 相比,它们是经过良好测试且稳定的 Ubuntu Linux 发行版。
但是这些Ubuntu 版本没有五年的软件支持; 相反,你将被限制为对 LTS 版本的三年支持。
但是这些 Ubuntu 风味版没有五年的软件支持;相反,你只能受限地得到对 LTS 版本的三年支持。
如果使用 Manjaro你可以选择官方提供的三个版本XFCE, KDE 和 GNOME。 无论桌面环境如何,你都会使用滚动发布模式。
如果使用 Manjaro你可以选择官方提供的三个版本XFCEKDE 和 GNOME。 无论桌面环境如何,你都会使用滚动发布模式。
![manjaro gnome 42][6]
当然你也可以使用一些社区版本如 Budgie, MATE, LXQt。
当然你也可以使用 Manjaro 的一些社区版本,如 Budgie、MATE、LXQt。
### 包管理器以及软件生态
在上述这些发行版中找到大多数必要的 Linux 应用是没问题的。
Manjaro Linux 使用 Pamac 作为其包管理器获得了更快速的体验。
在上述这两类发行版中,找到大多数必要的 Linux 应用是没问题的。
不过Manjaro Linux 使用 Pamac 作为其包管理器而获得了更快速的体验。
![manjaro package manager][8]
与 Ubuntu 上的应用商店相比Manjaro Linux 在快速安装/更新软件方面提供了更好的体验。 而且,如果您想通过单击启用它们,它还支持开箱即用的 Flatpak/Snap。
与 Ubuntu 上的应用商店相比Manjaro Linux 在快速安装/更新软件方面提供了更好的体验。而且,它还支持开箱即用的 Flatpak/Snap,如果你只需一键即可启用它们
Ubuntu 比较重视 Snap 包,你会发现一些应用程序预装为 Snap包如 Firefox 浏览器)。
Ubuntu 比较重视 Snap 软件包,你会发现一些应用程序预装为 Snap 软件包(如 Firefox 浏览器)。
![firefox as snap][9]
对于 Manjaro Linux来说你可以根据自身需求决定是否启用 Flatpak/Snap。
对于 Manjaro Linux 来说,你可以根据自身需求决定是否启用 Flatpak/Snap。
在使用 Ubuntu 时,其应用商店提供的 Linux 应用并不是最好的。取决于你的系统配置和使用年限,它会变得越来越慢。
在使用 Ubuntu时应用商店提供的 Linux 应用并不是最好的。取决于你的系统配置和使用年限,它会变得越来越慢。
![ubuntu 22 04 software center][10]
除此之外Manjaro Linux 还可以访问 [AUR][11],它可以获得你在 Ubuntu 应用商店中可能找不到的几乎所有软件。
@ -87,29 +92,29 @@ Ubuntu 桌面主要是为了易于使用而量身定制的。它专注于提供
即使有人不知道 Linux 上的“包管理器”是什么,在他们使用它时也可以完全把它作为 Windows/macOS 的完美替代品。
当然,我们也有一个指南来帮助[安装最新的 Ubuntu 后要做的事情][12]。
当然,我们也有一个指南来帮助[安装最新的 Ubuntu 后要做的事情][12]。
Manjaro Linux 也是为桌面用户使用量身定制的。但是它并不适合首次使用 Linux 的用户使用。
Manjaro Linux 也是为桌面用户使用量身定制的。 但是它并不适合首次使用 Linux 的用户使用。
它旨在简化 Arch Linux 的操作。 因此主要面向想要使用 Arch Linux 的 Linux 用户增加了一些便利性。
它旨在简化 Arch Linux 的操作。因此主要面向想要使用 Arch Linux 的 Linux 用户,但是增加了一些便利性。
### 稳定性
![stability tux][13]
Ubuntu LTS 版本主要关注稳定性和可靠性,因此你也可以在服务器上部署它们。
相比之下Manjaro Linux 可能没有开箱即用那么稳定。 你在 Manjaro Linux 中安装软件包时需要更加仔细,同时密切注意你的配置,以确保更新不会破坏你的系统。
相比之下Manjaro Linux 可能没有提供现成的的稳定性。你在 Manjaro Linux 中安装软件包时需要更加仔细,同时密切注意你的配置,以确保更新不会破坏你的系统。
对于 Ubuntu 用户来说则无需担心软件更新,尤其是在考虑 LTS 版本时,更新通常不会破坏你的系统。
### 个性化
Ubuntu 有一个由 Canonical 为最终用户设置的定制 GNOME 桌面。 虽然你可以自由选择不同的 Linux 发行版,但 Ubuntu 提供的开箱即用的功能让然很少
Ubuntu 多年来一直在改进,最近增加了[在 Ubuntu 22.04 LTS 中添加强调色][14] 的能力。 但是它仍然还有很长的路要走
Ubuntu 特别提供了一个由 Canonical 为最终用户设置的定制 GNOME 桌面。虽然你可以自由定制你的 Linux 发行版的各个方面,但 Ubuntu 开箱即用提供定制很少
如果你想获得个性化的桌面体验,你只能借助[GNOME Tweak][15] 等软件来实现。
Ubuntu 多年来一直在改进,最近增加了 [在 Ubuntu 22.04 LTS 中添加强调色][14] 的能力。 但是它仍然还有很长的路要走。
如果你想获得个性化的桌面体验,你只能借助 [GNOME Tweak][15] 等软件来实现。
对比 Manjaro GNOME你也只能使用相同的工具来自定义桌面。
@ -119,51 +124,53 @@ Manjaro 还对外观进行了一些自定义调整。但是它提供了更多组
在个性定制方面,你在 Manjaro 和 Ubuntu 上的体验大致相同。
如果想要更多自定义选项Manjaro Linux 可能是一个不错的选择。 但是如果你只想要一个个性化体验而不需要太多的改变Ubuntu 应该就足够了。
如果想要更多自定义选项Manjaro Linux 可能是一个不错的选择。但是如果你只想要个性化体验而不需要太多的改变Ubuntu 应该就足够了。
### 臃肿的软件
这对每个人来说可能都不是什么大问题。 但如果你不喜欢预装许多应用程序,那么 Ubuntu 可能会令你感到麻烦。
这对每个人来说可能都不是什么大问题。但如果你不喜欢预装许多应用程序,那么 Ubuntu 可能会令你感到麻烦。
![ubuntu 22 apps][17]
虽然可以随时删除不需要的应用程序。但是你会发现更多随 Ubuntu 一起安装的软件和服务还有很多。
虽然可以随时删除不需要的应用程序。但是你会发现随 Ubuntu 一起安装的软件和服务还有很多。
使用 Manjaro时你在安装时只需要安装最基础的内容即可。它们坚持使用最基础的实用程序最大限度地减少预装的软件包数量。 因此Manjaro 很少会和软件臃肿联系到一起。
但是你在默认安装的 Manjaro 上可能找不到你最喜欢的 Linux 软件。 因此如果你想在安装后立即使用一些你喜欢的软件Ubuntu 可能是一个不错的选择。
使用 Manjaro 时你在安装时只需要安装最基础的内容即可。它们坚持使用最基础的实用程序最大限度地减少预装的软件包数量。因此Manjaro 很少会和软件臃肿联系到一起。
但是你在默认安装的 Manjaro 上可能找不到你最喜欢的 Linux 软件。因此如果你想在安装后立即使用一些你喜欢的软件Ubuntu 可能是一个不错的选择。
### 性能
![ubuntu 22 04 neofetch lolcat][18]
虽然 Ubuntu 提高了系统性能,甚至可以在 2 GB 内存的树莓派上运行,但它仍然不是性能最好的 Linux 发行版。
虽然 Ubuntu 改进了其系统表现,甚至可以在 2 GB 内存的树莓派上运行,但它仍然不是性能最好的 Linux 发行版。
当然,性能确实取决于你选择使用的桌面环境。
但是与 Manjaro 的 GNOME 版本相比Manjaro 提供了更快捷的体验。
需要注意的是性能和动画首选项的用户体验还取决于你的系统配置。例如Manjaro 推荐旧电脑系统达到拥有 1GB 内存和 1GHz 处理器。
但是,对于 Ubuntu在撰写本文时你至少需要 4 GB 内存 和 2 GHz 双核处理器才能获得理想的桌面体验。
需要注意的是性能和动画首选项的用户体验还取决于你的系统配置。例如Manjaro 的推荐系统要求1GB 内存和 1GHz 处理器)给了你使用旧电脑的机会。
但是,对于 Ubuntu在撰写本文时你至少需要 4GB 内存 和 2GHz 双核处理器,才能获得理想的桌面体验。
### 文档
考虑到 Ubuntu 的受欢迎程度Ubuntu 更易于使用,并且对新用户来说可能更舒适。
[Ubuntu 的文档][19] 即使不是最好也足够好了。
谈到 Manjaro Linux他们有一个 [wiki][20],其中包含基础信息和深入的指南来帮助你入门。
谈到 Manjaro Linux他们有一个 [维基][20],其中包含基础信息和深入的指南来帮助你入门。
总的来说,[Arch Linux 的文档][21] 非常细致,几乎每个人(甚至是老手)都会参考它来寻求帮助。
Arch Linux 的文档在很大程度上也适用于 Manjaro Linux因此在文档方面使用 Manjaro Linux 比 Ubuntu 更有优势。
### 结束语
作为两个完全不同的 Linux 发行版,它们服务于各种类型的用户。你可以选择任意你感兴趣的操作系统并尝试去使用它来判断它是否适合你。
但是不管 Linux 发行版如何你想避免对系统进行任何更改并专注于你的工作Ubuntu 应该是一个明智的选择
作为两个完全不同的 Linux 发行版,它们服务于各种类型的用户。你可以选择你感兴趣的任意一个并尝试去使用它来判断它是否适合你
无论如何,如果 Ubuntu 的性能对你的体验有相当大的影响,你应该去尝试 Manjaro。 你可以阅读我的 [关于从 Ubuntu 切换到 Manjaro 的初步想法][22]。
但是,如果你想避免对系统进行任何更改,并专注于你的工作,那么 Ubuntu 应该是一个明智的选择。
而如果 Ubuntu 的性能对你的体验有相当大的影响,你应该去尝试 Manjaro。 你可以阅读我的 [关于从 Ubuntu 切换到 Manjaro 的初步想法][22]。
--------------------------------------------------------------------------------
@ -172,7 +179,7 @@ via: https://itsfoss.com/ubuntu-vs-manjaro/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[Return7g](https://github.com/Return7g)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,284 @@
[#]: subject: "Become A Pro Flatpak User By Learning These Commands"
[#]: via: "https://www.debugpoint.com/flatpak-commands/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15007-1.html"
如何成为专业的 Flatpak 用户
======
> 在这篇文章中,我将向你展示各种 Flatpak 命令,使你成为 Flatpak 的专业用户。
![][1]
Flatpak 沙盒技术是 Linux 应用分发的未来。如今,几乎所有重要的发行版都预装了 Flatpak因为采用它很容易维护它也更直接。
如果你每天都使用 Flatpak你可能知道这些命令。但如果你还在考虑把每一个应用程序都转到 Flatpak那么你应该通过这个命令列表来了解如何轻松管理 Flatpak 应用程序。
因此,为了帮助你做到这一点,我列出了一些易于使用的 Flatpak 命令供你参考,这些命令是从文档中的大量命令集中筛选出来的。
### Flatpak 命令参考
首先,我们来谈谈一些基本的命令。
#### 1、安装 Flatpak
自从上次我检查过后,如今所有重要的发行版都预装了 Flatpak。因此你可能不需要安装它。
然而,安装 Flatpak 就像在这两个主要发行版中运行以下命令一样简单:
```
sudo apt install flatpak // 用于 Ubuntu 和相关发行版
```
```
sudo dnf install flatpak // 适用于 Fedora 和基于 RPM 的发行版
```
如果你正在运行其他发行版,你可以查看我们关于 Flatpak 安装的 [详细指南][2]。
#### 2、设置 Flatpak 远程仓库
接下来,你需要在安装后设置与 <ruby>远程仓库<rt>remote</rt></ruby>的连接。远程仓库就像是一个存储库(参考 PPA用来分发 Flatpak 应用程序。
主要的仓库是 Flathub你可以用下面的命令来设置它。这个命令对所有发行版都是一样的。完成后重新启动你的系统你就可以安装 Flatpak 应用程序了。
```
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```
**提示**:如果你有别的远程仓库,你可以使用相同的命令来添加该仓库。在一个系统中设置多个远程仓库是正常的。
**提示**:另外,你可以指定 `--user``--system` 开关来安装特定于你的用户 ID 或整个系统的 Flatpak 远程仓库。
```
flatpak remote-add --if-not-exists --user https://flathub.org/repo/flathub.flatpakrepo
```
```
flatpak remote-add --if-not-exists --system https://flathub.org/repo/flathub.flatpakrepo
```
#### 3、从 Flathub 安装 Flatpak 应用程序
Linux 中大多数重要的基于 GUI 的软件商店都默认允许安装 Flatpak 应用程序。例如,如果你正在使用“<ruby>软件<rt>Software</rt></ruby>”(适用于 Ubuntu 或 Fedora GNOME 版),你可以找到应用程序并点击安装按钮进行安装。
或者,在 KDE Plasma 的 “<ruby>发现<rt>Discover</rt></ruby>” 中:
![KDE “发现”可以从 Flathub 拉取 Flatpak 应用程序][3]
但是,最简单的方法是复制 [Flathub 商店][4] 中的安装命令(可在每个应用程序信息页面的底部找到)并将其粘贴到终端。这是安装 Flatpak 应用程序的最快方法。
```
flatpak install org.kde.kdenlive
```
#### 4、运行一个应用程序
有两种方法来运行你安装的 Flatpak 应用程序。你可以在图形化桌面环境的应用程序菜单中找到它。或者,你可以使用简单的运行(`run`)参数来启动。
你可以从 Flathub 应用程序页面找到运行命令。
```
flatpak run org.kde.kdenlive
```
现在,你已经学会了如何设置、安装和运行 Flatpak 应用程序。现在是时候深入了解一下了。
#### 5、找出已安装的 Flatpak 应用程序列表
经过几年,你可能已经安装和删除了许多 Flatpak 应用程序。但是,你怎么找出安装了多少 Flatpak 应用程序?或者你可能想知道系统所安装的 Flatpak 应用是什么。
这里有一些 Flatpak 命令(通过终端运行),可以在这方面帮助你。
一个简单的 `flatpak` 命令可以列出所有安装的应用程序。这包括系统应用和你的应用:
```
flatpak list
```
只显示你的应用程序:
```
flatpak --user list
```
更详细一点,你可以在上述两个命令中使用额外的列(如名称、大小等)进行过滤:
```
flatpak --columns=app,name,size,installation list
```
```
flatpak --columns=name,size --user list
```
![flatpak 带有额外列的列出命令][5]
#### 6、找出已安装应用程序的更多信息
现在,你已经通过上述 Flatpak 命令安装了一个应用程序。但是,如果你想知道架构、版本、分支、许可证和其他信息,该怎么办呢?你可以使用 `info` 参数来实现。这个命令需要 Flatpak 的 “应用 ID”你可以通过上面的 `flatpak list` 命令得到它。
例如:
```
flatpak info org.kde.kdenlive
```
![flatpak info 命令][6]
#### 7、找出 flatpak 命令在你系统中的全部历史记录
`flatpak` 命令中的 `histroy` 开关会列出在你的系统中发生的活动,包括安装、更新、卸载和日期时间戳。如果你想调查一些事情,这非常有用。
```
flatpak history
```
#### 8、更新 Flatpak 应用程序
`flatpak` 命令中的 `update` 参数可以更新所有的应用程序和运行时。当你运行这个命令时,它会显示可用的更新,并要求你确认是否继续。
```
flatpak update
```
如果你想更新一个特定的应用程序而不是整个系统,请使用 `--app``--runtime` 开关,分别用于应用程序和运行时。
例如,如果我想在我的系统中只更新 kdenlive我将运行以下命令
```
flatpak update --app org.kde.kdenlive
```
**提示**`update` 参数通常会更新到任何程序的分支顶端。然而,使用 `update` 参数中的 `--commit` 开关,你可以更新到 Flatpak 中的某个特定分支(升级或降级)。例如:
```
flatpak update --app org.kde.kdenlive --commit 37103f4ee56361a73d20cf6957d88f3cab802909a5966c27a6e81d69795a15
```
如果你想使用同一个应用程序的多个版本,这个 `--commit` 开关是非常有用的。
![flatpak 带有提交开关的更新命令示例][7]
#### 9、管理 Flatpak 应用程序的权限
不同的应用程序需要不同的权限,如摄像头、麦克风、屏幕等等。通过命令来管理这些单独的权限有点让人不知所措。因此,管理 Flatpak 权限的最好方法是使用另一个叫做 Flatseal 的 Flatpak 应用程序。它为你提供了一个漂亮的 GUI有切换按钮来启用/禁用/审查已安装的 Flatpak 应用程序的权限。
你可以在 [这里][8] 阅读 Flatseal 的更多信息。
#### 10、卸载 Flatpak 应用程序的命令
卸载 Flatpak 应用程序有不同的使用情况。所以,这里是快速指南。
要卸载单个应用程序,使用 `uninstall` 参数和应用程序 ID。例如
```
flatpak uninstall org.kde.kdenlive
```
要卸载所有应用程序,使用 `—all` 开关:
```
flatpak uninstall --all
```
要卸载未使用的应用程序,请使用以下方法:
```
flatpak uninstall --unused
```
#### 11、删除并去除 Flatpak 应用程序的所有痕迹
**使用以下命令时要特别小心,因为它将删除一切。**
即使你卸载了 Flatpak 应用程序,一些应用程序的数据仍然保留在你的系统中,除非你在运行卸载程序时增加一些开关。在你可能想删除所有东西并重新开始使用 Flatpak 的情况下,这是必要的。
要卸载和删除特定应用程序的数据,请使用以下命令。例如:
```
flatpak uninstall -y --delete-data org.kde.kdenlive
```
要卸载和删除所有与 Flatpak 相关的东西,请使用下面的命令:
```
flatpak uninstall --all --delete-data
```
#### 12、清理和磁盘空间的使用
默认情况下Flatpak 被安装在 `/var/lib/flatpak`。这个目录包含所有与 Flatpak 相关的数据和元数据以及运行时文件。而用户特定的安装目录是 `~/.local/share/flatpak`
你可以用以下命令找出 Flatpak 应用程序使用的磁盘空间。
```
du -h /var/lib/flatpak
```
要清理,你可以使用上面提到的 `--unused``--uninstall` 开关。详情请访问我们的 [Flatpak 清理指南][9]。
### 总结
为了便于你随时参考,这里是对上面解释的 `flatpak` 命令的一个总结。把这个页面收藏起来,以便于参考。
```
# 安装和运行
flatpak install org.kde.kdenlive
flatpak run org.kde.kdenlive
# 列出已安装的 Flatpak 应用程序
flatpak list
flatpak --user list
flatpak --columns=app,name,size,installation list
flatpak --columns=name,size --user list
# 找出应用 ID 和命令历史
flatpak info org.kde.kdenlive
flatpak history
# 更新 Flatpak 应用程序
flatpak update
flatpak update --app org.kde.kdenlive
# 删除 Flatpak 应用程序
flatpak uninstall org.kde.kdenlive
flatpak uninstall --unused
# 删除应用及数据(小心使用)
flatpak uninstall --all
flatpak uninstall -y --delete-data org.kde.kdenlive
flatpak uninstall --all --delete-data
```
最后,请在评论框中告诉我,你认为还有哪些 Flatpak 命令也应该包括在这个列表中。
[一些例子来自官方参考资料][10]。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/flatpak-commands/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/fpref-1024x576.jpg
[2]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/
[3]: https://www.debugpoint.com/?attachment_id=10760
[4]: https://flathub.org/apps
[5]: https://www.debugpoint.com/?attachment_id=10758
[6]: https://www.debugpoint.com/?attachment_id=10757
[7]: https://www.debugpoint.com/wp-content/uploads/2022/08/Example-of-flatpak-commands-update-with-commit-1024x576.jpg
[8]: https://www.debugpoint.com/manage-flatpak-permission-flatseal/
[9]: https://www.debugpoint.com/clean-up-flatpak/
[10]: https://docs.flatpak.org/en/latest/flatpak-command-reference.html

View File

@ -0,0 +1,87 @@
[#]: subject: "Good News! Wii U Emulator Cemu 2.0 Goes Open Source With Linux Support"
[#]: via: "https://news.itsfoss.com/cemu-2-open-source-emulator/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Good News! Wii U Emulator Cemu 2.0 Goes Open Source With Linux Support
======
Cemu Wii U emulator is now open-source with a major upgrade! Also, a Linux build is available to test.
![Good News! Wii U Emulator Cemu 2.0 Goes Open Source With Linux Support][1]
If you have been following us, you might have noticed some new projects switching to open-source.
One of them is a live debugger tool, [Sidekick][2], and the other one is a privacy-focused Evernote alternative:
[Evernote Alternative Notesnook is Now Open Source][3]
Now, we have another exciting project to join the list, i.e., **Cemu Wii U emulator.**
Wii U was one of the most loved video game consoles developed by Nintendo in 2012.
Of course, Wii U games were popular back then, and now that it is no longer available as a new product, gamers use emulators to enjoy those games.
### Cemu 2.0 Experimental: Wii U Emulator
![cemu wii u emulator][5]
[Cemu][6] is a helpful emulator that runs just about every Wii U game (and homebrew), providing a good experience.
📢 Recently, they announced its next major upgrade,**Cemu 2.0**, and its transition to open-source. You can access its [GitHub repository][7] to explore more.
The release is **experimental**, considering it includes many internal changes. Some highlights include:
* Updated all dependencies.
* Fixed a crash in the H264 video decoder.
* Improved Call of Duty: Black Ops II support.
* Improved latency.
* Debugger improvements.
You can find the complete changelog in its [GitHub releases section][8].
🎉 Not just limited to the switch to open-source, Cemu 2.0 also **introduces Linux support**, with a preliminary build available for **Ubuntu 20.04 LTS**.
![wii u emulator][9]
I couldn't make it work with Ubuntu 22.04 LTS. So, you can expect more Linux support soon.
They should probably try offering a Flatpak to support all Linux distributions.
### Download Cemu 2.0 Experimental
You cannot upgrade to it from an existing stable version. So, you might want to install it separately if you like to experiment with it.
The GitHub page and its official website should give you plenty of information about the project.
[Cemu Wii U Emulator][10]
Nevertheless, we have another exciting project for the open-source community! 🥳
💬 *Share your thoughts in the comments section below!*
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/cemu-2-open-source-emulator/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/cemu-goes-open-source.jpg
[2]: https://news.itsfoss.com/sidekick-open-source/
[3]: https://news.itsfoss.com/notesnook-goes-open-source/
[5]: https://news.itsfoss.com/content/images/2022/09/cemu-2-ui.png
[6]: https://cemu.info/
[7]: https://github.com/cemu-project/Cemu
[8]: https://github.com/cemu-project/Cemu/releases/tag/v2.0
[9]: https://news.itsfoss.com/content/images/2022/09/cemu-2-settings.png
[10]: https://cemu.info/index.html

View File

@ -0,0 +1,83 @@
[#]: subject: "Lapce is a Fast, Lightweight Open-Source Code Editor in Making"
[#]: via: "https://news.itsfoss.com/lapce-code-editor/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Lapce is a Fast, Lightweight Open-Source Code Editor in Making
======
Lapce is an open-source code editor built in Rust. It is in its early stages of development, but looks promising!
![Lapce is a Fast, Lightweight Open-Source Code Editor in Making][1]
There are plenty of open-source code editors available for Linux.
What would you think about another option: A **Rust-based** open source code editor focusing on performance?
It should be **exciting**, right?
Lapce is one such project in development that aims to present a feature-rich and fast code editor as an alternative to Microsoft's Visual Studio Code.
The developer also mentions that it was inspired by [Xi-editor][2] (which is no longer in active development).
### Lapce at its Pre-Alpha Stage
![lapce editor][3]
Although Lapce is not yet a complete offering, it has much to offer.
So, seeing what we get as the stable releases approach closer should be interesting.
The features worth highlighting include:
* Command palette (quick actions).
* Customize the UI font, header height, font shadow, scroll width, etc.
* Built-in terminal.
* Vim-like modal editing.
* Connect to a remote computer.
* Code syntax highlighting, code completion, and similar essentials.
* Plugin system.
* Dark/light mode.
While it focuses on performance, it looks good in terms of user experience (even though it is incomplete).
![][4]
If users get access to all the essential features one expects in a code editor, and a better-performing application, Lapce can be a popular choice in no time.
### Download Lapce
Lapce is available for Linux, macOS, and Windows as a pre-alpha build.
For Linux, you just need to download and extract the tar.gz package and run the Lapce executable available using the GUI or the terminal.
It is under heavy development at the moment. You can download the package for your platform and test it, but you should expect bugs and new releases soon enough. Explore its [GitHub page][5] for more information.
[Lapce][6]
I tried it on Pop!_OS 22.04 LTS, and noticed the UI freezing a couple of times. However, the functionalities that it provides seem impressive.
💬 *What are your thoughts on Lapce as an open-source code editor built in Rust? Do you think you will consider it over your current favorite? Share what you think in the comments below.*
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/lapce-code-editor/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/09/lapce-editor.png
[2]: https://github.com/xi-editor/xi-editor
[3]: https://news.itsfoss.com/content/images/2022/09/lapce-screenshot.png
[4]: https://news.itsfoss.com/content/images/2022/09/lapce-code-edit.png
[5]: https://github.com/lapce/lapce
[6]: https://lapce.dev/

View File

@ -0,0 +1,253 @@
[#]: subject: "Advantages and Disadvantages of Using Linux"
[#]: via: "https://itsfoss.com/advantages-linux/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Advantages and Disadvantages of Using Linux
======
Linux is a buzzword and you keep hearing about Linux here and there. People discuss it in the tech forum, it is part of the course curriculum and your favorite tech YouTubers get excited while showing their Linux build. The 10x developers you follow on Twitter are all Linux fans.
Basically, Linux is everywhere and everyone keeps talking about it. And that gives you FOMO.
So, you wonder about the advantages of Linux and whether is it really worth trying.
I have compiled various possible advantages and disadvantages of Linux in this article.
If you are on the fence about choosing Linux over your preferred operating system, we would like to help you out.
Before you start, you should know that Linux is not an operating system on its own. The operating systems are called [Linux distributions and there are hundreds of them][1]. For simplicity, Ill address it as Linux OS instead of a specific Linux distribution. This [article][2] explains things better.
### Advantages of Using Linux
Considering you are curious about Linux as an alternative operating system choice, it only makes sense that you know its advantages.
You might never regret your decision if it excels at what you want it to do.
#### No Need to Purchase a License
![open source proprietary illustration][3]
You need to own an Apple device to use macOS as your daily driver and a Windows license to use Microsofts Windows.
Therefore, you need a bit of investment with these options. But, with Linux? Its entirely free.
Not just the OS, there are many software packages available for free on Linux when compared to Windows and macOS.
You can try every mainstream Linux distribution without paying for a license. Of course, you get the option to donate to support the project, but that is up to you if you really like it.
**Additionally**, Linux is totally open-source, meaning anyone can inspect the source code for transparency.
#### Can Run With Minimal System Resources
![linux mint 21 resource usage][4]
Typically, when users think of trying another operating system, it is because they are frustrated with the performance of their system.
This is from my personal experience. I have had friends willing to try Linux to revive their old laptop or a system that constantly lags.
And, when it comes to Linux distributions, they are capable of running on decent hardware configurations. You do not need to have the latest and greatest. Moreover, there are specialized [lightweight Linux distributions][5] that are tailored to run on older hardware with no hiccups.
So, you have more chances to revive your old system or get a fast-performing computer in no time with Linux.
#### Less Exposed to Malware
![malware illustration][6]
No operating system is safe from malicious files or scripts. If you download and run something from an unknown source, you cannot guarantee its safety.
However, things are better for Linux. Yes, researchers have found attackers targeting Linux IoT devices. But, for desktop Linux, it is not “yet” something to worry about.
Malicious actors target platforms that are more popular among households, and Linux does not have a big market share in the desktop space to attract that kind of attention. In a way, it can be a good thing.
All you have to do is just stick to the official software packages, and read instructions before you do anything.
As an extra plus, you do not necessarily need an antivirus program to get protection from malware.
#### Customization
![Pop!_OS 22.04 LTS][7]
With an open-source code, you get the freedom to customize your Linux experience as much as you want.
Of course, you require a bit of technical expertise to go utilize the best of it. Even without any experience, you get more customization features in your operating system when compared to macOS and Windows.
![Customized Linux experience | Reddit user: u/ZB652][8]
[u/ZB652][9]
If you are into personalizing your experience and willing to put in extra effort, Linux is for you. As an example, refer to the [KDE customization guide][10] and [dock options][11] to get basic ideas.
#### Something for Everyone
With macOS or Windows, you get limited to the design/preference choices finalized by Microsoft or Apple.
But, with Linux, you will find several Linux distributions that try to focus on various things.
For instance, you can opt for a Linux distribution that focuses on getting the latest features all the time, or you can opt for something that only gives you security/maintenance updates.
You can get something that looks beautiful out of the box or something that you provide crazy customization options. You will not run out of options with Linux.
I recommend starting with [options that give you the best user experience][12].
#### Complete Development Environment
If you are a software developer or student learning to code, Linux definitely has an edge. A lot of your build tools are available and integrated into Linux. With Docker, you can create specialized test environment easily.
Microsoft knows about this part and this is why it created WSL to give developers access to Linux environments inside Windows. Still, WSL doesnt come close to the real Linux experience. The same goes for using Docker on Windows.
I know the same cannot be said about web designing because the coveted Adobe tools are not available on Linux yet. But if you dont need Adobe for your work, Linux is a pretty good choice.
#### Learning Linux is a Skill One Must Have!
There is a learning curve to using Linux, but it provides you with insights on various things.
You get to learn how things work in an operating system by exploring and customizing it, or even just by using it.
Not everyone knows how to use Linux.
So, it can be a great skill to gain and expand your knowledge of software and computers.
#### Linux is an in-demand Job Skill
![job illustration][13]
As I mentioned above, it is a great skill to have. But, not just limited to expanding your knowledge, it is also useful professionally.
You can work your way to become a Linux system administrator or a security expert and fill several other job roles by learning the fundamentals of Linux.
So, learning Linux opens up a whole range of opportunities!
#### Privacy-Friendly
These days you cannot use Windows without a Microsoft account. And when you set up Windows, youll find that it tries to track your data from a number of services and applications.
![privacy windows][14]
While you can find such settings and disable them, it is clear that Windows is configured to disregard your privacy by default.
Thats not the case in Linux. While some applications/distributions may have an optional feature to let you share useful insights with them, it has never been a big deal. Most of the things on Linux are tailored to give you maximum privacy by default without needing to configure anything.
Apple and Microsoft on the other hand have clever tactics to collect anonymous usage data from your computer. Occasionally, they log your activity on their app store and while you are signed in through your account.
#### DIY projects and Self-hosting
Got a tinkerer in you? If you like to make electronics or software projects, Linux is your paradise.
You can use Linux on [single-board computers like Raspberry Pi][15] and create cool things like retro gaming consoles, home automation systems, etc.
You can also deploy open source software on your own server and maintain them. This is called self-hosting and it has the following advantages:
* Reduce hosting costs
* Take control of your data
* Customize the app/service as per your requirements
Clearly, youll be doing all this either directly with Linux or tools built on top of it.
### Disadvantages of Linux
Linux is not a flawless choice. Just like everything, there are some downsides to Linux as well. Those include:
#### Learning Curve
![too much learn illustration][16]
Every so often it is not just about learning a new skill, it is more about getting comfortable as quickly as possible.
If a user cannot get their way around the task they intend to do, it is not for them. It is true for every operating system. For instance, a user who uses Windows/macOS, may not get comfortable with Linux as quickly.
You can read our comparison article to know the [difference between macOS and Linux][17].
I agree that some users catch on quicker than others. But, in general, when you step into the Linux world, you need to be willing to put a bit of effort into learning the things that are not obvious.
#### Variety
While we recommend using the [best Linux distributions tailored for beginners][18], choosing what you like at first can be overwhelming.
You might want to try multiple of them to see what works with you best, which can be time-consuming and confusing.
Its best to settle with one of the Linux distributions. But, if you remain confused, you can stick to Windows/macOS.
#### Market Share in Desktop Space
![linux desktop market share][19]
Linux is not a popular desktop operating system.
This should not be of concern to a user. However, without having a significant market presence, you cannot expect app developers to make/maintain tools for Linux.
Sure, there are lots of essential and popular tools available for Linux, more than ever. But, it remains a factor that may mean that not all good tools/services work on Linux.
Refer to our regularly updated article on [Linuxs market share][20], to get an idea.
#### Lack of Proprietary Software
As I mentioned above, not everyone is interested in bringing their tools/apps to Linux.
Hence, you may not find all the good proprietary offerings for Windows/macOS. Sure, you can use a compatibility layer to run Windows/macOS programs on Linux.
But that doesnt work all the time. For instance, you do not have official Microsoft 365 support for Linux and tools like Wallpaper Engine.
#### Not a Gaming-first OS
![gaming illustration][21]
If you want to game on your computer, Windows remains the best option for its support for the newest hardware and technologies.
When it comes to Linux, there are a lot of “ifs and buts” for a clear answer. You can refer to our [gaming guide for Linux][22] to explore more if interested.
#### Lack of Professional Tech Support
I know not everyone needs it. But, there are tech support options that can guide users/fix issues remotely on their laptop or computer.
With Linux, you can seek help from the community, but it may not be as seamless as some professional tech support services.
Youll still have to do most of the hit and try stuff on your own and not everyone would like it.
### Wrapping Up
I am primarily a Linux user but I use Windows when I have to play games. Though my preference is Linux, I have tried to be unbiased and give you enough pointers so that you can make up your mind if Linux is for you or not.
If you are going for Linux and have never used it, take the baby step and [use Linux in a virtual machine first][23]. You can also use WSL2 if you have Windows 11.
I welcome your comments and suggestions.
--------------------------------------------------------------------------------
via: https://itsfoss.com/advantages-linux/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/what-is-linux/
[2]: https://itsfoss.com/what-is-linux/
[3]: https://itsfoss.com/wp-content/uploads/2022/08/open-source-proprietary-illustration.jpg
[4]: https://itsfoss.com/wp-content/uploads/2022/08/linux-mint-21-resource-usage.jpg
[5]: https://itsfoss.com/lightweight-linux-beginners/
[6]: https://itsfoss.com/wp-content/uploads/2022/09/malware-illustration.jpg
[7]: https://itsfoss.com/wp-content/uploads/2022/08/pop-os-screenshot-2022.png
[8]: https://itsfoss.com/wp-content/uploads/2022/09/customization-reddit-unixporn.jpg
[9]: https://www.reddit.com/r/unixporn/comments/wzu5nl/plasma_cscx2n/
[10]: https://itsfoss.com/kde-customization/
[11]: https://itsfoss.com/best-linux-docks/
[12]: https://itsfoss.com/beautiful-linux-distributions/
[13]: https://itsfoss.com/wp-content/uploads/2022/09/job-illustration.jpg
[14]: https://itsfoss.com/wp-content/uploads/2022/09/privacy-windows.webp
[15]: https://itsfoss.com/raspberry-pi-alternatives/
[16]: https://itsfoss.com/wp-content/uploads/2022/09/too-much-learn-illustration.jpg
[17]: https://itsfoss.com/mac-linux-difference/
[18]: https://itsfoss.com/best-linux-beginners/
[19]: https://itsfoss.com/wp-content/uploads/2017/09/linux-desktop-market-share.jpg
[20]: https://itsfoss.com/linux-market-share/
[21]: https://itsfoss.com/wp-content/uploads/2022/08/gaming-illustration.jpg
[22]: https://itsfoss.com/linux-gaming-guide/
[23]: https://itsfoss.com/why-linux-virtual-machine/

View File

@ -0,0 +1,108 @@
[#]: subject: "Unix History: A Mighty Origin Story"
[#]: via: "https://www.debugpoint.com/unix-history/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Unix History: A Mighty Origin Story
======
A brief walk down memory lane about Unix and its beginning.
![The beginning][1]
### Unix: The origin story
The world today runs on Linux. Billions of mobile phones and servers today run Linux. But before Linux, there was Unix, and without it, Linux would not have existed today.
Unixs origin can be traced back to the moon landing days. In 1965, three famous institutions started a joint venture to create an operating system that could serve multiple users and share data and resources.
![Scanned copy of actual Unix code][2]
They are the famous Bell Telephone Laboratories, the General Electric Company and the Massachusetts Institute of Technology. This project or the joint venture is called “Multics” an acronym for “Multiplex Information and Computing Service”.
But, the project did not see much success. Unfortunately. Due to complexity and poor outcome, Bell Labs discontinued the project.
Ken Thomson from Bell Labs, who worked in Multics, started afresh. He started writing a new operating system for an ancient computer PDP-7 of Digital Equipment Corporation. Later, Dennis Ritchie joined, and they created a hierarchical file system, device files, command line interpreter and processes. This is how the Unix was born, named by another member of the Multics project Brian Kernighan.
In 1971, Unix was ported to a little advanced PDP-11 computer with just a 512 KB disk. At the time, Unix was only supporting 16 KB and 8 KB memory allocated for user programs.
However, most of the Unix code was in assembly language, making it hardware dependent. So, it was not portable.
![Ken Thompson (sitting) and Dennis Ritchie at PDP-11 (credit and learn more about this image1)][3]
### Creation of C Programming Language
So, the only way to make it portable and machine-independent is to write it in a high-level language so that the compile and corresponding object code can take care of the machine code conversion.
The great brains at that time solve the problem in a jiffy. Ken Thompson created a high-level language from scratch called “B”. Then, he started the massive work to convert Unix assembly code to this newly created language. However, “B” also had some limitations, and Dennis Ritchie modified it to create the famous language “C”, which makes Unix a truly portable operating system.
The famous “C” language is still used today.
By the mid-80s, Unix became so successful that it was running on thousands of hardware, from micro-computers to mainframes with a variety of hardware.
![The text book of C which we all read][4]
### MINIX and the birth of Linux
In 1987, Andrew S. Tanenbaum a computer science professional, created a Unix fork called MINIX to explain the operating system concepts in his famous book “Operating Systems: Design and Implementation” and distributed (the 16-bit version) free along with the book. Those who studied computer science (including me) or related subjects knows that its the ultimate textbook on Operating system which explains the basics.
In 1991, Linux Torvalds [started a hobby project][5] while studying at the University of Helsinki. He based his work on MINIX with GNU C Compiler. He started his project to enable him to run programs on his new PC with a new 80386 processor. However, he wrote the entire operating system with features that MINIX lacked, eventually becoming the Linux Kernel.
![Famous operating systems book by Tanenbaum][6]
### BSD and macOS
During the 80s, when Unix was shaping up, Bell Labs developed BSD (Berkeley Standard Distribution) based on the original Source code of Unix (the version that runs on PDP-7 and PDP-11). BSD is distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley. After its formation, BSD has been adapted by many workstation vendors (the legacy desktop), such as Sun Microsystems, as a proprietary Unix variant.
This version eventually forked to create open-source variants such as OpenBSD, FreeBSD and so on. These free versions created the path to create NeXTSTEP by NeXT, founded by Steve Jobs. And NeXTSTEP eventually became the foundation for Apples macOS.
### Wrapping Up
Unix is a remarkable achievement by a few individuals with their original ideas and takes on problem-solving. The operating system is a work of art if you consider how much computing power and memory were available at the time of its creation.
All of these small steps, over several decades, eventually led us where we are today. No matter how many Kernels, OSes, and abstractions in the form of programming languages come in, at the core, it all started from a single source.
I always think that programs/codes are thoughts of human beings. Its your logic, ideas are merely written in “IF-ELSE” blocks to achieve some real-world result.
References
* [https://www.bell-labs.com/usr/dmr/www/picture.html][7]1
* [https://groups.google.com/g/comp.os.minix/c/dlNtH7RRrGA/m/SwRavCzVE7gJ][8]
* [https://en.wikipedia.org/wiki/Andrew_S._Tanenbaum][9]
* [https://en.wikipedia.org/wiki/History_of_Linux][10]
* [https://en.wikipedia.org/wiki/History_of_Unix][11]
* [https://computerhistory.org/blog/the-earliest-unix-code-an-anniversary-source-code-release/][12]
*“All revolutions are, until they happen, then they are historical inevitabilities.” Cloud Atlas*
![Join our Telegram channel and stay informed on the move.][13]
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/unix-history/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2022/09/The-beginning-1024x576.jpg
[2]: https://www.debugpoint.com/wp-content/uploads/2022/09/Scanned-copy-of-actual-Unix-code-1024x646.jpg
[3]: https://www.debugpoint.com/wp-content/uploads/2022/09/Ken-Thompson-sitting-and-Dennis-Ritchie-at-PDP-11.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2022/09/The-text-book-of-C-which-we-all-read.jpg
[5]: https://groups.google.com/g/comp.os.minix/c/dlNtH7RRrGA/m/SwRavCzVE7gJ
[6]: https://www.debugpoint.com/wp-content/uploads/2022/09/Famous-operating-systems-book-by-Tanenbaum.jpg
[7]: https://www.bell-labs.com/usr/dmr/www/picture.html
[8]: https://groups.google.com/g/comp.os.minix/c/dlNtH7RRrGA/m/SwRavCzVE7gJ
[9]: https://en.wikipedia.org/wiki/Andrew_S._Tanenbaum
[10]: https://en.wikipedia.org/wiki/History_of_Linux
[11]: https://en.wikipedia.org/wiki/History_of_Unix
[12]: https://computerhistory.org/blog/the-earliest-unix-code-an-anniversary-source-code-release/
[13]: https://t.me/debugpoint

View File

@ -1,283 +0,0 @@
[#]: subject: "Become A Pro Flatpak User By Learning These Commands"
[#]: via: "https://www.debugpoint.com/flatpak-commands/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Become A Pro Flatpak User By Learning These Commands
======
In this article, I will show you various Flatpak commands that make you a pro Flatpak user.
![][1]
Flatpak sandboxed technology is the future of Linux app distribution. Almost all significant distributions come with Flatpak pre-installed today since the adoption is easy and maintaining it more straightforward.
If you use Flatpak every day, you probably know these commands. But if you are still considering moving to Flatpak for every app, then you should go through this list to understand how easy to manage Flatpak apps.
Hence, to help you do that, I have listed some easy-to-use Flatpak commands for your reference, filtered from the huge set of command-set from documentation.
### Flatpak Commands Reference
First, lets talk about some basic commands.
#### 1. Installing Flatpak
Since last time I checked, all the significant distros come with pre-installed Flatpak packages today. Hence, you may not require to install it.
However, installing Flatpak is as easy as running the following command for two major distro lineups.
```
sudo apt install flatpak // for Ubuntu and related distros
```
```
sudo dnf install flatpak // for Fedora and RPM based distros
```
You may check out our [detailed guide][2] on Flatpak installation, if you are running any other distro.
#### 2. Set up Flatpak Remote
Next, you need to set up a connection to remotes after installation. The remotes are like repositories (think about PPA) which distribute Flatpak apps.
The primary repo is Flathub, and you can set it up using the following command. This command is same for all distros. And after you finish, reboot your system and you are ready to install Flatpak apps.
```
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```
**Tip**: If you have a different remote, you may use the same command to add that remote. Its normal to have multiple remotes set up in a single system.
**Tip**: Also, you can specify `--user` or `--system` switch to install the Flatpak remotes specific to your user id or the entire system!
```
flatpak remote-add --if-not-exists --user https://flathub.org/repo/flathub.flatpakrepo
```
```
flatpak remote-add --if-not-exists --system https://flathub.org/repo/flathub.flatpakrepo
```
#### 3. Installing a Flatpak app from Flathub
Most of the significant GUI-based Software stores in Linux allow Flatpak installation by default. For example, if you are using Software (for Ubuntu or Fedora GNOME), you can find and click on the install button to install.
Or, in KDE Plasmas discover:
![KDE Discover can pull up Flatpak apps from Flathub][3]
But, the easiest way is to copy the install command from the [Flathub store][4] (available at the bottom of each app info page) and paste it into the terminal. This is the fastest way to install any Flatpak app.
```
flatpak install org.kde.kdenlive
```
#### 4. Running an application
There are two ways to run a Flatpak app which you installed. You can either find it in the application menu in the graphical desktop environment. Or, you can use the simple run command to launch.
You can find the run command from the Flathub app page.
```
flatpak run org.kde.kdenlive
```
Now, you have learned how to set up, install and run the Flatpak app. Its time to go a little deeper.
#### 5. Find out list of Flatpak apps you have installed
Over the years, you may have installed and removed many Flatpak apps. But, how can you find out how many Flatpak apps I have installed at any given time? Or you might be wondering what the Flatpak apps that are installed by the system.
Here are some Flatpak commands (to run via terminal) that can help you in this regard as FAQ.
* Simple Flatpak commands to list all installed app. This includes both system apps and your apps.
```
flatpak list
```
* Command to display only your apps.
```
flatpak --user list
```
* A little more detail you can filter using additional columns (such as name, size etc) in both the above commands.
```
flatpak --columns=app,name,size,installation list
```
```
flatpak --columns=name,size --user list
```
![flatpak list command with additional columns][5]
#### 6. Find out more information about an installed app
Now, you have installed an app via above Flatpak commands. But what if you want to find out the architecture, version, branch, licence and other information. You can do that using the `info` switch. This command requires the Flatpak `Application ID` which you can get it via above `flatpak list` command.
Example:
```
flatpak info org.kde.kdenlive
```
![flatpak info command][6]
#### 7. Find out entire history of flatpak command in your system
The histroy switch in flatpak command gives you a list of activities happened in your system that includes install, update, uninstall with date time stamp. Its very useful if you want to trying to investigate something.
```
flatpak history
```
#### 8. Updating Flatpak apps
The update switch in flatpak command updates all applications and runtimes. When you run this command, it will show you the available updates and asks for your confirmation to proceed.
```
flatpak update
```
If you want to update a specific application and not the entire system use the `--app` or `--runtime` switch for applications and runtimes respectively.
For example, if I want to update only kdenlive in my system, I would run the following.
```
flatpak update --app org.kde.kdenlive
```
**Tip**: The update command usually updates to the top of the branch of any program. However, using the `--commit` switch in update parameter, you can update to a specific branch (upgrade or downgrade) in flatpak. For example:
```
flatpak update --app org.kde.kdenlive --commit 37103f4ee56361a73d20cf6957d88f3c3cab802909a5966c27a6e81d69795a15
```
This commit switch is very helpful if you want to play around several version of same app.
![Example of flatpak commands update with commit][7]
#### 9. Managing permission of flatpak apps
Different application require variety of permissions such as webcam, microphone, screen and so on. Managing these individual permissions are a little overwhelming via commands. Hence, the best way to manage Flatpak permission is using another flatpak app called Flatseal. It gives you a nice GUI with toggle buttons to enable/disable/review permissions of the installed Flatpak apps.
You can read more about [Flatseal here][8].
#### 10. Commands to uninstall Flatpak applications
There are different use cases for uninstall a flatpak app. So, heres quick guide.
To uninstall a single application, use the `uninstall` switch with application ID. For example:
```
flatpak uninstall org.kde.kdenlive
```
To uninstall all apps, use the `--all` switch.
```
flatpak uninstall --all
```
To uninstall unused apps, use the following.
```
flatpak uninstall --unused
```
#### 11. Delete and remove every trace of Flatpak apps
**Use the following commands with extreme caution, since it will delete everything.**
Even if you uninstall a Flatpak app, some app data remains in your system unless you run the uninstall with some additional switch. Its necessary for cases where you might want to delete everything and start afresh with Flatpak.
To uninstall and delete data for a specific app, use the following command. For example:
```
flatpak uninstall -y --delete-data org.kde.kdenlive
```
To uninstall and delete everything related to Flatpak, use below.
```
flatpak uninstall --all --delete-data
```
#### 12. Cleanup and disk space usage
By default Flatpak gets installed in `/var/lib/flatpak`. This directory contains all flatpak related data and metadata plus runtime files. And the user specific installation directory is `~/.local/share/flatpak`.
You can find out the disk space used by Flatpak apps using the following command.
```
du -h /var/lib/flatpak
```
To clean up, you can use the unused or uninstall commands mentioned above. For details, visit our [flatpak cleanup guide][9].
### Summary
For your ready reference, heres a summary of the Flatpak commands explained above. And bookmark this page for easy reference.
```
# install and run
flatpak install org.kde.kdenlive
flatpak run org.kde.kdenlive
#various ways of list installed apps
flatpak list
flatpak --user list
flatpak --columns=app,name,size,installation list
flatpak --columns=name,size --user list
# find out app id and history
flatpak info org.kde.kdenlive
flatpak history
# updating flatpak
flatpak update
flatpak update --app org.kde.kdenlive
# uninstalling flatpak apps
flatpak uninstall org.kde.kdenlive
flatpak uninstall --unused
# uninstall everything (use with caution)
flatpak uninstall --all
flatpak uninstall -y --delete-data org.kde.kdenlive
flatpak uninstall --all --delete-data
```
Finally, do let me know in the comment box which Flatpak commands you think should also be included in this list.
*[Some examples via the official reference.][10]*
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/flatpak-commands/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2022/08/fpref-1024x576.jpg
[2]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/
[3]: https://www.debugpoint.com/?attachment_id=10760
[4]: https://flathub.org/apps
[5]: https://www.debugpoint.com/?attachment_id=10758
[6]: https://www.debugpoint.com/?attachment_id=10757
[7]: https://www.debugpoint.com/wp-content/uploads/2022/08/Example-of-flatpak-commands-update-with-commit-1024x576.jpg
[8]: https://www.debugpoint.com/manage-flatpak-permission-flatseal/
[9]: https://www.debugpoint.com/clean-up-flatpak/
[10]: https://docs.flatpak.org/en/latest/flatpak-command-reference.html

View File

@ -1,131 +0,0 @@
[#]: subject: "Create Bootable USB Using Etcher in Linux Download and Usage Guide"
[#]: via: "https://www.debugpoint.com/etcher-bootable-usb-linux/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Create Bootable USB Using Etcher in Linux Download and Usage Guide
======
A quick and easy tutorial on how to create a bootable USB using the Etcher tool in Ubuntu and other Linux.
[Etcher][1] is a utility created by [Balena][2], that makes your life easy with its unique take on creating bootable USB and SD cards with a .iso file. In this guide, I will show you the steps to download and install Etcher.
Although it is a bit trivial for some, it may be difficult for others. Hence this guide.
Primarily Etcher is used for flashing or writing the Linux OS .iso images, for example, Ubuntu, [Linux Mint][3] .iso images, etc. But ideally, it should work for any other .iso files as well.
There are other utilities available as well to create bootable USB disks in particular, like earlier I wrote about a [guide][4] using Unetbootin.
But that said, Etcher is, in my opinion, **faster, cleaner, and better**. It seldom fails. The success rate is high.
Before I explain the steps, a quick recap of its features.
### Etcher Features
* Crisp 3-step process to create a bootable USB drive
* Autodetect the USB
* Select the file, Select target, and write fast
* Clone a drive
* Choose the local downloaded .iso file Or directly from the URL
* Clean and eye-friendly UI
* Cross-platform Linux, Windows, and macOS
* Built-in JS, electron
* Standalone AppImage executable available for Linux
### Installing Etcher
Etcher is available for all platforms. So you can easily install it using the following methods in all Linux distributions, macOS, and Windows.
Firstly, go to the below link.
[Download ETCHER][5]
#### For All Linux distributions
Download the AppImage executable from the above link. Then change the permission to the *executable* from `right click -> properties` . Then run the file.
For distribution-specific packages, refer below.
#### Debian, Ubuntu
To install Etecher in Debian, Ubuntu, Linux Mint, and related distributions, follow the below commands from the terminal.
```
echo "deb https://deb.etcher.io stable etcher" | sudo tee /etc/apt/sources.list.d/balena-etcher.listsudo apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 379CE192D401AB61sudo apt-get updatesudo apt-get install balena-etcher-electron
```
#### Fedora
For Fedora, follow the below commands from the terminal.
```
sudo wget https://balena.io/etcher/static/etcher-rpm.repo -O /etc/yum.repos.d/etcher-rpm.reposudo dnf install -y balena-etcher-electron
```
#### Arch Linux
For Arch Linux, make sure yay is installed. Then you can run the below command to install.
```
yay -S balena-etcher
```
### Create bootable USB Using Etcher
Once you have installed it successfully. Launch the application. The first window shows 3 steps which you need to follow. Of course, you need a USB stick and the .iso file to write.
##### Step 1: Select the file
Plugin your target USB or SD card. Browse and select the location of your .iso file. Or, you can pull it directly from the internet as well via the URL option.
![Step 1 - Select the file][6]
##### Step 2: Select the target device
Click on select target and carefully choose your USB or SD card. Etcher is friendly enough to notify you which one of the devices is your system device so that you dont end up destroying data.
Choose by clicking the check box. And click select.
![Step 2 - Select Target device][7]
##### Step3: Click flash to start creating the bootable USB or SD card.
![Step 3 - Start the process][8]
Wait until the process finishes.
![Process is complete][9]
And thats it. You can safely remove the USB or SD card for your use.
### Closing Note
While there are many ways to create a bootable USB, such as you can use Unetbootin, MKUSB, or even using Ubuntus default Disk utility, Etcher makes it easier to do it. The UI design, only 3 steps process, makes it ideal for new users and source advanced users who want reliability.
Because a bootable USB is a critical asset and you should use an excellent program to prepare it.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/etcher-bootable-usb-linux/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.balena.io/etcher/
[2]: https://www.balena.io/
[3]: https://www.debugpoint.com/linux-mint/
[4]: https://www.debugpoint.com/2015/05/how-to-create-a-bootable-usb-drive-in-ubuntu/
[5]: https://github.com/balena-io/etcher/releases
[6]: https://www.debugpoint.com/wp-content/uploads/2021/01/Step1-Select-the-file.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2021/01/Step-2-Select-Target-device.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2021/01/Step-3-Start-the-process.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2021/01/Process-is-complete.jpg

View File

@ -2,7 +2,7 @@
[#]: via: "https://www.debugpoint.com/dark-mode-browser/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -0,0 +1,340 @@
[#]: subject: "A beginner's guide to making a dark theme for a website"
[#]: via: "https://opensource.com/article/22/9/dark-theme-website"
[#]: author: "Sachin Samal https://opensource.com/users/sacsam005"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
A beginner's guide to making a dark theme for a website
======
Learn how to program dark website themes using HTML, CSS variables, classes, and JavaScript methods.
![Digital creative of a browser on the internet][1]
Having a dark theme for your website is a common feature these days. There are various ways to add a dark theme to your website, and in this article, I demonstrate a beginner-friendly way of programming a dark theme for the web. Feel free to explore, make mistakes, and, more importantly, learn by manipulating the code in your own way.
![Display of both light and dark theme web pages][2]
Image by: (Sachin Samal, CC BY-SA 4.0)
### Icons
I like to provide a visual way for my users to discover the dark mode feature. You can include an easy set of icons by inserting the Font Awesome link in the `<head>` element of your HTML.
```
<!doctype html>
<html lang="en">
<head>
  <title>Toggle - Dark Theme</title>
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.7/css/all.css">
</head>
```
Inside your `<body>` tag, create a Font Awesome moon icon class, which you will switch to the Font Awesome sun icon class later using JavaScript. This icon allows users to switch from the default light theme to the dark theme and back again. In this case, you're changing from `fa-moon` while in the light theme to `fa-sun` while in the dark theme. In other words, the icon is always the opposite of the current mode.
```
<body>
  <div id="theme-btn" class="far fa-moon"></div>
</body>
```
Next, create a CSS class in your stylesheet. You'll append this using the JavaScript `add()` method to toggle between themes. The `toggle()` function adds or removes a class name from an element with JavaScript. This CSS code creates a `changeTheme` class, setting the background color to dark gray and the foreground color (that's the text) to light gray.
```
.changeTheme {
  background: #1D1E22;
  color: #eee;
}
```
### Toggle between themes
To toggle the appearance of the theme button and to apply the `changeTheme` class, use the `onclick()`, `toggle()`, `contains()`, `add()`, and `remove()` JavaScript methods inside your `<script>` tag:
```
<script>
    //gets the button by ID from your HTML element
    const themeBtn = document.getElementById("theme-btn");
    //when you click that button
    themeBtn.onclick = () => {
    //the default class "fa-moon" switches to "fa-sun" on toggle
      themeBtn.classList.toggle("fa-sun");
    //after the switch on toggle, if your button contains "fa-sun" class
      if (themeBtn.classList.contains("fa-sun")) {
    //onclicking themeBtn, the changeTheme styling will be applied to the body of your HTML
        document.body.classList.add("changeTheme");
      } else {
    // onclicking themeBtn, applied changeTheme styling will be removed
        document.body.classList.remove("changeTheme");
      }
    }
</script>
```
The complete code:
```
<!doctype html>
<html lang="en">
<head>
  <title>Toggle - Dark Theme</title>
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.7/css/all.css">
</head>
<style>
/* Toggle Dark Theme */
#theme-btn {
  font-size: 1.5rem;
  cursor: pointer;
  color: #596AFF;
}
#theme-btn:hover {
  color: #BB86FC;
}
.changeTheme {
  background: #1D1E22;
  color: #eee;
}
</style>
<body>
  <div id="theme-btn" class="far fa-moon"></div>
<script>
const themeBtn = document.getElementById("theme-btn");
themeBtn.onclick = () => {
  themeBtn.classList.toggle("fa-sun");
  if (themeBtn.classList.contains("fa-sun")) {
    document.body.classList.add("changeTheme");
  } else {
    document.body.classList.remove("changeTheme");
  }
}
</script>
</body>
</html>
```
### Complete themes
The code so far may not fully switch the theme of a complex website. For instance, your site might have a header, a main, and a footer, each with multiple divs and other elements. In that case, you could create a standard dark theme CSS class and append it to the desired web parts.
### Get familiar with your browser's console
To inspect your browser's console, on the webpage where you run this code, press `Ctrl+Shift+I` or right-click and select the `Inspect` option.
When you select `Elements` in the console and toggle your theme button, the browser gives you an indication of whether or not your JavaScript is working. In the console, you can see that the CSS class you appended using JavaScript is added and removed as you toggle.
![Use browser tools to test light and dark themes][3]
Image by: (Sachin Samal, CC BY-SA 4.0)
Add a navigation and card section to see how adding the CSS class name on an HTML element with JavaScript works.
### Example code for a dark theme
Here's some example code. You can alternately view it with a live preview [here][4].
```
<!doctype html>
<html lang="en">
<head>
  <title>Toggle - Dark Theme</title>
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.7/css/all.css">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<style>
  #header {
    width: 100%;
    box-shadow: 0px 4px 10px rgba(52, 72, 115, 0.35);
  }
  nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }
  .nav-menu {
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .nav-menu li {
    margin: 0 0.5rem;
    list-style: none;
    text-decoration: none;
  }
  .nav-menu li a {
    text-decoration: none;
    color: inherit;
  }
  h1 {
    text-align: center;
  }
  /* Toggle Dark Theme */
  #theme-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: #596AFF;
  }
  #theme-btn:hover {
    color: #BB86FC;
  }
  .changeTheme {
    background: #1D1E22;
    color: #eee;
  }
  /*-- Card Section --*/
  .card-section .card {
    border: none;
  }
  .card-body {
    box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px,
      rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
  }
  .card-body ul {
    margin: 0;
    padding: 0;
  }
  .card-body ul li {
    text-decoration: none;
    list-style-type: none;
    text-align: center;
    font-size: 14px;
  }
</style>
<body>
  <header id="header">
    <nav>
      <div id="theme-btn" class="far fa-moon"></div>
      <div class="navbar">
        <ul class="nav-menu">
          <li class="nav-item">
            <a class="nav-link fas fa-home" href="# "> Home
            </a>
          </li>
        </ul>
      </div>
    </nav>
  </header>
  <section>
    <h1>Beginner Friendly Dark Theme</h1>
  </section>
  <section class="card-section mt-3">
    <div class="container text-center">
      <div class="row">
        <div class="col-md-4 col-sm-12">
          <div class="card p-1 dark-theme">
            <div class="card-body">
              <h6>What is Lorem Ipsum?</h6>
              <ul>
                <li>Sed sit amet felis tellus.</li>
                <li>Sed sit amet felis tellus.</li>
              </ul>
            </div>
          </div>
        </div>
        <div class="col-md-4 col-sm-12">
          <div class="card p-1 dark-theme">
            <div class="card-body">
              <h6>What is Lorem Ipsum?</h6>
              <ul>
                <li>Sed sit amet felis tellus.</li>
                <li>Sed sit amet felis tellus.</li>
              </ul>
            </div>
          </div>
        </div>
        <div class="col-md-4 col-sm-12">
          <div class="card p-1 dark-theme">
            <div class="card-body">
              <h6>What is Lorem Ipsum?</h6>
              <ul>
                <li>Sed sit amet felis tellus.</li>
                <li>Sed sit amet felis tellus.</li>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
  <script>
    const themeBtn = document.getElementById("theme-btn");
    const darkTheme = document.querySelectorAll(".dark-theme");
    themeBtn.onclick = () => {
      themeBtn.classList.toggle("fa-sun");
      if (themeBtn.classList.contains("fa-sun")) {
        document.body.classList.add("changeTheme");
        for (const theme of darkTheme) {
          theme.style.backgroundColor = "#1D1E22";
          theme.style.color = "#eee";
        }
      } else {
        document.body.classList.remove("changeTheme");
        for (const theme of darkTheme) {
          theme.style.backgroundColor = "#eee";
          theme.style.color = "#1D1E22";
        }
      }
    }
  </script>
  </body>
</html>
```
The `for...of` loop of JavaScript applies ".dark-theme" class styling properties to each `card` on the page, regardless of its position. It applies the theme to all web parts selected with `querySelectorAll()` in the `<script>` tag. Without this, the font and background color remain unchanged on toggle.
```
{
          theme.style.backgroundColor = "#eee";
          theme.style.color = "#1D1E22";
}
```
If you set `background-color` or any color property to the page, your dark theme would not work as expected. This is because the preset CSS style overrides the one yet to be appended. If you set the color of the HTML font to black, it stays the same in the dark theme, which you don't want. For example:
```
* {
  color: #000;
}
```
By adding this code in your CSS or in a `<style>` tag, you set the font color to black for all the HTML on the page. When you toggle the theme, the font stays black, which doesn't contrast with the dark background. The same goes for the background color. This is common if you've used, for instance, Bootstrap to create the `card` sections in the code above. When Bootstrap is used, the styling for each card comes from Bootstrap's `card.scss` styling, which sets `background-color` to white, which is more specific than a general CSS rule for the entire page, and so it takes precedence.
You must target such cases by using a JavaScript selector and set your desired `background-color` or `color` using `document.style.backgroundColor` or `document.style.color`properties.
### Dark theme with multiple web parts
Here's an [example of a personal portfolio][5] with a dark theme feature that may help you understand how to enable dark mode when you have multiple web parts.
These steps are a beginner-friendly approach to programming dark themes. Whether you target your HTML element in JavaScript by using `getElementById()` or `getElementByClassName()`, or with `querySelector()` or `querySelectorAll()`, depends on the content of your website, and how you want to program as a developer. The same is true with the selection of JavaScript `if…else` statements and loops. Feel free to choose your own method. As always, consider the constraints and flexibility of your programming approach. Good luck!
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/9/dark-theme-website
作者:[Sachin Samal][a]
选题:[lkxed][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/sacsam005
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/browser_web_internet_website.png
[2]: https://opensource.com/sites/default/files/2022-08/dark-theme.png
[3]: https://opensource.com/sites/default/files/2022-08/dark-theme_gif.gif
[4]: https://codepen.io/sacsam005/full/LYdMJgQ
[5]: https://codepen.io/sacsam005/pen/BaJmLwz

View File

@ -0,0 +1,213 @@
[#]: subject: "How to Analyse Sentiments Using Machine Learning"
[#]: via: "https://www.opensourceforu.com/2022/09/how-to-analyse-sentiments-using-machine-learning/"
[#]: author: "Jishnu Saurav Mittapalli https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Analyse Sentiments Using Machine Learning
======
This article will help you understand the concept of sentiment analysis and learn how it is done. It uses different machine learning algorithms for sentiment analysis, and then compares them to decide which one is the best for the particular problem described here.
Sentiment analysis is a major area in the field of natural language processing. A sentiment is any opinion or feeling that we have about an event, a product, a situation or anything else. Sentiment analysis is the field of research in which human sentiments are automatically extracted from the text. This field started evolving in the early 90s.
This article will help you understand how machine learning (ML) can be used for sentiment analysis, and compare the different ML algorithms that can be used. It does not try to improve the performance of any of the algorithms or methods.
In todays fast paced world, everything is online and everyone can post their views. A few negative online comments may hurt a companys reputation and, thereby, its sales. Now that everythings online, everyone can post their views and opinions. It becomes very important for companies to go through these to understand what their customers really want. But since there is so much data, it cannot be gone through manually. This is where sentiment analysis comes in.
Let us now start developing a model to do a basic sentiment analysis.
### Lets start!
The first step is to select a data set. You can choose from any publicly available reviews or comments such as tweets or movie reviews. The two columns that should definitely be there in the data set are the label and the actual piece of text.
Figure 1 shows a small sample of how the data looks.
![Figure 1: Data sample][1]
Now we need to import the required libraries:
```
import pandas as pd
import numpy as np
from nltk.stem.porter import PorterStemmer
import re
import string
```
As you can see in the above code, we have imported NumPy and Pandas for processing the data. We will look at the other imported libraries when we use them.
Now that the data set is ready and the libraries are imported, we need to bring the former into our project. The Pandas library is used for this purpose. We bring the data set into the Pandas data frame using the following line of code:
```
sentiment_dataframe = pd.read_csv(“/content/drive/MyDrive/Data/sentiments - sentiments.tsv”,sep = \t)
```
Now that we have the data set in our project, let us manipulate it so that our algorithm can understand the features better. We begin by giving names to our columns in the data set. This is done by using the line of code given below:
```
sentiment_dataframe.columns = [“label”,”body_text”]
```
We then assign numerical labels to the classes — negative is replaced with 1 and positive is replaced with 0. Figure 2 shows how the data frame looks at this stage.
![Figure 2: Data frame with basic modifications][2]
The next step is the preprocessing of the data. This is a very important step as it helps us to convert string/text data into numerical data (machine learning algorithms can understand/process numerical data and not text). Also, the redundant and useless data needs to be removed as it may taint our training model. We remove the noisy data, missing values and other non-consistent data in this step.
We will add the features text length and punctuation count in the data frame specifically for this application. We will also do the stemming, i.e., we will convert all similar words (like give, giving, etc) into a single form. Once this is done, we divide the data set into two — X and Y — where X is the features and Y is the prediction class.
This is done using the following piece of code. Figure 3 shows the data frame after these steps are taken.
![Figure 3: Data frame after the division of the data set][3]
```
def count_punct(text):
count = sum([1 for char in text if char in string.punctuation])
return round(count/(len(text) - text.count(“ “)),3)*100
tokenized_tweet = sentiment_dataframe[body_text].apply(lambda x: x.split())
stemmer = PorterStemmer()
tokenized_tweet = tokenized_tweet.apply(lambda x: [stemmer.stem(i) for i in x])
for i in range(len(tokenized_tweet)):
tokenized_tweet[i] = .join(tokenized_tweet[i])
sentiment_dataframe[body_text] = tokenized_tweet
sentiment_dataframe[body_len] = sentiment_dataframe[body_text].apply(lambda x:len(x) - x.count(“ “))
sentiment_dataframe[punct%] = sentiment_dataframe[body_text].apply(lambda x:count_punct(x))
X = sentiment_dataframe[body_text]
y = sentiment_dataframe[label]
```
We now need to convert the string into numerical data. We use a count vectorizer for this purpose; that is, we get the counts of each word and convert it into a vector.
After this, features such as length of text and punctuation count in the dataframe, i.e., X, are calculated. A sample of X is shown in Figure 4.
![Figure 4: Sample of final features][4]
Now the data is ready for training. The next step is to determine which algorithms we are going to use for training our model. As has been mentioned before, we are going to try several algorithms and determine the best one for sentiment analysis. Since we are basically trying to do binary classification, the following algorithms can be used:
* K-nearest neighbors (KNN)
* Logistic regression
* Support vector machines (SVMs)
* Stochastic gradient descent
* Naive Bayes
* Decision tree
* Random Forest
We first need to split our data set into testing and training data. This is done by using the sklearn library using the following code:
```
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X,y, test_size = 0.20, random_state = 99)
```
We will use 20 per cent of the data for testing and 80 per cent for the training part. We will separate the data because we want to test on a new set of data whether our model is working properly or not.
Now let us start with the first model. We will try the KNN algorithm first, and use the sklearn library for this. We will first train the model and then assess its performance (all of this can be done using the sklearn library in Python itself). The following piece of code does this, and we get an accuracy of around 50 per cent.
```
from sklearn.neighbors import KNeighborsClassifier
model = KNeighborsClassifier (n_neighbors=3)
model.fit(X_train, y_train)
model.score (X_test,y_test)
0.5056689342403629
```
The code is similar in the logistic regression model — we first import the function from the library, fit the model, and then test it. The following piece of code uses the logistic regression algorithm. The output shows we got an accuracy of around 66 per cent.
```
from sklearn.linear_model import LogisticRegression
model = LogisticRegression()
model.fit (X_train,y_train)
model.score (X_test,y_test)
0.6621315192743764
```
The following piece of code uses SVM. The output shows we got an accuracy of around 67 per cent.
```
from sklearn import svm
model = svm.SVC(kernel=linear)
model.fit(X_train, y_train)
model.score(X_test,y_test)
0.6780045351473923
```
The following piece of code uses the Random Forest algorithm, and we get an accuracy of around 69 per cent.
```
from sklearn.ensemble import RandomForestClassifier
model = RandomForestClassifier()
model.fit(X_train, y_train)
model.score(X_test,y_test)
0.6938775510204082
```
Next we use the Decision tree algorithm, which gives an accuracy of around 61 per cent.
```
from sklearn.tree import DecisionTreeClassifier
model = DecisionTreeClassifier()
model = model.fit(X_train,y_train)
model.score(X_test,y_test)
0.6190476190476191
```
The following piece of code uses the stochastic gradient descent algorithm. The output shows that we got an accuracy of around 49 per cent.
```
from sklearn.linear_model import SGDClassifier
model = SGDClassifier()
model = model.fit(X_train,y_train)
model.score(X_test,y_test)
0.49206349206349204
```
The following piece of code uses Naive Bayes. We get an accuracy of around 60 per cent.
```
from sklearn.naive_bayes import GaussianNB
model = GaussianNB()
model.fit(X_train, y_train)
model.score(X_test,y_test)
0.6009070294784581
```
Now that we have checked out all the algorithms, let us graph their accuracy performance. The graph is shown in Figure 5.
![Figure 5: Accuracy performance of the different algorithms][5]
As you can see, the random forest algorithm gave the best accuracy for this problem and we can conclude that it is the best fit for sentiment analysis amongst ML algorithms. We can improve the accuracy much more by getting better features, trying out other vectorising techniques, and using a better data set or newer classification algorithms.
Now that random forest is seen as the best algorithm for this problem, I am going to show you a sample prediction. In Figure 6, you can see that the right predictions are being made! Do try this out to improve upon this project!
![Figure 6: Sample predictions made][6]
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/09/how-to-analyse-sentiments-using-machine-learning/
作者:[Jishnu Saurav Mittapalli][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/jishnu-saurav-mittapalli/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-1-Data-sample.jpg
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-2-Data-frame-with-basic-modifications-3.jpg
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-3-Data-frame-after-the-division-of-the-data-set.jpg
[4]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-4-Sample-of-final-features.jpg
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-5-Accuracy-performance-of-the-different-algorithms.jpg
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-6-Sample-predictions-made.jpg

View File

@ -0,0 +1,131 @@
[#]: subject: "Create Bootable USB Using Etcher in Linux Download and Usage Guide"
[#]: via: "https://www.debugpoint.com/etcher-bootable-usb-linux/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
在 Linux 中使用 Etcher 创建可启动 USB 下载和使用指南
======
关于如何在 Ubuntu 和其他 Linux 中使用 Etcher 工具创建可引导 USB 的快速简单教程。
[Etcher][1] 是由 [Balena][2] 创建的实用程序,它以独特的方式使用 .iso 文件创建可启动的 USB 和 SD 卡,让你的生活变得轻松。在本指南中,我将向你展示下载和安装 Etcher 的步骤。
虽然对某些人来说有点微不足道,但对其他人来说可能很难。因此才有了本指南。
Etcher 主要用于刷写或写入 Linux 操作系统的 .iso 镜像,例如 Ubuntu、[Linux Mint][3] .iso 镜像等。但理想情况下,它也应该适用于任何其他 .iso 文件。
还有其他实用程序可用于创建可引导的 USB 驱动器,特别是像我之前写的关于使用 Unetbootin 的[指南][4]。
但话虽如此在我看来Etcher **更快、更干净、更好**。它很少失败。成功率很高。
在我解释这些步骤之前,快速回顾一下它的功能。
### Etcher 的功能
* 创建可启动 USB 驱动器的清晰 3 步过程
* 自动检测 USB
* 选择文件,选择目标,快速写入
* 克隆驱动器
* 选择本地下载的 .iso 文件或直接从 URL
* 干净而友好的用户界面
* 跨平台Linux、Windows 和 macOS
* 内置 JS、electron
* 适用于 Linux 的独立 AppImage 可执行文件
### 安装 Etcher
Etcher 适用于所有平台。因此,你可以在所有 Linux 发行版、macOS 和 Windows 中使用以下方法轻松安装它。
首先,进入以下链接。
[下载 ETCHER][5]
#### 适用于所有 Linux 发行版
从上面的链接下载 AppImage 可执行文件。然后通过“`右键单击->属性`”将权限更改为*可执行*。然后运行文件。
有关特定于发行版的软件包,请参阅下文。
#### Debian、Ubuntu
要在 Debian、Ubuntu、Linux Mint 和相关发行版中安装 Etecher请从终端执行以下命令。
```
echo "deb https://deb.etcher.io stable etcher" | sudo tee /etc/apt/sources.list.d/balena-etcher.listsudo apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 379CE192D401AB61sudo apt-get updatesudo apt-get install balena-etcher-electron
```
#### Fedora
对于 Fedora请从终端执行以下命令。
```
sudo wget https://balena.io/etcher/static/etcher-rpm.repo -O /etc/yum.repos.d/etcher-rpm.reposudo dnf install -y balena-etcher-electron
```
#### Arch Linux
对于 Arch Linux请确保已安装 yay。然后你可以运行以下命令进行安装。
```
yay -S balena-etcher
```
### 使用 Etcher 创建可启动 USB
安装成功后。启动应用。第一个窗口显示你需要遵循的 3 个步骤。当然,你需要一个 U 盘和 .iso 文件来写入。
##### 步骤 1选择文件
插入目标 USB 或 SD 卡。浏览并选择 .iso 文件的位置。或者,你也可以通过 URL 选项直接从互联网上提取它。
![Step 1 - Select the file][6]
##### 步骤 2选择目标设备
单击选择目标并仔细选择你的 USB 或 SD 卡。 Etcher 非常友好,可以通知你哪个设备是你的系统设备,这样你就不会最终破坏数据。
通过单击复选框进行选择。并单击选择。
![Step 2 - Select Target device][7]
##### 步骤 3点击 flash 开始创建可启动 USB 或 SD 卡
![Step 3 - Start the process][8]
等到该过程完成。
![Process is complete][9]
就是这样。你可以安全地取出 USB 或 SD 卡以供使用。
### 结束语
虽然创建可引导 USB 的方法有很多,例如你可以使用 Unetbootin、MKUSB甚至使用 Ubuntu 的默认磁盘程序,但 Etcher 可以更轻松地完成此操作。 UI 设计只需 3 个步骤,非常适合需要可靠性的新用户和高级用户。
因为可启动 USB 是一项重要资产,你应该使用出色的程序来准备它。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/etcher-bootable-usb-linux/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.balena.io/etcher/
[2]: https://www.balena.io/
[3]: https://www.debugpoint.com/linux-mint/
[4]: https://www.debugpoint.com/2015/05/how-to-create-a-bootable-usb-drive-in-ubuntu/
[5]: https://github.com/balena-io/etcher/releases
[6]: https://www.debugpoint.com/wp-content/uploads/2021/01/Step1-Select-the-file.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2021/01/Step-2-Select-Target-device.jpg
[8]: https://www.debugpoint.com/wp-content/uploads/2021/01/Step-3-Start-the-process.jpg
[9]: https://www.debugpoint.com/wp-content/uploads/2021/01/Process-is-complete.jpg