id
int64
2.05k
16.6k
title
stringlengths
5
75
fromurl
stringlengths
19
185
date
timestamp[s]
tags
sequencelengths
0
11
permalink
stringlengths
20
37
content
stringlengths
342
82.2k
fromurl_status
int64
200
526
status_msg
stringclasses
339 values
from_content
stringlengths
0
229k
16,202
Librem 11:Purism 推出注重隐私的 Linux 平板电脑
https://news.itsfoss.com/librem-11-tablet/
2023-09-18T11:18:43
[ "平板电脑" ]
https://linux.cn/article-16202-1.html
![](/data/attachment/album/202309/18/111844o8q8qggdqf0iqwqc.png) > > 一款昂贵的 Linux 平板电脑,注重安全和隐私。让我们拭目以待。 > > > [Purism](https://puri.sm/) 是一家日益流行的计算机硬件产品制造商,专门提供配备注重隐私的开源 Linux 发行版的笔记本电脑、台式机和移动设备。 最近,他们发布了一款新产品 **Librem 11** 平板电脑,配备了一些非常简洁的硬件。 让我们看看它能提供什么! > > ? 这不是赞助文章或认可。在订购之前,你应该从它的官方网站上研究有关该产品的更多信息(包括运输查询)。 > > > ### Librem 11 有什么? ![](/data/attachment/album/202309/18/111844otctpt2tp0eot2to.jpg) Librem 11 被称为**安全平板电脑**,由其自用 Linux 发行版 [PureOS](https://www.pureos.net/) 以及 **[PureBoot](https://puri.sm/projects/pureboot/)** 提供支持,提供非常安全和专注隐私的体验。 **Purism 确保了设备的安全和隐私**,这要归功于他们采取的各种措施: 第一个是**安全启动过程**,得益于 PureBoot,它可以与 [Librem Key](https://puri.sm/products/librem-key/) 结合在一起,以进一步增强安全性,并在与 PureBoot 一起使用时以加密方式识别篡改。 第二个是 **Purism 承诺不监视用户**,避免任何监视或数据挖掘。 最后一项是 Librem 11 附加的“[反拦截](https://puri.sm/posts/anti-interdiction-services/)”服务,确保设备在制造和运输过程的之前、期间或之后不会被篡改。 你可能想知道,所有这些都在谈论安全和隐私,但是,**它的配置如何?** ![](/data/attachment/album/202309/18/111845y3eig0fdgcgr9rgx.jpg) Librem 11 由 [英特尔 N5100](https://www.intel.com/content/www/us/en/products/sku/212329/intel-celeron-processor-n5100-4m-cache-up-to-2-80-ghz/specifications.html) CPU 以及 **8 GB LPDDR4 RAM** 和 **高达 1 TB 的 NVMe 存储**提供支持。 至于显示屏,该平板电脑配备多点触控 **60hz 11.5 英寸 AMOLED 显示屏**,分辨率为 **2560×1600。** > > ? 出于安全考虑,CPU 上的英特尔管理引擎(IME)默认处于禁用状态。 > > > 它还预装了一个带有倾斜支持,具有 4096 级压力的笔,以及一个**可拆卸键盘**,在平板电脑折叠时**还可用作保护套**。 其他一些亮点包括: * 指纹识别器。 * 英特尔超高清显卡。 * 1 个 USB Type-C 3.1 端口。 * 借助 [英特尔 AX201](https://www.intel.com/content/www/us/en/products/sku/130293/intel-wifi-6-ax201-gig/specifications.html) 芯片支持 Wi-Fi 6。 * 支持 Bluetooth 5,由 [英特尔 9460](https://www.intel.com/content/www/us/en/products/sku/99446/intel-wirelessac-9560/specifications.html) 芯片提供。 * 3.5 毫米音频插孔(麦克风输入和耳机输出组合)。 * 前置 2MP 摄像头,后置 5MP 自动/手动对焦摄像头。 你可以浏览其 [公告博文](https://puri.sm/posts/purism-launches-new-secure-librem-11-tablet/) 以了解有关这款注重安全的平板电脑的更多信息。 ### ? 获取 Librem 11 Purism 的 Librem 11 平板电脑现已发售,**价格为 999 美元**,交货期长达 10 天。 但是,如果你居住在美国,你很可能会比其他地区更早收到它。 > > **[Librem 11](https://shop.puri.sm/shop/librem-11/)** > > > --- via: <https://news.itsfoss.com/librem-11-tablet/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) [Purism](https://puri.sm/?ref=news.itsfoss.com) is an increasingly popular manufacturer of computer hardware products that specializes in providing laptops, desktops, and mobile devices equipped with a privacy-focused open-source Linux distro. With a recent announcement, they have unveiled a new product, **Librem 11 **tablet equipped with some pretty neat hardware. Let's look at what it has to offer! ## Librem 11: What to Expect? ![the librem 11 tablet with its keyboard and pen accessories](https://news.itsfoss.com/content/images/2023/09/Librem_11.jpg) Dubbed as **a secure tablet**, Librem 11 is powered by their in-house Linux distro [ PureOS](https://www.pureos.net/?ref=news.itsfoss.com), alongside **for offering a very secure and privacy-focused experience.** [PureBoot](https://puri.sm/projects/pureboot/?ref=news.itsfoss.com)The **security and privacy of the device is ensured by Purism**, thanks to a variety of measures that they have taken: The first is the **secure boot process** that works thanks to PureBoot, which can be coupled together with the [ Librem Key](https://puri.sm/products/librem-key/?ref=news.itsfoss.com) to further enhance security, and cryptographically identify tampering when used with PureBoot. The second is **Purism's commitment to not spying on their users**, by avoiding any surveillance, or data mining practices. And, the final one is the add-on '[ Anti-Interdiction](https://puri.sm/posts/anti-interdiction-services/?ref=news.itsfoss.com)' service for Librem 11 which ensures that the device has not been tampered with before, during, or after the manufacturing and shipping processes. You may be wondering; All this talk about security and privacy, but, **what powers it?** ![the librem 11 shown vertically](https://news.itsfoss.com/content/images/2023/09/Librem_11_2.jpg) The Librem 11 is powered by an ** Intel N5100 CPU**, alongside **8 GB of LPDDR4 RAM**, and **a whopping 1 TB of NVMe storage**. As for the display, the tablet features a multitouch **60hz 11.5″ AMOLED display**, with a resolution of **2560×1600.** It also comes pre-equipped with a** pen with 4096 pressure levels** and **tilt support**, alongside a **detachable keyboard** that also **acts as a protective sleeve** when the tablet is folded. **Some other highlights include:** - Fingerprint Reader. - Intel UHD Graphics. - 1x USB Type-C 3.1 port. - Support for Wi-Fi 6 thanks to the [Intel AX201](https://www.intel.com/content/www/us/en/products/sku/130293/intel-wifi-6-ax201-gig/specifications.html?ref=news.itsfoss.com)chip. - Support for Bluetooth 5, courtesy of the [Intel 9460](https://www.intel.com/content/www/us/en/products/sku/99446/intel-wirelessac-9560/specifications.html?ref=news.itsfoss.com)chip. - A 3.5 mm Audio Jack (Mic-in & Headphone-out combo). - A 2MP front camera, with a 5MP auto/manual-focus camera at the rear. You may go through its [announcement blog](https://puri.sm/posts/purism-launches-new-secure-librem-11-tablet/?ref=news.itsfoss.com) to learn more about this security-focused tablet. ## 🛒 Get Librem 11 Purism's Librem 11 tablet is up for grabs right now at a **price of $999 with** a delivery window of up to 10 days. However, if you are living in the US, you will most likely receive it earlier than other regions. ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,203
Linux 爱好者线下沙龙:LLUG 2023 深圳硬核来袭
https://jinshuju.net/f/uxTekt
2023-09-18T15:17:00
[ "LLUG" ]
https://linux.cn/article-16203-1.html
![](/data/attachment/album/202309/18/151703dr7r1rr1sllmsw3z.jpg) 经历过 [6 月北京场](/article-15929-1.html)、[7 月上海场](/article-16052-1.html),一个月的休整之后,这次 LLUG 来到大陆的南端,美丽的鹏城。 **2023 年 9 月 24 日下午,我们将在深圳举行 LLUG 2023 · 深圳场**,欢迎大家来到现场,和我们一起交流技术,分享自己工作过程中的所思所想。 本次活动依然由 Linux 中国和龙蜥社区(OpenAnolis)联合主办,电子工业出版社博文视点、《Linux 就该这么学》的刘遄老师提供了支持。 > 龙蜥社区(OpenAnolis)是国内的顶尖 Linux 发行版社区,我们希望在普及 Linux 知识的同时,也能让中国的 Linux 发行版,为更多人知晓,推动国产发行版的发展和进步。 ### 活动议程 | 时间 | 议题 | 分享者 | | --- | --- | --- | | 14:00 ~ 14:30 | 现场签到 | | 14:30 ~ 15:00 | 《简单聊聊 BPF》 | Locez,Linux 中国翻译组(LCTT)核心译者、开发者 | | 15:00 ~ 15:30 | 《coolbpf 在阿里云应用实践》 | 廖肇燕,龙蜥社区 eBPF 技术探索 SIG Maintainer,拥有十余年 Linux 操作系统开发、问题定位和调优经验。 | | 15:30 ~ 16:00 | 茶歇 | | 16:00 ~ 16:30 | 《如何高效参与开源?》 | 老王(wxy),Linux 中国技术社区负责人 | | 16:30 ~ 17:00 | 闪电演讲 | ### 议程介绍 #### 《简单聊聊 BPF》 ![](/data/attachment/album/202309/18/145401axxr9mem9bfr5rmf.jpg) *Locez,Linux 中国翻译组(LCTT)核心译者、开发者* 简单介绍 BPF 起源和一些基于 BPF 的工具使用。 #### 《coolbpf 在阿里云应用实践》 ![](/data/attachment/album/202309/18/145409g2zz7q6rdrgh3zdg.jpg) *廖肇燕,龙蜥社区 eBPF 技术探索 SIG Maintainer* 介绍 coolbpf 如何通过对 Linux 内核和 eBPF 技术的探索,降低使用门槛实现大规模落地并解决用户问题。 #### 《如何高效参与开源》 ![](/data/attachment/album/202309/18/145415gaezeh3hoaezjsee.jpg) *老王(wxy),Linux 中国技术社区创始人* 老王的经典分享,聊聊作为一个社区新人,应该如何参与到开源社区当中,并逐步成长为社区的中坚力量的。 ### ⚡️闪电演讲 本次线下活动依旧保留闪电演讲环节,作为最受欢迎的线下活动,本次活动依旧继续举办闪电演讲。每位演讲者有 5 分钟时间参与现场活动,可以提前报名,也可即兴上台演讲。时间一满,马上结束~强制大家控制自己的分享时间,用最短的时间,向大家发出你的声音~ 上海场闪电演讲照片 ![](/data/attachment/album/202309/18/145429qi1bf5bd9b5fy6vb.jpg)![](/data/attachment/album/202309/18/145435ylj6dgw5wd6wj81l.jpg) ### 活动地点及到达信息 南山区科苑南路3331号 深圳阿里中心(由于阿里中心需要登记才能进入,请务必填写表单报名。现场直接空降可能是进不来的哦~) ![](/data/attachment/album/202309/18/145754hz3j693fuflg6106.jpg) 抵达方式: 【自驾】 * 导航到“南山区科苑南路3331号深圳阿里中心”,按照入园指引图办理入园。 【公共交通】 * 地铁:乘坐2号线登良站C出口(步行7分钟到达);地铁11号线后海站G出口(步行15分钟到达)。 * 公交:乘坐B737、B817、M409、M474、M506、M507、M528在后海滨路口下车(步行15分钟到达)。 如果你因为有事,没办法来到线下,那也没问题,我们的活动也会在 Linux 中国视频号/B 站账号、龙蜥社区社群/B 站账号等开启同步直播。 当然,我们更希望你能亲自来到线下,和我们一起畅聊 BPF, 看看 BPF 在你的企业中是如何被应用的~ [填写问卷即可报名活动](https://jinshuju.net/f/uxTekt),并在活动前收到我们的提醒~此外,也可以在问卷中反馈你想听的内容,我们将竭尽所能,邀请行业专家,针对大家感兴趣的话题进行分享。 由于阿里中心需要登记才能进入,请务必填写表单报名。现场直接空降可能是进不来的哦~ *(题图:MJ/eb08b3a2-161b-4fc2-8d1f-3cb3384d1131)*
302
Found
null
16,205
10 个在 Linux 终端中生成有趣的 ASCII 字符画的工具
https://itsfoss.com/ascii-art-linux-terminal/
2023-09-19T15:24:00
[ "字符画" ]
https://linux.cn/article-16205-1.html
> > 以为 Linux 终端都是严肃的工作?想多了。以下是你可以在终端中使用字符画做的几件趣事。 > > > Linux 终端其实没有想象中的那样 [可怕](https://itsfoss.com/basic-terminal-tips-ubuntu/)。 当然啦,一开始它可能会令人望而却步,但是当我们更 [了解](https://itsfoss.com/love-thy-terminal/) 它的时候,我们就会喜欢上它的。 你可能会使用终端来做一些严肃的工作。不过,你也可以在终端中做很多有趣的事情。 其中的一项就是试一试 <ruby> ASCII 字符画 <rt> ASCII art </rt></ruby>。你可以在 Linux 终端中用各种命令行工具以 ASCII 的形式显示一些预定义的或是随机的消息、玩游戏,抑或是播放动画。 我的同事 Sreenath 喜欢探索此类不寻常的命令行工具并将他的发现分享给我。现在,我也将他的发现与你分享。 ![ascii art tools linux](/data/attachment/album/202309/19/152425sdv3l7hydh9sl9i6.png) 你的 Linux 发行版的仓库中应该已经有这些程序中的大多数了。你可以用系统的包管理器安装它们。为了使文章简洁,下文的安装指南均以 Ubuntu 为例。 ### 1、lolcat:向终端加入缤纷色彩 虽然 `lolcat` 与 ASCII 字符画没有任何关系,至少,没有直接关系。 但是,我还是在文章开头就列出了它,因为它可以与其他的 ASCII 工具组合使用。 所以,它能做什么呢?它与 `cat` 指令很相似,但是它向输出内容加入随机的渐变色彩。 ![lolcat](/data/attachment/album/202309/19/152426qe656pim6t9uve2z.png) 目前它看起来可能没什么用,但当其他 ASCII 工具通过 `lolcat` 输出时,你会看到它的效果。 用 `apt` 安装 `lolcat`: ``` sudo apt install lolcat ``` ### 2、Aewan:漂亮地显示 ASCII 字符 Aewan 是一个多层 ASCII 图形、动画编辑器。它可以生成独立的,可被 `cat` 命令查看的 ASCII 字符画文件和便于命令行工具集成与解析的格式。 它包括两个工具:ASCII 编辑器 `aewan`,和文件查看器 `aecat`。 这里不讨论编辑器部分。 ![aewan 的初始状态布局](/data/attachment/album/202309/19/152426kzrf2xtksf6fes9f.png) 用 `aecat` 命令以 ASCII 格式漂亮地显示任何文本。注意下面的截屏中字母的使用方式。 ![aewan output](/data/attachment/album/202309/19/152427cs2ytdwatqx29jqb.png) 用下面的命令安装 `aewan`: ``` sudo apt install aewan ``` 然后这样使用: ``` aecat hello ``` ### 3、Cowsay:让 ASCII 牛复述你想说的话 这头牛在说什么?你想什么就让它说什么。 `cowsay` 是经验丰富的 Linux 用户中流行的工具。它显示了一个 ASCII 格式的牛,会重复你提供的文本。 ![cowsay](/data/attachment/album/202309/19/152427tgs83hee8egt9hps.png) 但不仅限于牛。你也可以将其更改为其他的角色。比如,一条龙(火龙君临): ![cowsay](/data/attachment/album/202309/19/152427an4lo8743smuu7cx.png) 你注意到截图中的色彩了吗?这正是上文提到过的 `lolcat` 命令的魔力所在。 用下列命令安装 `cowsay`: ``` sudo apt install cowsay ``` 装好之后,这样使用: ``` cowsay hello ``` 你可以参考它的 [手册](https://itsfoss.com/linux-man-page-guide/),浏览其他配置和选项。 ### 4、jp2a:图片转 ASCII 字符画 `jp2a` 是一个在 Linux 终端中将图像转换为 ASCII 字符画的命令行工具。它适用于 JPEG 和 PNG 文件,允许彩色输出和用你选定的字符显示 ASCII 字符画。 ![jp2a](/data/attachment/album/202309/19/152427wbffqbzgzmxfn1fj.png) 用下列命令安装它: ``` sudo apt install jp2a ``` 你可以像这样得到彩色的输出,并且保存到文件。 ``` jp2a --output=ascii.txt --colors input.png ``` 它并不是这类工具中的唯一一种,比如,`ascii-image-converter` 和几个其他的工具也可以达成相同的效果。在这里不再一一讨论了。 ### 5、linuxlogo:用 ASCII 格式显示 Linux 发行版的徽标 正如起名,它 [用 ASCII 格式显示 Linux 发行版的标志](https://itsfoss.com/display-linux-logo-in-ascii/)。 不,不是我们 [喜爱的 Linux 标志 Tux](https://itsfoss.com/tux-trivia/),而是你的 Linux 发行版的徽标。它还显示一些其他信息,比如 Linux 内核版本、CPU、RAM、主机名等等。 ![linux logo](/data/attachment/album/202309/19/152428zaqjfkg8fk8g9mdk.png) 用 `apt` 安装: ``` sudo apt install linuxlogo ``` 输入 `linuxlogo` 就可以用啦。 ### 6、Neoftech:显示 Linux 标志和系统信息 上面的 Linux 标志有点太简化了。你可以用 Neofetch 放大它。 它以更漂亮的方式显示发行版以及一些系统信息,如内核、运行时间、桌面环境、主题和图标等等。 ![neofetch](/data/attachment/album/202309/19/152428e1sdsesux7e78x7z.png) 你还可以通过 `lolcat` 解析它,获得彩虹色的输出。 用这行命令安装 Neofetch: ``` sudo apt install neofetch ``` 然后,输入 `neofetch` 就可以运行啦。 还有一个与 Neofetch 很像的工具,`screenfetch`。用哪个都行。 ### 7、fortune:看看命运如何 开玩笑啦。这样的事情根本就不存在。 不过,幸运饼干仍然很流行,所以显然,人们喜欢阅读随机的预测或说法。 你可以在 Linux 终端中用 Fortune 命令达到类似效果: ![fortune cookie linux](/data/attachment/album/202309/19/152428pdhvefk3efaf0akw.png) 你可以用下面的命令安装它。 ``` sudo apt install fortune ``` 装好之后,在终端中输入 `fortune` 来得到一条随机消息。 ### 8、pv:让一切动起来 这是非预期使用 Linux 命令的典型例子。`pv` 命令本来用于通过管道监控数据的进度。 但你可以使用它来对显示任何命令的输出加入动画效果。将其与上述的命令结合起来,你就可以看到 ASCII 字符画逐渐显现在屏幕上,就像正在输入一样。 不太明白?看看这个: 用下面的命令安装: ``` sudo apt install pv ``` 然后按这样使用: ``` neofetch | pv -qL 200 | lolcat ``` 数字越大,速度越快。 ### 9、cmatrix:类似黑客帝国的 ASCII 动画 还记得 “黑客帝国” 吗?下落的绿色代码是黑客帝国和黑客的象征。 你可以使用 `cmatrix` 命令在 Linux 终端用 ASCII 模拟运行下落代码。 我在这里用一张图片代替视频。 ![cmatrix](/data/attachment/album/202309/19/152429qm7vy9e1e1nh1z0h.png) 你可以用 `apt` 安装它: ``` sudo apt install cmatrix ``` 安装好之后,用它运行: ``` cmatrix ``` 它会立即启动,并不断生成随机的绿色文本,带着从屏幕上落下后消失的动画效果。该命令会持续运行。使用 `Ctrl+C` 停止运行程序。 ### 10、cbonsai:在你的终端种植盆景 有没有园艺的天赋?在终端中种植一棵 ASCII 盆景树怎么样? `cbonsai` 是一个可让你以 ASCII 格式运行盆景树生长动画的有趣 Linux 命令。 几天前我发了一条关于 `cbonsai` 命令的 YouTube 短视频。 你可以用下面的命令安装 `cbonsai`: ``` sudo apt install cbonsai ``` 用这行命令运行: ``` cbonsai -l ``` ### 试试更多 还有很多这样的有趣的命令行工具,甚至还有 [ASCII 游戏](https://itsfoss.com/best-ascii-games/)。有时,看着它们给周围的人带来欢乐真的很有趣。 这些命令能派上用场吗?我不确定是否可用,但你可以在 `.bashrc` 文件中添加其中一些,这样一旦打开终端会话,命令就会立即运行。 许多系统管理员在共享的 Linux 系统上都会这样做。像 `cowsay` 或 `figlet` 这样的程序可以用来以漂亮的方式显示消息或系统概况。 你也可以在你的 Bash 脚本中使用其中的一些程序,尤其是当你需要突出显示某些内容时。 ASCII 字符画在 Linux 中可能还会有其他用途。你可以与我们分享。 --- via: <https://itsfoss.com/ascii-art-linux-terminal/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lkxed](https://github.com/lkxed) 译者:[泠知落汐](https://github.com/CoWave-Fall) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) [Linux terminal is not as scary](https://itsfoss.com/love-thy-terminal/) as you think. Of course, it could be intimidating in the beginning but once you [know the terminal better](https://itsfoss.com/basic-terminal-tips-ubuntu/), you start loving it. You are likely to use the terminal for serious work. But there are many fun stuff you can do in the terminal as well. One of them is experimenting with ASCII art. You can display predefined or random messages, play games, or run some animation in ASCII format in the Linux terminal using various command line tools. My teammate Sreenath likes to explore such unusual CLI tools and share his findings with me. I am sharing those findings with you. ![ascii art tools linux](https://itsfoss.com/content/images/wordpress/2022/07/ascii-art-tools-linux.png) Most of these programs should be available in the repositories of your Linux distribution. You can use your system’s package manager to install them. To keep the article concise, I have only included the installation instructions for Ubuntu. ## 1. lolcat: Add colors to your terminal Alright! lolcat doesn’t have anything to do with ASCII art. At least not directly. Still, I included it at the beginning of this article because you can combine other ASCII tools with lolcat. So, what does it do? It is similar to the cat command but it adds random gradient colors to its output. ![lolcat](https://itsfoss.com/content/images/wordpress/2022/07/lolcat.png) It may not look useful at the moment but you’ll see its impact when the outputs of other ASCII tools are piped through lolcat. Install lolcat with the apt command: `sudo apt install lolcat` ## 2. Aewan: Display ASCII text beautifully Aewan is a multi-layered ASCII graphics/animation editor. It produces stand-alone cat-able ASCII art files and an easy-to-parse format for integration into terminal applications. It has two tools: `aewan` , an ASCII editor and `aecat` , for viewing the created file. I am not going to discuss the editor part here. ![aewan initial layout](https://itsfoss.com/content/images/wordpress/2022/07/Aewan-initial-layout.png) To display any text in pretty ASCII format, you need the aecat command. Notice the use of letters in the screenshot below. ![aewan output](https://itsfoss.com/content/images/wordpress/2022/07/aewan-output.png) To install aewan use the following command: `sudo apt install aewan` And then use it like this: `aecat hello` ## 3. Cowsay: Make an ASCII cow say whatever you want What does the cow say? Whatever you want it to say. The [cowsay](https://itsfoss.com/cowsay/) is already a popular tool among seasoned Linux users. It shows an ASCII cow that repeats the text you provide it. ![cowsay](https://itsfoss.com/content/images/wordpress/2022/07/cowsay-1.png) But you are not restricted to cows only. You can change it to several other characters as well. Like a dragon (burning King’s landing): ![cowsay](https://itsfoss.com/content/images/wordpress/2022/07/cowsay.png) Did you notice the colored output in the above screenshot? That’s the magic of the lolcat command I mentioned earlier. To install cowsay, use: `sudo apt install cowsay` Once installed, you can use it like this: `cowsay hello` You can refer to this article for additional configuration and options. [Using Cowsay Linux Command Like a ProThe cowsay is a fun little Linux command line utility that can be enjoyed in so many ways. Here are several examples.](https://itsfoss.com/cowsay/)![](https://itsfoss.com/content/images/2023/06/cowsay-linux-1.png) ![](https://itsfoss.com/content/images/2023/06/cowsay-linux-1.png) ## 4. jp2a: Convert images into ASCII art jp2a is a command-line tool that [converts images to ASCII art in the Linux terminal](https://itsfoss.com/ascii-image-converter/). It works with JPEG and PNG files. It also allows colored output and your selection of character set to appear as ASCII image. ![jp2a](https://itsfoss.com/content/images/wordpress/2022/07/jp2a.png) You can install it using the following command: `sudo apt install jp2a` You can get the colorful output and save the ASCII text like this: `jp2a --output=ascii.txt --colors input.png` It’s not the only program of this kind. There is ascii-image-converter and several other tools that could be used for the same purpose. I won’t discuss all of them in this list. ## 5. linuxlogo: Display the ASCII logo your Linux distro The name says it all. It displays the [Linux logo in ASCII format](https://itsfoss.com/display-linux-logo-in-ascii/). No, not our [beloved Linux logo, Tux](https://itsfoss.com/tux-trivia/) but the logo of your Linux distribution. It also shows a few additional information like [Linux kernel version](https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/), CPU, RAM, hostname, etc. ![linux logo](https://itsfoss.com/content/images/wordpress/2022/07/linux-logo.png) You can install it using the apt command: `sudo apt install linuxlogo` Just enter linuxlogo to use the command. ## 6. Neofetch: Display the Linux logo along with system info The above linuxlogo command is too simplistic. You can amp it up by [using Neofetch](https://itsfoss.com/using-neofetch/). It displays the distribution in a more pretty way along with several system information like kernel, uptime, desktop environment, theme, icons, etc. ![neofetch](https://itsfoss.com/content/images/wordpress/2022/07/neofetch.png) You can also parse it through lolcat to get rainbow-colored output. Install Neofetch using this command: `sudo apt install neofetch` And then just enter neofetch to run the command. There is also screenfetch, a similar tool to Neofetch. You can use either of them. [9 Rather Unknown Ways of Using Neofetch in Linux - It’s FOSSNeofetch displays the system information and distribution logo in the Linux terminal. It can be tweaked to change its output in surprising new ways.](https://itsfoss.com/using-neofetch/)![](https://itsfoss.com/content/images/wordpress/2022/07/neofetch-tweaks.png) ![](https://itsfoss.com/content/images/wordpress/2022/07/neofetch-tweaks.png) ## 7. fortune: Get your fortune told Just kidding! There’s no such thing. However, fortune cookies are still fashionable and apparently, people like to read random predictions or teachings. You can get a similar feature in the Linux terminal with the fortune command: ![fortune cookie linux](https://itsfoss.com/content/images/wordpress/2022/07/fortune-cookie-Linux.png) You can install it using the following command: `sudo apt install fortune` Once installed, just enter fortune in the terminal to get a random message. ## 8. pv: Make things animated This is a classic example of the unintended use of a Linux command. The pv command is used to monitor the progress of data through pipe. But you can use it to animate the output of any command. Combine it with some of the above-mentioned commands and you can see the ASCII art appearing on your screen as if it is being typed. Don’t get it? Watch this video: Install it using the following command: `sudo apt install pv` And then use it in the following manner: `neofetch | pv -qL 200 | lolcat` The higher the number, the higher will be the speed. ## 9. cmatrix: Matrix like animation in ASCII Remember the cult geek move Matrix? The green falling code is synonymous with Matrix and hacking. You can run an ASCII simulation of the falling code in the Linux terminal with [cmatrix command](https://itsfoss.com/using-cmatrix/). I am sharing a screenshot instead of animation here. ![cmatrix](https://itsfoss.com/content/images/wordpress/2022/07/cmatrix.png) You can install it with apt command: `sudo apt install cmatrix` Once installed, you can run it with: `cmatrix` It starts the animation immediately and it keeps on generating random green text falling and disappearing from the screen. The command keeps on running. To [stop the running application](https://itsfoss.com/stop-program-linux-terminal/), use the Ctrl+C keys. ## 10. cbonsai: Grow a bonsai in your terminal Got a green thumb? How about growing an ASCII bonsai tree in the terminal? cbonsai is a [fun Linux command](https://itsfoss.com/funny-linux-commands/) that lets you run bonsai tree growing animation in ASCII format. I shared a YouTube Shorts of cbonsai command a few days ago. You can install `cbonsai` using: `sudo apt install cbonsai` And then to run the animation, use this command: `cbonsai -l` ## Try some more There are many more such fun CLI tools. Heck, there are [ASCII games](https://itsfoss.com/best-ascii-games/) as well. It’s fun to use them at times to amuse people around you. [Best ASCII Games for Linux That are Insanely GoodText-based or should I say terminal-based games were very popular a decade back – when you didn’t have visual masterpieces like God Of War, Red Dead Redemption 2 or Spiderman. Of course, the Linux platform has its share of good games – but not always the “latest and greatest”. But, there](https://itsfoss.com/best-ascii-games/)![](https://itsfoss.com/content/images/wordpress/2018/11/best-ascii-games-featured.png) ![](https://itsfoss.com/content/images/wordpress/2018/11/best-ascii-games-featured.png) Can you put these commands to some good use? Not certain about the usability, but you can add some of them in your .bashrc file so that the command is run as soon as you open a terminal session. Many sysadmins do that on shared Linux systems. A program like [cowsay](https://itsfoss.com/cowsay/) or figlet can be used to display a message or system info in a pretty way. You may also use some of these programs in your bash scripts, especially if you have to highlight something. There could be other usages of ASCII art in Linux. I'll let you share them with the rest of us here.
16,207
Fedora 39 新特性抢先看
https://news.itsfoss.com/fedora-39-features/
2023-09-19T23:24:40
[ "Fedora" ]
https://linux.cn/article-16207-1.html
![](/data/attachment/album/202309/19/232440e647ygv46o4gychy.png) > > Fedora 39 即将热门登场!在你进行安装前,先在这里了解一下新的功能。 > > > [Fedora 38](https://news.itsfoss.com/fedora-38/) 的升级引人瞩目,带来了全新的定制版,同时可以无限制地访问 Flathub。 如今,我们再次迎来升级,也就是 **Fedora 39**。 如果一切按计划进行,Fedora 39 将在 **2023 年 10 月 17 日** 正式发布。然而,这次有何新奇特性呢? 一起来探索一下! ![](/data/attachment/album/202309/19/232440zk4qlnyqe73m4p5d.jpg) ### Fedora 39:重要亮点 在 Fedora 39 中,你能期待一些值得关注的更新和变化,以及其他一些内容。 其主要改进包括: * GNOME 45 * Fedora Onyx 定制版 * 彩色 Bash 提示符 * 应用程序更新 * 性能优化 ### 彩色 Bash 提示符 ![](/data/attachment/album/202309/19/232441dfzaptx6v7mmamn5.png) Bash 提示符有了微小修改,改变了默认配色。 过往的单色默认配色与长命令的输出在视觉上容易混淆,现在,这种区分就容易多了。 当然,你也可以根据个人喜好,随意更改提示符的颜色。 ### GNOME 45 GNOME 45 是本次升级的一大亮点。 与 [Ubuntu 23.10](https://news.itsfoss.com/ubuntu-23-10/) 一样,Fedora 39 也将是首批搭载 GNOME 45 的发行版之一。 GNOME 45 带来了大量实用的改动,以及一些微妙的视觉整改。 一些关键亮点包括: * 新增的核心应用 * 系统设置新增的“<ruby> 关于 <rt> About </rt></ruby>”面板 * 系统设置中的隐私中心 * 对 Nautilus 文件管理器的改善 对文件管理器的性能优化应会带来显著提升。 重新设计的简洁的侧边栏使得文件与文件夹区域的区分比以往更为明显。 ![左侧(GNOME 44),右侧(GNOME 45)](/data/attachment/album/202309/19/232441eqyb9hw0b9uymxz0.png) 引入的核心应用,如 “<ruby> 放大镜图像查看器 <rt> Loupe Image Viewer </rt></ruby>” 和 “<ruby> 快照 <rt> Snapshot </rt></ruby>”,应当大有用处。这是一个简单且极简的图片查看器,以及一款网络摄像头应用。然而,Fedora 39 仍坚持使用较为经典的 “<ruby> 茄子 <rt> Cheese </rt></ruby>” 网络摄像头应用。 ![](/data/attachment/album/202309/19/232441kbmggqn3q6rqq38b.png) 不仅新增了应用,已有的核心应用也进行了很多优化,例如“<ruby> 日历 <rt> Calendar </rt></ruby>”应用有了新的应用图标,“<ruby> 控制台 <rt> Console </rt></ruby>”应用和“<ruby> 天气 <rt> Weather </rt></ruby>”应用的用户体验也得到了提升。 “<ruby> 设置 <rt> Settings </rt></ruby>”菜单在呈现信息方式上也进行了升级,目的在于更好地为最终用户呈现信息。 在 “<ruby> 关于 <rt> About </rt></ruby>” 面板,新增了一个 “<ruby> 系统详情 <rt> System Details </rt></ruby>”,在此你可以获取到你正在运行的系统详细信息以及其硬件规格。 ![](/data/attachment/album/202309/19/232441w5sg5325ivz5sh3s.jpg) 尽管在 Fedora 等 Linux 发行版中,隐私保护已经非常可靠,但 GNOME 45 给我们带来了更深一步的改进。 这些选项既便于快速访问,对于初次接触 Linux 的用户来说,也易于理解。 ![](/data/attachment/album/202309/19/232442fi292t662eti6aea.png) 当然,GNOME 45 还有更多的亮点,你可以在我们的 [GNOME 45 特性](https://news.itsfoss.com/gnome-45/) 专题文章中详细略览: > > **[GNOME 45 带来令人兴奋的升级: 新功能介绍](https://news.itsfoss.com/gnome-45/)** > > > ### Fedora Onyx Fedora 提供的 Silverblue 变体,被公认为 [最优秀的不可变发行版](https://itsfoss.com/immutable-linux-distros/) 之一,其桌面环境采用的是 GNOME。 为了拓宽其产品线,Joshua Strobl 提出新增一款采用 Budgie 桌面环境的不可变版本,以此补充 Budgie 定制版,即 [Fedora Onyx](https://news.itsfoss.com/fedora-onyx-official/)。 在 Fedora 39 的新版本发布时,你应可以找到这个全新的版本。 > > **[11 个面向未来、不可改变的 Linux 发行版](https://itsfoss.com/immutable-linux-distros/)** > > > ### 默认废弃 fedora-repos-modular Fedora 带有几个已预先启用的存储库,让你可以顺畅地安装软件包。 然而,根据开发者的观察,现在大多数用户并不使用模块化的存储库。因此,移除这些存储库将有助于提升 DNF 的性能。 > > ? DNF 是 Fedora 的 [软件包管理器](https://itsfoss.com/package-manager/)。 > > > 因此,预计在默认不再包含 fedora-repos-modular 存储库的情况下,DNF 特别是在网络环境较差的情况下,其性能会得到一些改善。 ### 应用和软件包更新 以下是最主要的应用程序更新: * [LibreOffice 7.6](https://news.itsfoss.com/libreoffice-7-6/) * Python 3.12 * RPM 4.19 * Vagrant 2.3 * Perl 5.38 * LLVM 17 * Golang 1.21 * FontAwesome6 ### 其它改进 虽然安装程序基本无变化(Anaconda Web UI 的 [目标](https://fedoraproject.org/wiki/Changes/AnacondaWebUIforFedoraWorkstation) 是 Fedora 40),但是新的“<ruby> 欢迎屏 <rt> Welcome Screen </rt></ruby>”在帮助你开始使用时会提供些许便利。 ![](/data/attachment/album/202309/19/232442hunk13y5k23zrryu.jpg) 为了提供更好的用户体验,Fedora 39 加入了多项改进。 其中包括: * **Fedora Workstation 不再对 Qt 进行定制主题设计**:Qt 应用将遵循 Qt 上游的默认主题设置。 * **Fedora Kinoite 变体启用自动更新** * **改变 Fedora 中的 Flatpak 构建方式(不用模块)** 更多细节改进,你可以在其 [官方变更集维基](https://fedoraproject.org/wiki/Releases/39/ChangeSet) 上查看。 ? 你对 Fedora 39 有怎样的期待?这是否对你将是一个重要的升级,或者只是类似常规新版本发布? --- via: <https://news.itsfoss.com/fedora-39-features/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:ChatGPT 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) [Fedora 38](https://news.itsfoss.com/fedora-38/) was an exciting upgrade with new spins, and unfiltered Flathub access. Now, it is again time for an upgrade, i.e., **Fedora 39**. If all goes well, Fedora 39 will be released on **October 17, 2023**. But, what is interesting this time? Let us take a look! ![fedora 39 homescreen](https://news.itsfoss.com/content/images/2023/09/fedora-39-home.jpg) ## Fedora 39: Key Highlights With Fedora 39, you can expect some good updates and changes, among other things. Some key improvements include: **GNOME 45****Fedora Onyx spin****Colored bash prompt****Application updates****Performance refinements** ## Colored Bash Prompt ![fedora 39 prompt](https://news.itsfoss.com/content/images/2023/09/fedora-prompt.png) A subtle change in the default color of the bash prompt. The monochrome default blended in too well with long command outputs. Now, it should be easy to differentiate. Of course, you can also change the prompt color as per your convenience. ## GNOME 45 GNOME 45 is a major highlight of the upgrade. Along with [Ubuntu 23.10](https://news.itsfoss.com/ubuntu-23-10/), Fedora 39 will be among the first few distributions debuting GNOME 45 out of the box. GNOME 45 comes baked in with plenty of useful changes, and subtle visual makeovers. Some key highlights include: **New core apps****New about panel in system settings****Privacy hub in system settings****Improvements to the Nautilus file manager** The performance improvements to the file manager should be an impressive feat. And, a simple re-design to the sidebar now separates the file/folder area better as compared to the older design. ![nautilus file manager gnome 45](https://news.itsfoss.com/content/images/2023/09/image.png) The new additions to the core apps, **Loupe Image Viewer** and **Snapshot, **should be beneficial.** ** A simple and minimal image viewer, and a webcam application. However, Fedora 39 sticks to the older Cheese webcam app. ![loupe image viewer](https://news.itsfoss.com/content/images/2023/09/image-1.png) Not just limited to new applications, there have been many improvements to the core apps, including a new app icon for the Calendar app and a better user experience with the console and weather app. **Suggested Read **📖 [Ubuntu 23.10: Release Date and New FeaturesUbuntu’s next latest and greatest. Here’s what it is expected to pack in.](https://news.itsfoss.com/ubuntu-23-10/)![](https://news.itsfoss.com/content/images/2023/08/ubuntu-23-10-release-ft.png) ![](https://news.itsfoss.com/content/images/2023/08/ubuntu-23-10-release-ft.png) The Settings menu also received upgrades to the way the information is presented to the end-user. A new "**System Details**" section was added in the "**About**" section where you get detailed information on what you are running, and the hardware specifications. ![fedora 39 system info](https://news.itsfoss.com/content/images/2023/09/fedora-39-system-info.jpg) While privacy is already solid in Linux distributions like Fedora, GNOME 45 brings in a revamped section for it. The options are accessible quickly and should be easy-to-understand for new Linux users. ![fedora 39 privacy hub](https://news.itsfoss.com/content/images/2023/09/image-2.png) Of course, GNOME 45 has much more to offer. And, you can find that all in our [GNOME 45 feature](https://news.itsfoss.com/gnome-45/) article: [GNOME 45 Packs in Exciting Upgrades: Here’s What’s NewThe features and improvements that you can expect with GNOME 45. We’ve listed them here.](https://news.itsfoss.com/gnome-45/)![](https://news.itsfoss.com/content/images/2023/08/gnome-45-features-ft.png) ![](https://news.itsfoss.com/content/images/2023/08/gnome-45-features-ft.png) ## Fedora Onyx Fedora already offers a "**Silverblue**" variant as one of the [best immutable distros](https://itsfoss.com/immutable-linux-distros/?ref=news.itsfoss.com) around, with GNOME as the desktop. To expand their arsenal, Joshua Strobl proposed to add a new immutable variant with Budgie desktop environment, complementing the Budgie spin, i.e., ** Fedora Onyx**. And, you should find it available as a new offering with the Fedora 39 release. **Suggested Read **📖 [11 Future-Proof Immutable Linux DistributionsImmutability is a concept in trend. Take a look at what are the options you have for an immutable Linux distribution.](https://itsfoss.com/immutable-linux-distros/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/03/list-of-immutable-linux-distros--1-.png) ![](https://itsfoss.com/content/images/2023/03/list-of-immutable-linux-distros--1-.png) ## Drop fedora-repos-modular by default Fedora comes with a couple of repos enabled for you to seamlessly install packages. However, the modular repos are no longer used by most users, as observed by the developers. So, removing them would speed up DNF's performance. [package manager](https://itsfoss.com/package-manager/?ref=news.itsfoss.com). Hence, with the fedora-repos-modular repo no longer included by default, you can expect some performance improvements with DNF, especially, on poor networks. ## Application and Package Updates Here are the most significant application updates: [LibreOffice 7.6](https://news.itsfoss.com/libreoffice-7-6/)- Python 3.12 - RPM 4.19 - Vagrant 2.3 - Perl 5.38 - LLVM 17 - Golang 1.21 - FontAwesome6 **Suggested Read **📖 [LibreOffice 7.6 Releases With Document Themes, Navigation Panel for Slides, and MoreLibreOffice 7.6 is here with plenty of good improvements.](https://news.itsfoss.com/libreoffice-7-6/)![](https://news.itsfoss.com/content/images/2023/08/libreoffice-7-6.png) ![](https://news.itsfoss.com/content/images/2023/08/libreoffice-7-6.png) ## Other Improvements While the installer remains unchanged (*Anaconda Web UI targeted for Fedora 40*), a new welcome screen to help you started is appreciated. ![](https://news.itsfoss.com/content/images/2023/09/fedora-39-installer.jpg) There are several other changes that lead to a better Fedora 39 user experience. Some of those include: **No custom Qt theming for Fedora Workstation**: The Qt applications will stick to the default theme settings with the Qt upstream.**Enabling auto-updates in Fedora Kinoite variant****Changing the way Flatpak for Fedora is built (without modules)** There are many more refinements, you can check out those on its [official changeset wiki](https://fedoraproject.org/wiki/Releases/39/ChangeSet?ref=news.itsfoss.com). *💬 What do you think about Fedora 39? Will it be a good upgrade for you or sound like a routine release?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,208
我是如何在科技领域找到第一份工作并帮助其他人做到同样的事情
https://opensource.com/article/23/3/my-first-job-tech
2023-09-20T10:55:03
[ "工作" ]
/article-16208-1.html
![](/data/attachment/album/202309/20/105501j7sl7s3zksod3zhs.jpg) > > 没有我的导师,就没有我的今天。现在,我在开源领域找到了梦寐以求的工作。 > > > 两年前,当 Sauce Labs 在 <ruby> <a href="https://opensource.com/business/16/5/whats-open-source-program-office"> 开源项目办公室 </a> <rt> Open Source Program Office </rt></ruby>(OSPP)开设实习岗位时,我参加了它的面试。当时竞争十分激烈,而我并不具备一个技术公司青睐的技术背景。彼时的我正忙于从艺术领域寻求一个出路,参加了一系列技术课程,努力学习 Python 和 JavaScript 等技能。我下定决心要把握住这次可以在开源领域工作的面试机会,因为这是我踏上新的职业道路的入口。 在 [柏林的 PyLadies](https://berlin.pyladies.com/) 社区中,我认识了 [Eli Flores](https://www.linkedin.com/in/elifloresch/),她和我亦师亦友,也正是她最终内推了我。如果不是因为 Eli,我可能根本不会有机会在 Sauce Labs 参加面试。 但我的简历真的很差。 我试图为自己包装一些我没有的技术能力,努力猜测面试官希望看到的内容。当然,面试筛选的过程也很困难。必须有人从成堆的简历中挑选出专业技能对口、适应工作角色的投递者,同时期待着有能够为团队带来新理念的创新人才。一方面,公司提供了一个面试的机会,对自己信任的人的判断有信心;另一方面,这也会使大家有很多的相似之处。 这正是内推计划的妙处所在,也是我在技术领域赢得 [第一份工作的故事](https://opensource.com/article/21/4/my-first-tech-job)。 但是,为别人内推就足够了吗?很多帮助他人内推的人认为自己已经完成这一年的“善事”,但 Eli 并不这样想。 Eli 是 Sauce Labs 在德国雇佣的第一位女性软件工程师。当我来到公司时,一共有三位女性员工:Eli,我自己以及 Elizabeth —— 她是在一年前入职的一位初级工程师。基于 Eli 自己的奋力历程,她关注了我的发展,邀请我参加定期的工作检查,同时根据公司的考察体系,为我提供了很多关于如何制定职业规划的有实际意义的信息。Eli 从不会只是甩给我一个链接然后离开,她会耐心的给我解释其中的含义以及系统中内置的一些“陷阱”。那时候,领导层还没有接受过认识自己偏见的培训,这对 Eli 的职业道路产生了影响。 除此之外,她还是制定正式文件的人——一份向决策层解释为什么当我的实习结束时,公司需要给我提供正式初级岗位的文件。在我合同结束前 Eli 准备了数月,她在我的同事中收集信息,找出了具有最后招聘权力的人,最重要的,教给了我捍卫自己岗位所需要的的洞察力。 我也做好了我的分内之事。 当我的合同续约前景不明朗时,我向一位朋友和导师咨询了要采取什么行动,以及对我的期望是什么。我也询问了最近正处于相同处境的同事。我创建了一个文档,里面记录了这几个月来我取得的进展,确保我的成果所展示的职业发展路线和公司所定义的充分吻合。有了这份文件,我可以证明 Eli 是对的:他们有充分的理由来留下我——基于客观事实而非主观臆断。 ### 定义我的角色 然而,在这一过程中,仍然存在一个重要问题—— Sauce 想要留住我,但他们不知道该如何留下我。初级职位需要指导,以及一个渐进式的知识积累过程。我已经在开源项目办公室(OSPO)找到了自己的热爱,在这里我可以积极地和开源社区进行合作。但是 OSPO 可能是公司里最复杂的部门之一。它收集开源和业务信息,需要主动地去将业务需求和开源需求联系起来。我的同事大多是资深工程师,负责对业务至关重要的开源项目——这些工作都非常复杂。 我的一位同辈,[Christian Bromann](https://bromann.dev/),也在寻求提高自己的管理技能,所以他关照了我。我们开始定期的一对一研讨,讨论在商业环境中开展开源项目的意义。他邀请我更进一步了解了他所参加的基金会和项目,并且进行了几次结对编程的活动,来帮助我学习对于一个工程师来说,在遇到特殊需求时该如何处理。他丝毫没有顾虑的为我在公司桌子旁准备了一把椅子,带我融入了业务。得益于此,我在公司中的角色定位变得清晰而明确。 在作为一个职场人争取转正并成长的过程中,我得了来自不同部门同事的帮助。他们向我展示了很多企业世界中我不了解的事情,包括在业务上最纯粹也是最重要的事情:我们的工作是如何让生活变得更好。我们拥有 <ruby> 多元、公平和包容 <rt> diversity, equity, and inclusion </rt></ruby>(DEI)小组,环境、职工资源小组,非正式导师制度以及跨部门合作支持。Sauce Labs 最棒的地方就是它拥有的每一个人——充满智慧、满腔热情,我也努力做到见贤思齐。 不久之后,我决定是时候回馈了。 我回顾过往,思绪中涌现出了所有帮助我找到喜爱的工作并且极大改善了我的生活的前辈,我有了一个强烈的感觉:有必要在桌子旁边为他人再准备一把椅子。我开始寻找如何让一个盈利组织设立奖学金计划变得有意义。 ### 一项来自盈利组织的奖学金项目 我现在正式担任了连接 OSPO 和社区部门的职位。我的主要任务是建立开源社区的开发者关系(我认为这是一份梦幻的工作!)。 在开源领域,尤其是 [基础设施](https://www.redhat.com/en/topics/cloud-computing/what-is-it-infrastructure?intcmp=7013a000002qLH8AAM) 相关(这是业务之本),贡献和消耗之间的不平衡一直是开源生态中的风险。所以问题成了:一个公司和一个开源项目有什么共同之处? 答案就是:人。 有许多法律上的条例限制着一家盈利性公司维持一个奖学金计划。这因国家而异,因为每个国家的法律也不尽相同。德国为工人提供了许多保障措施。我的人力资源部门同事告诉过我:“如果你觉得这是一份工作,那么它就是。”当然这通常也和税收和支出联系在一起,成本开销一直都是启动新项目的主要决定因素之一。 对于公司来说,实习意味着培训一位将来会被雇佣的人,因此需要有一个预先批准的包含一年工资的预算。但是奖学金不同于此。它是一种更加宽松的合约,类似于助学金,只涵盖一定的时间。这对于一个开源项目以及类似的活动比如 <ruby> <a href="https://opensource.com/article/21/10/google-summer-code"> 谷歌编程之夏 </a> <rt> Google Summer of Code </rt></ruby>(GSoC)和 Outreachy 来说再合适不过了。 我提出的计划模型是以人为中心的。我希望为有抱负的本地技术人员们提供进入该领域的机会。我已经经历过类似的项目,也明白它们可能有多么令人沮丧。这些项目的竞争非常激烈,如果想被选中,还必须在申请之前承诺几个月的无薪工作。 通过举办几个小型的当地活动,我深信整个开源生态系统都将受益。我觉得通过减少竞争,简化申请流程可以降低入门门槛,这一定会吸引更多的人——尤其是那些无法承诺数月无薪工作的人。 ### 奖学金 [开源社区奖学金](https://saucelabs.com/resources/blog/sauce-labs-community-fellowship-program-open-source) 是一个为期六个月的带薪项目,旨在连接盈利组织和开源项目,促进开源中贡献和治理的多样性。 将员工转变为导师降低了项目的成本,同时也为公司带来了巨大的价值,因为这样有助于将员工培养为更好的导师。多项研究证明了在公司内部建立正式的、非正式的导师制度的优势,其中包含增强员工归属感,减少公司的人才流失。很多公司表示需要员工具备承担导师制度的技能以达到高级职称水平,但这是一种需要实践的技能。通过每周提供 2 小时来培训相关技能,公司可以在长期内获益颇丰,而付出的工作量很少。 一个与业务紧密相关的开源项目需要对业务至关重要。如果你打算雇佣一定数量的人在六个月内专门完成一个项目,那么就需要从这笔支出中取得回报。我鼓励奖学金成为一个跨学科、跨专业的项目,因为大多数开源项目需要文档编写、翻译、设计和社区支持等多方面的帮助。 并且,奖学金项目应该设置为六个月——不能再少。诸如一些为期三个月的项目,也许有津贴,但对于一个合理的入职申请来说是不够的。未来的项目维护者应该现在就融入到社区,这是需要时间的。 最后,这必须是一个带薪项目。我们不仅仅需要导师制度,还需要资助。尽管导师制度可以帮助你扩展人脉,但我们还需要支出薪水。向获奖者支付薪水可以让他们全身心地投入到项目中。 Sauce Labs 首次赞助了这个项目并于 2022 年 12 月在全美招募了 5 名获奖者。我们希望这个项目成为 [自由软件运动中的典范][],这样的话,所有人都可以在其基础上创建分支、修改并重新分发。 ### 每个人都有优点 我们时常面临这样的问题:“我能做什么?”与其对永远存在的困难感到挫败,不如积极地发掘自己的优点。以下是一些基于我自身经历的想法: * 成为社区的组织者。附近没有找到组织?那就创建属于你自己的团队并招贤纳士,要知道,你需要支持。 * 成为导师。加入一些倡议组织,或是在你的公司创建正式的亦或是非正式的导师项目。 * 关心你的同事,并主动提供帮助。即使你的工作十分稳定,你仍然需要他人的帮助来成长。和同事搞好关系,并利用这个优势,让每一种声音得到倾听。 * 接受一个属于你自己的奖学金项目。这是一个可重复,易实施的模型,同时也为开源生态系统带来了无尽的帮助。 我们一直可以为我们周围的世界更加美好而做出贡献,而你是其中重要的一环。 *(题图:MJ/994ad9ce-29e3-438b-959c-84fb4e037eb5)* --- via: <https://opensource.com/article/23/3/my-first-job-tech> 作者:[Paloma Oliveira](https://opensource.com/users/discombobulateme) 选题:[lkxed](https://github.com/lkxed/) 译者:[lyxwest](https://github.com/lyxwest) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='opensource.com', port=443): Read timed out. (read timeout=10)
null
16,210
Beaver Notes:一款开源的私人记事本应用
https://news.itsfoss.com/beaver-notes/
2023-09-20T23:11:39
[ "记事本", "Beaver Notes" ]
https://linux.cn/article-16210-1.html
![](/data/attachment/album/202309/20/231046ah0ehdhf8x1uqt88.jpg) > > 这是一款以隐私保护为重点,能在各平台上运行的记事本应用。一起来了解一下吧! > > > 你是否正在寻找一款以隐私保护为核心的记事本应用? 那么,我们可能为你找到了合适的东西! Beaver Notes 是一个**跨平台的开源记事本应用**,它将**笔记数据存储本地**,从而避免了数据泄露的风险,并允许用户在离线时访问已存储的笔记。 我认为它很快就可以登上我们的 [最佳 Linux 记事本应用](https://itsfoss.com/note-taking-apps-linux/) 列表了。 以下我将带你了解这款应用,同时我也会分享我的初步印象。 ### Beaver Notes:概况 ⭐ ![](/data/attachment/album/202309/20/231140x3zeelfte3ean5nr.jpg) Beaver Notes 使用了 **Vue** 和 **JavaScript** 构建,作为一款以隐私为主导的记事本应用,它提供了简洁而直观的用户界面。 它有许多让人赞赏的功能,使它成为一款理想的记事应用。一些突出的特点包括: * 专注模式 * 笔记标签系统 * Markdown 编辑支持 * 导出/导入笔记的功能 推荐阅读: > > **[Linux 上 16 个最好的记事本应用](https://itsfoss.com/note-taking-apps-linux/?ref=news.itsfoss.com)** > > > #### 初步使用体验 ?‍? 我在我的 [Ubuntu 22.04](https://news.itsfoss.com/ubuntu-22-04-release/) 系统上安装了 Beaver Notes,并且添加了一些随机的笔记以及它自带的两份介绍笔记。 当我打开 Beaver Notes 时,我首先看到的是其主页,上面展示了各种信息。其中包括一个**整齐地组织了的我的笔记的区块**,以及它旁边的**配有笔记分类功能的搜索菜单**。 此外还有一个**侧边栏菜单**,其中**列出了创建/编辑新笔记、浏览所有/归档笔记、切换深色模式和设置菜单等重要选项**。 ![](/data/attachment/album/202309/20/231140p7mzgp1iw3dwhatz.jpg) 随后,我尝试了下 **笔记编辑体验**。 如前所述,**Beaver Notes 支持** [Markdown](https://en.wikipedia.org/wiki/Markdown) 格式,而且我发现使用它编辑非常直观,而且它拥有我期待中的所有常用选项。 ![](/data/attachment/album/202309/20/231140s4uc6ebyxpxnm4uy.jpg) > > **[Linux 上 11 个最好的 Markdown 编辑器](https://itsfoss.com/best-markdown-editors-linux/)** > > > 值得注意的是,它有一个 “<ruby> 专注模式 <rt> Focus Mode </rt></ruby>”。启用后,所有的菜单元素都被隐藏起来,让我可以全屏进行更专注的编辑。 > > ? 尽管该特性带我进入了全屏模式,但我为了能够以下面的截图,还是选择了退出全屏模式。 > > > ![](/data/attachment/album/202309/20/231140jr3vo7nlmngsru73.jpg) 另外一个吸引我眼球的功能是 “<ruby> 标题树 <rt> Headings Tree </rt></ruby>” 特性。这使得在大型的,由多个标题组成的笔记中轻松导航成为可能。 ![](/data/attachment/album/202309/20/231140xsk4nno0zk3okrw9.jpg) Beaver Notes 还有一个 **笔记标签系统**,这让你更有效地管理你的笔记。只需要输入 `#` 和标签名,即可创建新的标签。 之后,你可以通过搜索栏邻近的标签排序菜单,或点击主页上的标签进行排序。 ![](/data/attachment/album/202309/20/231140x3gsk9ykz1ki849i.jpg) 你还可以 **归档笔记**。我可以将笔记归档而不是删除它,并以后在侧边栏中的 “<ruby> 归档 <rt> Archive </rt></ruby>” 选项中查看。 ![](/data/attachment/album/202309/20/231141eq28cgv5xfxg98ng.jpg) 那如何改变它的外观配置呢? “<ruby> 设置 <rt> Settings </rt></ruby>” 菜单中包含了常规的选项,允许你在浅色模式、深色模式和系统模式之间切换。 在这里还可以对数据导出设置密码,同时也能导入笔记。 ![](/data/attachment/album/202309/20/231141xq5oqcvo34zmoqnu.jpg) 最后,还有 “<ruby> 快捷键 <rt> Shortcuts </rt></ruby>” 菜单,这里列出了在 Beaver Notes 中可用的所有键盘快捷键。 ![](/data/attachment/album/202309/20/231141nqfxfkwrnhkwto4m.jpg) 在我短暂的使用体验中,Beaver Notes 给我留下了深刻的印象,尤其针对不需要进行云同步的情况,这是一个非常理想的记事本应用。 我建议你也试试看,它提供了许多有价值的功能。 ### ? 下载 Beaver Notes 由于 Beaver Notes 是 **一款跨平台应用**,因此它可以在 **Linux**、**Windows** 和 **macOS** 上运行。你可以在 [官方网站](https://beavernotes.com/download) 下载你需要的安装包。 > > **[Beaver Notes](https://beavernotes.com/download)** > > > 如果你对源码感兴趣,也可以访问它的 [GitHub 仓库](https://github.com/Daniele-rolli/Beaver-Notes) 查看。 ? 你对 Beaver Notes 有什么看法?它是你一直在寻找的吗? --- via: <https://news.itsfoss.com/beaver-notes/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:ChatGPT 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Are you looking for a privacy-focused, note-taking app? Well, then, we stumbled upon just the right thing for you! Beaver Notes is an **open-source, cross-platform note-taking app** that **stores notes locally**, foregoing any risk of data breaches and allowing for offline access to the stored notes. I think it can make its way to our list of [best note-taking apps for Linux](https://itsfoss.com/note-taking-apps-linux/?ref=news.itsfoss.com) soon. Allow me to take you through this app; I also share my initial impressions below. ## Beaver Notes: Overview ⭐ ![a screenshot of beaver notes' about page](https://news.itsfoss.com/content/images/2023/08/BN-1-1.jpg) Built using a combination of **Vue** and **JavaScript**, Beaver Notes is a **privacy-first** note-taking app that offers a simple and intuitive user interface. It offers plenty of features that make it a pretty solid option for a note-taking app. Some of the notable highlights include: **Focus Mode****Note Tagging System****Markdown Editing****Ability to Export/Import notes** **Suggested Read **📖 [Top 16 Best Note Taking Apps For Linux [2023]Plenty of amazing note-taking apps for Linux. Here’s what we recommend you to check out.](https://itsfoss.com/note-taking-apps-linux/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/07/note-takings-apps-for-linux.png) ![](https://itsfoss.com/content/images/2023/07/note-takings-apps-for-linux.png) ### Initial Impressions 👨💻 After installing it on my [Ubuntu 22.04](https://news.itsfoss.com/ubuntu-22-04-release/) system, I populated Beaver Notes with a few random notes and the two introduction notes it already came with. When I launched Beaver Notes, I was taken to the homepage that featured many things. One was a **neatly organized section with all my notes; **then there was the **search menu with note-sorting options** beside it. The last thing was **a sidebar menu** that **housed important options** for creating/editing a new note, accessing all/archived notes, toggling dark mode, and the settings menu. ![a screenshot of beaver notes' homepage](https://news.itsfoss.com/content/images/2023/08/BN-2.jpg) I then went on to look at the **note-editing experience**. As mentioned earlier, **Beaver Notes has support for **[ Markdown](https://en.wikipedia.org/wiki/Markdown?ref=news.itsfoss.com), and my editing experience with it was pretty intuitive; it gave me all the usual options that one would expect from an editor like this. ![a screenshot of beaver notes' note editor](https://news.itsfoss.com/content/images/2023/08/BN-3.jpg) **Suggested Read **📖 [11 Best Markdown Editors for LinuxLooking for a good Markdown editor? Here are some of the best tools you can use on Linux to write in Markdown syntax easily.](https://itsfoss.com/best-markdown-editors-linux/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/wordpress/2016/10/Best-Markdown-Editors-for-Linux.jpg) ![](https://itsfoss.com/content/images/wordpress/2016/10/Best-Markdown-Editors-for-Linux.jpg) Interestingly, it also features a '**Focus Mode**'. When enabled, it hid all the menu elements and took me into full-screen mode for a more immersed editing experience. ![a screenshot of beaver notes' focus mode feature](https://news.itsfoss.com/content/images/2023/08/BN-4.jpg) Another feature that caught my eye was the '**Headings Tree**' feature. This made it effortless to navigate around larger notes that consisted of many headings. ![a screenshot of beaver notes' headings tree feature](https://news.itsfoss.com/content/images/2023/08/BN-5.jpg) Beaver Notes also has a **note tagging system** that lets you organize your notes more effectively. Simply add an '#' with the tag name, and a new tag will be created. Thereafter, you can sort it using the tag sorting menu near the search bar or by clicking on the tags on the homepage. ![a screenshot of beaver notes' tags sorting feature](https://news.itsfoss.com/content/images/2023/08/BN-6.jpg) You can also** archive notes**.** **Instead of deleting a note, I could archive one and access it from the dedicated 'Archive' option on the sidebar menu for later use. ![a screenshot of beaver notes' archive notes feature](https://news.itsfoss.com/content/images/2023/08/BN-7.jpg) What about customizing its appearance? The '**Settings'** menu features the usual options to change the app theme between 'Light', 'Dark', and 'System'. It also lets you export data with/without a password, as well as the ability to import notes. ![a screenshot of beaver notes' general settings](https://news.itsfoss.com/content/images/2023/08/BN-8.jpg) Finally, we have the 'Shortcuts' menu that shows all the keyboard shortcuts available to use on Beaver Notes. ![a screenshot of beaver notes' keyboard shortcuts](https://news.itsfoss.com/content/images/2023/08/BN-9.jpg) In my brief usage, Beaver Notes seems like a solid note-taking option, especially if you don't want any form of cloud syncing involved. I suggest you try it, as it offers plenty of valuable features. ## 📥 Get Beaver Notes As Beaver Notes is **a cross-platform app**, it is available for **Linux**, **Windows**, and **macOS**. Head over to the [official website](https://beavernotes.com/download?ref=news.itsfoss.com) to grab the package of your choice. You can also head over to its [GitHub repo](https://github.com/Daniele-rolli/Beaver-Notes?ref=news.itsfoss.com) for diving into the source code. *💬 What did you think of Beaver Notes? Is this something you've been looking for?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,211
Linux 内核支持周期即将发生一项重大变革!
https://news.itsfoss.com/linux-kernel-support/
2023-09-21T08:59:00
[ "内核", "LTS" ]
https://linux.cn/article-16211-1.html
![](/data/attachment/album/202309/21/085832oy6xi3jqrm44s9xg.jpg) > > 从文字描述上看,它对用户产生的影响将如何呢?你有何看法呢? > > > <ruby> <a href="https://events.linuxfoundation.org/open-source-summit-europe/"> 欧洲开源峰会 </a> <rt> Open Source Summit Europe </rt></ruby> 刚刚开幕,我们开始看到围绕 Linux 和开源软件的一些有趣动态。 其中一项新闻是关于未来将如何处理 Linux 内核的 [长期支持](https://itsfoss.com/long-term-support-lts/)(LTS)版本。 我们来看一下即将进行的更迭。 **新变化:** 在峰会上,Linux 开发者和 [LWN](https://lwn.net/) 执行编辑 Jonathan Corbett 宣布,**Linux 内核的 LTS 周期即将从原先的六年缩短至两年**! 目前,有 **六个 LTS 版本的 Linux 内核**,即 4.14、4.19、5.4、5.10、5.15 和 6.1。 在将来,继 4.14 之后,当 LTS 状态的下两个版本被淘汰时,**它们将不会被其他内核版本所取代**。 > > ? 你可以查阅 [Linux 内核归档](https://kernel.org/category/releases.html) 来了解目前 LTS 版本 Linux 内核预计的终止支持日期。 > > > 长期支持内核: | 版本 | 维护者 | 发布于 | 计划终止日期 | | --- | --- | --- | --- | | 6.1 | Greg Kroah-Hartman & Sasha Levin | 2022-12-11 | 2026 年 12 月 | | 5.15 | Greg Kroah-Hartman & Sasha Levin | 2021-10-31 | 2026 年 10 月 | | 5.10 | Greg Kroah-Hartman & Sasha Levin | 2020-12-13 | 2026 年 12 月 | | 5.4 | Greg Kroah-Hartman & Sasha Levin | 2019-11-24 | 2025 年 12 月 | | 4.19 | Greg Kroah-Hartman & Sasha Levin | 2018-10-22 | 2024 年 12 月 | | 4.14 | Greg Kroah-Hartman & Sasha Levin | 2017-11-12 | 2024 年 1 月 | **时机选择:**Jonathan 提到的理由之一是,**并不是很多人使用旧版本的 Linux 内核**,因此这些版本没必要继续进行维护。 我对此表示同意。然而,肯定有些人对此举动感到不满。 但是,这个决策的推进主要是由于 **Linux 代码维护人员过度劳累的大问题**。 你看,对于一个 LTS 版本的代码进行检查和改善是一项重任务,需要消耗大量的时间和精力,而问题就出在这里。 据 Jonathan 所说,维护人员面临的 **两个大挑战** 分别是:大部分 **维护人员并未得到酬劳以维护 Linux 内核**,以及采用 “[Fuzzing](https://en.wikipedia.org/wiki/Fuzzing)” 技术寻找问题,虽然有所帮助,但有时也可能揭示出许多小问题,需要维护人员花费更多的精力。 看到这样的情况,维护人员容易感到疲劳,对吧?? 当被问及 **维护人员如何得到帮助?** 时,Jonathan 建议他们与雇主进行沟通,把 Linux 内核维护工作转为付费工作。 他还补充说, > > 如果公司希望继续从 Linux 中获益,就需要意识到他们必须向 Linux 回馈。 > > > 总的来说,此次变革将减轻维护人员的负担,但依赖于旧版本 Linux 内核的系统可能会承受不获得关键更新的风险。 这可能会对大部分用户产生影响,或可能不会,但对某些组织来说,可能会带来些许不便。 ? 你怎么看?在下方评论区分享你的想法吧。 *新闻来源:[ZDNET](https://www.zdnet.com/article/long-term-support-for-linux-kernel-to-be-cut-as-maintainence-remains-under-strain/)* *(题图:MJ/47a40c0f-3a3c-4534-98fe-3c986e9a881c)* --- via: <https://news.itsfoss.com/linux-kernel-support/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:ChatGPT 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) The [Open Source Summit Europe](https://events.linuxfoundation.org/open-source-summit-europe/?ref=news.itsfoss.com) edition has kicked off, and we are starting to see some interesting news surrounding Linux and open-source software in general. One such news is regarding how [Long-term Support](https://itsfoss.com/long-term-support-lts/?ref=news.itsfoss.com) (LTS) Linux kernel versions will be handled going forward. Let's take a look at the upcoming changes. **What's happening: **At the summit, Jonathan Corbett, Linux developer and executive editor at [LWN](https://lwn.net/?ref=news.itsfoss.com) disclosed that **the LTS period for the Linux kernel is being brought down to two years, from the previous six years period**. Seeing that currently there are **six LTS Linux Kernels**, 4.14, 4.19, 5.4, 5.10, 5.15, and 6.1. In the future, after 4.14, when the next two in line exit LTS status, **they will not be replaced with other kernel versions**. [The Linux Kernel Archives](The Linux Kernel Archives)for knowing the projected end-of-life of the current LTS Linux kernels. **Why Now: **One of the reasons Jonathan mentions is the fact that **not many people use older versions of the Linux kernel**, so there's not much point in maintaining those. And, I do agree with that. However, there will be some out there who won't be happy with this move. But, there's **a bigger problem at hand** that has pushed this decision forward, and that is the **matter of Linux code maintainers being burnt out**. You see, checking/improving the code for an LTS release is a major task that can take up a lot of time and effort to get it done right, and this is where the problem lies. According to Jonathan, there are **two distinct obstacles that maintainers face**, one is that **many** **maintainers are not paid to maintain the Linux kernel**. The second one is the **use of the ' Fuzzing' technique to find bugs**, which is helpful, but at times can also uncover numerous minor bugs that will require the maintainers' attention. You see how this can easily burn out a maintainer? 🙁 When asked; **How can maintainers get help?**, Jonathan suggested that they speak with their employers for getting them paid for their Linux kernel maintainer work. He also added that: Companies must realize they need to give back to Linux if they want to continue to reap its benefits. So, wrapping up. This move will lessen the burden on the maintainers, however systems that rely on older Linux kernels may have to bear the brunt of not getting essential patches. While it may or may not affect a big chunk of users, it could be inconvenient for some organizations. *💬 What do you think? Share your thoughts in the comments below.* **Via: ZDNET** ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,212
用 Rust 编码?这是 JetBrains 的新 IDE
https://news.itsfoss.com/rust-ide-jetbreains/
2023-09-21T10:57:00
[ "Rust", "JetBrains" ]
https://linux.cn/article-16212-1.html
![](/data/attachment/album/202309/21/105704plqhnljnw255huaw.jpg) > > Rust 开发者,你们有新的东西可以尝试了! > > > 在最近宣布基于 IntelliJ 的 IDE [将支持](https://news.itsfoss.com/intellij-wayland-support/) Wayland [显示服务器](https://itsfoss.com/display-server/) 协议之后,JetBrains 推出了**面向 Rust 开发人员的新 IDE**。 它被称为 “**RustRover**”,目的成为**一个功能丰富的独立 Rust IDE**,并将接收定期更新、快速支持和“开箱即用的体验”。 请允许我向你展示它所提供的内容。 > > ? 这是一个早期使用工具,目前不适合生产使用。 > > > ### RustRover:可以期待什么? ![](/data/attachment/album/202309/21/105717u71gwykgyowwm47y.png) > > ? RustRover 不是自由开源软件。 > > > RustRover 从头开始开发,**取代了现已弃用的 [IntelliJ Rust](https://intellij-rust.github.io/) 插件**,该插件用于提供 JetBrains 平台上的 Rust 支持。 它是根据 JetBrains 的其他 IDE 构建的,用于提供**专用的 Rust 开发环境**,而这是以前所缺少的。 > > ? RustRover 还使用 IntelliJ Rust 插件作为组成部分。 > > > 在当前状态下,RustRover 支持诸如 **Rust** 、 **Cargo** 、 **TOML** 、 **web** 和**数据库**等语言和技术。具有来自 **[IntelliJ IDEA](https://www.jetbrains.com/idea/)** 的附加功能,包括 **[VCS 集成](https://www.jetbrains.com/help/youtrack/cloud/Integration-with-Version-Control-Systems.html)**。 而且,说到它的功能,还不少呢! ?️ **对于编码**,它支持**代码补全**、**代码生成**、**智能重构**、**实时模板**等。RustRover 旨在帮助用户更快、更准确地编写代码。 它还具有一些基本功能,例如**语法高亮显示**、**宏扩展**、**跨语言操作**等,以帮助更好地理解代码库。 **对于测试**,RustRover 具有测试运行器、调试器、对运行配置、运行目标、分析和性能分析的支持。 **对于项目管理**,它支持 Cargo 和 `Cargo.toml`、构建脚本、依赖项声明中的代码补全,并且可以轻松访问 Crate 文档。 RustRover 还**具有一些简洁的实时协作功能**,例如**支持 [VCS](https://en.wikipedia.org/wiki/Version_control)**([Git](https://git-scm.com/) 和 [GitHub](https://github.com/))、**配置共享** 和 **[code with me](https://www.jetbrains.com/code-with-me/)**。 你可能想知道**它的许可和定价模式怎么样?** 鉴于 **RustRover 不是开源的**,JetBrains **计划将其作为商业产品以订阅方式出售**,与其他 IDE 产品类似。 定价结构尚未最终确定,但预计会与他们的 IDE 产品定价类似。 你可以通过他们的[公告博客](https://blog.jetbrains.com/rust/2023/09/13/introducing-rustrover-a-standalone-rust-ide-by-jetbrains/)来了解更多关于 RustRover 的信息。 > > ? 既然我们正在讨论 Rust 的话题,为什么不尝试一下我们的 [Rust 基础系列](https://itsfoss.com/tag/rust-basics/)呢?它应该作为 Rust 世界的一个很好的介绍。 > > > **想要试一试么?** RustRover 已提供 **tar.gz 包**、**JetBrains Toolbox App** 和 \*\* Ubuntu Snap 包\*\* 提供。你可以从 [官方网站](https://www.jetbrains.com/rust/download/) 获取你选择的包。 > > **[RustRover](https://www.jetbrains.com/rust/download/)** > > > 对于 Ubuntu,你还可以运行以下命令: ``` sudo snap install jetbrains rustrover --classic ``` 请注意,在撰写本文时,**Snap 包未按预期运行**,在使用上述命令时在安装过程中引发错误。 JetBrains **计划在 2024 年 9 月之前对 RustRover 保持公共预览版**,并在此之前发布稳定版本。 ? 你有兴趣使用这样的 IDE 进行 Rust 编码吗?在下面的评论中分享你的想法! --- via: <https://news.itsfoss.com/rust-ide-jetbreains/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) After recently announcing that IntelliJ-based IDEs [will support](https://news.itsfoss.com/intellij-wayland-support/) the Wayland [display server](https://itsfoss.com/display-server/?ref=news.itsfoss.com) protocol, JetBrains has unveiled a **new IDE for Rust Developers**. Called the “**RustRover**”, it aims to be **a feature-packed standalone Rust IDE** that is set to receive regular updates, quick support, and an “out-of-the-box experience”. Allow me to show you what it has to offer. ## RustRover: What to Expect? ![a screenshot of jetbrains rustrover](https://news.itsfoss.com/content/images/2023/09/RustRover_IDE.png) Developed from the ground up, RustRover **replaces the now deprecated IntelliJ Rust plugin** that used to handle Rust support on the JetBrains platform. It has been built in line with JetBrains' other IDEs for providing **a dedicated Rust development environment**, that was missing previously. In its current state, RustRover has support for languages and technologies such as **Rust**, **Cargo**, **TOML**, **web**, and **database**. With the **additional functionality of IntelliJ IDEA**, including **.** [VCS integration](https://www.jetbrains.com/help/youtrack/cloud/Integration-with-Version-Control-Systems.html?ref=news.itsfoss.com)And, as for its features, there are quite a few! 🗒️ **For coding,** it has support for **code completion**, **code generation**,** smart refactoring**, **live templates**, and more. RustRover has been designed to help users write code faster, and more accurately. It also features the essentials, like **syntax highlighting**, **macro expansion**, **cross-language actions**, etc. for helping understand the codebase better. **For testing**, RustRover features test runners, a debugger, support for running configurations, run targets, profiling and performance analysis. **For project management**, it has support for Cargo and 'Cargo.toml', build scripts, code completion in dependency declarations, with easy access to crates documentation. RustRover also **features some neat real-time collaboration features** such as **support for VCS** ( [Git](https://git-scm.com/?ref=news.itsfoss.com)and [GitHub](https://github.com/?ref=news.itsfoss.com)), **configuration sharing**, and **.** [code with me](https://www.jetbrains.com/code-with-me/?ref=news.itsfoss.com)You are maybe wondering; **what about its licensing and pricing model?** Seeing as **RustRover is not** **open-source**, JetBrains has **plans to sell it as a commercial product on a subscription basis**, similar to its other IDE offerings. The pricing structure is yet to be finalized, but expect something similar to what they have been charging for their IDE products. You can go through their [announcement blog](https://blog.jetbrains.com/rust/2023/09/13/introducing-rustrover-a-standalone-rust-ide-by-jetbrains/?ref=news.itsfoss.com) to know more about RustRover. [Rust Basics series](https://itsfoss.com/tag/rust-basics/?ref=news.itsfoss.com)a try? It should act as a nice introduction into the world of Rust. **Suggested Read **📖 [Rust Basics 🦀 - It’s FOSSStart learning Rust, the programming language that is C like but better than C. No wonder Linus Torvalds liked it and allowed it to be included in Linux Kernel. The series makes you familiar with the basic Rust concepts with simple to follow examples.](https://itsfoss.com/tag/rust-basics/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/05/rust-series-tag.png) ![](https://itsfoss.com/content/images/2023/05/rust-series-tag.png) **Want to give it a try?** RustRover has been made available as **a tar.gz package**, **a JetBrains Toolbox App**, and as **a Snap for Ubuntu**. You can grab the package of your choice from the [official website](https://www.jetbrains.com/rust/download/?ref=news.itsfoss.com). For Ubuntu, you can also run this command: `sudo snap install jetbrains rustrover --classic` Do note that, at the time of writing this article, the **Snap package was not working as expected**, throwing an error during install when using the above-mentioned command. JetBrains have **planned to keep RustRover in public review until September 2024**, with scope for the release of a stable version before that. *💬 Would you be interested in using such an IDE for coding in Rust? Share your thoughts in the comments below!* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,214
在 Linux 的 VirtualBox 中从 USB 驱动器启动
https://itsfoss.com/virtualbox-boot-from-usb/
2023-09-22T10:19:00
[ "USB", "VirtualBox" ]
https://linux.cn/article-16214-1.html
![](/data/attachment/album/202309/22/101826lcduo6etry9ep2rb.jpg) > > 你可以在 VirtualBox 中的虚拟机上使用立付 Linux USB。这样可以省去重新启动主机的麻烦。 > > > 你有一个 <ruby> 立付 <rt> Live </rt></ruby> Linux USB 吗?在当前系统上测试它的常用方法是重新启动,并在系统重新启动时选择从立付 USB 启动。 但这很烦人,因为你需要停止计算机上的工作并重新启动它。 一种干扰较小的方法是使用虚拟机。 是的,你可以使用 VirtualBox 从虚拟机中的 USB 启动。这样,你不必为了尝试而在 VM 中安装发行版,而是改用立付会话。 在本教程中,我将展示在 Linux 系统使用 VirtualBox 从 USB 驱动器启动的步骤。这需要花费一些时间和精力,但可以让你免于重启系统。 ### 在 Linux 的 VirtualBox 中从 USB 驱动器启动 由于这是针对高级用户的教程,因此我省略了你事先需要的几个步骤: * 在 Linux 系统上 [安装 VirtualBox](https://itsfoss.com/install-virtualbox-ubuntu/) * 创建立付 Linux USB,最好 [使用 Ventoy](https://itsfoss.com/use-ventoy/) 本指南分为三个部分: * 创建虚拟机磁盘文件 * 在 VM 中使用 USB 启动 * 删除虚拟机磁盘(可选) 那么让我们从第一个开始。 #### 步骤 1:创建虚拟机磁盘文件(VMDK) 首先,你需要识别 USB 驱动器的磁盘名称,为此,你需要 [列出系统的驱动器](https://linuxhandbook.com/linux-list-disks/)。 为此,我将使用 lsblk 命令: ``` lsblk ``` ![](/data/attachment/album/202309/22/101904kr5vh5wqwtahavrd.png) > > ? 确保使用不带任何数字的磁盘名称。就我而言,Ventoy 以 sdb1 命名,但我仍然只能使用 sdb。 > > > 从上图中,你可以看到,Ventoy 列出了 `sdb11`,但你必须使用不带任何数字的名称。这意味着我必须只使用 `sdb`,否则,它会抛出错误。 找到驱动器名称后,使用以下命令中的 `VBoxManage` 命令来创建: ``` sudo VBoxManage createmedium disk --filename=/path/to/rawdisk.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sda ``` 在上面的命令中,将 `/path/to/rawdisk.vmdk` 替换为要保存文件的路径 ,将 `/dev/sda` 替换为目标驱动器。 就我而言,我想在我的主目录中创建一个名为 `IF.vmdk` 的文件,并且我的目标驱动器是 `/dev/sdb`,然后,我将使用以下命令: > > ? 你需要提供绝对路径来创建 vmdk 文件! > > > ``` sudo VBoxManage createmedium disk --filename=/home/sagar/IF.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sdb ``` ![](/data/attachment/album/202309/22/101904ar55zyyg2yiwwdrw.png) 最后,使用 `chmod` 命令更改权限: ``` sudo chmod 777 Filename.vmdk ``` ![](/data/attachment/album/202309/22/101905anqp9tqdbsavqpbp.png) #### 步骤 2:在 Linux 的 VirtualBox 中从 USB 启动 首先,从系统菜单中打开 VirtualBox,然后单击 “<ruby> 新建 <rt> New </rt></ruby>” 按钮。 在那里,为你的虚拟机命名并选择操作系统类型及其版本: ![](/data/attachment/album/202309/22/101905b683bmvv8xm8b3z8.png) 现在,单击 “<ruby> 下一步 <rt> Next </rt></ruby>” 按钮,它会要求你为虚拟机分配硬件资源: ![](/data/attachment/album/202309/22/101906czcobzoqbfvmi9cd.png) 完成硬件资源分配后,单击“下一步”按钮。 在这里,你将找到创建或添加虚拟磁盘的选项。现在,请执行 3 个简单步骤: * 选择第二个选项 “<ruby> 使用现有虚拟硬盘文件 <rt> Use an Existing Virtual Hard Disk File </rt></ruby>”。 * 点击“文件”图标。 * 点击“<ruby> 添加 <rt> Add </rt></ruby>”按钮并选择你最近创建的以 `.vmdk` 结尾的文件。 ![](/data/attachment/album/202309/22/101906iv3fjgvf33a8gq0h.png) 选择文件后,它将显示文件的名称,选择它并点击 “<ruby> 选择 <rt> Choose </rt></ruby>” 选项: ![](/data/attachment/album/202309/22/101907xp94wku9c4y4mwp6.png) 它将向你显示已选择从中启动的文件。单击下一步,它将显示你所做的选择的摘要。 点击 “<ruby> 完成 <rt> Finish </rt></ruby>” 按钮: ![](/data/attachment/album/202309/22/101907kw0k5obbp823yz88.png) 就是这样! 虚拟机已创建。 要启动虚拟机,首先选择虚拟机并单击启动按钮: ![](/data/attachment/album/202309/22/101908f3vkon8o9d58755o.png) 由于我的 USB 有 Ventoy,你可以看到,此处列出了多个发行版: ![](/data/attachment/album/202309/22/101908y1ygen1sbf25aeuo.png) 很酷。是么? #### 步骤 3:使用删除虚拟机及 vmdk 文件(可选) 当我在删除虚拟机后尝试删除 vmdk 文件时,当然,它被删除了,但每当我尝试创建具有相同名称的新文件时,它都会给我一个错误,说该文件已经存在! 因此,在这里,我将引导你了解如何删除虚拟机及 vmdk 文件。 首先,关闭虚拟机并将其删除。 ![](/data/attachment/album/202309/22/101909e24905v53g1ztr0m.png) 现在,如果你尝试 [使用 rm 命令](https://linuxhandbook.com/remove-files-directories/) 并提升权限删除 vmdk 文件,你可以删除它(但这就是幻觉的开始)。 例如,在这里,我删除了 `IF.vmdk` 文件: ``` sudo rm IF.vmdk ``` ![](/data/attachment/album/202309/22/101909p8udwzdvzd6w40j0.png) 现在,如果我尝试创建一个具有相同名称的新 vmdk 文件,则会出现错误,指出该文件已存在: ![](/data/attachment/album/202309/22/101909k3oz1y5j7b73a39b.png) 要删除 vmdk 文件,首先,你必须使用以下命令取消注册该文件: ``` sudo VBoxManage closemedium disk /path/to/MyDrive.vmdk ``` ![](/data/attachment/album/202309/22/101910wqc9hs4afpe9j9tn.png) 完成后,你可以使用 `rm` 命令删除该文件,它将轻松删除: ``` sudo rm Filename.vmdk ``` 然后,如果你尝试创建具有相同文件名的 vmdk 文件,你可以这样做: ![](/data/attachment/album/202309/22/101910hhkqu4tq25x5qfho.png) 这就行了! ### 更多虚拟机技巧 如果你正在寻找最快的 VM,可以使用 Qemu + KVM 的组合。我知道这听起来很复杂。 但为了更简单一些,我们制作了一份关于如何在 Ubuntu 上安装和使用 Qemu 的专门指南,包括启用共享文件夹、剪贴板和自动调整大小: > > **[如何在 Ubuntu 上安装和使用 Qemu](https://itsfoss.com/qemu-ubuntu/)** > > > 我希望本指南对你有所帮助。 *(题图:MJ/f74a3b33-2bcf-445b-8868-1dfc420f5b9d)* --- via: <https://itsfoss.com/virtualbox-boot-from-usb/> 作者:[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Got a live Linux USB? The usual way to test it on your current system is to reboot and choose to boot from the live USB when the system restarts. But that's annoying as you need to quit working on your computer and restart it. A less disruptive way is to use a VM. Yes, you can boot from a USB in a virtual machine with VirtualBox. This way, you don't have to install a distribution in VM just to try it. Use the live session instead. In this tutorial, I'll show the steps to boot from a USB drive in VirtualBox on Linux systems. It takes some time and effort but saves you from rebooting your system. ## Boot from USB drive in VirtualBox in Linux Since this is a tutorial for advanced users, I am leaving out a few steps that you need beforehand**:** - VirtualBox installed on your Linux system - A live Linux USB, preferably [Using Ventoy](https://itsfoss.com/use-ventoy/) [How to Install VirtualBox on Ubuntu Linux [3 Simple Ways]This beginner’s tutorial explains various ways to install VirtualBox on Ubuntu and other Debian-based Linux distributions.](https://itsfoss.com/install-virtualbox-ubuntu/)![](https://itsfoss.com/content/images/2023/08/install-vbox-on-ubuntu.png) ![](https://itsfoss.com/content/images/2023/08/install-vbox-on-ubuntu.png) This guide is divided into three parts: - Create a virtual machine disk file - Boot using USB in VM - Removing virtual machine disk (optional) So let's start with the first one. ### Step 1: Create a virtual machine disk file (VMDK) First, you need to identify the disk name of the USB drive, and to do so, you have to [list the drives of your system](https://linuxhandbook.com/linux-list-disks/). For that purpose, I'm going to use the lsblk command: `lsblk ` ![list drives in Linux using the lsblk command](https://itsfoss.com/content/images/2023/07/list-drives-in-Linux.png) From the above image, you can see, Ventoy is listed having the `sdb1` but you have to use the name without any numbers. This means I have to use the `sdb` only, or else, it will throw an error. Once you find your drive name, use the VBoxManage command in the following command to create `sudo VBoxManage createmedium disk --filename=/path/to/rawdisk.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sda` In the above command, replace the path with `/path/to/rawdisk.vmdk` to where you want to save the file and `/dev/sda` with your target drive. In my case, I want to create a file named `IF.vmdk` in my home directory and my target drive is `/dev/sdb` , then, I will be using the following: `sudo VBoxManage createmedium disk --filename=/home/sagar/IF.vmdk --variant=RawDisk --format=VMDK --property RawDrive=/dev/sdb` ![create virtual machine disk drive for virtualbox to boot from USB drive in Linux](https://itsfoss.com/content/images/2023/07/create-virtual-machine-disk-drive-for-virtualbox-to-boot-from-USB-drive-in-Linux.png) And finally, change the permissions using the chmod command: `sudo chmod 777 Filename.vmdk` ![use chmod command to change the permissions](https://itsfoss.com/content/images/2023/07/use-chmod-command-to-change-the-permissions.png) ### Step 2: Boot from USB in VirtualBox in Linux First, open the VirtualBox from your system menu and click on the `New` button. There, name your VM and select the operating system type and its version: ![Create VM in VirtualBox to boot from USB in Linux](https://itsfoss.com/content/images/2023/07/Create-VM-in-VirtualBox-to-boot-from-USB-in-Linux.png) Now, click on the `Next` button and it will ask you to allocate hardware resources for your VM: ![allocate RAM and cores to Vm to boot from USB in VirtualBox in Linux](https://itsfoss.com/content/images/2023/07/allocate-RAM-and-cores-to-Vm-to-boot-from-USB-in-VirtualBox-in-Linux.png) Once you are done allocating the hardware resources, click on the `Next` button. Here, you will find an option to create or add a virtual disk. Now, follow 3 simple steps: - Select the 2nd option saying `Use an Existing Virtual Hard Disk File` . - Click on the `File` icon. - Hit the `Add` button and select the file ending the`.vmdk` that you created recently. ![](https://itsfoss.com/content/images/2023/07/add-virtual-machine-disk-drive-in-VirtualBox-to-boot-from-USB-in-Linux.png) Once you select the file, it will show you the name of the file, select it and hit the `Choose` option: ![select the vmdk file](https://itsfoss.com/content/images/2023/07/select-the-vmdk-file.png) It will show you the file that has been selected to boot from. Click on the next and it will show the summery of choices you've made. Hit the `Finish` button: ![Finish the VM creation to boot from USB in VirtualBox in Linux](https://itsfoss.com/content/images/2023/07/Finish-the-VM-creation-to-boot-from-USB-in-VirtualBox-in-Linux.png) That's it! The VM has been created. To start the VM, first, select the VM and hit the start button: ![start the VM](https://itsfoss.com/content/images/2023/07/start-the-VM.png) As my USB had Ventoy, you can see, multiple distros listed here: ![Create Ventoy USB and boot from Virtual machine in Linux](https://itsfoss.com/content/images/2023/07/Boot-from-USB-in-VirtualBox-in-Linux.png) Pretty cool. Right? ### Step 3: Remove VM with vmdk file (optional) When I tried removing the vmdk file after deleting the VM, sure, it was getting deleted but whenever I tried creating a new file having the same name, it gave me an error saying the file already exists! So here, I will walk you through how you can remove the VM with the vmdk file. First, turn off the VM and remove it ![Remove VM from VirtualBox](https://itsfoss.com/content/images/2023/07/Remove-VM-from-VirtualBox.png) Now, if you try to remove the vmdk file [using the rm command](https://linuxhandbook.com/remove-files-directories/) and elevated privileges, you can remove it (but there's where the illusion starts). For example, here, I removed the IF.vmdk file: `sudo rm IF.vmdk` ![use rm command to remove vmdk file](https://itsfoss.com/content/images/2023/07/use-rm-command-to-remove-vmdk-file.png) And now, if I try to create a new vmdk file with the same name, it gives me an error saying the file already exists: ![unable to create vmdk file in Linux, file already exist](https://itsfoss.com/content/images/2023/07/unable-to-create-vmdk-file-in-Linux--file-already-exist.png) To remove the vmdk file, first, you have to unregister the file using the following: `sudo VBoxManage closemedium disk /path/to/MyDrive.vmdk` ![unregister vmdk file in Linux to remove it](https://itsfoss.com/content/images/2023/07/unregister-vmdk-file-in-Linux-to-remove-it.png) Once done, you can remove the file using the rm command and it will be removed easily: `sudo rm Filename.vmdk` And then, if you try to create a vmdk file with the same filename, you can do that: ![how to remove the vmdk file in Linux](https://itsfoss.com/content/images/2023/07/how-to-remove-the-vmdk-file-in-Linux.png) There you have it! ## More VM tips If you are looking for the fastest VM, you can use the combination of Qemu + KVM. I know it sounds complex. But to make things easy, we made a dedicated guide on how to install and use Qemu on Ubuntu including enabling shared folders, clipboard, and auto-resizing: [How to Install and Use Qemu on UbuntuLearn how to properly install Qemu in Ubuntu and then configure a Linux distro in VM.](https://itsfoss.com/qemu-ubuntu/)![](https://itsfoss.com/content/images/2023/04/install-qemu-on-ubuntu.png) ![](https://itsfoss.com/content/images/2023/04/install-qemu-on-ubuntu.png) I hope you will find this guide helpful.
16,215
GNOME 45 发布,弃用“活动”按钮
https://news.itsfoss.com/gnome-45-release/
2023-09-22T16:09:00
[ "GNOME" ]
https://linux.cn/article-16215-1.html
![](/data/attachment/album/202309/22/160637a5eeghw50ej20hwh.jpg) > > GNOME 桌面的最新版本已经发布。 > > > 我们见证了 GNOME 的不断演化,每次重大更新都会带来新的功能及改进。 在上一个版本中,[GNOME 44](https://news.itsfoss.com/gnome-44-release/) 推出了许多酷炫的特性,如今,GNOME 45 也紧跟其后,推出许多有益的优化。 下面让我们一探究竟。 ### GNOME 45:有何新变化? 尽管我们已经单独详述过 [GNOME 45 的亮点特性](/article-16150-1.html),我还是简洁回顾一下这次发布的所有相关详情。 * 系统设置的调整 * 新的工作空间指示器 * 新的或者更新的核心应用程序的引入 * Nautilus 的用户界面优化 > > **[GNOME 45 引入激动人心的更新](/article-16150-1.html)** > > > #### 新的工作空间指示器 ![](/data/attachment/album/202309/22/160945taqzg7roj8zgqj8g.gif) 根据我们 [之前的报道](https://news.itsfoss.com/gnome-activities-indicator/),GNOME 45 让 “<ruby> 活动 <rt> Activities </rt></ruby>” 按钮走向了历史。 如今,我们已经有了一个药丸状的动态指示器,能明了当前处于活动状态的工作空间,以及工作空间的数量。 这是一个微小但整齐的设计改动! #### 系统设置的调整 ![](/data/attachment/album/202309/22/160945hcxb4xiii6xseg5e.png) 在 GNOME 45 中,设置应用下方出现了全新的 “<ruby> 隐私 <rt> Privacy </rt></ruby>” 子菜单,现在各类选项展示得更有序。 “<ruby> 关于 <rt> About </rt></ruby>” 子菜单也被优化,现已通过 “<ruby> 系统详细信息 <rt> System Details </rt></ruby>” 菜单显示技术数据。除此之外,线上账户设置也在可用性上得到了提升。 #### 引入了新的核心应用 ![Loupe 图片查看器](/data/attachment/album/202309/22/160945cvqrsrszvysixxy0.jpg) GNOME 45 版本告别了 “<ruby> GNOME 之眼 <rt> Eye of GNOME </rt></ruby>” 图片查看器,转而采用 “<ruby> <a href="https://news.itsfoss.com/loupe-image-viewer/"> 放大镜 </a> <rt> Loupe </rt></ruby>” 应用,并摒弃了 “<ruby> 茄子 <rt> Cheese </rt></ruby>” 相机应用,全新引入了 “<ruby> <a href="https://news.itsfoss.com/gnome-snapshot/"> 快照 </a> <rt> Snapshot </rt></ruby>” 应用。 **原有的核心应用也得到了更新。** 就 “<ruby> 地图 <rt> Maps </rt></ruby>” 应用而言,出现了一些微小变动,如缩放按钮的调整以及侧边栏的重塑。 同样地, “<ruby> 天气 <rt> Weather </rt></ruby>” 应用的默认窗口大小被扩大,以便为所有温度计部件提供空间。 别忘了,“<ruby> 计算器 <rt> Calculator </rt></ruby>” 应用现已支持更多种类的货币,以及 “<ruby> 连接 <rt> Connections </rt></ruby>” 应用 可以在 RDP 连接中复制 / 粘贴文本、图片和文件。 #### ? Nautilus 的用户界面优化 ![](/data/attachment/album/202309/22/160946tr3vj0yrmjjjjs70.png) Nautilus 文件管理器已 **做了一些轻微的界面优化**,新的左侧边栏汉堡菜单使得侧边栏看起来比以前更醒目。 #### ?️ 其他改动与优化 除了我们述及的重点,下面还有一些其他值得注意的变化; * 文档扫描应用已迁移到 GTK4。 * 数个应用新增了视觉效果并改进了自适应表现。 * 在快速设置中新增了一个控制键盘背光的切换。 * 在 Shell 中新增了一个指示器,用于显示相机何时在活动状态。 如果你感兴趣,可参阅官方 [发布公告](https://release.gnome.org/45/) 了解更多详情。 ### 如何开始使用 GNOME 45 你可期待 GNOME 45 将在 [Fedora 39](https://news.itsfoss.com/fedora-39-features/) 及 [Ubuntu 23.10](https://news.itsfoss.com/ubuntu-23-10/) 上首次亮相。 在那之前,你可以通过在 [GNOME OS](https://os.gnome.org/) 上使用 [Boxes](https://wiki.gnome.org/Apps/Boxes) 或在你的 Arch 发行版上手动安装(当它在仓库中可用时)来尝试 GNOME 45。 请注意,GNOME OS 的主要目的是用于测试。 > > **[GNOME](https://www.gnome.org/getting-gnome/)** > > > ? 对于这次发布,你有何看法?是否还有其他期待? *(题图:MJ/f559d170-e20a-45a5-8d38-cd655ce7a955/)* --- via: <https://news.itsfoss.com/gnome-45-release/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Over the years, we have seen GNOME evolve regularly, with new features and improvements on offer alongside every major release. Last time, [GNOME 44](https://news.itsfoss.com/gnome-44-release/) offered some really cool features, and now the GNOME 45 release is following suit with many improvements on offer. Let's see what's in store for us. ## GNOME 45: What's new? Even though we have covered some of the best [features of GNOME 45](https://news.itsfoss.com/gnome-45/) separately, allow me to give you a quick recap with all the relevant details of this release. **System Settings Tweaks****New workspace indicator****Inclusion of New/Updated Core Apps****UI Improvements for Nautilus** [GNOME 45 Packs in Exciting Upgrades: Here’s What’s NewThe features and improvements that you can expect with GNOME 45. We’ve listed them here.](https://news.itsfoss.com/gnome-45/)![](https://news.itsfoss.com/content/images/2023/08/gnome-45-features-ft.png) ![](https://news.itsfoss.com/content/images/2023/08/gnome-45-features-ft.png) ### New Workspace Indicators ![gnome 45 indicators](https://news.itsfoss.com/content/images/2023/09/gnome-45-indicator-1.gif) GNOME 45 did make the "**Activities**" button out of fashion as per our [original coverage](https://news.itsfoss.com/gnome-activities-indicator/). Instead of the button, we now have a pill-shaped dynamic indicator to let you know about the active workspace and the number of workspaces. A subtle but a neat design change! ### System Settings Tweaks ![a screenshot of the privacy tab on gnome 45 settings menu](https://news.itsfoss.com/content/images/2023/09/GNOME_45_Release_1.png) GNOME 45 has bought about **a revamped “Privacy” menu** under the settings app, that now features the various options in a more organized manner than before. The “**About**” section has also been tweaked to now show technical information via a “**System Details**” menu. Other than that, the online accounts settings have also been improved for better usability. ### Inclusion of New Core Apps ![a screenshot of the loupe image viewer](https://news.itsfoss.com/content/images/2023/09/GNOME_45_Release_2.jpg) The GNOME 45 release bids a goodbye to the “Eye of GNOME” image viewer in favor of [Loupe](https://news.itsfoss.com/loupe-image-viewer/), and replaces the “Cheese” camera app in favor of [Snapshot](https://news.itsfoss.com/gnome-snapshot/). **Existing core apps have also been updated.** **In the case of Maps**, there are some subtle changes such as tweaks to the zoom buttons, and a reworked sidebar. Similarly, **the Weather app** features a bigger default window size to make space for all the thermometer widgets. Not to forget, the **Calculator app** now supports more currencies, and the **Connections app** can now copy/paste text, images, and files with RDP connections. ### 🎨 UI Improvements for Nautilus ![gnome 45 nautilus](https://news.itsfoss.com/content/images/2023/09/gnome-45-file-manager.png) The Nautilus file manager has **received a minimal UI tweak**, where a new hamburger menu in the left sidebar now makes the sidebar look more distinct than before. ### 🛠️ Other Changes and Improvements Other than the highlights we discussed, here are a few other changes worth noting; - The document scanner app has been ported to GTK4. - Various apps have received new visuals and improved adaptive behavior. - A new toggle was added for controlling the keyboard backlight in quick settings. - A new camera indicator was added to the shell for showing when the camera is active. If you are curious, you can refer to the official [release notes](https://release.gnome.org/45/?ref=news.itsfoss.com) to know more about all the details. **Suggested Read **📖 [Fedora 39 Features: It’s Time To Talk About Them!Fedora 39 is coming in hot! Learn what’s new here before you get it installed.](https://news.itsfoss.com/fedora-39-features/)![](https://news.itsfoss.com/content/images/2023/09/fedora-39-features.png) ![](https://news.itsfoss.com/content/images/2023/09/fedora-39-features.png) ## Get Started With GNOME 45 You can expect GNOME 45 to make a debut with [Fedora 39](https://news.itsfoss.com/fedora-39-features/) and [Ubuntu 23.10](https://news.itsfoss.com/ubuntu-23-10/). Until then, you can take GNOME 45 out for a spin by installing [GNOME OS](https://os.gnome.org/?ref=news.itsfoss.com) using [Boxes](https://wiki.gnome.org/Apps/Boxes?ref=news.itsfoss.com) or manually install it on your Arch distro (when it is available in the repo). Do keep in mind that GNOME OS is meant for testing purposes. *💬 What are your thoughts of this release? Were you expecting something more?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,217
Tagger 的新更新可让你更好地组织和标记音乐
https://news.itsfoss.com/tagger-2023-9-release/
2023-09-22T22:46:00
[ "音乐" ]
https://linux.cn/article-16217-1.html
![](/data/attachment/album/202309/22/224653c080ssjgi8ba808c.jpg) > > 使用 Tagger 来标记你的音乐? 现在,它增加了新功能和修复。 > > > Tagger 已发布新版本,其中包含大量有用的改进! 对于那些不知道的人来说,Tagger 是**一款专注于流行音乐文件类型的开源 [标签编辑器应用](https://en.wikipedia.org/wiki/Tag_editor)**,支持 MP3、OGG、FLAC、WAV 等音乐文件。 它可用于**向音乐文件添加重要的元数据**,例如专辑封面、艺术家/发行商信息、发行年份,甚至自定义属性。 让我们看看这个新版本的 Tagger 能提供什么。 ### ? Tagger V2023.9.1:有什么新变化? ![](/data/attachment/album/202309/22/224657o2wkosx9daaojgxh.png) Tagger 采用 C# 语言编写,**它出现自 2021 年底**,并且一直在定期进行改进。 在 **Tagger V2023.9.1** 版本中添加了多项改进。 首先,它包括了**更新的翻译**,要感谢 [Weblate](https://weblate.org/en/) 上的用户。 然后还有**新添加的功能**,可以在 Tagger 中**打开、管理和创建播放列表**。这是为了更容易地同时处理许多音乐文件,从而“<ruby> 音乐文件夹 <rt> Music Folder </rt></ruby>”现在被称为“<ruby> 音乐库 <rt> Music Library </rt></ruby>”。 接下来,**同步歌词时间戳现在以 “mm:ss.xx” 格式显示**,遵循 [LRC](https://en.wikipedia.org/wiki/LRC_(file_format)) 规范,并且可以指定 “**hh:mm:ss**” 和 “**mm:ss.xx**” 格式,允许 Tagger 对其进行转换。 此外,Tagger 现在在排序时**在音乐文件列表中显示标题**,为了获得更有条理的文件视图,**主窗口大小在应用重新启动时不会丢失**,并且 **LRC 文件现在可以正确导入**。 有关更多技术细节,你可以参考其 [发行说明](https://github.com/NickvisionApps/Tagger/releases/tag/2023.9.1)。 ### ? 下载Tagger V2023.9.1 你可以通过选择可用的软件包之一来获取最新版本的 Tagger,如下所示: * [Snap](https://snapcraft.io/tagger) * [Flatpak](https://flathub.org/apps/org.nickvision.tagger) * [AUR 包](https://aur.archlinux.org/packages/tagger) 对于 Ubuntu,你还可以运行以下命令来安装它: ``` sudo snap install tagger ``` > > ? 当我们谈论添加元数据的应用时,还有 [元数据清理器](https://itsfoss.com/metadata-cleaner/)。它允许你清除最流行的文件类型中的元数据,这与 Tagger 完全相反。 > > > ? 你以前用过 Tagger 吗? 你对此的体验如何? 在评论区分享你的观点。 *(题图:MJ/02d910b8-80d1-4802-8125-11ebc45287bf)* --- via: <https://news.itsfoss.com/tagger-2023-9-release/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Tagger has received a new release with plenty of useful improvements! For those not aware, Tagger is **an open-source tag editor app** that focuses on popular music file types such as MP3, OGG, FLAC, WAV, and more. It can be used to **add important metadata to a music file**, such as the album art, artist/publisher info, year of release, and even custom properties. Let's see what this new release of Tagger has to offer. ## 🆕 Tagger V2023.9.1: What's New? ![a screenshot of the tagger v2023.9.1 app](https://news.itsfoss.com/content/images/2023/09/Tagger.png) Written in the C# programming language, Tagger's **been around since late-2021**, and has been receiving improvements regularly. With this release, **Tagger V2023.9.1** has added several refinements. To start with, it includes **updated translations, **made possible thanks to the users on [Weblate](https://weblate.org/en/?ref=news.itsfoss.com). Then there's the **newly added ability** to **open, manage, and create playlists** within Tagger. This is meant to make it easier to handle many music files together, resulting in the “Music Folder” now being called “**Music Library**”. Next, **synchronized lyric timestamps are now shown in the “mm:ss.xx” format**, following the [LRC](https://en.wikipedia.org/wiki/LRC_(file_format)?ref=news.itsfoss.com) specifications, and both “**hh:mm:ss**” and “**mm:ss.xx**” formats can be specified, allowing Tagger to convert them. Furthermore, Tagger now **displays headers in the music files list** when sorting, for a more organized view of the files, the **main window size is not lost on app restart**, and **LRC files now get imported correctly**. For more technical details, you may refer to its [release notes](https://github.com/NickvisionApps/Tagger/releases/tag/2023.9.1?ref=news.itsfoss.com). ## 📥 Download Tagger V2023.9.1 You can grab the latest release of Tagger by opting for one of the available packages, as: For Ubuntu, you can also run the following command to get it installed: `sudo snap install tagger` [Metadata Cleaner](https://itsfoss.com/metadata-cleaner/?ref=news.itsfoss.com). It allows you to clean metadata off most popular file types, the entire opposite of Tagger. **Suggested Read **📖 [Metadata Cleaner: Remove Traces From Pictures & Docs in LinuxGetting rid of the metadata is essential for enhanced privacy. Metadata Cleaner is an open-source application for Linux that helps you do that. Let’s explore more here.](https://itsfoss.com/metadata-cleaner/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/wordpress/2022/03/metadata-cleaner.png) ![](https://itsfoss.com/content/images/wordpress/2022/03/metadata-cleaner.png) *💬 Have you used Tagger before? How is your experience with it? Share your thoughts in the comments.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,218
Linux 上的最佳白板应用程序
https://www.debugpoint.com/top-whiteboard-applications-linux/
2023-09-22T23:45:00
[ "白板" ]
/article-16218-1.html
![](/data/attachment/album/202309/22/234542niviqp0tqutnvi56.jpg) > > 我们将介绍几款可在 Linux 系统中使用的白板应用程序。我相信,这些信息对你将大有帮助。请继续阅读! > > > 一般而言,数字白板是一种大型互动显示面板的工具。比如:平板、大屏手机、触控笔记本和表面显示设备等,就是一些常见的白板设备类型。 假设教师使用了白板,你就可以使用触控笔、手写笔、手指甚至鼠标在设备屏幕上进行绘画、书写或操作元素。这意味着,你可以在白板上进行拖动、点击、删除和绘画,就如同用笔在纸上一样。 但是,要做到这一切,就需要一款软件来支持这些功能,即实现触控和显示之间的精细协调。 现在的市面上,有很多商业应用都能完成这项工作。然而,在这篇文章中,我们将会重点介绍一些自由且开源的、并且可在 Linux 系统中运行的白板应用程序。 ### Linux 系统白板应用程序佳选 #### 1、Xournal++ 在我们的推荐名单上,第一个就是 [Xournal++](https://xournalpp.github.io/)。我认为,这是此列表中最好的应用程序。它十分稳定,而且已经存在了一段时间。 Xournal++ 允许你进行书写、绘画,以及其他常见的在纸上进行的各种事情。它支持手写、自定义荧光笔、橡皮擦等工具。此外,它还有其他诸多功能,例如:支持图层,支持添加外部图像,支持添加音频,具有多页特性等。 该应用程序兼容几乎所有的压敏输入设备,例如 Wacom、Huion 和 XP-Pen。我曾在触摸板笔记本上进行过测试,经过少量设置修改后,它就可以正常工作了。因此,你可以开始使用任何你手头上的触控设备。 Xournal++ 是使用 C++ 和 GTK3 进行编写的。 ![Linux 下的 Xournal++ 白板应用程序](/data/attachment/album/202309/22/234707oi47v8lbvbgbwv9v.jpg) 对于 Linux 系统,你可以按下述步骤进行安装。此程序是完全免费的,且适用于 Linux、macOS 和 Windows 系统。如果你想在移动设备上尝试,也提供了 BETA 版本。 安装步骤: 该应用程序可以通过 AppImage、Snap、Flatpak 和 deb 包进行安装。同时,也可以通过 PPA 的方式,安装至基于 Ubuntu/Debian 的系统。 特别的是,还为 Fedora、SUSE 和 Arch 提供了专用的安装包。你只需要点击下方的链接,就可以按你所需的格式,下载相应的执行程序。 > > **[下载 Xournal++](https://xournalpp.github.io/installation/linux/)** > > > 更多信息: * [首页](https://xournalpp.github.io/) * [文档](https://xournalpp.github.io/guide/overview/) * [源代码](https://github.com/xournalpp/xournalpp/) #### 2、OpenBoard 我们接下来想要重点介绍的是 [OpenBoard](https://openboard.ch/)。这是一个简洁易用的白板绘画应用,它不会通过过多的选项干扰你的使用体验。 该软件非常适合初学者以及在线课程的初级学生来使用进行笔记。 OpenBoard 内置了丰富的功能,包括颜色、画刷、文本、简单的绘图形状,页面支持等等。此应用基于 Qt 技术构建。 ![OpenBoard](/data/attachment/album/202309/22/234717u1722712x4p49c1j.jpg) 安装步骤: 此应用仅为 Ubuntu 提供独立的 deb 包。你可以通过以下链接下载。 > > **[下载 OpenBoard](https://openboard.ch/download.en.html)** > > > 更多信息: * [主页](https://openboard.ch/) * [文档](https://openboard.ch/support.html) * [源代码](https://github.com/OpenBoard-org/OpenBoard) #### 3、Scrivano Scrivano 是一款新推出的基于 Qt 技术的白板应用。其设计理念强调易用性,能在记笔记和其他绘画活动中提供高效的功能表现。 它提供了一些独特的功能,如吸附到网格、创建自定义贴纸、填充笔触、激光选项等等。 此外,你还可以在此工具中导入 PDF 文件,并利用各种功能对其进行批注。 以下是一些值得关注的功能。 你可以在我们关于 [该应用官方评述](https://www.debugpoint.com/scrivano/) 中了解更多关于 Scrivano 的信息。 ![Scrivano 中的贴纸](/data/attachment/album/202309/22/234729eaxgwigogifhhh78.jpg) 你可以 [对你的系统进行 Flatpak 配置以使用 Flathub](https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/),然后点击下面的按钮,通过 [Flathub](https://flathub.org/apps/details/com.github.scrivanolabs.scrivano) 进行安装。 > > **[下载并安装 Scrivano](https://dl.flathub.org/repo/appstream/com.github.scrivanolabs.scrivano.flatpakref)** > > > 更多信息: * [主页](https://scrivanolabs.github.io/) * [Scrivano 评价](https://www.debugpoint.com/scrivano/) #### 4、Notelab [NoteLab](http://java-notelab.sourceforge.net/) 是一款具有十年历史的老牌白板应用。它是一个自由开源的应用,内含丰富的功能集,因此你可以理解这款应用的稳定性和广受欢迎的程度。 以下是其中的部分特性: * 此应用支持所有常用的图片格式作为导出选项,例如 SVG、PNG、JPG、BMP 等。 * 提供了可配置的笔和纸的自定义选项 * 内建的内存管理器,用于指定 NoteLab 所使用的内存量。 * 不同格式的纸张可供选择,如宽格式、大学格式和图形纸。 * 含所有标准绘图工具。 * 对任何笔记部分都可以进行调整大小、移动、删除、改变颜色等多种操作。 ![NoteLab](/data/attachment/album/202309/22/234740a6e6ce55e483w5dk.jpg) 然而,这是一个由 Java 编写并以 .jar 文件形式发布的应用,所以你需要 Java 运行环境来运行它。你可以参考我们的指南在 Linux 系统中安装 Java 或 JRE。 * [在基于 Ubuntu 的系统中安装 Java/JRE 的方法](https://www.debugpoint.com/2016/05/how-to-install-java-jre-jdk-on-ubuntu-linux-mint/) * [在 Arch Linux 中安装 Java/JRE 的方法](https://www.debugpoint.com/2021/02/install-java-arch/) 如何安装: NoteLab 提供了独立的可执行 .jar 文件,可以通过下方链接从 SourceForge 下载。请记住,要运行此应用,你需要 JRE。 > > **[下载 NoteLab](https://sourceforge.net/projects/java-notelab/files/NoteLab/)** > > > 更多信息: * [主页](http://java-notelab.sourceforge.net/) * [文档](http://java-notelab.sourceforge.net/features.html) #### 5、Rnote 我们此次要介绍的第五款应用叫做 [Rnote](https://github.com/flxzt/rnote)。Rnote 是一款在触屏设备上进行手写笔记的绝佳应用程序。这款应用基于矢量图像技术,不仅便于进行绘图和注释图片,还方便对 PDF 文件进行标注。它支持本地的 .rnote 文件格式,并提供了 png、jpeg、SVG 和 PDF 的导入/导出选项。 Rnote 最酷的一项特性是它支持 Xournal++ 的文件格式(即本列表的首款应用程序),这使它成为必备的工具。 Rnote 使用 GTK4 和 Rust 进行开发,非常适合在 GNOME 桌面以及各类 Linux 系统上运行。 需要注意的是,该应用程序目前仍在开发中。 ![基于 GTK4 和 Rust 的 Linux 白板应用 Rnote](/data/attachment/album/202309/22/234752ui5ol5igvo0f4oor.jpg) 如何安装: 此应用以 Flatpak 包的形式提供。你可以使用 [此指南](https://flatpak.org/setup/) 为你的 Linux 系统安装 Flatpak,然后点击下方的按钮进行安装。 > > **[安装 Rnote](https://dl.flathub.org/repo/appstream/com.github.flxzt.rnote.flatpakref)** > > > 更多信息: * [主页和源代码](https://github.com/flxzt/rnote) #### 6、Lorien [Lorien](https://github.com/mbrlabs/Lorien) 是一个能让你利用多种工具创造个性化笔记的理想数字笔记本软件。Lorien 是一个基于 Godot 游戏引擎的跨平台、自由开源的“无限画布绘图/笔记”应用。这款应用十分适合于快速记取头脑风暴会议中的笔记。 其工具箱相当标准,拥有自由手绘刷、橡皮擦、直线工具和选择工具等。你可以移动或删除你的笔划部分——这些在运行时会被视为点的集合进行渲染。 ![Lorien 白板应用程序 for Linux](/data/attachment/album/202309/22/234801ecc0jze3zz41nknf.jpg) 如何安装: 使用 Lorien 不需要安装。你可以从下面的链接下载一个自我包含的可执行文件(下载 tar 文件)。下载后,解压文件并双击即可运行。 > > **[下载 Lorien](https://github.com/mbrlabs/Lorien/releases)** > > > 更多信息: * [主页和源代码](https://github.com/mbrlabs/Lorien) #### 7、Rainbow Board Rainbow Board 是一款基于 Electron 和 React 的自由开源白板应用。通常,由于性能和臃肿的问题,人们并不喜欢 Electron 应用。但考虑到我们正在列出这个分类的应用,我认为值得一提。 它提供了一个标准的画布,支持触控和手写输入。工具箱包括刷子大小、颜色、填充颜色、字体以及撤销和重做操作。你可以将你的绘制结果导出为 PNG 或 SVG 文件。 ![Rainbow Board 白板应用 for Linux](/data/attachment/album/202309/22/234808kn3dmv23mrrvzfge.jpg) 如何安装: 此应用可以作为 Snap、Flatpak 或独立的 deb 安装程序下载。你可以从下面的链接中得到它们。 > > **[下载 Rainbow Board](https://www.electronjs.org/apps/rainbow-board)** > > > 更多信息: * [主页](https://harshkhandeparkar.github.io/rainbow-board/) * [源代码](https://github.com/HarshKhandeparkar/rainbow-board) ### 特别推荐 在这里,我想额外提到的两款绘图应用分别是 Vectr 和 Excalidraw。这两款应用都是基于网络的白板绘图应用。它们被单独归类是因为它们并非传统意义上的桌面应用。 因此,如果你不愿安装其他应用,或者你使用的学校或工作系统中无法进行安装,你可以选择在浏览器中使用这些网络应用。下面是它们的网址。 > > **[Vectr](https://vectr.com/)** > > > > > **[Ecxalidraw](https://excalidraw.com/)** > > > ### 结束语 以上是一些适用于 Linux 及其他操作系统的现代白板 [绘图](https://www.debugpoint.com/tag/digital-drawing) 应用。由于大流行病和居家工作环境的影响,你们许多人可能在使用笔和纸进行在线课程或会议的笔记记录。我相信这些软件会在你的学习和工作中提供帮助。 试一试这些软件,你肯定能找到最适合你的。对此清单如有任何评论或反馈,请在下方的留言区域告诉我。 干杯。 *(题图:MJ/373801b1-50f2-4078-8961-fcea78623f2f)* --- via: <https://www.debugpoint.com/top-whiteboard-applications-linux/> 作者:[Arindam](https://www.debugpoint.com/author/admin1/) 选题:[lkxed](https://github.com/lkxed) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
null
16,220
在 Ubuntu 上安装 VSCodium
https://itsfoss.com/install-vscodium-ubuntu/
2023-09-23T21:06:00
[ "VS Code", "VSCodium" ]
https://linux.cn/article-16220-1.html
![](/data/attachment/album/202309/23/210544rez2940i0z590669.jpg) > > 不满意 VS Code 中的遥测功能?安装 VSCodium,它是 VS Code 的 100% 开源克隆。 > > > [VSCodium](https://itsfoss.com/vscodium/) 是微软 VS Code 的“完全开源版本”。 它基本上是 [VS Code](https://code.visualstudio.com/) 的克隆,并去除了所有遥测痕迹。[遥测是用于收集有关应用使用情况的数据](https://code.visualstudio.com/docs/getstarted/telemetry)。许多开发人员使用它来深入了解改进他们的应用。 从外观和功能来看,这两个编辑器是相同的。 ![VSCodium 与 VS Code 相同](/data/attachment/album/202309/23/210610yaraknw5kipz3d5e.png) 在 Ubuntu 上安装 VSCodium 有三种方法: 1. 从发布页面下载 deb 文件进行安装。缺点是你无法轻松更新它,因为你必须再次下载新的 deb 文件。 2. 将第三方开发者仓库添加到你的系统中([VSCodium](https://vscodium.com/) 推荐的方式)。这样,你还可以获得 VSCodium 新版本的定期更新。 3. 使用 snap 版本。如果你不厌恶 Snap 软件包,这也许是最简单的方法。 我不会讨论第一种方法,因为它只是从 [发布页面](https://github.com/VSCodium/vscodium/releases) 下载并 [安装 deb 文件](https://itsfoss.com/install-deb-files-ubuntu/)。 我们来看看另外两种方法。 ### 方法 1:通过添加外部仓库来安装 VSCodium VSCodium 官方文档引用了 [Pavlo Rudy 的 GitLab 仓库](https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo),它为你提供了 VSCodium 的持续更新版本。 > > ? 虽然我在这里使用 Ubuntu,但这些步骤应该适用于 Debian 和其他基于 Debian 和 Ubuntu 的发行版。 > > > 以下是步骤。 [在 Ubuntu 中打开终端](https://itsfoss.com/open-terminal-ubuntu/) 并使用以下命令获取开发者的 GPG 签名密钥并将其添加到你的系统中。这样,你的 Ubuntu 系统将信任该开发人员签名的软件包。 ``` sudo wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg -O /usr/share/keyrings/vscodium-archive-keyring.asc ``` ![Adding the GPG signature key for VSCodium repository](/data/attachment/album/202309/23/210610soifdjqd3q3m3pz3.png) 下一步是将仓库添加到 [你系统的 sources.list 文件](https://itsfoss.com/sources-list-ubuntu/)。这样,你的 Ubuntu 系统就会知道应该从哪里获取包。 ``` echo 'deb [signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main'| sudo tee /etc/apt/sources.list.d/vscodium.list ``` ![Adding the VSCodium repo to sources.list](/data/attachment/album/202309/23/210611ojj3jjq67rfbfsqq.png) 正如你所看到的,该条目中的仓库是由你在其上方添加的密钥签名的。 更新本地包缓存,以便你的系统能够识别新添加的仓库中的包。 ``` sudo apt update ``` 现在你已准备好在 Ubuntu 上安装 VSCodium: ``` sudo apt install codium ``` 是的,该软件包名为 `codium`,而不是 `vscodium`。 ![](/data/attachment/album/202309/23/210611mj4jgpq1ffb7b6qj.png) 很好! 现在你可以在菜单中查找 “VSCodium” 并从那里启动应用: ![](/data/attachment/album/202309/23/210611q6pho6pbmhv1pbvp.png) 现在你可以在 VSCodium 中享受编码的乐趣。 #### 更新 VSCodium 好处是你已将仓库添加到系统中。当新的 VSCodium 发布时,仓库维护者会将新版本推送到仓库,你应该在系统更新程序中看到新版本。 换句话说,[保持你的 Ubuntu 系统更新](https://itsfoss.com/update-ubuntu/),你就会拥有更新版本的 VSCodium。 #### 删除 VSCodium 如果你出于某种原因不想再使用它,可以使用以下命令将其删除: ``` sudo apt remove codium ``` 你可以将仓库和签名添加到你的系统中。 > > ? 如果你对这些东西很在意,你也可以将它们从系统中删除。使用 sudo [在 Linux 终端中删除文件](https://itsfoss.com/delete-files-folders-linux/) 时要小心一些。 > > > ``` sudo rm /usr/share/keyrings/vscodium-archive-keyring.asc ``` 接下来,你还可以从 `sources.list` 中删除仓库: ``` sudo rm /etc/apt/sources.list.d/vscodium.list ``` 你的主目录中应该有一些与应用相关的本地文件,你可能还想删除它们: ``` rm -r ~/.config/VSCodium ``` ### 方法2:使用 Snap 安装 VSCodium > > ? Snap 方法适用于任何 Linux 发行版,而不仅仅是 Ubuntu,只要 [你在系统上启用了 Snap 支持](https://itsfoss.com/install-snap-linux/)。 > > > Snap 安装方法比较简单,步骤也较少。 打开终端并使用以下命令安装 VSCodium Snap 包: ``` sudo snap install codium --classic ``` 等待几秒钟,它会下载 Snap 软件包,然后进行安装。你将在屏幕上看到进度。 ![](/data/attachment/album/202309/23/210612ht773dkqd6bxz36d.png) **你如何 [更新 Snap 版本的 VSCodium](https://itsfoss.com/snap-update/)**?Snap 应用每天自动更新多次。但是,如果应用正在运行,那么不会更新。 因此,你也可以关闭任何正在运行的 VSCodium 实例并运行此命令来强制更新(如果有任何新版本): ``` sudo snap refresh codium ``` 如果你不喜欢它,可以使用以下命令轻松删除它: ``` sudo snap remove codium ``` ### VS Code VS. VSCodium 主要区别在于,VSCodium 从 VS Code 中移除了遥测部分。除此之外,它就是这个微软项目的克隆版,在外观和功能上与著名的 VS Code 完全相同。 对于某些人来说,遥测可能是一个障碍,因此这个项目在开源社区中颇受欢迎。 下面是一篇关于 [VS Code 遥测问题](https://www.roboleary.net/tools/2022/04/20/vscode-telemetry.html)的好文章。 > > **[VS Code - 遥测技术是怎么回事?](https://www.roboleary.net/tools/2022/04/20/vscode-telemetry.html)** > > > 如果你能接受遥测部分,你可以 [在 Ubuntu 上轻松安装 VS Code](https://itsfoss.com/install-visual-studio-code-ubuntu/)。这确实可以是你的选择。 希望本教程对你在 Ubuntu 和其他基于 Debian 的发行版上安装 VSCodium 有所帮助。请在评论区留下你的反馈意见。 *(题图:MJ/352e50f1-3ae2-4fe2-9a32-b75d1b5f0c73)* --- via: <https://itsfoss.com/install-vscodium-ubuntu/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) [VSCodium](https://itsfoss.com/vscodium/) is the 'complete open source version' of Microsoft's VS Code. It's basically a clone of the [VS Code](https://code.visualstudio.com/) that removes any signs of telemetry. The [telemetry is used for collecting data](https://code.visualstudio.com/docs/getstarted/telemetry) on the usage of the application. Many developers use it to get an insight on improving their application. Look and feature wise, the two editors are identical. ![VSCodium interface](https://itsfoss.com/content/images/2023/09/vscodium-interface.png) There are three ways to install VSCodium on Ubuntu: - Install it by downloading the deb file from the release page. The downside is that you cannot easily update it as you have to download the new deb file again. - Add a third-party developer repository (recommended by [VSCodium](https://vscodium.com/)) to your system. This way, you also get regular updates for the new releases of VSCodium. - Use the snap version. Perhaps the easiest way if you don't have an aversion to Snap packages. I won't discuss the first method, as it is just downloading and [installing the deb file](https://itsfoss.com/install-deb-files-ubuntu/) from the [release page](https://github.com/VSCodium/vscodium/releases). Let's see the other two methods. ## Method 1: Installing VSCodium by adding external repo The official VSCodium documentation refers to a [GitLab repository by Pavlo Rudy](https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo) that gives you a continuous update version of VSCodium. Here are the steps. [Open a terminal in Ubuntu](https://itsfoss.com/open-terminal-ubuntu/) and use the following command to get the GPG signature key of the developer and add it to your system. This way, your Ubuntu system will trust the packages that are signed by this developer. ``` sudo wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg -O /usr/share/keyrings/vscodium-archive-keyring.asc ``` ![Add the GPG signature key for VSCodium repository](https://itsfoss.com/content/images/2023/09/add-vscodium-signature-key.png) The next step is to add the repository to [your system's sources.list file](https://itsfoss.com/sources-list-ubuntu/). This way, your Ubuntu system will know from where it should get the package from. ``` echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' | sudo tee /etc/apt/sources.list.d/vscodium.list ``` ![Adding the VSCodium repo to sources.list in Ubuntu](https://itsfoss.com/content/images/2023/09/add-vscodium-repo-ubuntu.png) As you can see, the entry mentions that the repository is signed by the key you had added just above it. Update the local package cache so that your system is aware of the packages from the newly added repository. `sudo apt update` Now you are ready to install VSCodium on Ubuntu: `sudo apt install codium` Yes, the package is called `codium` , not `vscodium` . ![](https://itsfoss.com/content/images/2023/09/install-vscodium-ubuntu.png) Great! Now you can look for VSCodium in the menu and start the application from there: ![](https://itsfoss.com/content/images/2023/09/vscodium-ubuntu.png) And now you can enjoy coding in VSCodium. ### Updating VSCodium The good thing is that you have added a repository to your system. When a new VSCodium is released, the repository maintainer pushes the new version to the repository and you should see the new version in the system updater. In other words, [keep your Ubuntu system updated](https://itsfoss.com/update-ubuntu/) and you should have the newer version of VSCodium. ### Removing VSCodium If you don't want to use it any more for some reason, you can remove it using this command: `sudo apt remove codium` You may keep the repository and signature added to your system. [deleting file in the Linux terminal](https://itsfoss.com/delete-files-folders-linux/)with sudo. `sudo rm /usr/share/keyrings/vscodium-archive-keyring.asc` Next, you could also remove the repository from the sources.list: `sudo rm /etc/apt/sources.list.d/vscodium.list` There should be some local, application related files in your home directory, you may want to delete them as well: `rm -r ~/.config/VSCodium` ## Method 2: Install VSCodium using snap [you have snap support enabled on the system](https://itsfoss.com/install-snap-linux/). The snap installation method is rather easier and involves less steps. Open a terminal and use the following command to install VSCodium snap package: `sudo snap install codium --classic` Wait for some seconds as it downloads the Snap package and then installs it. You'll see the progress on the screen and ![Install VSCodium using Snap in Ubuntu](https://itsfoss.com/content/images/2023/09/snap-install-codium.png) **How do you **? Snap applications are updated automatically multiple times a day. However, the application won't be updated if it's running. **update the snap version**of VSCodium So, alternatively, you can close any running instance of VSCodium and run this command to force an update (if there is any new version): ``` sudo snap refresh codium ``` If you don't like it, you can easily remove it with the command below: ``` sudo snap remove codium ``` ## VS Code VS VSCodium The major difference is that VSCodium removes the telemetry part from the VS Code. Otherwise, it's a clone of the Microsoft's project and looks and works identical to the famous VS Code. The telemetry could be a dealbreaker for some, and hence this project has a considerable popularity in the open source community. Here's a good take on the [VS Code telemetry issue](https://www.roboleary.net/tools/2022/04/20/vscode-telemetry.html). [VS Code - What’s the deal with the telemetry?VS Code collects telemetry data to help understand Microsoft how to improve the product. Is it above board? Can I turn it off completely?](https://www.roboleary.net/tools/2022/04/20/vscode-telemetry.html)![](https://www.roboleary.net/assets/img/blog/2022-04-20-vscode-whats-the-deal-with-telemetry/cover.jpg) ![](https://www.roboleary.net/assets/img/blog/2022-04-20-vscode-whats-the-deal-with-telemetry/cover.jpg) If you are okay with the telemetry part, you can [install VS Code on Ubuntu as easily](https://itsfoss.com/install-visual-studio-code-ubuntu/). It's really your choice. I hope you find this tutorial helpful in installing VSCodium on Ubuntu and other Debian-based distributions. Please leave your feedback in the comment sections.
16,221
如何在 Linux 下使用 WebP 图像
https://www.debugpoint.com/view-webp-ubuntu-linux/
2023-09-23T22:11:00
[ "WebP" ]
/article-16221-1.html
![](/data/attachment/album/202309/23/221007y1kza44qxd68fq6t.jpg) 本文将详细介绍如何在 Ubuntu 和其他 Linux 发行版中转换和查看 WebP 图像,主题内容涵盖了你所需知道的全部信息。 ### WebP 图像格式的定义 2010 年 9 月,谷歌提出了 WebP 图像格式,其愿景是完全替代 JPEG、PNG 和 GIF 文件格式。就如你所见,WebP 是一个全能型的格式,继承了先前压缩算法的所有特性,支持有损和无损的动画以及透明度。 除此以外,WebP 基于块预测技术,它是互联网上推荐使用的图像格式。由于其文件大小明显更小、图象质量更好,WebP 已经成为了为网站提供图像的现代化标准。 ### 现状简述 现在,几乎所有的主流 Web 浏览器都开始支持 WebP,也就是说你可以在包括 Chromium、Chrome、Firefox、Brave、Vivaldi、Safari 和 Edge 在内的热门浏览器中查看这种格式的图像。 然而,要从现有的 JPG 和 PNG 文件创建 WebP 图像,你需要安装谷歌开发的 [WebP](https://developers.google.com/speed/webp) 库。另外,Linux 发行版的文件管理器暂时还不能直接显示该格式的图像。 为了与 WebP 实现无缝集成和提供良好的用户体验,各个组件必须协同工作。操作系统需要的是 WebP 的核心库。此外,文件管理器和图像查看器则需要能识别 `*.webp` 文件类型并进行加载。 这些为用户提供了一致的体验。由于 WebP 是新的标准,正在广泛施行和应用,你可能需要在 Linux 下执行一些额外的步骤以便运用这种技术。 另一方面,Windows 10 和 11 现在已经默认支持 WebP,包括其新的图像查看器功能。 因此,本篇文章将探讨如何在 Linux 系统下浏览、创建以及转换 WebP 图像的问题。 ### 如何查看 WebP 图像 #### 针对 Ubuntu、Linux Mint 及相关发行版 要查看图像,首先需要一个加载器。文件管理器或图像查看器会使用这个加载器库来实现 WebP 图像的显示。然而,在 Ubuntu Linux 中,默认情况下并未提供 WebP 图像加载器。因此,你需要通过下列指令安装 `webp-pixbuf-loader` 库,此库能帮助 Ubuntu 中的 GTK 应用程序显示 WebP 图像。 ``` sudo add-apt-repository ppa:helkaluin/webp-pixbuf-loadersudo apt updatesudo apt install webp-pixbuf-loader ``` 如果你有兴趣了解 GDK 库如何在显示服务器(例如 [X.Org](http://X.Org))和 GTK 组件间进行协作,可以参考 [这个页面](https://docs.gtk.org/gdk-pixbuf/)。 #### openSUSE Leap 和 Tumbleweed 的软件包在 [这里](https://software.opensuse.org/package/webp-pixbuf-loader) 提供。访问页面并点击 “<ruby> 专家下载 <rt> Expert Download </rt></ruby>” 进行安装即可。 #### Arch Linux 在 Arch Linux 中,这个软件包在 [社区仓库](https://archlinux.org/packages/community/x86_64/webp-pixbuf-loader/) 里有提供。因此,你可以通过以下的命令方便地进行安装: ``` sudo pacman -S webp-pixbuf-loader ``` #### Fedora Linux 以及 RHEL 对于 Fedora 以及其他相关的发行版,可以使用如下的指令进行安装: ``` sudo dnf install webp-pixbuf-loader ``` 安装完成以后,你可以选择**重新启动你的计算机**。 现在,我们来到了最有趣的部分。只要导航到任何包含 WebP 图像的目录,通过缩略图或者默认的图像查看器,你应该就能看到这些图像了。 以下是一个示例,展示了在 Ubuntu 22.04 LTS 中带有 WebP 图像的 Nautilus 文件管理器在之前和之后的界面。 ![GNOME Files (Nautilus) with WebP file - before](/data/attachment/album/202309/23/221114af9s4he02646wv0s.png) ![GNOME Files (Nautilus) with WebP file - after](/data/attachment/album/202309/23/221114ygzy1v1hdgsvs0sq.png) ### 在文件管理器/图像查看器中查看 WebP 图像 #### GNOME & Nautilus 对于 GNOME 桌面环境,Nautilus 文件管理器可以配合我在之前章节针对 Ubuntu/Fedora 等系统所解释的步骤正常工作。 #### Thunar 桌面(基于 Xfce 的发行版)下的 WebP 图像查看 尽管 Thunar 在 Xfce 桌面环境下默认就可展示缩略图,但默认的图像查看器 Ristretto 不能打开 WebP 格式的文件。因此,你首先需要安装我在先前章节中提及的一些软件包(例如针对 Ubuntu/Fedora 或 Arch 的包)并重启。然后,你可以通过改变默认的 .webp 文件类型关联,使用 Ristretto 查看器打开这些图像。 ![Thunar and Ristretto Image Viewer shows webp image](/data/attachment/album/202309/23/221311nw2w0n7ne75wccn8.jpg) #### KDE Plasma - Dolphin 文件管理器及 Gwenview 图像查看器 KDE 默认的图像查看器 Gwenview 原生支持 WebP 格式,因此,你无需额外的安装步骤就可以查看 WebP 图像。另外,Dolphin 文件管理器也可以很好地展示 WebP 格式的缩略图。 ![Dolphin and Gwenview displaying a sample WebP image on KDE Plasma](/data/attachment/album/202309/23/221319vu1uui5kzuku5azi.jpg) #### PCManFMQt(基于 LXQt 的发行版)下的 WebP 图像查看 如果你使用的是 Lubuntu,那你应该可以使用 LXImage 查看器打开 WebP 图像,因为这款查看器默认就支持 WebP。同样,PCManFMQt 文件管理器也能默认展示 WebP 图像的缩略图。 ![PCManFM-Qt and LXImage](/data/attachment/album/202309/23/221327gwji408w9g90zlww.jpg) #### Nemo 文件管理器 从 [Linux Mint](https://www.debugpoint.com/linux-mint/) 的 [Mint 21 “Vanessa”](https://debugpointnews.com/linux-mint-21-systemd-oom/) 版本开始,Nemo 文件管理器也将支持 WebP。你也可以通过上述的 PPA 方案在 Linux Mint 中查看 WebP 图像,直到新的 Mint 正式版本发布。 ### 使用其它应用程序查看 WebP 图像(推荐方式) 首先,著名的光栅图形编辑器 **GIMP** 在 2.10 版本及以后的版本中,已经支持打开和保存 WebP 格式的图像(目前在所有的 Linux 发行版中都已经可用)。 其次,除了你的桌面环境自带的图像查看器外,还有一些其他支持 WebP 图像格式的查看器,如: * [Qview](https://interversehq.com/qview/download/) — 一款极简的图像查看器 * [gThumb](https://flathub.org/apps/details/org.gnome.gThumb) — 一款基于 GTK 的图像查看器,同时也提供 [Flatpak 版本](https://flathub.org/apps/details/org.gnome.gThumb) 最后,[LibreOffice 7.4](https://www.debugpoint.com/libreoffice-7-4/) 为其所有的组件(比如 Writer、Calc、Draw 和 Impress)带来 [对 WebP 格式的原生支持](https://cgit.freedesktop.org/libreoffice/core/commit/?id=60eaa424c5e213f31227008e1ed66a646491a360),支持这类图像的导入和导出。 ### 如何将 WebP 图像转换为 JPG 或 PNG 格式 现在,你已经知道了如何查看 .webp 格式的文件,再来学习如何转换这类文件应该会很有用。 首先,使用以下命令为 Ubuntu 或 Fedora Linux 系统,包括其他相关的发行版安装 webp 包。如果你需要一个不需要安装就能在所有发行版和操作系统上执行的预编译版本,可以访问 [这个页面](https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html) 并下载最新的 zip 文件。 对于 Ubuntu 和相关的发行版: ``` sudo apt install webp ``` 对于 Fedora 和相关的发行版: ``` sudo dnf install libwebp ``` **安装完成后**,使用以下命令可以将 WebP 格式的图像转换为 JPG 或 PNG 格式。记得根据你的实际情况,修改文件名和路径。 ``` dwebp image1.webp -o image1.png ``` ### 把 JPEG 或 PNG 图像转换为 WebP 格式 如果需要把一张 JPEG 或 PNG 格式的图像转化为 WebP 格式,你可以使用 `cwebp``(WebP 编码器)命令如下: ``` cwebp -q <压缩因数> <输入图像> -o <输出图像> ``` 例如,你可以使用下面的示例命令,它将 `image1.png` 转换为使用 80 的压缩因子的 `image1.webp`: ``` cwebp -q 80 image1.png -o image1.webp ``` ### 把 GIF 图像转换为 WebP 图像 一个在 WebP 格式中常被忽视的特点是它支持动画。因此,可以轻松将 WebP 格式用来保存具有动画效果的 GIF 文件。使用下面的命令就能把一个已有的 GIF 文件转换为 WebP 文件。 ``` gif2webp input_file.gif -o output_file.webp ``` 你可以访问 [这个页面](https://developers.google.com/speed/webp/download) 以获取更多关于上述工具和其他选项的信息。 ### 结语 虽然 WebP 格式自首次发布以来已经有十年的时间了,Linux 桌面环境适应并支持 WebP 图像格式却并没有那么快。我相信以后 WebP 格式的支持应该会变成基本的,你甚至可能不需要进行额外的调整就能查看或保存 WebP 文件了。 我希望这篇文章可以帮你了解并掌握如何在工作流程中更好地使用 WebP 格式。 那么,你现在是怎么处理 WebP 格式图像的呢?欢迎在下方评论区分享你的经验。 *(题图:MJ/2541dab1-f071-4836-a34e-81c085c4d1ff)* --- via: <https://www.debugpoint.com/view-webp-ubuntu-linux/> 作者:[Arindam](https://www.debugpoint.com/author/admin1/) 选题:[lkxed](https://github.com/lkxed) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
null
16,223
在 Linux 上的 VirtualBox 中从虚拟机访问 USB
https://itsfoss.com/virtualbox-access-usb/
2023-09-25T00:27:00
[ "USB", "VirtualBox" ]
https://linux.cn/article-16223-1.html
![](/data/attachment/album/202309/25/002722v04rbi1g34084gf1.jpg) > > 你完全可以从虚拟机内部访问 USB 存储器。如果你使用的是 Linux 上的 VirtualBox,下面将介绍如何做到这一点。 > > > 当你插入 USB 时,你的宿主操作系统可以轻松访问它并使用其中的文件。这并不奇怪。 如果你在 Linux 上使用带有 VirtualBox 的虚拟机,那么可以付出一些努力并从虚拟机访问插入物理机的 USB。 让我逐步引导你了解如何在 VirtualBox VM 中访问 USB 磁盘。 ### 如何在 VirtualBox VM 中访问 USB 驱动器 默认情况下,你无法使用 VirtualBox 访问 USB 驱动器,因为你必须安装扩展包管理器,此外,还有一些配置部分。 这就是我将本教程分为三个简单步骤的原因。那么让我们从第一步开始。 #### 步骤 1:安装 VirtualBox 扩展包(在主机上) 这是本教程中最重要的一步,因为你将安装 VirtualBox 的扩展,这将使你能够在虚拟机中使用 USB 驱动器。 > > ? 你应该安装与你安装的 VirtualBox 版本相同版本的扩展包。 > > > 要安装 VirtualBox 扩展包,只需访问 [VirtualBox 官方下载页面](https://www.virtualbox.org/wiki/Downloads),向下滚动一点,你将找到下载扩展包的选项: ![](/data/attachment/album/202309/25/002742hqro4rbjz0vvr0z8.png) 下载完扩展包后,请执行 3 个简单步骤: * 转到 “<ruby> 文件 <rt> File </rt></ruby>” > “<ruby> 工具 <rt> Tools </rt></ruby>” > “<ruby> 扩展包管理器 <rt> Extension Pack Manager </rt></ruby>” * 点击 “<ruby> 安装 <rt> Install </rt></ruby>” 按钮 * 从文件管理器中选择下载的文件: ![](/data/attachment/album/202309/25/002743tolba6zq977e6w7g.png) 它将打开一个新的提示来安装扩展包,你所要做的就是点击“安装”按钮并接受条款和条件: ![](/data/attachment/album/202309/25/002744w3npgcf9ag2i3fau.png) 我们就完成了扩展包的安装。 #### 步骤 2:将用户添加到 vboxusers 组(在宿主机上) 要在 VirtualBox 中使用 USB 驱动器,你的当前用户需要位于 `vboxusers` 组中。 我知道这听起来有点复杂,但 [将用户添加到组](https://learnubuntu.com/add-user-group/) 是一个命令过程,将用户添加到 `vboxusers` 组可以通过以下方式完成: ``` sudo usermod -aG vboxusers $USER ``` **完成这两个步骤后,重启系统以使这些步骤生效。** #### 步骤 3:将 USB 驱动器添加到虚拟机 > > ? 在为特定虚拟机添加 USB 之前,请确保其已关闭(未保存),否则你将无法按照给定的说明进行操作。 > > > 要为虚拟机添加 USB,你必须遵循以下简单步骤: * 选择你想要使用 USB 的虚拟机并点击 “<ruby> 设置 <rt> Settings </rt></ruby>” * 转到 “USB” 选项卡 * 选中 “<ruby> 启用 USB 控制器 <rt> Enable USB Controller </rt></ruby>” 框并单击 “+” 按钮选择 “USB”: ![](/data/attachment/album/202309/25/002744pyri44afzafxfhy6.png) 这就好了!现在你可以启动虚拟机,并且 USB 驱动器应该出现在文件管理器中。就我而言,它是 Ubuntu,所以它看起来像这样: ![](/data/attachment/album/202309/25/002745bfgkfokfyqxyfodd.png) ### 更多 USB 和 VM 技巧 如果你在虚拟机中使用 USB 看起来很酷,那么在虚拟机中从 USB 启动就更酷了!这里有一个关于 [如何在 VirtualBox 中从 USB 驱动器启动](https://itsfoss.com/virtualbox-boot-from-usb/) 的详细指南: > > **[如何在 VirtualBox 中从 USB 驱动器启动](https://itsfoss.com/virtualbox-boot-from-usb/)** > > > 我希望本指南对你有所帮助。 *(题图:MJ/d9a1b4b5-30ec-4019-979f-b258a1fc075f)* --- via: <https://itsfoss.com/virtualbox-access-usb/> 作者:[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) When you plug in a USB, your host OS can easily access it and use the files on it. That's not a surprise. If you are using virtual machines with Virtual Box on Linux, you can put some effort and access the USB plugged in to your physical machine from the VM. Let me walk you through step-by-step how you can access a USB disk in VirtualBox VM. ## How to access a USB drive in VirtualBox VM By default, you can not use VirtualBox to access the USB drive as you have to install the extension pack manager and additionally, a little configuration part is also there. This is the reason why I've divided this tutorial into three easy steps. So let's start with the first one. ### Step 1: Install the VirtualBox extension pack (on host) This is the most important step of this tutorial as you are about to install an extension of VirtualBox which will enable you to use a USB drive in a VM. To install the VirtualBox extension pack, simply visit the [official download page of VirtualBox](https://www.virtualbox.org/wiki/Downloads), scroll down a bit and there you will find an option to download the extension pack: ![download VirtualBox extension pack](https://itsfoss.com/content/images/2023/09/download-VirtualBox-extension-pack.png) Once you are done downloading the extension pack follow 3 simple steps: - Go to `File` >`Tools` >`Extension Pack Manager` - Hit the `Install` button - Select the downloaded file from the file manager: ![](https://itsfoss.com/content/images/2023/09/Install-VirtualBox-extension-pack-to-use-USB-in-VM.png) It will open a new prompt to install the extension pack where all you have to do is hit the Install button and accept the terms and conditions: ![](https://itsfoss.com/content/images/2023/09/Install-VirtualBox-extension-pack.png) And we are done with the installation of the extension pack. ### Step 2: Add the user to the vboxusers group (on host) To use a USB drive in VirtualBox, your current user needs to be in the `vboxusers` group. I know it sounds a little complex but[ adding a user to the group](https://learnubuntu.com/add-user-group/) is one command process and to add your user to `vboxusers group can be done by following: `sudo usermod -aG vboxusers $USER` **Once you are done with these two steps, reboot your system to take effect from the steps.** **Step 3: Add USB drive to VM ** To add USB for VM, you have to follow the given simple steps: - Select the VM on which you want to use USB and hit `Settings` - Go to `USB` tab - Check the `Enable USB Controller` box and select the USB by clicking on`+` button: ![Enable USB drive for VM in VirtualBox](https://itsfoss.com/content/images/2023/09/Enable-USB-drive-for-VM-in-VirtualBox.png) And that's it! Now you can start your VM and the USB drive should reflect in the file manager. In my case it was Ubuntu, so it looked like this: ![Use USB drive in VirtualBox VM](https://itsfoss.com/content/images/2023/09/Use-USB-drive-in-VirtualBox-VM-1.png) ## More USB and VM trick If using USB in a VM looks cool to you, booting from it in the VM is even cooler! And here's a detailed guide on [how to boot from a USB drive in VirtualBox](https://itsfoss.com/virtualbox-boot-from-usb/): [Boot From a USB Drive in VirtualBox in LinuxYou can use a live Linux USB with virtual machines in VirtualBox. It saves you the annoyance of rebooting your host machine.](https://itsfoss.com/virtualbox-boot-from-usb/)![](https://itsfoss.com/content/images/2023/09/boot-from-usb-in-vbox.png) ![](https://itsfoss.com/content/images/2023/09/boot-from-usb-in-vbox.png) I hope you will find this guide helpful.
16,224
arm vs AArch64 vs amd64 vs x86_64 vs x86:有什么区别?
https://itsfoss.com/arm-aarch64-x86_64/
2023-09-25T09:28:00
[ "架构", "CPU", "ISA" ]
https://linux.cn/article-16224-1.html
![](/data/attachment/album/202309/25/092727ilaax5z7dexxhxop.jpg) > > 当涉及到 CPU 的时候,有许多术语:AArch64、x86\_64、amd64、arm 等等。了解它们是什么以及它们之间的区别。 > > > 当你查看数据表或软件下载页面时是否被 `ARM`、`AArch64`、`x86_64`、`i386` 等术语混淆?这些被称为 CPU 架构,我会帮你深入了解这个计算话题。 以下的表将为你总结每个字符串所代表的意义: | CPU 架构 | 描述 | | --- | --- | | **`x86_64`** /`x86`/`amd64` | 64 位 AMD/英特尔 CPU 的别称 | | **`AArch64`** /`arm64`/`ARMv8`/`ARMv9` | 64 位 ARM CPU 的别称 | | **`i386`** | 32 位 AMD/英特尔 CPU | | **`AArch32`** /`arm`/`ARMv1` 到 `ARMv7` | 32 位 ARM CPU 的别称 | | **`rv64gc`** /`rv64g` | 64 位 RISC-V CPU 的别称 | | **`ppc64le`** | 64 位 PowerPC CPU,**小端字节序存储** | 从左到右是使用该术语来描述 CPU 架构超过其右侧其他可选用术语的偏好。 从左到右是使用该术语描述 CPU 架构的优先级,使用左侧的而不是其右侧的其他可供选择的术语。 如果你像我一样是个极客,并想要更深入地解释,请继续阅读! ### 概述:CPU 架构 通常来说,我之前列出的术语是描述 CPU 架构的。但严格讲,它们被计算机工程师视为 CPU 的 <ruby> 指令集架构 <rt> Instruction Set Architecture </rt></ruby>(ISA)。 CPU 的指令集架构定义了 CPU 如何解析二进制代码中的 1 和 0。 这些 CPU 的 ISA 有几个主要的类别: * x86(AMD/英特尔) * ARM * RISC-V * PowerPC(IBM 仍在使用) 当然,还有更多种类的 CPU ISA,比如 MIPS、SPARC、DEC Alpha 等等。但我列出的这些至今仍然被广泛使用(以某种形式)。 上述列出的 ISA 主要根据 *内存总线的宽度* 分为至少两个子集。内存总线的宽度指的是 CPU 和 RAM 一次能传输的位数。内存总线有很多种宽度,但最常见的是 32 位和 64 位。 > > ? 32 位的 CPU ISA 要么是已经过时的历史产物,被留下来要么只是为了支持旧的系统,要么只运用在微控制器中。可以说,**所有新的硬件都已经是 64 位的了**,特别是那些面向消费者的硬件。 > > > ### x86(AMD/英特尔) x86 CPU 的指令集架构主要源于英特尔,因为英特尔是最初搭配 8085 微处理器创建了它。8085 微处理器的内存总线宽度为 16 位。而后来,AMD 加入了这个领域,并且一直紧随英特尔的步伐,直到 AMD 创建出了自己的超集 64 位架构,超过了英特尔。 x86 架构的子集如下: * `i386`:如果你拥有的是 2007 年之前的 CPU,那么这可能就是你的 CPU 架构。它是现在使用的 AMD/英特尔的 x86 架构的 32 位“版本”。 * `x86_64`/`x86`/`amd64`:这三个术语在不同的项目中可能会被交替使用。 但它们都是指 x86 AMD/英特尔架构的 64 位“版本”。无论如何,`x86_64` 这个字符串比 `x86` 和 `amd64` 使用得更广泛(也更受欢迎)。例如,FreeBSD 项目称 64 位的 x86 架构为 `amd64`,而 Linux 和 macOS 则称之为 `x86_64`。 > > ? 由于 AMD 在创造 64 位 ISA 上超越了英特尔,所以一些项目(比如 FreeBSD)把 x86 的 64 位版本称为 `amd64`。**但更被广泛接受的术语还是 x86\_64**。 > > > 对于 CPU ISA,“x86” 这个字符串是一种特殊的情况。你要知道,在从 32 位的 x86(`i386`)到 64 位的 x86(`x86_64`)的过渡过程中,CPU 制造商确保了 CPU 能够运行 32 位 *和* 64 位指令。所以,有时你可能会看到 `x86` 也被用来意指“这款产品只能运行在 64 位的计算机上,但如果该计算机能运行 32 位指令,那么你也可以在它上面运行 32 位的用户软件”。 这种 x86 的模糊性——也就是诸如能同时运行 32 位代码的 64 位处理器——其主要用于和存在于运行在 64 位处理器上的,但是允许用户运行 32 位软件的操作系统,Windows 就通过这种被称作“兼容模式”的特性运用了这种方式。 汇总一下,由 AMD 和 英特尔 设计的 CPU 有两种架构:32 位的(`i386`)和 64 位的(`x86_84`)。 #### 其它的英特尔 `x86_64` ISA 实际上有几个子集。这些子集都是 64 位,但它们新添加了诸如 SIMD(<ruby> 单指令多数据 <rt> Single Instruction Multiple Data </rt></ruby>)指令等功能。 * `x86_64-v1`:这是大多数人都熟知的基础 `x86_64` ISA。当人们谈论 `x86_64` 时,他们通常指的就是 `x86_64-v1` ISA。 * `x86_64-v2`:此版本新增了更多如 SSE3(<ruby> 流式 SIMD 扩展版本 3 <rt> Streaming SIMD Extensions 3 </rt></ruby>)之类的指令扩展。 * `x86_64-v3`:除了基础指令外,还新增了像 AVX(<ruby> 高级矢量扩展 <rt> Advance Vector eXtensions </rt></ruby>)和 AVX2 等指令。这些指令可以**使用高达 256 位宽的 CPU 寄存器**!如果你能够有效利用它们,就能大规模并行处理计算任务。 * `x86_64-v4`:这个版本在 `x86_64-v3` ISA 的基础上,迭代了更多的 SIMD 指令扩展,比如 AVX256 和 AVX512。其中,AVX512 可以**使用高达 512 位宽的 CPU 寄存器**! ### ARM ARM 不仅是一家为 CPU ISA 制定规范的公司,它也设计并授权给其他厂商使用其 CPU 内核,甚至允许其他公司使用 ARM CPU ISA 设计自己的 CPU 内核。(最后那句话听起来就像是个 SQL 查询似的!) 你可能因为如树莓派这类的 <ruby> 单板计算机 <rt> Single Board Computer </rt></ruby>)(SBC)听说过 ARM。但其实 ARM 的 CPU 还广泛应用于手机中。最近,苹果从使用 `x86_64` 处理器转向了在其笔记本和台式机产品中使用自家设计的 ARM 处理器。 就像任一种 CPU 架构一样,ARM 基于内存总线宽度也有两个子集。 官方认定的 32 位和 64 位 ARM 架构的名称分别是 `AArch32` 和 `AArch64`。这里的 `AArch` 字符串代表 “<ruby> Arm 架构 <rt> Arm Architecture </rt></ruby>”。这些是 CPU 执行指令时可切换的**模式**。 实际符合 ARM 的 CPU ISA 的指令规范被命名为 `ARMvX`,其中 `X` 是规范版本的代表数字。目前为止,已经有九个主要的规范版本。规范 `ARMv1` 到 `ARMv7` 定义了适用于 32 位 CPU 的架构,而 `ARMv8` 和 `ARMv9` 是适用于 64 位 ARM CPU 的规范。([更多信息在此](https://en.wikipedia.org/wiki/ARM_architecture_family#Cores)) > > ? 每个 ARM CPU 规范又有进一步的子规范。例如 ARMv8,我们有 ARMv8-R、ARMv8-A、ARMv8.1-A、ARMv8.2-A、ARMv8.3-A、ARMv8.4-A、ARMv8.5-A、ARMv8.6-A、ARMv8.7-A、ARMv8.8-A 和 ARMv8.9-A。 其中 -A 表示“应用核心”,-R 表示“实时核心”。 > > > 你可能会觉得困惑,为什么在 `AArch64` 正式被 ARM 认定为 64 位 ARM 架构后,有些人仍然称其为 `arm64`。原因主要有两点: 1. `arm64` 这个名称在 ARM 决定采用 `AArch64` 之前就已经广为人知了。(ARM 的一些官方文档也将 64 位的 ARM 架构称为 `arm64`…… ?) 2. [Linus Torvalds 对 `AArch64` 这个名称表示不满。](https://lore.kernel.org/lkml/CA+55aFxL6uEre-c=JrhPfts=7BGmhb2Js1c2ZGkTH8F=+rEWDg@mail.gmail.com/) 因此,Linux 的代码库主要将 `AArch64` 称为 `arm64`。然而,当你在系统中运行 `uname -m` 时,输出仍然是 `aarch64`。 因此,对于 32 位 ARM CPU,你应该寻找 `AArch32` 这个字符串,但有时也可能是 `arm` 或 `armv7`。相似的,对于 64 位 ARM CPU,你应该找 `AArch64` 这个字符串,但有时也可能会是 `arm64`、`ARMv8` 或 `ARMv9`。 ### RISC-V RISC-V 是 CPU 指令集架构(ISA)的一个开源规范。\*\*但这并不意味着 CPU 自身是开源的!\*\*这有点像以太网的情况。以太网规范是开源的,但你需付费购买网线、路由器和交换器。同样,RISC-V CPU 也要花钱购买。 ? 尽管如此,这并没有阻止人们创建并在开源许可下提供免费获取(**设计上的获取**,并非物理核心/SoC)的 RISC-V 核心。[这是其中的一项尝试](https://github.com/openhwgroup)。 > > ? 总结一下:如果你在寻找运行于 RISC-V 消费级 CPU 上的软件,你应该寻找 “**rv64gc**” 这一字符串。这是许多 Linux 发行版所公认的。 > > > 像所有 CPU 架构一样,RISC-V 拥有 32 位和 64 位 CPU 架构。但由于 RISC-V 是非常新的描述 CPU ISA 的方式,大部分主流消费端或客户端的 CPU 核心一般都是 64 位的。大部分 32 位的设计都是微控制器,用于非常具体的用例。 它们的区别在于 CPU 的扩展。被称为 RISC-V CPU 的最低要求即实现“<ruby> 基本整数指令集 <rt> Base Integer Instruction Set </rt></ruby>”(`rv64i`)。 下表列出了一些扩展及其描述: | 扩展名称 | 描述 | | --- | --- | | `rv64i` | 64 位基本整数指令集(**必须的**) | | `m` | 乘法和除法指令 | | `a` | 原子指令 | | `f` | 单精度浮点指令 | | `d` | 双精度浮点指令 | | `g` | 别名;一组运行**通用**操作系统所需的扩展集(包括 `imafd`) | | `c` | 压缩指令 | 在 `rv64i` 这一字符串中,`rv` 表示 RISC-V,`64` 指的是 64 位 CPU 架构,而 `i` 指的是**强制性的**基本整数指令集扩展。 `rv64i` 之所以是一体的,因为即使 `i` 被认为是一种“扩展”,**但它是必须的**。 约定俗成的,扩展名称按上述特定顺序排列。因此,`rv64g` 展开为 `rv64imafd`,而不是 `rv64adfim`。 > > ? 还有其他一些像 Zicsr 和 Zifencei 这样的扩展,它们位于 `d` 和 `g` 扩展之间,但我故意不列出,以避免令你感到害怕。 > > > 因此,严格说来,(在写这篇文章的时候)`rv64g` 实际上是 `rv64imafdZicsrZifencei`。**恶魔般的笑声** > > > ### PowerPC PowerPC 曾是苹果、IBM 以及,摩托罗拉早期合作时代的一种流行 CPU 架构。在苹果转向英特尔的 x86 架构之前,它一直被应用于苹果的全部消费品产品线。 最初,PowerPC 采取的是大端字节序的内存排序。后来随着 64 位架构的引入,增加了使用小端字节排序的选项。这么做的目的是为了与英特尔的内存排序保持兼容(以防止软件错误),因为英特尔自始至终都一直采用的是小端字节序。有关字节序的更多内容,我可以唠叨很久,不过你可以通过阅读 [这篇 Mozilla 的文档](https://developer.mozilla.org/en-US/docs/Glossary/Endianness) 来了解更多。 由于字节序在此也起到了一定的作用,PowerPC 共有三种架构: * `powerpc`:表示 32 位的 PowerPC 架构。 * `ppc64`:表示拥有**大端字节序内存排序**的 64 位 PowerPC 架构。 * `ppc64le`:表示拥有**小端字节序内存排序**的 64 位 PowerPC 架构。 目前,**`ppc64le` 是被广泛使用的架构**。 ### 结论 市面上有各种各样的 CPU 架构。对于每一种架构,都有 32 位和 64 位的子集。在现有的 CPU 中,我们可以找到 x86、ARM、RISC-V 和 PowerPC 等架构。 其中,x86 是最广泛和易于获取的 CPU 架构,因为英特尔和 AMD 都采取了这种架构。此外,ARM 提供的产品几乎在手机和易于获取的单板计算机中被独占使用。 RISC-V 正在努力使硬件更广泛地被使用。我就有一款带有 RISC-V CPU 的单板计算机。 ? 而 PowerPC 主要用于服务器,至少当前如此。 *(题图:MJ/634ac7ea-b344-443a-b041-3bb3b31a956f)* --- via: <https://itsfoss.com/arm-aarch64-x86_64/> 作者:[Pratham Patel](https://itsfoss.com/author/pratham/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Are you someone that is confused by terms like `ARM` , `AArch64` , `x86_64` , `i386` , etc when viewing a datasheet or downloads page of a software? These are called CPU architectures and I will help you dip your toes in this topic of computing. Following is a table that will provide you with a good summary of what each string means: CPU Architecture | Description | ---|---| /`x86_64` `x86` /`amd64` | Same name for 64-bit AMD/Intel CPUs | /`AArch64` `arm64` /`ARMv8` /`ARMv9` | Same name for 64-bit ARM CPUs | `i386` | 32-bit AMD/Intel CPUs | /`AArch32` `arm` /`ARMv1` to `ARMv7` | Same name for 32-bit ARM CPUs | /`rv64gc` `rv64g` | Same name for 64-bit RISC-V CPUs | `ppc64le` | 64-bit PowerPC CPUs with little-endian memory ordering | Reading from left to right is the preference of using that term to describe the CPU architecture over the other, alternatively used terms on its right. If you are nerdy like me and want a more in-depth explanation, do read on! ## General overview: CPU architectures The terms that I listed above, generally speaking, are CPU architectures. Though, pedantically speaking, these are what a computer engineer calls a CPU ISA (Instruction Set Architecture). A CPU ISA is what defines how the 1's and 0's of binary are interpreted by your CPU. There are a few supersets of these CPU ISAs. - x86 (AMD/Intel) - ARM - RISC-V - PowerPC (still alive at IBM) There are more CPU ISAs like MIPS, SPARC, DEC Alpha, etc. But the ones I listed above are the ones that are still widely used today (in some capacity). The above listed ISAs have at least two subsets. This is mainly based on the *width of the memory bus*. The width of the memory bus denotes how many bits can be transferred between the CPU and the RAM in one go. There are several widths for the memory bus, but the two most important widths are 32-bit wide memory bus and a 64-bit wide memory bus. **(especially consumer facing hardware).** **any new hardware is 64-bit**## x86 (AMD/Intel) The x86 CPU ISA comes primarily from Intel as Intel was the one who created it in the first place with the 8085 micro-processor. The 8085 micro-processor had a 16-bit wide memory bus. Later, AMD came to the game and followed Intel's footsteps until AMD created their own superset 64-bit architecture, surpassing Intel. The subsets of x86 architecture are as follows: `i386` : If you own a CPU from pre-2007, this is likely your CPU architecture. It is the 32-bit "variant" of the currently known x86 architecture from AMD/Intel.`x86_64` /`x86` /`amd64` : All three terms are used interchangibly depending on the project you look at. But they all refer to the 64-bit "variant" of the x86 AMD/Intel architecture. Regardless, the string`x86_64` is widely used (and preferred) over`x86` and`amd64` . An example of this is that the FreeBSD project refers to the 64-bit x86 architecture as`amd64` while Linux and macOS refer to this as`x86_64` . **But the more widely accepted term is still** **x86_64** **.**The `x86` string for CPU ISA is a special one. You see, during the transition from 32-bit x86 (`i386` ) to 64-bit x86 (`x86_64` ), the CPU vendors made sure that the CPU can run both, 32-bit *and* 64-bit instructions. Therefore, sometimes when you read `x86` , it can also mean "It will run only on a 64-bit computer, but if that computer can run 32-bit instructions, you can run 32-bit user software on it." This ambuiguity of x86--meaning 64-bit processors that can also run 32-bit code--is mainly for/due-to Operating Systems that run on 64-bit processors, but allow the user of said OS to run 32-bit software. Windows makes use of this with a feature called "compatibility mode". Let's recap, there are two CPU architectures for the CPUs designed by AMD and Intel. They are 32-bit (`i386` ) and 64-bit (`x86_84` ). ### Extra *intel* *(Yeah! I am funny)* The `x86_64` ISA also has sub-sets. All of these subsets are 64-bit but have various features added. Especially SIMD (Single Instruction Multiple Data) instructions. `x86_64-v1` : The base`x86_64` ISA that almost everyone is familar with. When someone says`x86_64` , they are most likely referring to the`x86_64-v1` ISA.`x86_64-v2` : This adds more instructions like SSE3 (Streaming SIMD Extensions 3) as extensions.`x86_64-v3` : Adds instructions like AVX (Advance Vector eXtensions) and AVX2 which can use**up-to 256-bit wide CPU registers**! This can massively parallelize your computations if you can take advantage.`x86_64-v4` : Iterates upon the`x86_64-v3` ISA by adding more SIMD instruction as extensions. Such as AVX256 and AVX512. The later can use**up-to 512-bit wide CPU registers**! ## ARM ARM is a company that creates its own specification for a CPU ISA, designs and licenses their own CPU cores and also allows other companies to design their own CPU cores using the ARM CPU ISA. (The last part felt like an SQL query!) You might have heard about ARM because of SBCs (Single Board Computer) like the Raspberry Pi line up of SBCs. But their CPUs are also widely used in mobile phones. Recently, Apple has switched from `x86_64` processors to using their own design of ARM processors in their laptop and desktop offerings. Like any CPU architecture, there are two subsets based on the width of the memory bus. The officially recognised names for the 32-bit and 64-bit ARM architectures are `AArch32` and `AArch64` respectively. The 'AArch' string stands for 'Arm Architecture'. These are **modes** a CPU can be in, for executing instructions. The actual specification of an instruction that complies with ARM's CPU ISA are named `ARMv` where *X** X* refers to a generation number of a specification. To this date, there have been 9 major versions of this specification. Ranging from `ARMv1` to `ARMv7` , which is defines a CPU architecture specification for 32-bit CPUs. While `ARMv8` and `ARMv9` are specifications for the 64-bit ARM CPUs. ([More info here.](https://en.wikipedia.org/wiki/ARM_architecture_family#Cores)) You might be wondering why some people call it `arm64` even when `AArch64` is the officially recognized name for 64-bit ARM architecture. The reason is two-folds: - The name `arm64` caught on before`AArch64` was decided upon by ARM. (ARM also refers to the 64-bit ARM architecture as`arm64` in some of it's official documentation... 😬) [Linus Torvalds dislikes the](https://lore.kernel.org/lkml/CA+55aFxL6uEre-c=JrhPfts=7BGmhb2Js1c2ZGkTH8F=+rEWDg@mail.gmail.com/)Therefore the Linux codebase largely refers to`AArch64` name.`AArch64` as`arm64` . But it will still report`aarch64` when you do a`uname -m` . Therefore, for 32-bit ARM CPUs, you should look for the string `AArch32` but sometimes it might also be `arm` or `armv7` . Similarly, for 64-bit ARM CPUs, you should look for the string `AArch64` but sometimes it might also be `arm64` or `ARMv8` or `ARMv9` . ## RISC-V RISC-V is an open source specification of a CPU ISA. **This doesn't mean that the CPUs themselves are open source!** It is a standard, kind of like Ethernet. The Ethernet specification is open source but the cables, routers and switches you purchase do cost money. Same deal with RISC-V CPUs. :) Though, this has not prevented people from creating RISC-V cores that are freely available (**as designs**; not as physical cores/SoC) under an open source license. Here is [one such effort](https://github.com/openhwgroup). **if you are looking for software to run on RISC-V consumer CPUs. This is what a large number of Linux distributions have agreed upon.** **rv64gc**Just like any CPU architecture, RISC-V has 32-bit and 64-bit CPU architectures. Since RISC-V is *very new* (in the terms of a CPU ISA), all major CPU cores in consumer/client side are usually 64-bit CPUs. The 32-bit designs are mostly micro-controllers that have a very specific use-case. What they do differ in, are CPU extensions. The absolute minimum extension one needs to implement to be called a RISC-V CPU is the 'Base Integer Instruction Set' (`rv64i` ). A table of a few extensions and the description is as below: Extension name | Description | ---|---| `rv64i` | 64-bit Base Integer Instruction Set (mandatory) | `m` | Multiplication and Division instructions | `a` | Atomic instructions | `f` | Single-precision floating point instructions | `d` | Double-precision floating point instructions | `g` | Alias; A collection of extensions necessary to run a general-purpose OS (includes `imafd` ) | `c` | Compressed instructions | In the string `rv64i` , `rv` stands for RISC-V, `64` denotes that this is a 64-bit CPU architecture and `i` is the extension for the **mandatory** base integer instruction set. The reason why `rv64i` is written together is because, even though the `i` extension is an "extension", **it is mandatory**. The convention is to have the extension name in the specific order listed as above. So `rv64g` expands to `rv64imafd` , not to `rv64adfim` . So technically, (as of writing this article) rv64g is actually rv64imafdZicsrZifencei. *evil laughter*## PowerPC PowerPC was very popular CPU architecture in the early days of Apple, IBM and Motorola partnership. It was the CPU architecture that Apple used in their entire consumer line-up until they switched from PowerPC to Intel's x86. PowerPC initially had big-endian memory ordering. Later, when a 64-bit architecture was introduced, an option to use little-endianness was added. This was done to be compatible with Intel's memory ordering (to prevent software bugs) which has always been little-endian. I could go on and on about endianness but you are better served with [this Mozilla document](https://developer.mozilla.org/en-US/docs/Glossary/Endianness) to learn more about endianness. Since endianness is also a factor here, there are 3 architectures of PowerPC: `powerpc` : The 32-bit PowerPC architecture.`ppc64` : The 64-bit PowerPC architecture with**big-endian memory ordering**.`ppc64le` : The 64-bit PowerPC architecture with**little-endian memory ordering**. As of now, ** ppc64le is widely used**. ## Conclusion There are many CPU architectures out there in the wild. For each CPU architecture, there are 32-bit and 64-bit subsets. There are CPUs that offer x86, ARM, RISC-V and PowerPC architectures. The x86 is the most widely and easily available CPU architecture, since that is what Intel and AMD use. There are also offerings from ARM which are almost exclusively used in mobile phones and accessible SBCs. RISC-V is in an ongoing effort to make the hardware more widely accessible. I have an SBC that has a RISC-V CPU ;) PowerPC is mainly found in servers, at least at the moment.
16,227
在 Linux 上用 Doxygen 生成源代码文档
https://opensource.com/article/22/5/document-source-code-doxygen-linux
2023-09-26T10:33:09
[ "Doxygen", "文档" ]
https://linux.cn/article-16227-1.html
![](/data/attachment/album/202309/26/103240lkeeijekke3egs5n.jpg) > > Doxygen 是一款广泛使用的开源文档生成工具,它通过代码注释来生成文档。 > > > 在试着熟悉别人的代码时,你总希望他们留下的代码注释能对你理解代码有所帮助。同理,无论为了自己还是其他人,编写代码时写注释是好习惯。所有编程语言都有专门的注释语法,注释可以是一个单词、一行文字、甚至是一整段话。编译器或解释器处理源代码时会忽略注释。 注释不能完全取代文档,但是有方法可以使用注释来生成文档。[Doxygen](https://www.doxygen.n/) 是一个开源的文档生成工具,它能够根据代码注释生成 HTML 或 LaTeX 格式的文档。Doxygen 让你在不用额外操作的情况下创建代码结构概览。尽管 Doxygen 主要是用来给 C++ 生成文档的,它对其它语言同样适用,比如 C、Objective-C、 C#、 PHP、Java 和 Python 等。 要使用 Doxygen,你只需要在源代码中使用 Doxygen 能够识别的语法来写注释。Doxygen 会扫描源码文件,然后根据这些特殊注释生成 HTML 或 LaTeX 文档。下面的示例项目会演示如何使用 Doxygen 注释,以及文档是如通过注释生成出来的。示例代码可从 [GitHub](https://github.com/hANSIc99/DoxygenSample) 上获得,本文中也将引用 [Doxygen 手册及文档](https://www.doxygen.nl/manual/) 的相关章节。 ### 在 Linux 上安装 Doxygen 在 Fedora 上可以通过软件包的形式安装 Doxygen。打开终端运行命令: ``` sudo dnf install doxygen ``` 在基于 Debian 的操作系统上,可以通过以下命令来安装: ``` sudo apt-get install doxygen ``` ### 使用 安装完 Doxygen 后,你需要在项目中按 Doxygen 可以识别的格式来注释代码,还要提供一个 Doxyfile 配置文件来控制 Doxygen 的一些行为。 注意:如果你用的是 GitHub 上的示例项目,你可以忽略下面一步。 如果 Doxyfile 文件不存在,你可以用 Doxygen 生成一个标准 Doxyfile 模板文件。切换到项目根目录下,运行: ``` doxygen -g ``` 参数 `-g` 表示 <ruby> 生成 <rt> generate </rt></ruby>。现在应该会出现一个名为 `Doxyfile` 的新文件。通过命令调用 Doxygen: ``` doxygen ``` 现在应该能会有两个新文件夹: * `html/` * `latex/` 默认情况下,Doxygen 会同时输出 LaTeX 和 HTML 格式的文档。本文主要关注 HTML 文档。你可以在 Doxygen 官方文档的**入门**小节中找到关于 LaTeX 格式输出的更多信息。 双击 `html/index.html` 打开 HTML 文件。用空的配置文件生成的文档如下图: ![A screenshot of a doxygen generated main page on Firefox. The content field under My Project Documentation is blank.](/data/attachment/album/202309/26/103309q0shh51euusk0j7j.png) 现在我们试着修改 `Doxyfile` 文件,并在源代码中添加特殊注释。 ### Doxyfile 文件 在 `Doxyfile` 文件中可以定义大量的可调选项,本文通过介绍示例项目的 `Doxyfile` 文件我只能覆盖其中很小的子集。 #### 第 35 行:项目名称 你可以在这里指定项目名称,它最终会显示在<ruby> 页眉 <rt> header </rt></ruby>和浏览器标签上。 ``` # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = "My Project" ``` #### 第 47 行:项目简介 项目简介会以略小的字号显示在页眉上。 ``` # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = "An example of using Doxygen in C++" ``` #### 第 926 行:包含子目录 允许 Doxygen 查找源代码和文档文件时递归遍历子目录。 ``` # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES ``` #### 第 1769 行:禁用 LaTeX 输出 如果你只想生成 HTML 文档,可以通过这个开关禁用 LaTeX 输出。 ``` # If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO ``` 修改完成后,你可以再次运行 Doxygen 来检验修改是否生效了。可以在调用 Doxygen 时使用 `-x` 选项来查看 `Doxyfile` 文件的变更项: ![A screenshot of the terminal showing the differences, Project Name, Project Brief, Recursive, and status of Generate Latex](/data/attachment/album/202309/26/103309d32ec3ck46ayuqqq.png) 通过调用 `diff` 命令,Doxygen 仅显示当前 Doxyfile 文件和模板文件的差异。 ### 特殊注释 Doxygen 通过扫描源代码文件中的特殊注释和关键字来生成 HTML 文档。示例项目中的 ByteStream 类的头文件可以很好地解释特殊注释的用法。 下面用构造函数和析构函数作为示例: ``` /*! @brief Constructor which takes an external buffer to operate on * * The specified buffer already exist. * Memory and size can be accessed by buffer() and size(). * * @param[in] pBuf Pointer to existing buffer * @param[in] size Size of the existing buffer */ ByteStream(char* pBuf, size_t size) noexcept; ``` 特殊注释块有不同的格式风格。我倾向于使用 `/*!` 开头(Qt 风格),每行前添加 `*`,以 `*/` 结束注释块。你可以参考 Doxygen 手册的*文档化代码*小节,以大致了解不同的风格选项。 Doxygen 注释分两个部分:简要描述和详细描述。它们都是可选的。在上面的例子中的注释块是对紧跟其后的构造函数声明的描述。在 `@brief` 之后的文本会显示在类概览小节中: ![A screenshot of the C++ example of using Doxygen showing the Byte Stream Class Reference. The categories in the list are public member functions, writing (operators for writing to the stream), and reading (operators for reading from the stream)](/data/attachment/album/202309/26/103309cv5pzl1o6k155j0j.png) 在空行(空行是段落分隔符)之后是构造函数的实际文档。用 `@param[in/out]` 关键字标注传递给构造函数的参数,Doxygen 基于此生成参数列表: ![Screenshot of the Doxygen example showing the parameters under ByteStream](/data/attachment/album/202309/26/103310bhmjmafjzbjbhubj.png) 值得注意的是 Doxygen 为 `buffer()` 和 `size()` 方法自动生成了链接。相反,Doxygen 忽略了析构函数前的注释,因为它并没有使用特殊注释: ``` // Destructor ~ByteStream(); ``` 现在你已经看到 Doxygen 的绝大部分功能了。通过使用一种稍微改良的注释格式,让 Doxygen 能够识别它们。通过使用一些关键字,你甚至可以进一步控制格式化。在下一节中,我会进一步介绍 Doxygen 的其它特性。 ### 其它特性 现在几乎所有的工作都可以通过对源代码注释的方式完成。通过一些微调,你可以轻松地优化 Doxygen 的输出。 #### Markdown 格式 为了进阶的格式化,Doxygen 支持 Markdown 和 HTML 命令。Markdown 速查表可以在 [这里](https://opensource.com/downloads/cheat-sheet-markdown) 下载到。 #### 项目主页 除了自定义页眉之外,`html/index.html` 几乎没有其它内容了。你可以通过使用关键字向其中添加一些有意义的内容。因为主页通常不是针对某个源代码文件的,你可以将要显示在主页的内容放到项目根目录下的一个单独文件中。示例项目中就是这样做的,其输出效果如下: ![The Doxygen Example Documentation field now contains headings and documentation: Introduction, Running the example, System requirements, and Building the code, with step by step examples and code snippets (all can be found in the example on GitHub)](/data/attachment/album/202309/26/103310v5uvrvn200c9rvrc.png) #### 自动链接生成 上面已将提到了,当你引用代码的其它部分时,Doxygen 会自动识别并生成相应链接。但要注意,这要求被引用部分也有文档才行。 更多信息可以在官方文档的*自动链接生成*中找到。 #### 分组 `ByteStream` 类<ruby> 重载 <rt> overload </rt></ruby> 了的读写流操作符 (`<<` 和 `>>`)。在类的概览中可以发现操作符被分为读和写两组。分组是在 `ByteStream` 的头文件中定义的。 分组的语法以标记 `@{` 开始,以 `}@` 结束。在标记范围中的内容都属于这个分组。在 `ByteStream.h` 中的实现如下: ``` /** @name Writing * Operators for writing to the stream * @{ */ (...) /** @} * @name Reading * Operators for reading from the stream * @{ */ (...) /** @} */ ``` 你可以在官方文档的*分组*中找到更多相关信息。 #### LLVM 支持 如果你用 [Clang](https://clang.llvm.org/) 构建项目的话,可以通过使用 `-Wdocumentation` 选项让 Clang 对特殊注释进行检查。想了解该特性的更多信息,可以参考 LLVM 用户手册和 Dmitri Gribenko 的展示报告,它们可以在 Clang 网站上找到。 ### 谁在用 Doxygen Doxygen 是在 1997 年首次发布的。尽管有些年头了,现在仍然有很多项目在使用 Doxygen。比如 NASA 的飞行软件框架 [F Prime](https://github.com/nasa/fprime)、图像处理库 [OpenCV](https://docs.opencv.org/4.5.5/index.html)、包管理器 [RPM](https://github.com/rpm-software-management/rpm)。你还可以在其它领域发现 Doxygen 语法标记的身影,比如内容管理平台 [Drupal](https://www.drupal.org/docs/develop/standards/api-documentation-and-comment-standards) 的文档标准中。 注意:Doxygen 输出的 HTML 文档风格类似于九十年代网页。并且它也难以描绘元编程和模板编程架构。在这些情况下,你应该选择 [Sphinx](https://opensource.com/article/18/11/building-custom-workflows-sphinx) 而不是 Doxygen。 *(题图:MJ/4d354094-397e-4ac5-a80d-25b9c736ede5)* --- via: <https://opensource.com/article/22/5/document-source-code-doxygen-linux> 作者:[Stephan Avenwedde](https://opensource.com/users/hansic99) 选题:[lkxed](https://github.com/lkxed) 译者:[toknow-gh](https://github.com/toknow-gh) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
When trying to familiarize yourself with someone else's project, you usually appreciate the comments left behind that help you understand the meaning of their code. In the same way, whenever you are programming, whether for yourself or for others, it is good practice to comment your own code. All programming languages offer a special syntax to mark a word, a line, or a whole section as a comment. Those areas are then ignored by the compiler or interpreter when the source code is processed. Comments don't take the place of documentation, but there is a way to use your comments to produce documentation easily. Meet [Doxygen](https://www.doxygen.n/), an open source tool for generating HTML or LaTeX documentation based on comments in the code. Doxygen enables you to provide a comprehensive overview of the structure of your code without additional effort. While Doxygen is mainly used to document C++, you can use it for many other languages, like C, Objective-C, C#, PHP, Java, Python, and more. To use Doxygen, you simply comment your source code in a syntax that Doxygen can read. Doxygen then walks through your source files and creates HTML or LaTeX documentation based on those special comments. The C++ example project below will illustrate how the source code is commented and how the documentation is generated from it. The example is available on [GitHub](https://github.com/hANSIc99/DoxygenSample), and I will also include references to different sections of the [Doxygen manual and documentation](https://www.doxygen.nl/manual/). **[ Download now: Doxygen cheat sheet ]** **Install Doxygen on Linux** On Fedora, Doxygen is available as a package. Open a terminal and run: ``` ````sudo dnf install doxygen` On Debian-based systems, you can install it by running: ``` ````sudo apt-get install doxygen` **Usage** Once installed, all you need is a project with Doxygen-compatible comments and a *Doxyfile*, a configuration file that controls the behavior of Doxygen. Note: If you stick to the related example project on GitHub, you can omit the next step. If there is no `Doxyfile` yet, you can simply let Doxygen generate a standard template. To do so, navigate to the root of your project and run: ``` ````doxygen -g` The `-g` stands for generate. You should now notice a newly created file called `Doxyfile` . You can invoke Doxygen by simply running: ``` ````doxygen` You should now notice two newly created folders: `html/` `latex/` By default, Doxygen outputs LaTeX-formatted documentation as well as HTML-based documentation. In this article, I will focus only on HTML-based documentation. You can find out more about LaTeX output in the official Doxygen documentation, in the *Getting started* section. Double click on `html/index.html` to open the actual HTML documentation. With a blank configuration, it probably looks like the screenshot below: ![A screenshot of a doxygen generated main page on Firefox. The content field under My Project Documentation is blank.](https://opensource.com/sites/default/files/2022-05/main%20page%20doxy.png) (Stephan Avenwedde, CC BY-SA 4.0) Now it's time to modify the `Doxyfile` and add some special comments to the source code. ## Doxyfile The `Doxyfile` allows you to define tons of adjustment possibilities, so I will describe only a very small subset. The settings correspond to the `Doxyfile` of the example project. ### Line 35: Project name Here you can specify the project name, which will be visible in the header line and the browser tab. ``` `````` # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = "My Project" ``` ### Line 47: Project brief description The brief description will also be shown in the header but in a smaller font. ``` `````` # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = "An example of using Doxygen in C++" ``` ### Line 926: Inclusion of subdirectories Allow Doxygen to walk recursively through subdirectories to find source and documentation files. ``` `````` # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES ``` ### Line 1769: Disable LaTeX output If you are just interested in the HTML output, you can disable the LaTeX code generation using this switch. ``` `````` # If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO ``` After every change, you can run Doxygen again to check whether your changes have had the desired effect. If you just want to check which modification an existing `Doxyfile` has, invoke Doxygen with the `-x` switch: ![A screenshot of the terminal showing the differences, Project Name, Project Brief, Recursive, and status of Generate Latex](https://opensource.com/sites/default/files/2022-05/doxygen%20class%20overview.png) (Stephan Avenwedde, CC BY-SA 4.0) As with the command `diff` , Doxygen displays only the differences between the actual Doxyfile and the template. ## Special comments Doxygen reads the sources and checks each file for special comments. Based on those comments and keywords, it builds up the HTML documentation. The anatomy of the special comments can be well explained using the header file of the class ByteStream, as shown in the GitHub example linked above. I will look at the constructor and destructor as an example: ``` `````` /*! @brief Constructor which takes an external buffer to operate on * * The specified buffer already exist. * Memory and size can be accessed by buffer() and size(). * * @param[in] pBuf Pointer to existing buffer * @param[in] size Size of the existing buffer */ ByteStream(char* pBuf, size_t size) noexcept; ``` There are different flavors of formatting a special comment block. I prefer to start the comment in the Qt-style (`/*!` ) and add an asterisk (`*` ) before each line. The block then ends with an asterisk followed by a forward slash (`*/` ). To get an overview of the different style options, refer to the Doxygen manual, in the section *Documenting the code*. Comments in Doxygen are divided into two sections, a *brief* description and a *detailed* description. Both sections are optional. In the code sample above, the comment block refers to the following line of code, the declaration of a constructor. The sentence behind the `@brief` will be shown in the compact class overview: ![A screenshot of the C++ example of using Doxygen showing the Byte Stream Class Reference. The categories in the list are public member functions, writing (operators for writing to the stream), and reading (operators for reading from the stream)](https://opensource.com/sites/default/files/2022-05/actual%20doxy%20byte%20stream%20class.png) (Stephan Avenwedde, CC BY-SA 4.0) After a blank line (blank lines are treated as paragraph separators), the actual documentation for the constructor begins. With the `@param[in/out]` keyword, you can mark the arguments passed to the constructor, and Doxygen will make a clear argument list from it: ![Screenshot of the Doxygen example showing the parameters under ByteStream](https://opensource.com/sites/default/files/2022-05/argument%20list%20from%20Doxygen.png) (Stephan Avenwedde, CC BY-SA 4.0) Note that Doxygen automatically creates a link to the mentioned `buffer()` and `size()` method in the comment. In contrast, the comment before the destructor declaration won't have any effect on Doxygen as it is not recognized as a special comment: ``` `````` // Destructor ~ByteStream(); ``` Now you have seen 90% of the magic. By using a slightly modified syntax for your comments, you can convert them into special comments that Doxygen can read. Furthermore, by using a few keywords, you can advance the formatting. In addition, Doxygen has some special features, which I will highlight in the following section. ## Features Most of the work is already done via your regular commenting on the source code. But with a few tweaks, you can easily enhance the output of Doxygen. ### Markdown For advanced formatting, Doxygen supports Markdown syntax and HTML commands. There is a Markdown cheat sheet available in the [download section](https://opensource.com/downloads/cheat-sheet-markdown) of opensource.com. ### Mainpage Aside from your customized header, you will get a mostly empty page when you open `html/index.html` . You can add some meaningful content to this empty space by using specific keywords. Because the main page is usually not dedicated to a particular source code file, you can add an ordinary text file containing the content for the main page into the root of your project. You can see this in the example on GitHub. The comments in there produce the following output: ![The Doxygen Example Documentation field now contains headings and documentation: Introduction, Running the example, System requirements, and Building the code, with step by step examples and code snippets (all can be found in the example on GitHub)](https://opensource.com/sites/default/files/2022-05/main%20page%20doxygen.png) (Stephan Avenwedde, CC BY-SA 4.0) ### Automatic link generation As noted above, Doxygen automatically figures out when you are referring to an existing part of the code and creates a link to the related documentation. Be aware that automatic link creation only works if the part you refer to is documented as well. More information can be found in the official documentation, under *Automatic link generation*. ### Groups The ByteStream class has overloaded stream operators for writing (`<<` ) and reading (`>>` ). In the class overview in the **Special comments** section above, you can see that the operator declarations are grouped as *Writing* and *Reading*. These groups are defined and named in the ByteStream header file. Grouping is done using a special syntax: You start a group with `@{` and end it with `}@` . All members inside those marks belong to this group. In the header `ByteStream.h` it is implemented as follows: ``` `````` /** @name Writing * Operators for writing to the stream * @{ */ (...) /** @} * @name Reading * Operators for reading from the stream * @{ */ (...) /** @} */ ``` You can find more information about grouping in the Doxygen documentation, under *Grouping*. ### LLVM Support If you are building with [Clang](https://clang.llvm.org/), you can apply the flag `-Wdocumentation` to the build process to let Clang check your special comments. You can find more information about this feature in the LLVM Users Manual or in Dmitri Gribenko's presentation, both on the Clang website. ## Where Doxygen is used Doxygen was first released in 1997, so it has been already around for some years. Despite its age, many projects use Doxygen to create their documentation. Some examples are NASA's [F Prime](https://github.com/nasa/fprime) flight software framework, the image processing library [OpenCV](https://docs.opencv.org/4.5.5/index.html), and the package manager [RPM](https://github.com/rpm-software-management/rpm). You can also find the Doxygen syntax in other areas, like in the documentation standards of the content management platform [Drupal](https://www.drupal.org/docs/develop/standards/api-documentation-and-comment-standards). A caveat: One drawback of using Doxygen is that it outputs HTML documentation with the look and feel of web pages from the nineties. It is also hard to depict the architecture of meta and template programming using Doxygen. For those cases, you would probably choose [Sphinx](https://opensource.com/article/18/11/building-custom-workflows-sphinx) over Doxygen. Download the ** Doxygen cheat sheet** now. ## Comments are closed.
16,228
21 个专业 Linux 用户喜爱的实用终端快捷键
https://itsfoss.com/linux-terminal-shortcuts/
2023-09-26T15:40:55
[ "终端", "快捷键" ]
https://linux.cn/article-16228-1.html
![](/data/attachment/album/202309/26/153948umngxcj8pemmejfe.jpg) > > 掌握这些极致实用的快捷键,让你的 Linux 终端操作效率大幅提升。 > > > 学习 Linux 命令无疑是你的首要任务,但当你能熟练 [运用命令行](https://itsfoss.com/linux-terminal-basics/) 之后,有另一样东西值得你去关注。 **那就是终端快捷键!** 如果你不知道如何利用它们提升终端会话的效率,那你就无法真正理解它们的重要性。 在本教程中,我将为你详细讲解顶级的终端快捷键,并且举例说明它们的用法。 在我逐一解释快捷键之前,先来看一下这个备忘录,它对我将在本教程中讨论的内容进行了概览: | 快捷键 | 功能描述 | | --- | --- | | `Ctrl + A` | 光标快速跳至行首。 | | `Ctrl + E` | 光标快速跳至行尾。 | | `Ctrl + U` | 删除光标至行首的所有内容。 | | `Ctrl + K` | 删除光标至行尾的所有内容。 | | `Ctrl + W` | 删除光标前的一个单词。 | | `Ctrl + L` | 清空整个终端屏幕。 | | `Ctrl + C` | 停止正在执行的进程或命令。 | | `Ctrl + D` | 注销或退出终端。 | | `Ctrl + Z` | 暂停正在执行的进程(之后可恢复执行)。 | | `Ctrl + R` | 在命令历史中进行逆向搜索。 | | 上箭头 `↑` | 从命令历史中显示先前的命令。 | | 下箭头 `↓` | 从命令历史中显示后续的命令。 | | `!!` | 重复执行最近的命令。 | | `!n` | 重复执行命令历史中的第 n 条命令。 | | `Tab` | 自动补全命令,文件名或目录名。 | | 连续按 `Tab` 两次 | 列出所有可能的补全选项。 | | `Ctrl + Shift + C` | 复制所选文本或命令。 | | `Ctrl + Shift + V` | 粘贴已复制的文本或命令。 | | `Ctrl + Shift + N` | 打开新的终端窗口。 | | `Ctrl + Shift + T` | 在当前终端中打开新的选项卡。 | | `Ctrl + Tab` 或 `Ctrl + PageDown` | 在终端的选项卡之间切换。 | > > ? 虽然我在这篇文章中用的是大写字母,但实际上我们不需要使用大写来输入它们。比如 `Ctrl+A`,意思是同时按下 `Ctrl` 键和 `A` 键,并不意味着需要同时按下 `Shift` 键和 `a` 键来输入大写的 `A`。 > > > 接下来,我们更详细地看看这些快捷键如何使用。 ### 1、Ctrl + A:光标切换至行首 当你在终端中按下 `Ctrl + A` 组合键,光标就会迅速跳到命令的起始处。这个功能在你需要修改一条长命令序列起始部分的时候十分实用。 例如,在以下示例中,你可以看到无论光标处在何位置,只需按下 `Ctrl + A`,光标就会立刻跳转至行首: ![使用 Ctrl + A 快捷键在 Linux 终端内前往行首](/data/attachment/album/202309/26/154055bqykmehuomonitbl.svg) ### 2、Ctrl + E:光标切换至行尾 在使用终端的过程中,如果你想迅速跳到当前行的末尾,直接按下 `Ctrl + E` 组合键就可以了。 在下面的示例中,我使用了一段样本文本,并按下 `Ctrl + E` 来快速移动到行尾: ![使用 Ctrl + E 在 linux 终端内前往行尾](/data/attachment/album/202309/26/154055ud6867z7uk132176.svg) ### 3、Ctrl + U:删除光标位置至行首的内容 有些时候,你可能需要删除从光标位置到行首的所有内容。 此时,你只需使用左箭头键将光标移动至你想要开始删除的位置,然后按下 `Ctrl + U` : ![使用 Ctrl+U 从光标位置删除到行首的内容](/data/attachment/album/202309/26/154055ig0ojsh0mfhch60r.svg) > > ? 在输完 `sudo` 命令输入密码时,不确定是否输入正确?没必要用退格键一路删除,只需简单地使用 `Ctrl+U` 快捷键重新开始输入密码即可。 > > > ### 4、Ctrl + K:从光标删除至行尾 如你所猜想,当你按下 `Ctrl + K` ,它会移除光标至行尾的所有内容(光标位置右侧的所有)。 使用这种快捷操作时,你先要把光标放在你想从那里开始删除的位置,然后按下 `Ctrl + K`,如下图展示的那样: ![在 Linux 终端利用 Ctrl + K 删除光标至行尾的内容](/data/attachment/album/202309/26/154055lv6y3zjmo6e6c7tc.svg) ### 5、Ctrl + W:删除光标前的一个词 我日常常用该快捷键,因为我时常打错命令,需要删除命令的一部分,这个时候只需要简单地按 `Ctrl + W` 就可以了。 当你按下 `Ctrl + W` 键时,它只会删除光标前的一个词: ![在 Linux 终端通过按 Ctrl + W 删除光标前的一个词](/data/attachment/album/202309/26/154055kejskkkdir5k16s7.svg) ### 6、Ctrl + L:清理终端显示(或者理解为整理显示内容) 按下 `Ctrl + L` 并不会彻底地 [清空终端显示](https://itsfoss.com/clear-terminal-ubuntu/),但它可以整理显示内容。如果你向上滚动,你还能找到之前的命令和执行记录。 它与 `clear` 命令有所不同。`clear` 命令会消除历史记录,而且你会在命令历史中找到 `clear` 命令的执行。 但是当你按下 `Ctrl + L` 时,它只是整理当前屏幕的显示内容,并不会出现在历史记录中,因为它本身并不是一条命令。 比如在这个示例中,我执行了历史命令,随后按下 `Ctrl + L` 键进行了屏幕清理: ![利用 Ctrl+L 清理 Linux 终端屏幕显示](/data/attachment/album/202309/26/154055kwf4fee4v4u4ve1d.svg) ### 7、Ctrl + C:终止当前进程/执行 有没有想要 [停止进行中的命令](https://itsfoss.com/stop-program-linux-terminal/),却不知所措,最后只好关闭终端呢?解决办法其实很简单,按下 `Ctrl + C` 就行了。 当你按下这一组键时,它将发送 `SIGINT` 信号以终别过程。 例如,在这里,我结束了正在执行的命令进程: ![利用 Ctrl+C 终端快捷键来中止运行中的命令](/data/attachment/album/202309/26/154055y9gx3sd9sgyygv46.svg) 最后,你会看到 `^C` 符号,表示你按下了 `Ctrl + C` 来中止当前执行。 但是,有些进程可能不会被 `Ctrl + C` 信号所中止,此时,你可以使用 Linux 中的其他 [中止信号](https://linuxhandbook.com/termination-signals/) 来终止。 > > **[如何在 Linux 中使用 SIGINT 和其它中止信号](https://linuxhandbook.com/termination-signals/)** > > > ### 8、Ctrl + D:退出登录或者退出终端 你总是可以使用 `exit` 命令来关闭 Shell 会话和终端。你也可以选择使用 `Ctrl+D` 快捷键。 当你按 `Ctrl + D` 时,如果你正在 SSH 中使用,它会结束会话,如果再次按下,它将直接关闭终端: ![利用 Ctrl+D 来关闭会话](/data/attachment/album/202309/26/154055wv444bm3syjzzv1l.gif) ### 9、Ctrl + Z:暂停当前进程 总是杀掉命令并不是个好主意,因为你有可能需要重新启动过程。 这种情况下,你可以按 `Ctrl + Z` 来暂停当前的进程,然后可以从之前暂停的地方继续。 例如,在这里,我暂停了更新进程: ![利用 Ctrl+Z 挂起一个进程](/data/attachment/album/202309/26/154055n1oofbgaz3wiz4gp.gif) 你想更多地了解 [如何暂停命令及如何恢复它们](https://linuxhandbook.com/suspend-resume-process/) 吗?这里有一篇为此准备的详细指南: > > **[如何在 Linux 中暂停并稍后恢复一个进程](https://linuxhandbook.com/content/images/size/w256h256/2021/08/Linux-Handbook-New-Logo.png)** > > > ### 10、Ctrl + R:搜索命令历史 当你按 `Ctrl + R` 时,它会打开一个搜索模式的提示,从中你可以键入命令的任何部分,并将找到匹配你输入的字符串的命令。 一旦你找到那个命令,只需按 `Enter` 键,它就会执行那个命令。 例如,在这里,我搜索了 `update`,返回的结果是在 Ubuntu 中的仓库更新命令(`sudo apt update`): ![利用 Ctrl + R 快捷键从历史记录中搜索命令](/data/attachment/album/202309/26/154055h26r4oo525aqyjau.svg) > > ? 如果你对历史记录中的任何建议都不满意,可以使用 `Ctrl+C` 退出搜索模式。 > > > ### 11、上箭头:呈现命令历史中的上一条 当你按下上箭头 `↑` 键时,命令历史中之前执行过的命令将会按次序逐一显示: ![使用箭头键向下遍历历史记录](/data/attachment/album/202309/26/154055rihh99oo6z2lwsok.svg) ### 12、下箭头:呈现命令历史中的下一条 当你按下上箭头 `↑` 键时,它会展示先前的命令,但在有些情况下,你可能无意间点击了多次,这时你希望展示之前已显示过的命令。 这个时候,你可以使用下箭头 `↓` 键。 在以下图示中,我首先多次按下了上箭头键,然后为了返回到先前显示的命令,我按下了下箭头键: ![使用箭头键向下遍历历史记录](/data/attachment/album/202309/26/154055xhf7gz05f7745ce9.svg) > > ? `Page Up` 和 `Page Down` 键也可以用于同样的目的。 > > > ### 13、!!:重复最后一条命令 有时候,你可能需要重复执行一次或多次最近的命令,此时你只需要输入 `!!`(两个感叹号)即可: ``` !! ``` 比如,在这里,我执行了一个 `echo` 命令,随后我用了 `!!` 来重复执行相同的命令: ![!! 命令能够重复执行你最近在终端输入的命令](/data/attachment/album/202309/26/154055ogdquq1o7szqduzu.png) 但是,这个快捷键最常用且最实用的场景是,当你忘记给命令加上 `sudo`。这样你无需重新输入整个命令,只需使用 `sudo !!` 就可以了 ![在 Linux 终端中使用 !! 快捷键的实践应用](/data/attachment/album/202309/26/154056ebbzsbbtfapbtmtv.png) > > ? 一个类似的键盘快捷键是 `Alt+.`,这个快捷键会给你提供上一条命令的最后一个参数或部分。假设你刚使用了 `ls /etc/apt/sources.list.d`,现在你想进入这个目录。只需输入 `cd` 然后使用 `Alt+.` 就可以。这就如同你输入 `cd /etc/apt/sources.list.d` 一样。 > > > ### 14、!n:重播历史中的第 n 条命令 你可以通过执行 Bash 的 `history` 命令来查看命令历史,每个命令都会有一个相应的索引号: ``` history ``` ![从历史中选择命令](/data/attachment/album/202309/26/154056a0kirbe560k0fi58.png) 现在,假设我想要执行倒数第二个 `echo` 命令,我会这样使用: ``` !1998 ``` ![](/data/attachment/album/202309/26/154056irs3pqmh2p3h4e6p.png) ### 15、Tab:命令自动补全 我认为这应是终端快捷键列表的首个条目。 在输入长命令时,你可以输入一部分,然后点击 `Tab` 键,它将为你进行自动补全。 例如,这里,我通过 `Tab` 键来自动完成我的脚本执行: ![点击 Tab 来查看命令,选项与参数建议](/data/attachment/album/202309/26/154056lbdkbrqvcsnrcwt2.svg) ### 16、Tab(连击两次):列出所有可能的自动补全 如果按 `Tab` 键无效果,那可能是因为当前输入的命令存在多种可能。 在这种场合,你可以连击两次 `Tab` 键,以列出所有可能的补全选项: ![连击两次 Tab 键可列出所有可能的自动补全建议](/data/attachment/album/202309/26/154056t8i896s24yk6i9bn.svg) > > ✋ 接下来的一些快捷键取决于终端的模拟器。虽然这些快捷键应该适用于大多数的终端应用,但不能完全确定。 > > > ### 17、Ctrl + Shift + C:复制所选文本 [复制终端中的文本](https://itsfoss.com/copy-paste-linux-terminal/),你需要先用鼠标选取文本,然后按下 `Ctrl + Shift + C` 来复制选中的内容: ![按下 Ctrl+Shift+C 进行复制](/data/attachment/album/202309/26/154056dw3dn9933u9lzlu4.gif) ### 18、Ctrl + Shift + V:粘贴已复制的文本 当你通过选取和按下 `Ctrl + Shift + C` 复制了文本后,你可以通过按下 `Ctrl + Shift + V` 在任何地方粘贴: ![在终端按下 Ctrl+Shift+V 进行粘贴](/data/attachment/album/202309/26/154056y4gidg8s2844ddga.gif) ### 19、Ctrl + Shift + N:打开新的终端窗口 当你按下 `Ctrl + Shift + N` 时,会打开一个新的终端窗口,且新窗口的工作目录与之前那个窗口内的工作目录相同: ![](/data/attachment/album/202309/26/154016byv1rs9p5o9411e1.gif) ### 20、Ctrl + Shift + T:开启新的终端标签页 就像使用网络浏览器一样,终端也支持开启多个标签页来进行不同的任务。要开启一个新的标签页,只需按下 `Ctrl + Shift + T` 就可以了: ![](/data/attachment/album/202309/26/154056vc4edtrzrhtcrtdt.gif) ### 21、Ctrl + Tab 或 Ctrl + PageDown:切换标签页 如果你按照之前的方式创建了多个标签页,你或许需要在它们之间进行切换。 为此,你可以使用 `Ctrl + Tab` 或 `Ctrl + PageDown`: ![](/data/attachment/album/202309/26/154056czxnd51m31s3snod.gif) > > ? 这可能更多是 Ubuntu 的功能。你可以通过 [按下 Ctrl+Alt+T 键来打开新的终端窗口](https://itsfoss.com/open-terminal-ubuntu/)。 > > > ### 接下来:必知的 Linux 命令 你喜欢这个“必备”键盘快捷键列表吗?可能你会对 [最基本却必备的 Linux 命令列表](https://itsfoss.com/essential-ubuntu-commands/) 也感兴趣: > > **[31 个最基本却必备的 Ubuntu Linux 命令](https://itsfoss.com/essential-ubuntu-commands/)** > > > 我明白起初你可能不容易记住所有这些终端快捷键。但通过不断实践,它们会逐渐深入你的肌肉记忆。 另外,你有一些没有在这里列出的钟爱的快捷键吗?欢迎在评论区分享。 *(题图:MJ/992e3559-4ed7-4529-9aea-85d52484cccf)* --- via: <https://itsfoss.com/linux-terminal-shortcuts/> 作者:[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Sure, learning the Linux commands should always be your priority but once you [get a grip on the command line](https://itsfoss.com/linux-terminal-basics/), there's one other thing you should focus on. *Terminal shortcuts! * You have no idea how helpful they are until you know how to use them to make your terminal sessions super productive. So in this tutorial, I will walk you through the top terminal shortcuts with examples of how to use them. Before I explain all the shortcuts individually, here's a cheat sheet of what I'll be discussing in this tutorial: Shortcut | Description | ---|---| `Ctrl + A` | Move to the start of the line. | `Ctrl + E` | Move to the end of the line. | `Ctrl + U` | Delete from the cursor to the start of the line. | `Ctrl + K` | Delete from the cursor to the end of the line. | `Ctrl + W` | Delete the word before the cursor. | `Ctrl + L` | Clear the terminal screen. | `Ctrl + C` | Stop the current process/command. | `Ctrl + D` | Log out or exit the terminal. | `Ctrl + Z` | Pause the current process (can be resumed). | `Ctrl + R` | Search command history (backward search). | `Up Arrow` | Show the previous command (from the command history). | `Down Arrow` | Show the next command (from the command history). | `!!` | Repeat the last command. | `!n` | Repeat the nth command from history. | `Tab` | Auto-complete commands, files, or directories. | `Tab` twice | List all possible completions. | `Ctrl + Shift + C` | Copy the selected text or command. | `Ctrl + Shift + V` | Paste copied text or command. | `Ctrl + Shift + N` | Open a new terminal window. | `Ctrl + Shift + T` | Open a new tab in the terminal. | `Ctrl + Tab` or`Ctrl + PageDown` | Switch between terminal tabs. | Now, let's have a look at them individually. ## 1. Ctrl + A: Move to the start of the line When you press the `Ctrl + A` , it will shift the cursor to the beginning of the file which can be really helpful when you write a long command and want to make changes at the beginning of the line. For example. here, I've demonstrated how you can press the `Ctrl + A` anywhere and it will shift you to the beginning of the line: ## 2. Ctrl + E: Move to the end of the line While using the terminal if you want to jump to the end of the line, you can simply press the `Ctrl + E` and it will do the job. In the following example, I used a sample text and pressed `Ctrl + E` to get to the end of the line: ## 3. Ctrl + U: Delete from the cursor to start There are times when you want to remove everything from the cursor position to the beginning of the line. In that case, all you have to do is use the left arrow keys to place the cursor from where you would like to delete to the start of the line and then press `Ctrl + U` : **Actually, it 'cuts' the text which can be pasted with Ctrl+Y.** ## 4. **Ctrl + K:** Delete from the cursor to the end As you can guess from the title, when you press the `Ctrl + K` , it will remove (it also 'cuts' the next) everything from the cursor to the end of the line (everything from the cursor position to the right-hand side). To use this shortcut, first, you have to place your cursor from where you want to remove text to the end and then press the `Ctrl + K` as shown here: ## 5. **Ctrl + W:** Delete a single word before the cursor This is what I use daily as I often mistype commands and want to remove one part of the command for that, you can simply press the `Ctrl + W` . When you press the `Ctrl + W` key, it will only remove (cuts actually) a single word before the cursor: [Learn Linux Quickly - Linux Commands Book for BeginnersLearn Linux Quickly doesn’t assume any prior Linux knowledge, which makes it a perfect fit for beginners. Nevertheless, intermediate and advanced Linux users will still find this book very useful as it goes through a wide range of topics. Learn Linux Quickly will teach you the following topics:Insta…](https://linuxhandbook.gumroad.com/l/mEsrwA)![](https://public-files.gumroad.com/ecjyjb71cmsww7i7srgezk6cq7tg) ## 6. **Ctrl + L:** Clear terminal screen (kind of) It does not [clear the terminal screen](https://itsfoss.com/clear-terminal-ubuntu/) in a true manner but declutters the screen and if you scroll up, you will still find the previous command and execution history. Yes, it is different than the `clear` command as it removes the history and you will find the execution of the `clear` command in the command history. But when you press `Ctrl + L` , it just declutters your current screen and you won't find it inside of the history (as it is not a command itself). For example, here, I executed the history command and then pressed the `Ctrl + L` key to clear the screen: ## 7. **Ctrl +C:** Stop the current process/execution How many times did it happen when you wanted to [stop the command execution](https://itsfoss.com/stop-program-linux-terminal/) and you had no idea how to do it and ended up closing the terminal itself? Well, in any case, all you have to do is press `Ctrl + C` . When you press the keys, it sends the `SIGINT` signal that will eventually kill the process. For example, here, I killed the ongoing point command execution: In the end, you'll see the `^C` symbol indicating you pressed the `Ctrl + C` to kill the ongoing execution. But there are several processes that may not be killed using the `Ctrl + C` signal and in that case, you can use the other [termination signals in Linux](https://linuxhandbook.com/termination-signals/): [How to use SIGINT and other Termination Signals in LinuxTerminating executing process is more than just kill -9. Here are some of the prominent termination signals and their usage.](https://linuxhandbook.com/termination-signals/)![](https://linuxhandbook.com/content/images/2022/10/termination-signals-linux.png) ![](https://linuxhandbook.com/content/images/2022/10/termination-signals-linux.png) ## 8. **Ctrl + D:** Logout or exit from the terminal You can always use the exit command to close a shell session and terminal. You can also use the Ctrl+D shortcut keys as well. When you press the `Ctrl + D` , it will log you out from the ongoing session if you use it in SSH, it will close the session and if pressed again, it will close the terminal itself: ![close terminal using shortcut Ctrl+D](https://itsfoss.com/content/images/2023/09/exit-from-the-ssh-session-and-close-the-terminal-using-shortcut.gif) ## 9. **Ctrl + Z:** Pause the current process Killing an ongoing process is not a good idea always as you have to start over again. So in that case, what you can do is press `Ctrl + Z` to stop the ongoing process and later on can be continued from where it was left. For example, here, I stopped the update process: ![stop ongoing process using Ctrl + Z shortcut in Linux](https://itsfoss.com/content/images/2023/09/stop-ongoing-process-in-Linux-terminal.gif) Want to know more ways to [stop ongoing processes and how to resume them](https://linuxhandbook.com/suspend-resume-process/)? Here's a detailed guide for that purpose: [How to Suspend a Process in Linux [And Resume it Later]Learn how to suspend a running process in the Linux command line. Also learn how to resume a stopped process.](https://linuxhandbook.com/suspend-resume-process/)![](https://linuxhandbook.com/content/images/2023/06/suspend-processes-in-linux.png) ![](https://linuxhandbook.com/content/images/2023/06/suspend-processes-in-linux.png) ## 10. **Ctrl + R: **Search command history When you press `Ctrl + R` , it opens a search mode prompt from where you can type any part of the command and it will find you the command with matching string you've entered. Once you find that command, you simply press the `Enter` key and it will execute that command. For example, here, I searched for the `update` and it gave me the command to update the repository in Ubuntu (sudo apt update): ## 11. Up Arrow: Show the previous command from history When you press the `Up Arrow` key, it will show you previously executed commands one by one from the command history: ## 12. Down Arrow: Show the next command from history When you press the `Up Arrow` key, it shows you previous commands but there are times when you accidentally press it many times and now you want to show the previously shown command. In that case, you can use the `Down Arrow` key. In the following illustration, first I pressed the up arrow key multiple times, and then to come back to previously shown commands, I pressed the down arrow key: ## 13. !!: Repeat the last command There are times when you want to execute the most recent command one or more times and in that case, you can simply type `!!` (exclamation twice): `!!` For example, here, I executed an echo command and then used the `!!` twice to use the same command again and again: ![Use !! to execute the most recent command](https://itsfoss.com/content/images/2023/09/Use----to-exccute-the-most-recent-command.png) But the most common and useful execution of this shortcut is when you forget to use sudo with a command. Instead of writing the entire command again, you just use `sudo !!` ![Practical use of the !! keyboard shortcuts in Linux terminal](https://itsfoss.com/content/images/2023/09/using---terminal-shortcut.png) ## 14. !n: Repeat the nth command from history You can access the history of executed commands by simply executing the bash history command in the terminal and each will have an index number associated with it: `history` ![Select commands from the history](https://itsfoss.com/content/images/2023/09/Use-the-history-command-to-find-previously-executed-commands.png) Now, let's suppose I want to execute the 2nd last echo command, then I will be using the following: `!1998` ![Use the !n shortcut to execute any command from the command history in Linux terminal](https://itsfoss.com/content/images/2023/09/Use-the--n-shortcut-to-execute-any-command-from-the-command-history-in-Linux-terminal.png) ## 15. Tab: Auto-complete the command I think I should have started the terminal shortcuts list with this one. While typing a long command, you can type half of it and then press the `Tab` key and it will auto-complete for you. For example, here, I pressed the `Tab` key to auto-complete my script execution: ## 16. Tab (twice): List all the possible auto-completes If pressing the `Tab` key does not work, it means there are multiple possibilities of the currently typed command. In that case, what you can do is press the `Tab` key twice to list all the possibilities: ## 17. Ctrl + Shift + C: Copy the selected text [To copy the text in the terminal](https://itsfoss.com/copy-paste-linux-terminal/), you have to select the text using the mouse and then press the `Ctrl + Shift + C` to copy the selected text: ![Copy text in Linux terminal](https://itsfoss.com/content/images/2023/09/Copy-text-in-Linux-terminal.gif) ## 18. Ctrl + Shift + V: Paste the copied text Once you copy the text by selecting the text and pressing `Ctrl + Shift + C` , now you can paste it anywhere by pressing `Ctrl + Shift + V` : ![paste text in terminal](https://itsfoss.com/content/images/2023/09/Paste-text-in-terminal.gif) ## 19. Ctrl + Shift + N: Open a new terminal window When you press the `Ctrl + Shift + N` , it will open a new terminal window with the same working directory you were working in the previous window: ## 20. Ctrl + Shift + T: Open new tab Like web browsers, in the terminal, you can open tabs to separate different tasks. To open a new tab, all you have to do is press `Ctrl + Shift + T` : ![Open new tab in Linux terminal](https://itsfoss.com/content/images/2023/09/Open-new-tab-in-Linux-terminal.gif) ## 21. Ctrl + Tab or Ctrl + PageDown: Switch tabs If you created multiple tabs using the above method, you may want to switch between them. And for that purpose, you can use `Ctrl + Tab` or `Ctrl + PageDown` : ![switch between tabs in Linux terminal](https://itsfoss.com/content/images/2023/09/Switch-between-tabs-in-Linux-terminal.gif) [Press Ctrl+Alt+T keys to open a new terminal](https://itsfoss.com/open-terminal-ubuntu/). ![](https://itsfoss.com/content/images/2023/04/efficient-at-linux-command-line-horizontal.png) #### New Book: Efficient Linux at the Command Line Pretty amazing Linux book with lots of practical tips. It fills in the gap, even for experienced Linux users. Must have in your collection. [Get it from Amazon](https://amzn.to/3MPjiHw) ## Next: Must-know Linux commands How about testing your just enhanced knowledge of terminal shortcuts with this quiz? Liked this list of 'essential' keyboard shortcuts? Perhaps you would like this list of the[ most basic yet essential Linux commands:](https://itsfoss.com/essential-ubuntu-commands/) [31 Basic Yet Essential Ubuntu CommandsAn extensive list of essential Linux commands that every Ubuntu user will find helpful in their Linux journey.](https://itsfoss.com/essential-ubuntu-commands/)![](https://itsfoss.com/content/images/wordpress/2022/11/must-know-linux-commands-for-ubuntu-user.png) ![](https://itsfoss.com/content/images/wordpress/2022/11/must-know-linux-commands-for-ubuntu-user.png) I understand that you may not remember all of these terminals shortcuts, at least not initially. But practice them and gradually they will be in your muscle memory. By the way, do you have some of your favourite shortcuts that have not been included here? Share it in the comments?
16,230
使用 Just Perfection 扩展定制 GNOME
https://itsfoss.com/just-perfection-gnome-extension/
2023-09-27T10:04:00
[ "GNOME" ]
https://linux.cn/article-16230-1.html
![](/data/attachment/album/202309/27/100446sz5yo50qzg49eqqo.jpg) > > 利用 Just Perfection GNOME 扩展为你的 Linux 桌面带来全新的个性化定制体验。 > > > GNOME 在 Linux 界中备受喜爱,是 [最热门的桌面环境](https://itsfoss.com/best-linux-desktop-environments/) 之一。 然而,讨论到 GNOME 的可定制程度,你会发现与 KDE 相比,可供选择的选项相对较少。 这并不意味着我们无法 [定制 GNOME](https://itsfoss.com/gnome-tricks-ubuntu/)。图形化的界面工具 <ruby> <a href="https://itsfoss.com/gnome-tweak-tool/"> GNOME 调整 </a> <rt> GNOME Tweaks </rt></ruby> 让你能轻松改变一些常规配置。而对于更深层次的设置更改,可以使用 [dconf 编辑器](https://wiki.gnome.org/Apps/DconfEditor),不过这对许多人可能略显复杂。 在此,我想向你推荐一款名叫 **Just Perfection** 的 GNOME 扩展,它帮助你一次性修改桌面的多种设置。 ### Just Perfection,一款全能扩展 ? ![](/data/attachment/album/202309/27/100450wej4hmpdezep4mvd.png) 如果 Just Perfection 扩展的名称是 “Do it all” 或许会更符合其特性。我在后续的功能介绍中会更详细地解释此扩展的用途。 通过使用这个扩展,你可以进行诸如设置 <ruby> 停靠区 <rt> Dock </rt></ruby>、通知面板、图标,以及调整与 GNOME 交互方式等一系列的微调。 Just Perfection 这款工具有以下一些核心特性: * 提供 4 个预设的用户配置文件 * 可以启用/禁用 `super` 键、动画、面板、时钟、日历等功能 * 可以启用/禁用应用菜单、面板通知、电源图标及活动状态的图标显示 * 可以个性化调整面板、通知栏、OSD 位置(音量/亮度弹出)、窗口尺寸,以及在按下 `Alt + Tab` 时的应用程序预览 * 可以调整工作空间预览的行为、是否展示工作空间切换器、应用网格的打开方式等等 这些功能听起来确实令人期待,对吗? #### Just Perfection 的安装方法 Linux 上安装 GNOME 扩展有 [多种途径](https://itsfoss.com/gnome-shell-extensions/)。其中一个是通过网页浏览器来进行安装。 若要使用网页浏览器进行安装,请访问其官方下载页面: > > **[获取 Just Perfection](https://extensions.gnome.org/extension/3843/just-perfection/)** > > > 在完成安装之后,你可以在下载页面看到一个设置图标,点击它,就会弹出一个对话框,你可以在其中调整 Just Perfection 扩展的设置: ![](/data/attachment/album/202309/27/100450ivffrpprrv89rf9p.png) ### Just Perfection GNOME 扩展的使用方法 使用这款扩展最方便的方法,就是选择四个预先配置好的用户配置之一。 虽然这一步是可选的,我还是建议启用“覆盖 Shell 主题”的选项,这样可以让你的桌面更具视觉吸引力: ![](/data/attachment/album/202309/27/100451b3z99899da96z97z.png) 一旦做了这个操作,它会自动切换到 `Custom` 用户配置,同时使停靠区背景变为透明。 关于各个用户配置文件的简述: * `Default`:默认文件,不会做出任何改变,但如果你启用了覆盖 Shell 的选项,它会稍微缩小面板和停靠区的尺寸。 * `Custom`:在启用且覆盖 Shell 选项后生效,可将停靠区背景变为透明。 * `Minimal`:减少停靠区和面板的尺寸,增加更多的屏幕工作区域。 * `Super Minimal`:移除停靠区和面板,给予你一个干净的视野和最大的屏幕工作空间。 以下是在切换这些用户配置文件时的预期效果情况: ![](/data/attachment/album/202309/27/100959yhk99zaz4as3qah4.gif) 现在,你可以启用或禁用各种选项,来定制你理想的桌面环境。 ### 使用 Just Perfection 创造简洁的桌面环境 在本节,我将展示如何实现一个由 Linux Mint 的 Cinnamon 桌面启发的简约桌面体验,其视觉效果如下: ![](/data/attachment/album/202309/27/100451d60ccb97rr66smfm.png) 下图是在切换工作空间时的显示效果: ![](/data/attachment/album/202309/27/100452fzo4iuloszl79wj7.png) 为了使我的桌面看起来如上所示的简约,我进行了以下设定: * 透明的停靠区定位于右侧(可在系统菜单中设置) * 将面板位置调整到底部 * 从面板中移除 <ruby> 应用 <rt> Application </rt></ruby> 菜单及 <ruby> 活动 <rt> Activities </rt></ruby> * 将时钟调整到左下角 * 设置通知弹出位置为左下角 * 启用工作区切换器 * 增大工作区概览面板的半径 不过这些步骤可根据个人喜好进行跳过。 #### 1、将透明的停靠区定位在右侧 要实现透明的停靠区,你需要在 “<ruby> 用户配置 <rt> Profile </rt></ruby>” 菜单中选取 `Custom` 配置文件,并启用 “<ruby> Shell 主题 <rt> Shell Theme </rt></ruby>” 选项即可: ![](/data/attachment/album/202309/27/100453oey82pqpeeqqkk7w.png) 如果你使用的是 Ubuntu 的最新版本,你可以在系统菜单中找到调整停靠区位置的选项。 首先,在系统菜单中打开设置,然后进入 “<ruby> 外观 <rt> Appearance </rt></ruby>” 菜单。在 “<ruby> 停靠区 <rt> Dock </rt></ruby>” 部分,你会找到 “<ruby> 在屏幕上的位置 <rt> Position on screen </rt></ruby>” 选项。 在这里选择 “<ruby> 右侧 <rt> Right </rt></ruby>” 即可: ![](/data/attachment/album/202309/27/100453yzs4zsm8mz0net2x.png) 对于使用较旧 GNOME 版本的用户,你可能无法找到这个菜单。 然而,不必担心,你可以 [安装名为 Dash to Dock 的扩展](https://news.itsfoss.com/dash-to-dock-gnome-40/) 来获得相同的效果。 在此,你需进行以下两个设置: * 将屏幕上的位置选项设为 “<ruby> 右侧 <rt> Right </rt></ruby>” * 如果已经选中了面板模式,取消选中即可 ![](/data/attachment/album/202309/27/100454edf3xdhnxxiwux7r.png) #### 2、将面板定位至底部 要将面板定位至底部,前往 “<ruby> 定制 <rt> Customize </rt></ruby>” 菜单,找到 “<ruby> 面板位置 <rt> Panel Position </rt></ruby>” 选项。 双击这个选项并选择 “<ruby> 底部 <rt> Bottom </rt></ruby>”: ![](/data/attachment/album/202309/27/100454be81ez5z1n885bp4.png) #### 3、将时钟位置设定在左下角 过去的六个月里我一直在以此方式使用时钟,这对我的工作流程帮助很大。简单说,你会更频繁地看时钟,以此更快地对时间有所感触。 这也让桌面看起来更好! 要更改时钟位置,进入 “定制” 菜单,然后找到 “<ruby> 时钟菜单位置 <rt> Clock Menu Position </rt></ruby>” 选项,选择 “<ruby> 左侧 <rt> Left </rt></ruby>”: ![](/data/attachment/album/202309/27/100455mccmnzov99don4zs.png) #### 4、移除应用菜单和活动按钮 ![](/data/attachment/album/202309/27/100455oxmo7rw17ox4p0w8.png) 我注意到用户中鲜有人使用这两个选项,因此移除它们不失为一种方式,这样可以使界面看上去更清晰简洁。 要达到目的,你需要前往 “<ruby> 视觉 <rt> Visibility </rt></ruby>” 菜单,然后取消以下两个选项: * 活动按钮 * 应用菜单 ![](/data/attachment/album/202309/27/100455qd4gzgju9qu54bpb.png) #### 5、将通知弹窗定位至右下角 因为面板自身已经被移动到底部,所以(至少对我来说)将弹窗放在顶部毫无意义。而且,相比从顶部,从底部阅读信息要更加方便。 为此,你需要做以下两步: * 前往 “定制” 菜单 * 在 “<ruby> 提示栏位置 <rt> Notification Banner Position </rt></ruby>` 中选择 “<ruby> 底部末端 <rt> Bottom End </rt></ruby>”。 ![](/data/attachment/album/202309/27/100456pp8lild7p3emgliv.png) #### 6、启用工作区切换器 当你在预览多个工作区的活动时,工作区切换器可以显示每个工作区的预览。 可能有些混淆?启用后的样子如下: ![](/data/attachment/album/202309/27/100658g3kgtfuruxbb77up.jpg) 这样,你只需要按下 `super` 键,就可以清楚地查看在每个工作区中发生的事情。 当然,你同样可以通过(按两下 `super` 键)打开系统菜单来获得相同的视角,但为何要浪费一次按键并打开系统菜单,而不是在预览窗口中就实现呢? 要启用这个功能,需要以下三步: * 前往 “<ruby> 行为 <rt> Behavior </rt></ruby>” 菜单并打开 “<ruby> 始终显示工作区切换器 <rt> Always Show Workspace Switcher </rt></ruby>” * 进入 “<ruby> 定制 <rt> Customize </rt></ruby>” 菜单 * 为 “<ruby> 工作区切换器大小 <rt> Workspace Switcher Size </rt></ruby>” 选择 `11%` ![](/data/attachment/album/202309/27/100457dz0mmo955smig01e.png) 我增加工作区切换器大小的原因是,我觉得默认的视图尺寸相对较小。 #### 7、增大工作区概览面板的圆角半径 我非常喜欢圆角设计,尤其是当它应用在工作区概览面板上时,当壁纸与设置相得益彰时尤为如此。 这就是应用上述设置后的效果: ![](/data/attachment/album/202309/27/100458skqpwpkpkvo6qqlr.png) 要增加工作区概览面板圆角的半径,你需要: * 前往 “定制” 菜单 * 在 “<ruby> 工作区背景圆角尺寸 <rt> Workspace Background Corner Size </rt></ruby>” 中选择 `60px` (这是最大的设置值) ![](/data/attachment/album/202309/27/100459fwvn1sl1l40wpvb5.png) ### 关于 GNOME 更深层次的自定义 如果你是 Ubuntu 的新手,那么我们有一份详细的指南,可以带你熟悉 [如何自定义 GNOME](https://itsfoss.com/gnome-tricks-ubuntu/): > > **[如何自定义 GNOME](https://itsfoss.com/gnome-tricks-ubuntu/)** > > > 下面会演示如何使用 GNOME Tweak 工具来提升 GNOME 的使用感受: > > **[在 Ubuntu 等 Linux 下安装和使用 GNOME 调整工具](https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png)** > > > 我希望这篇指南能对你有所帮助。 *(题图:MJ/a7937194-0bf3-4626-99b6-4fbba1790314)* --- via: <https://itsfoss.com/just-perfection-gnome-extension/> 作者:[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lct/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) GNOME is [one of the most popular desktop environments](https://itsfoss.com/best-linux-desktop-environments/) in the Linux world. But if we discuss the customizability aspect of GNOME, then you don't as get many options as KDE. Not that you cannot [customize GNOME](https://itsfoss.com/gnome-tricks-ubuntu/). The GUI tool [GNOME Tweaks](https://itsfoss.com/gnome-tweak-tool/) helps you with several easy config changes. For advanced setting changes, you'll have to rely on the [dconf editor](https://wiki.gnome.org/Apps/DconfEditor) which could be intimidating for many. In the customization sense, let me introduce you to **Just Perfection **GNOME extension that lets you tweak various aspects of your desktop at once. ## Just Perfection, the do it all extension 🌟 ![just perfection extension in GNOME](https://itsfoss.com/content/images/2023/08/just-perfection-extension-in-GNOME.png) If the Just Perfection extension would make more sense if it were named `Do it all` . I'll be more clear when I'll introduce you to the set of features it gets. Using this extension, you will be able to tweak little things like how you want your dock, notification panel, icons, and interactions with GNOME to be treated. And here are some key features of the Just Perfection tool: - 4 pre-configured profiles - Ability to enable/disable super key, animations, panel, clock, calendar, and more. - Ability to enable/disable icons for the app menu, panel notification, power icon, and activities. - Customize the panel, notification bar, OSD position (volume/brightness pop-up), size of the window, and app preview when `Alt + tab` pressed. - Change the behavior of the workspace preview, whether to show a workspace switcher or not, how you want to open the app grid, and more. Sounds too promising. Right? ### How to install Just Perfection There are [multiple ways to install the GNOME extension in Linux](https://itsfoss.com/gnome-shell-extensions/). One of which is to install through a web browser. And to install it using the web browser, visit their official download page: Once you're done with the installation, you will see the settings icon on the download page, click that button and it will open a prompt to tune the Just Perfection extension: ![how to use gnome extensions after installing them](https://itsfoss.com/content/images/2023/08/how-to-use-gnome-extensions-after-installing-them.png) [Proton Mail: Get a private, secure, and encrypted email account | ProtonProton Mail is the world’s largest secure email service with over 100 million users. Available on Web, iOS, Android, and desktop. Protected by Swiss privacy law.](https://itsfoss.click/protonmail)![](https://proton.me/images/social/proton-mail-og.png) ![](https://proton.me/images/social/proton-mail-og.png) Partner Link ## How to use the Just Perfection GNOME extension The most convenient way to use this extension is to choose between 4 pre-configured profiles. Optional but I would recommend enabling the option to override the shell theme to make your desktop more visually appealing: ![override shell theme in just perfection extension](https://itsfoss.com/content/images/2023/08/override-shell-theme-in-just-perfection-extension.png) Once you do so, it will automatically switch to the `Custom` profile and make the dock background transparent. Brief of each profile: `Default` : The default profile where won't apply any changes but if you enable the shell overriding, it reduces the size of the panel and docks a little.`Custom` : Gets activated when you enable shell overriding and makes the dock background transparent.`Minimal` : Reduces the size of the dock and panel to have more screen area to work with.`Super Minimal` : Removes the dock and panel to have a clean look and the most screen area to work with. Here's the expected behavior while switching between these profiles: Now, you can enable/disable different options to get a desktop of your liking. ## Going minimal with Just Perfection In this section, I will show you how you can have a minimal desktop experience that is inspired by the Linux Mint's Cinnamon desktop that looks like this: ![GNOME miminal desktop setup](https://itsfoss.com/content/images/2023/08/main-desktop-with-message.png) And here's what it looks like while switching workspaces: ![Make workspace switcher visible in GNOME](https://itsfoss.com/content/images/2023/08/activities-after-customisation.png) Here's what I did to make my desktop look minimal as shown above: - Transparent dock positioned to the right (from the system menu) - Change the position of the panel to the bottom - Remove `Application menu` and`Activities` from panel - Reposition the clock to the bottom left - Position notification pop-ups to the bottom left - Enable workspace switcher - Increase the radius of the workspace overview pane Sure, you can skip any of the shown steps. ### 1. Transparent dock positioned to the right To have a transparent dock, all you have to do is choose the `Custom` present from the `Profile` menu and enable the `Shell Theme` option: ![](https://itsfoss.com/content/images/2023/08/Use-custom-profile-in-just-perfection-GNOME-extension.png) If you're using Ubuntu's recent version, then you will find the option to relocate the dock in the system menu. First, open settings from the system menu and open the `Appearance` menu. Inside the **Dock **section, you will find an option for `Position on screen` . There, choose the `Right` : ![](https://itsfoss.com/content/images/2023/08/change-position-of-dock-1.png) If you are using an older version of GNOME, then you won't find this menu. But worry not, you can have the same benefit by [installing an extension called Dash to Dock.](https://news.itsfoss.com/dash-to-dock-gnome-40/) Here, you have to change two settings: - Change the position on the screen to `Right` - Uncheck Panel mode (if checked) ![](https://itsfoss.com/content/images/2023/08/Change-dock-position-using-the-dask-to-dock-extension.png) ### 2. Relocate the panel to the bottom To relocate the panel to the bottom, go to the `Customize` menu and there you will find the option for `Panel Position` . Double-click on that option and choose `Bottom` : ![change panel to bottom in GNOME](https://itsfoss.com/content/images/2023/08/change-panel-to-bottom-in-GNOME.png) ### 3. Change the clock position to the left corner I've been using the clock this way for the last 6 months and it had made wonders for my workflow. In simple terms, you read the clock more often and this way you can cope with time faster. It looks good too! To change the clock's position, go to the `Customize` menu and from there, find the `Clock Menu Position` option and choose the `Left` option: ![change clock position to left in GNOME](https://itsfoss.com/content/images/2023/08/change-clock-position-to-left.png) ### 4. Remove the Application menu and Activities button ![Remove Activities and App menu from Ubuntu GNOME](https://itsfoss.com/content/images/2023/08/Remove-Activities-and-App-menu-from-Ubuntu-GNOME.png) haven't seen many users using these two options so why not simply remove them and achieve a clean minimal look? To do that, go to the `Visibility` menu and disable the following two options: - Activities Buttons - App Menu ![disable Activities and App menu from Ubuntu GNOME](https://itsfoss.com/content/images/2023/08/disable-Activities-and-App-menu-from-Ubuntu-GNOME.png) ### 5. Notification pop-up re-positioned to bottom right As the panel itself was relocated to the bottom, having pop-ups on the top won't make any sense (to me at least). Also, reading messages from the bottom is easy compared to the top. For this, follow these two simple steps: - Go to the `Customize` menu - Select `Bottom End` from`Notification Banner Position` : ![change notification pop-up location in GNOME](https://itsfoss.com/content/images/2023/08/change-notification-pop-up-location-in-GNOME.png) ### 6. Enable workspace switcher The workspace switcher shows a preview of each workspace when having an overview of the activities of multiple workspaces. Still confused? It looks like this when enabled: ![enable workspace switcher in GNOME overview](https://itsfoss.com/content/images/2023/08/enable-workspace-switcher-in-GNOME-overview.png) Using this, you can have a clear overview of what is going on in each workspace by just pressing the super key. Sure, you can have the same view by opening the system menu (by pressing the super key twice) but why waste one keystroke and open the system menu when it can be enabled in the overview itself? To enable this, you have to follow the three simple steps: - Go to the `Behavior` menu and enable`Always Show Workspace Switcher` - Go to the `Customize` menu - Select `11%` for`Workspace Switcher Size` ![](https://itsfoss.com/content/images/2023/08/enable-always-show-workspace-switcher.png) The reason why I increased the size of the workspace switcher is the default view is pretty small. ### 7. Increase the radius of the workspace overview pane I love rounded corners, especially if applied over the workspace overview pane especially if the wallpaper compliments the setup. And here's how it will look in after applying the shown setting: ![Change corner radius of workspace switcher pane in GNOME ubuntu](https://itsfoss.com/content/images/2023/08/Change-corner-radius-of-workspace-switcher-pane-in-GNOME-ubuntu.png) Use the following steps to increase the radius of the workspace overview panel - Go to the `Customize` menu - Select `60px` (the max amount) in the`Workspace Background Corner Size` ![increse radius of workspace corners in GNOME Ubuntu](https://itsfoss.com/content/images/2023/08/increse-radius-of-workspace-corners-in-GNOME-Ubuntu.png) ## More on GNOME customization If you're new to Ubuntu, then we have a detailed guide walking you through all the basics of [how you can customize GNOME](https://itsfoss.com/gnome-tricks-ubuntu/): [15 Simple Tips to Customize Ubuntu GNOMESome basic and interesting GNOME customization tips for enriching your experience and getting more out of your Ubuntu desktop.](https://itsfoss.com/gnome-tricks-ubuntu/)![](https://itsfoss.com/content/images/2023/03/gnome-customisation-tips.png) ![](https://itsfoss.com/content/images/2023/03/gnome-customisation-tips.png) Here's how you can use the GNOME tweaks tool to make GNOME awesome: [Install and Use GNOME Tweak Tool in Ubuntu and Other LinuxLearn to install GNOME Tweak too in Ubuntu. You’ll also learn how to use GNOME Tweaks to customize your Linux desktop.](https://itsfoss.com/gnome-tweak-tool/)![](https://itsfoss.com/content/images/2023/03/customise-ubuntu-with-gnome-tweaks.png) ![](https://itsfoss.com/content/images/2023/03/customise-ubuntu-with-gnome-tweaks.png) I hope you will find this guide helpful.
16,231
在 Windows 上安装 VirtualBox
https://itsfoss.com/install-virtualbox-windows/
2023-09-27T15:03:53
[ "VirtualBox" ]
https://linux.cn/article-16231-1.html
![](/data/attachment/album/202309/27/150351mos0snvjpqnz4qv1.jpg) > > 简单易学的指南,帮助你在 Windows 上安装 Oracle VirtualBox,以便在虚拟机中安装 Linux。 > > > VirtualBox 是 [最好的虚拟化软件](/article-15911-1.html) 之一。 如果你想 [使用 Windows 上的 VirtualBox,在虚拟机中安装 Linux](/article-15183-1.html),第一步是安装 VirtualBox 应用本身。 我们已经介绍了 [在 Ubuntu 上安装 VirtualBox](/article-11282-1.html) 的教程。让我重点介绍 Windows 系统的步骤。 对于最新的 Windows 10 或 11 及更早版本,步骤将相同。在 Windows 上安装 Oracle VirtualBox 的两种简单方法: 1. 下载 Windows 版安装程序并按照屏幕上的说明进行操作 2. 使用 winget 工具 ### 1、使用 Windows 安装程序 要开始使用,请前往 [VirtualBox 的官方下载页面](https://www.virtualbox.org/wiki/Downloads)。单击 “**Windows host**” 选项下载 .exe 安装程序。 ![](/data/attachment/album/202309/27/150353zzpm38pm5rmtlx0e.jpg) 下载安装程序(.exe)文件后,启动它后将执行以下操作: ![](/data/attachment/album/202309/27/150353myrceynre2epnz2y.jpg) 安装指导允许你选择安装位置。你应该坚持使用 C: 驱动器上的默认设置,以确保安装 VirtualBox 所需的所有内容,使其按预期工作。 ![](/data/attachment/album/202309/27/150353puwidrd7abxuxp7a.jpg) 安装过程包括设置虚拟网络接口。因此,你的网络此时可能会被重置。确保安装时没有连接到任何重要的东西。 ![](/data/attachment/album/202309/27/150353plder3uiob8ejf3v.jpg) 在对网络功能进行重整的同时,还需要处理一些依赖关系。 需要安装 Python 核心包才能使 Python 绑定正常工作。如果你不想使用 Python 脚本控制虚拟机,则不一定需要安装它。 ![](/data/attachment/album/202309/27/150353ss04jbmq6t7sk099.jpg) 但是,如果你认为将来可能需要它们,则应该将其与它一起安装。 现在,最终的安装过程将根据你上面的偏好开始,并且它将向你提供在关闭安装程序时启动 VirtualBox 的选项。 ![](/data/attachment/album/202309/27/150353qujyfky2xpqwq5qn.jpg) ### 2、使用 winget 工具 `winget` 命令行工具使用 Windows 包管理器在 Windows 10 和 11 上搜索、安装、升级、删除和配置应用。 如果你更喜欢使用命令行,那么这就是适合你的方法。 首先,你需要以**管理员**身份启动**命令提示符**。 ![](/data/attachment/album/202309/27/150354ltrek7rrzxuxef7u.jpg) 接下来,你需要使用 `winget` 命令来安装 VirtualBox。 这是要输入的命令: ``` winget install Oracle.VirtualBox ``` > > ? 如果你是第一次使用 winget,它会要求你同意这些条款。你需要接受它们才能继续使用它,同时你的一些数据(例如区域)将发送到微软商店。 > > > ![](/data/attachment/album/202309/27/150354izrqh18v80nr06hq.jpg) ### 下一步是启用虚拟化 你可以注意到,这两种方法都会安装适用于 Windows 的最新 VirtualBox 软件包。因此,你可以开始使用 VirtualBox 来创建和管理虚拟机。 但安装 VirtualBox 只是第一步。你应该通过调整一些设置来 [确保你的 Windows 系统已做好虚拟化准备](/article-16186-1.html)。以下是更多详细信息。 > > **[让你的 Windows 系统为虚拟机做好准备](/article-16186-1.html)** > > > ? 你在流程中遇到过任何问题吗?你更喜欢哪种方法?请在下面的评论中告诉我。 *(题图:MJ/ac593dfb-8d50-4e77-a3d7-6b772bcfc870)* --- via: <https://itsfoss.com/install-virtualbox-windows/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/%E6%A0%A1%E5%AF%B9%E8%80%85ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) VirtualBox is one of the [best virtualization software](https://itsfoss.com/virtualization-software-linux/) out there. If you want to [install Linux on Windows in a virtual machine using VirtualBox](https://itsfoss.com/install-linux-in-virtualbox/), the first step is to install the VirtualBox application itself. We have covered a tutorial to [install VirtualBox on Ubuntu](https://itsfoss.com/install-virtualbox-ubuntu/). Let me highlight the steps for a Windows system. The steps will be the same for the latest Windows 10 or 11 and older. Two easy ways to get Oracle VirtualBox installed on Windows: **Download the installer for Windows and follow the on-screen instructions****Use the winget tool** ## 1. Using the Windows Installer To get started, head to [VirtualBox's official download page](https://www.virtualbox.org/wiki/Downloads). Click on "**Windows hosts**" option to download the .exe installer. ![virtualbox download](https://itsfoss.com/content/images/2023/07/virtualbox-exe-download.jpg) Once you download the installer (.exe) file, here's what is next after launching it: ![virtualbox installation start](https://itsfoss.com/content/images/2023/07/vbox-installer-next.jpg) The installation instructions let you choose a location to get it installed to. You should stick with the defaults on the C: drive to ensure everything essential gets installed for VirtualBox to work as expected. ![virtualbox installation storage location](https://itsfoss.com/content/images/2023/07/vmbox-location.jpg) The installation process includes setting up virtual network interfaces. So, your network might get reset at the moment. Ensure that you are not connected to anything important at the time of installing it. ![virtualbox installation networking interfaces](https://itsfoss.com/content/images/2023/07/vmbox-network-interface.jpg) While the networking feature gets sorted, there are also dependencies to take care of. The Python core package needs to be installed for Python bindings to work. You do not necessarily need to install it if you would rather not control your virtual machine using Python scripts. ![virtualbox installation dependencies](https://itsfoss.com/content/images/2023/07/vmbox-dependencies.jpg) However, if you think you might need them in the future, you should install it along with it. Now, the final installation process will begin as per your preferences above, and it will present you with the option to launch VirtualBox upon closing the installer. ![virtualbox installation complete](https://itsfoss.com/content/images/2023/07/vmbox-install-complete.jpg) **Suggested Read 📖** [10 Reasons to Run Linux in Virtual MachinesYou can run any operating system as a virtual machine to test things out or for a particular use case. When it comes to Linux, it is usually a better performer as a virtual machine when compared to other operating systems. Even if you hesitate to install Linux on bare](https://itsfoss.com/why-linux-virtual-machine/)![](https://itsfoss.com/content/images/wordpress/2022/04/reasons-to-install-linux-in-virtualmachines.jpg) ![](https://itsfoss.com/content/images/wordpress/2022/04/reasons-to-install-linux-in-virtualmachines.jpg) ## 2. Using the winget tool The winget command-line tool uses the Windows Package Manager to search, install, upgrade, remove, and configure applications on Windows 10 and 11. If you prefer to use the command-line, this is the method for you. First, you need to launch **Command Prompt** as an **administrator**. ![command prompt](https://itsfoss.com/content/images/2023/07/cmd-administrator.jpg) Next, you need to use the winget command to install VirtualBox. Here's the command to type in: `winget install Oracle.VirtualBox` ![winget installing virtualbox](https://itsfoss.com/content/images/2023/07/winget-vbox-1.jpg) ## Enabling virtualization is the next step As you can notice, both the methods install the latest VirtualBox package for Windows. So, you can get started using VirtualBox to create and manage virtual machines. But installing VirtualBox is only the first step. You should [ensure that your Windows system is virtualization ready](https://itsfoss.com/windows-enable-virtualization/) by tweaking some settings. Here are more details. [How to Enable Virtualization on WindowsHere are the things you need to make sure that your Windows system is ready to run virtual machines.](https://itsfoss.com/windows-enable-virtualization/)![](https://itsfoss.com/content/images/2023/07/preparing-windows-system-for-vms.png) ![](https://itsfoss.com/content/images/2023/07/preparing-windows-system-for-vms.png) 💬 *Did you face any issues with the process? What method do you prefer? Let me know in the comments below.*
16,233
Linux Mint Debian 版本 6 “Faye” 来了!
https://news.itsfoss.com/lmde-6/
2023-09-28T09:28:00
[ "LMDE" ]
https://linux.cn/article-16233-1.html
![](/data/attachment/album/202309/28/102652rb3y42wf4ftwdfz9.jpg) > > 无需再等待!Linux Mint 的 Debian 版本升级已经发布了。 > > > 我们期待已久! 去年,Linux Mint Debian Editon(LMDE)发布了一个重要的版本 [LMDE 5](https://news.itsfoss.com/lmde-5-release/),并带来了一些比较不错的改进。 今年,我们迎来了 **LMDE 6 版本**,代号为 “**Faye**”。它采用了与以往版本相似的命名方式。 让我们看看这一新版本有什么引人注目的地方! ### Linux Mint Debian Edition 6 “Faye”: 有什么新功能? ![](/data/attachment/album/202309/28/102750w0d0g00jgpj9lwhv.jpg) LMDE 6 由 Debian 的最新的稳定发行版 [Debian 12](https://news.itsfoss.com/debian-12-release/) 支持,具有所有改进、错误修复和新功能等等。 你可以期待在 Linux Mint 21.2 中看到所有精彩功能。 新版本的一些主要亮点: * 基于 Linux 内核 6.1 * Cinnamon 桌面升级 * 改进后的软件包管理器 > > ? LMDE 只是另一个版本的 Linux Mint,它基于 Debian,而非 Ubuntu,在功能实现上与 Linux Mint 主版本保持同步。 > > > #### Linux 内核 6.1 ![](/data/attachment/album/202309/28/102707qwe0lfw8juj11ftb.png) LMDE 6 使用了长期支持的 [Linux 内核 6.1](https://news.itsfoss.com/linux-kernel-6-1-release/) 版本,从而获得了 Rust 的**实验支持**、对英特尔 Meteor Lake 芯片和 AMD 的 RDNA 3 图形芯片的 **初始支持**。 #### Cinnamon 的升级 ![](/data/attachment/album/202309/28/102708uqls64dvczso66sn.png) 此外,使用了 **Cinnamon 5.8** 作为 LMDE 6 的默认桌面,它作为 Linux Mint 的旗舰桌面环境,提供了很多实用功能。 比如,对窗口管理的**手势支持**、**更好的窗口平铺与媒体控制**、**更强的工作区管理**等等。 还有一个名为“<ruby> 风格 <rt> Styles </rt></ruby>”的新设置项,它用于调整系统的整体外观,允许你为系统的不同元素设置不同的颜色。 我们建议你阅读我们关于 **[Linux Mint 21.2](https://news.itsfoss.com/linux-mint-21-2/)** 发行版本的文章,以更好地了解 Cinnamon 的改进。 #### 全新的软件包管理器 ![](/data/attachment/album/202309/28/102708ogduktfytfdrlccf.png) 同样,我们现在也有了**全面改版的软件包管理器**,我们在 Linux Mint 21.2 版本中首次看到了它,现在它又出现在了 LMDE 6 中。 它采用了**改良的布局**,以方便使用,主页上的主要应用类别移到了更下方,搜索栏也移到了左侧。 此外,在应用程序的系统软件包与 Flatpak 之间进行选择也变得**更加简单**。 #### ?️ 其他变化和改进 除上述更新外,还有一些变化值得一提: * 新的登录屏幕; * 为 Warpinator 提供更好的安全保障; * 支持 HEIF 和 AVIF 图像; * “Mint-Y-Legacy” 主题更名为 “Mint-L”; * 可以在文件管理器中为文件夹设置重点颜色。 有关此版本的更多详情,请参阅官方 [发行说明](https://linuxmint.com/rel_faye.php)。 ### ? 下载 LMDE 6 “Faye” 别忘了,LMDE 是为数不多的 [支持 32 位系统的 Linux 发行版](https://itsfoss.com/32-bit-linux-distributions/),当然也包括最新的 LMDE 6! 它有 **32 位** 与 **64 位** 两种版本,你可以前往 [官方网站](https://linuxmint.com/download_lmde.php) 获取你所需要的版本。 **对于 LMDE 5 用户** ,可通过以下命令安装升级工具进行升级: ``` apt update apt install mintupgrade ``` 安装完成后,用以下命令启动图形用户界面升级工具: ``` sudo mintupgrade ``` ![](/data/attachment/album/202309/28/102708m3sjfs5003p4jwh3.png) 按照屏幕上的说明进行操作,升级成功后,使用以下命令移除升级工具并重新启动: ``` apt remove mintupgrade sudo reboot ``` > > **[LMDE 6 “Faye”](https://linuxmint.com/download_lmde.php)** > > > ? 你会体验 LMDE 6 吗?请告诉我们! --- via: <https://news.itsfoss.com/lmde-6/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[GenshinMinecraft](https://github.com/GenshinMinecraft) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) We have been waiting for this one for some time now! Linux Mint Debian Edition (**LMDE**) received a major release last year in the form of [LMDE 5](https://news.itsfoss.com/lmde-5-release/), and that had arrived with some pretty neat improvements. And for this year, we have the **LMDE 6 release **code-named “**Faye**”, it follows a similar naming scheme to past releases. Let's see what this release has to offer. ## Linux Mint Debian Edition 6 “Faye”: What's New? ![a screenshot of the neofetch output on lmde 6](https://news.itsfoss.com/content/images/2023/09/LMDE_6_1.png) Powered by the recently launched [ Debian 12 release](https://news.itsfoss.com/debian-12-release/), LMDE 6 features all of its improvements, bug fixes, new features, and then some more. You can expect all the goodies added to Linux Mint 21.2. Some key highlights of this release include: **Linux Kernel 6.1****Cinnamon Upgrades****Revamped Software Manager** ### Linux Kernel 6.1 ![a screenshot showing the linux kernel version of lmde 6](https://news.itsfoss.com/content/images/2023/09/LMDE_6_2.png) LMDE 6 takes advantage of the long-term supported [Linux Kernel 6.1](https://news.itsfoss.com/linux-kernel-6-1-release/) release, that allows it to leverage **experimental support for Rust**, **initial support for Intel's Meteor Lake chips**, **AMD's RDNA 3 graphics**, and more. ### Cinnamon Upgrades ![a screenshot of the system info on lmde 6](https://news.itsfoss.com/content/images/2023/09/LMDE_6_3.png) Then there are the improvements thanks to the implementation of **Cinnamon 5.8**. Being the flagship desktop environment for Linux Mint, plenty of things are being offered. Take for instance the **gestures support for window management**, **better window tiling/media controls**, **enhanced workspace management**, and more. Then there's the new setting called '**Styles**', for tweaking the whole look and feel of the system. It allows you to set various colors to the different elements of the system. I suggest you go through our article on the ** Linux Mint 21.2 **release to get a better look at the Cinnamon-specific improvements. **Suggested Read **📖 [Linux Mint 21.2 Release Improves The Visual Redesign FurtherLinux Mint 21.2 is an impressive upgrade!](https://news.itsfoss.com/linux-mint-21-2/)![](https://news.itsfoss.com/content/images/2023/06/linux-mint-21-2-release.jpg) ![](https://news.itsfoss.com/content/images/2023/06/linux-mint-21-2-release.jpg) ### Revamped Software Manager ![a screenshot of the revamped software manager on lmde 6](https://news.itsfoss.com/content/images/2023/09/LMDE_6_4.png) Similarly, we now have the **overhauled software manager** that we first saw with the Linux Mint 21.2 release, and now it is here with LMDE 6. It features an **improved layout for accessibility**, with the main app categories being shifted further below on the homepage, and the search bar being moved to the left side. Furthermore, it has become significantly **simpler to choose between the system package and Flatpak** of an application. ### 🛠️ Other Changes and Improvements Other than the above-mentioned, here are a few changes that are worth mentioning: - Improved login screen. - Better security for Warpinator. - Proper support for HEIF and AVIF images. - The 'Mint-Y-Legacy' theme was renamed to 'Mint-L'. - Ability to set accent colors to folders in the file manager. For more details of this release, you can go through the official [release notes](https://linuxmint.com/rel_faye.php?ref=news.itsfoss.com). ## 📥 Download LMDE 6 “Faye” Not to forget, LMDE is one of the few [Linux distributions supporting 32-bit systems](https://itsfoss.com/32-bit-linux-distributions/?ref=news.itsfoss.com), and with the release of LMDE 6, that has remained unchanged. It is being offered in both **32-bit** and **64-bit** variants, you can head over to the [official website](https://linuxmint.com/download_lmde.php?ref=news.itsfoss.com) to get the variant of your choice. **For existing LMDE 5 users**, you can upgrade by installing the upgrade tool through the commands below: ``` apt update apt install mintupgrade ``` Once you install it, launch the GUI upgrade tool with: `sudo mintupgrade` ![linux mint debian edition upgrade tool](https://news.itsfoss.com/content/images/2023/09/shadow_mintupgrade.png) Follow the on-screen instructions, and when the upgrade is a success, remove the upgrade tool using the following commands and reboot: ``` apt remove mintupgrade sudo reboot ``` *💬 Will you be taking LMDE 6 for a spin? Let us know!* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,234
Firefox 118 版本发布,带来了原生的翻译功能
https://news.itsfoss.com/firefox-118-release/
2023-09-29T10:10:00
[ "Firefox" ]
https://linux.cn/article-16234-1.html
![](/data/attachment/album/202309/28/101123d2z9i6a67yol42oq.jpg) > > Firefox 118 让用户更轻松地翻译网页。 > > > 近期,Mozilla 积极努力改进 Firefox,以使其在各方面都更强大,例如针对谷歌的 Web 服务提供更强大的 [支持](https://news.itsfoss.com/mozilla-firefox-progress/),以及之前发布的 [Firefox 117 版本](https://news.itsfoss.com/firefox-117-release/)。 现在,Firefox 的新版本 118 来到了我们面前,它**终于带来了注重隐私保护的原生翻译功能**,无需寻找临时解决方案。 让我们一起深入了解新版本能为我们带来什么。 ### ? Firefox 118:有哪些新特性? ![](/data/attachment/album/202309/28/101216haw4zwzbi5n2j5la.png) 和之前的版本一样,Firefox 118 提供了很多新特性,其中一些主要的亮点包括: * 原生的浏览器翻译 * 谷歌会议的功能增强 * 重要的安全更新 首先,我们会关注到原生的翻译功能,然后再逐一了解其他的特性。 ### 原生且内置的翻译功能 经过一段时期的测试后,[Firefox](https://www.mozilla.org/en-US/firefox/new/) 最终获得了**原生支持浏览器内部的翻译功能**。我们在 [Firefox 117 版本](https://news.itsfoss.com/firefox-117-release/) 中测试过这个功能,但并未设置为默认开启。 现在,只需要简单的几次点击就能启动翻译,如同视频中展示的那样。你需要进入汉堡菜单,然后点击 “<ruby> 翻译此页 <rt> Translate page </rt></ruby>”,选择来源语言和你想要翻译成的语言,然后点击 “<ruby> 翻译 <rt> Translate </rt></ruby>”。 如果你想返回原文,只需点击地址栏中的翻译图标,再点击 “<ruby> 显示原文 <rt> Show original </rt></ruby>”。 在我实际使用过程中,**这个功能在处理具有多种语言的网页时有一些问题**,并且不支持从图像或视频中翻译文本。 但是请注意,**翻译工具依然标注为 “Beta” 版本**。我有信心,在未来几个月,开发者将会提供更多更新以改进其功能。 ### ?️ 其他的更变与改进 关于其他的底层优化: * 对于 [谷歌会议](https://apps.google.com/meet/),Firefox 用户现在可以使用视频特效和背景模糊这类新功能。 * [Firefox 建议](https://blog.mozilla.org/en/products/firefox/firefox-news/firefox-suggest/) 的用户现在将可以在地址栏看到浏览器插件的建议(仅适用于美国用户)。 * 为了防止在隐私浏览窗口中进行字体指纹跟踪,网站上字体的可见性已被限制为仅显示系统字体。 * Firefox 现在使用 [FDLIBM](https://www.netlib.org/fdlibm/readme) 数学库来处理 Web 音频,以提高隐私保护。 * 进行了各种 [安全修补](https://www.mozilla.org/en-US/security/advisories/mfsa2023-41/)。 你还可以浏览官方的 [版本发布说明](https://www.mozilla.org/en-US/firefox/118.0/releasenotes/),以更深入地了解一些技术问题。 ### ? 下载 Mozilla Firefox 118 你可以在 [官方网站](https://www.mozilla.org/firefox/download/) 中下载 Firefox 118 版本,提供的格式有 **.tar.bz2 包** ,或者可以在 [Flathub 商店](https://flathub.org/apps/org.mozilla.firefox) 中 获取 **Flatpak**。 此外,你也可以尝试 Firefox 的 [Snap 包](https://snapcraft.io/firefox)。 > > **[Mozilla Firefox 118](https://www.mozilla.org/firefox/download/)** > > > **对于已经安装的用户:** 你可以在设置菜单中搜索 “<ruby> 更新 <rt> Update </rt></ruby>”,然后点击 “<ruby> 检查更新 <rt> Check for Updates </rt></ruby>” 或者检查系统更新以从软件库中获取。 ? 自从新的翻译功能发布,你是否为之振奋?你期待 Firefox 在未来会推出什么样的更新呢?请在评论区告诉我们你的想法! --- via: <https://news.itsfoss.com/firefox-118-release/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) In recent times, Mozilla seems to be busy improving Firefox in whatever way possible. Take, for instance, [better support](https://news.itsfoss.com/mozilla-firefox-progress/) for Google's web services, or the previous [Firefox 117 release](https://news.itsfoss.com/firefox-117-release/). And now we have yet another release in the form of the Firefox 118 release, that **finally introduces privacy-focused translations natively**, doing away with the need for workarounds. Let's dive in and see what this release has to offer. ## 🆕 Firefox 118: What's New? ![a screenshot of the firefox about information](https://news.itsfoss.com/content/images/2023/09/Firefox_118_1.png) Firefox 118, like previous releases, has a lot to offer. Some key highlights include: **Native In-Browser Translations****Improvements for Google Meet****Important Security Fixes** We will first focus on the translation feature, then the rest. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ### Native In-Browser Translations Well, after some time of testing, [Firefox](https://www.mozilla.org/en-US/firefox/new/?ref=news.itsfoss.com) finally has **native support for in-browser translations**. We checked this out in the [Firefox 117 release](https://news.itsfoss.com/firefox-117-release/), but it was not available by default. Now, it's just a few clicks away, as shown in the video above. You just have to go into the hamburger menu, then click on '**Translate page**', then select the translate from and to languages and click on '**Translate**'. For switching back to the original language, just click on the translation logo in the address bar, and click on '**Show original**'. In my experience, **this feature runs into some issues** when there are multiple languages on the same webpage, and there's no support for translating text from images or videos. But that figures, as **the translation widget still says 'Beta'** on it. I am certain that the developers will push updates for improving its functionality in the coming months. **Suggested Read **📖 [There’s One More Reason to Use Mozilla Firefox Now!Firefox is making good advances. Let’s take a look at what’s cooking now!](https://news.itsfoss.com/mozilla-firefox-progress/)![](https://news.itsfoss.com/content/images/2023/09/firefox-google-workspace.png) ![](https://news.itsfoss.com/content/images/2023/09/firefox-google-workspace.png) ### 🛠️ Other Changes and Improvements As for the rest of the under-the-hood refinements: - Video effects and background blur are now available for Firefox users on [Google Meet](https://apps.google.com/meet/?ref=news.itsfoss.com). [Firefox suggest](https://blog.mozilla.org/en/products/firefox/firefox-news/firefox-suggest/?ref=news.itsfoss.com)users will now be shown browser add-on suggestions in the address bar. (US Only).- The visibility of fonts on websites has been restricted to only system fonts, to stop font fingerprinting in private browsing windows. - Web audio in Firefox now makes use of the [FDLIBM](https://www.netlib.org/fdlibm/readme?ref=news.itsfoss.com)math library to improve privacy. - Various [security fixes](https://www.mozilla.org/en-US/security/advisories/mfsa2023-41/?ref=news.itsfoss.com). You can also go through the official [release notes](https://www.mozilla.org/en-US/firefox/118.0/releasenotes/?ref=news.itsfoss.com) to dive further into some technical bits. ## 📥 Get Mozilla Firefox 118 Firefox 118 is available to download from the [official website](https://www.mozilla.org/firefox/download/?ref=news.itsfoss.com) as a** .tar.bz2 package**, and as a** Flatpak** from the [Flathub store](https://flathub.org/apps/org.mozilla.firefox?ref=news.itsfoss.com). In either case, you can also try Firefox's [Snap package](https://snapcraft.io/firefox?ref=news.itsfoss.com). **For existing installations:** You can update it by searching for '**Update**', in the settings menu, and clicking on '**Check for Updates**' or check for system updates to get it from the repositories. *💬 Are you excited about the new translation feature? What else do you expect from Firefox updates in the near future? Let us know in the comments below!* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,235
Element X:用 Matrix 2.0 协议打造去中心化 WhatsApp 杀手
https://news.itsfoss.com/element-x-matrix-2/
2023-09-28T10:49:28
[ "Matrix" ]
https://linux.cn/article-16235-1.html
![](/data/attachment/album/202309/28/104903vzny14gjuudsy1o0.jpg) > > Matrix 2.0 协议已发布。如果你是早期用户,现在就可以试用! > > > Matrix 是一种开源的去中心化通信协议。 你可以将其集成到你的服务中,自行托管 Matrix 服务器,或从选定的托管提供商处购买服务器。而且,要开始与其通信,你可以使用这几个 [最佳 Matrix 客户端](https://itsfoss.com/best-matrix-clients/) 之一。 Matrix 协议非常适合隐私和安全,并被政府、组织和个人采用。然而,它尚未成功取代 WhatsApp、Telegram 或 iMessage 等中心化消息应用的流行度。 为了解决这个问题,[Matrix.org](http://Matrix.org) 宣布了下一代协议,即 **Matrix 2.0**。 ### ? Matix 2.0 x Element X:正在进行中 Matrix 2.0 旨在关注可用性和性能。 根据官方公告,可能的功能包括: * 滑动同步(即时登录/同步) * 原生 Open ID Connect(身份验证协议) * 原生群组 VoIP(用于大规模加密语音和视频通话) * 更快的远程加入 这听起来像是改善通信体验的可靠新功能。 然而,所有这些还不是当前 Matrix 规范的一部分。所以,作为用户,你必须等待。 但是,对于任何想要测试改进的开发人员来说,都可以在 Matrix 2.0 客户端的帮助下进行测试,这就是 **Element X** 的用武之地。 你还可以选择探索其他支持的 Matrix 客户端,目前 Element X 是 Matrix 2.0 的测试环境。 ![](/data/attachment/album/202309/28/104928nn0367hfc6o3ybby.jpg) **Element X** 是我们所知的 [Element 消息应用](https://element.io/) **开发中的后续版本**。它的目标是超越 WhatsApp、iMessage 和 Telegram 等消息应用?。 ![](/data/attachment/album/202309/28/104928mzxfozrwgmaqfer5.png) Element X 的亮点包括: * 端到端加密多方 VoIP 和视频通话 * 由于采用 Rust 编写的核心,有简化的 UI 和快速的性能 * 富文本编辑器 UI * 支持位置共享和投票 ![Element Call integration within Element X](/data/attachment/album/202309/28/104929r66rujmpfnu6zj9j.png) 当然,**这是一个大目标**。根据我使用 Element 应用的经验,它设法提供了良好的体验,但无法取代 WhatsApp/Telegram。 因此,看看他们如何在利用 Matrix 2.0 协议的同时改进 Element X 应该很有趣。我在我的安卓手机上对其进行了快速测试,看起来性能有所提高?。 除非你想成为该应用的早期采用者并希望向开发人员提供有关其进度的反馈,否则你可能需要等待。 当然,现在下结论还为时过早,因为 Element X 仍然没有许多功能,并且随着他们继续测试和实现 Matrix 2.0 协议功能,只会变得更好。 但是,我很兴奋! ? 有关 Matrix 2.0 的所有**技术细节**,请参阅 [官方公告](https://matrix.org/blog/2023/09/matrix-2-0/)。而且,如果你热衷于探索 Element X 的计划,请前往其官方 [博客](https://element.io/blog/element-x-ignition/)。 ? 你如何看待 Element 的下一代版本和 Matrix 2.0 计划? 在下面的评论中分享你的想法。 --- via: <https://news.itsfoss.com/element-x-matrix-2/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Matrix is an open-source decentralized communication protocol. You can always integrate it to your services, self-host a matrix server, or purchase a server from select hosting providers. And, to get started communicating with it, you can utilize one of the [best Matrix clients](https://itsfoss.com/best-matrix-clients/?ref=news.itsfoss.com) available. The Matrix protocol is great for privacy and security, and being adopted by governments, organizations, and individuals. However, it has not yet managed to take over the popularity of centralized messaging apps like WhatsApp, Telegram, or iMessage. To tackle that, Matrix.org announced the next generation of the protocol, i.e., **Matrix 2.0.** **Suggested Read **📖 [9 Best Matrix Clients for Decentralized MessagingMatrix clients help you experience secure, and decentralized messaging. Here are the best options if you want to use it.](https://itsfoss.com/best-matrix-clients/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/wordpress/2022/06/best-matrix-clients.jpg) ![](https://itsfoss.com/content/images/wordpress/2022/06/best-matrix-clients.jpg) ## Matix 2.0 x Element X: Work in Progress 🚧 Matrix 2.0 aims to focus on the usability, and performance. As per the official announcement, the features that make it possible include: **Sliding Sync (instant login/sync)****Native Open ID Connect (authentication protocol)****Native Group VoIP (for large-scale encrypted voice and video calls)****Faster Remote Joins** That sounds like solid new features to improve the communication experience. However, all of these are not part of the current Matrix specification yet. So, as a user, you will have to wait it out. But, for any developer who wants to test out the improvements can do so with the help of a Matrix 2.0 client, which is where **Element X** comes in. You can also choose to explore other Matrix clients when they support it, for now, Element X is the test ground for Matrix 2.0 ![element x screenshots](https://news.itsfoss.com/content/images/2023/09/element-x-screenshot.jpg) **Element X** is a **work-in-progress successor** to the [Element messaging app](https://element.io/?ref=news.itsfoss.com) that we know. It aims to outperform messaging apps like WhatsApp, iMessage, and Telegram 🤯 ![element x rich editor](https://news.itsfoss.com/content/images/2023/09/element-x-editor.png) Highlights of Element X include: **End-to-end encrypted multiparty VoIP and video calling****Simplified UI and fast performance, thanks to the core written in Rust****Rich-text editor UI****Location sharing and poll support** ![element call](https://news.itsfoss.com/content/images/2023/09/element-call.png) Definitely, **a big goal there**. As per my experience with the Element app, it managed to provide a good experience, but not something I could replace WhatsApp/Telegram with. So, it should be interesting to see how they improve Element X while utilizing the Matrix 2.0 protocol. I gave it a quick test on my Android mobile, and it seemed like an improvement in terms of performance 📈 Unless you want to be an early adopter for the app and want to provide feedback to the developers on their progress, you might want to wait. Of course, it is too early for me to reach a conclusion as Element X still misses out on many features, and would only get better as they continue to test and implement the Matrix 2.0 protocol features. But, I am excited! 🤩 For all the **technical details** on Matrix 2.0, refer to the [official announcement](https://matrix.org/blog/2023/09/matrix-2-0/?ref=news.itsfoss.com). And, if you are keen to explore what's planned for Element X, head to its official [blog post](https://element.io/blog/element-x-ignition/?ref=news.itsfoss.com). * 💬* *What do you think of Element's next-gen version and Matrix 2.0 initiatives? Share your thoughts in the comments down below.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,236
《泰拉瑞亚》开发商支持开源游戏引擎而非 Unity
https://news.itsfoss.com/terraria-open-source-game-engine/
2023-09-29T11:32:00
[ "Unity", "游戏" ]
https://linux.cn/article-16236-1.html
![](/data/attachment/album/202309/28/133314q5y3ibodit666056.jpg) > > 开源游戏引擎万岁! > > > 继 Unity 制定了会在游戏安装或启动时向开发者收取费用的掠夺性 “[运行时费用](https://blog.unity.com/news/plan-pricing-and-packaging-updates)” 定价模式之后,《<ruby> 泰拉瑞亚 <rt> Terraria </rt></ruby>》的开发商 [Re-Logic](https://re-logic.com/) 承诺将会支持两个新兴的开源游戏引擎。 尽管 Unity 的定价模式 [已进行了调整](https://www.theregister.com/2023/09/19/unity_talks_of_price_cap/),但对玩家以及开发者的信任已经被打破。许多游戏开发商不得不采取预防措施来限制成本。 那么,让我们看看 Re-Logic 都承诺了些什么。 ### 巨大贡献 ? 他们最近在 Twitter 上宣布了两件大事。 第一,他们**谴责 Unity 提出的定价模式改革**,提到了以下几点: > > 我们明确谴责并拒绝接受 Unity 最近提出的服务条款/收费变更,以及推出这些变更的暗箱操作方式。 > > > 最令人痛心的是,Unity 多年来培养的信任被轻描淡写地抛到了一边,成为压榨发行商、工作室和玩家的又一种方式。 > > > 他们还补充说,**一份简单的公开声明**不足以挽回这样的事情,被破坏的信任,不可能轻易修复。 不过,该公告的**第二项**主要亮点是他们**承诺向开源游戏引擎 [Godot](https://godotengine.org/) 和 [FNA](https://fna-xna.github.io/)** 各捐赠 100,000 美元。 而且,这还不够,他们还决定**赞助这些项目**,每个项目的赞助费为每月 1000 美元,只有一个很简单的要求: > > 作为回报,我们所要求的只是他们保持良好的品格,继续尽其所能为世界各地的开发人员提供功能强大、易于使用的引擎。 > > > 这是一个很好的回报要求! ? 尽管《泰拉瑞亚》的手机和游戏机移植版使用的是 Unity(由第三方维护),但这并不妨碍他们对这种情况发表意见。 你可以在原 [公告推文](https://twitter.com/Terraria_Logic/status/1704227519027651016) 上关注围绕此事发表的讨论,了解用户和游戏开发者的更多想法。 ### 是时候闪亮登场了吗? ![](/data/attachment/album/202309/28/133551ydmauedn6vvu3686.png) 我觉得,是的! 鉴于大多数流行的游戏引擎,要么是需要付费的闭源引擎,要么是仅供游戏开发者自用的引擎(说的就是你 [RAGE](https://en.wikipedia.org/wiki/Rockstar_Advanced_Game_Engine) ),因此**像 Godot 和 FNA 这样的开源游戏引擎是当务之急**。 很高兴看到 Re-Logic 这样的热门游戏开发商尝试支持开源游戏引擎,我们已经有一段时间没有看到这样的努力了。 我希望通过这件事,**更多的开发者会对支持开源游戏引擎产生浓厚的兴趣**,无论他们以何种方式,可以是金钱,也可以是贡献代码。 ? 你对此怎么看?可以在下方分享你的想法。 --- via: <https://news.itsfoss.com/terraria-open-source-game-engine/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[GenshinMinecraft](https://github.com/GenshinMinecraft) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Terraria's developers, [Re-Logic](https://re-logic.com/?ref=news.itsfoss.com), have pledged to support two up-and-coming open-source game engines following Unity's predatory '[Runtime Fee](https://blog.unity.com/news/plan-pricing-and-packaging-updates?ref=news.itsfoss.com)' pricing model that would charge devs whenever a game was installed or launched. Even though the pricing model [was tweaked](https://www.theregister.com/2023/09/19/unity_talks_of_price_cap/?ref=news.itsfoss.com), the trust has been broken, with many game devs having to take precautionary measures to limit costs. So, let's see what Re-Logic has promised to do. ## A Sizeable Contribution 💰 In a recent announcement on Twitter, they said two major things. One, they **denounced the pricing model changes proposed by Unity **by mentioning the following: We unequivocally condemn and reject the recent TOS/fee changes proposed by Unity and the underhanded way they were rolled out. The flippant manner with which years of trust cultivated by Unity were cast aside for yet another way to squeeze publishers, studios, and gamers is the saddest part. They also added that **a simple public statement was not sufficient** to undo such a thing, and trust had been broken that cannot be repaired easily. However, the main highlight of the announcement was their **pledge to donate $100,000 each to open-source gaming engines, Godot and FNA**. And, that's not all, they have **also decided to sponsor these projects for $1000/month each**, with only a simple demand: All we ask in return is that they remain good people and keep doing all that they can to make these engines powerful and approachable for developers everywhere. Now, that's an excellent thing to ask for in return! 😄 Even though the mobile and console ports of Terraria use Unity (maintained by a third-party), this hasn't stopped them from being vocal about the situation. You can follow the discussion surrounding this on the original [announcement tweet](https://twitter.com/Terraria_Logic/status/1704227519027651016?ref=news.itsfoss.com) to get more insights on what the users and game developers think. ## Time to Shine? ![a custom banner showing the godot and fna logos](https://news.itsfoss.com/content/images/2023/09/Terraria_Devs_W.png) I say, yes! **Open-source game engines such as Godot and FNA are the need of the hour**, seeing that most popular game engines are either close-sourced behind a paywall, or strictly for a game developer's own use (I am looking at you [RAGE](https://en.wikipedia.org/wiki/Rockstar_Advanced_Game_Engine?ref=news.itsfoss.com)). It is great to see a popular game developer like Re-Logic trying to support open-source game engines like this, it has been some time since we saw such an endeavor. I hope with this, **more developers take a keen interest in supporting open-source game engines** in whatever way they can, it could be either monetarily, or by contributing to the code. * 💬* *What do you think? Share your thoughts in the comments below.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,237
NewsFlash 3.0:大升级,焕然一新
https://news.itsfoss.com/newsflash-3-0-release/
2023-09-30T10:00:00
[ "RSS" ]
https://linux.cn/article-16237-1.html
![](/data/attachment/album/202309/28/140112c761cazfcocf6ogd.jpg) > > 适用于 Linux 的现代新闻阅读器应用获得超级升级。 > > > NewsFlash 是一个简洁的程序,可让你关注你最喜爱的新闻网站和博客。作为现已不复存在的 [FeedReader](https://github.com/jangernert/FeedReader) 的精神继承者,它与许多现有的基于网络的 RSS 阅读器(如 Inoreader 和 Feedly)很好地集成,并且还支持本地 <ruby> 订阅源 <rt> Feed </rt></ruby>。 不要忘记,NewsFlash 是 [Linux 上最好的订阅源阅读器桌面应用](https://itsfoss.com/feed-reader-apps-linux/) 之一。 NewsFlash 3.0 升级后,应用有许多重要的改进。 ### ? NewsFlash 3.0:有什么新内容? ![](/data/attachment/album/202309/28/140149kswdc6lwlflcmid7.jpg) NewsFlash 具有**调整后的界面布局**,并使用 libadwaita 1.4 的“分割视图”和“工具栏视图”。 这可以显示**无边框标题栏** ,其中 **三列的外观略有不同**。侧边栏和文章列表的调整大小行为也得到了改进。 同样,通过使用 GTK 4.12 的“列表视图”部分,**文章列表得到了改进**,并且文章现在按天/日期分组。 然而,这些并不是此版本的唯一亮点,以下是一些值得注意的亮点: * 更好的性能 * 改进的缩略图 * 拖放功能 * 图像查看器 #### 更好的性能 得益于 [Tokio 运行时](https://tokio.rs/tokio/tutorial) 的实现,NewsFlash 3.0 现在**快了很多**,它允许在单个 Tokio 运行时实例上进行异步处理。 简而言之,该应用更加快捷,因为它以更优化的方式处理请求。因此,同步、将文章标记为已读以及抓取完整文章内容等操作现在要快得多。 #### 改进的缩略图 ![](/data/attachment/album/202309/28/140149pie093rwsjwzbuwj.jpg) NewsFlash 中添加了**启发式进程**,它现在可以根据订阅源中的文章生成缩略图。 它应该从文章的 HTML 代码中收集“相关”图像,并将其用作缩略图。 然而,正如你在我们的 [Element X](/article-16235-1.html) 新闻文章中看到的那样,它从文章中抓取了图像,而不是获取题图。随着未来的更新,这应该会变得更好。 #### 拖放功能 现在,你可以拖放侧边栏上的元素,将订阅源从一个类别移动到另一个类别,并对列表重新排序。 #### 图像查看器 ![](/data/attachment/album/202309/28/140149yigggdwijs3jgejz.jpg) 使用 NewsFlash 3.0,你现在可以单击文章中的图像,在**专用图像查看窗口**中查看它们。同样用于显示文章的图像附件。 #### ?️ 其他更改和改进 至于其他变化,以下是一些技术改进: * 添加了对 [Commafeed](https://www.commafeed.com/) 的支持。 * 在移动设备上对订阅源的订阅已得到改进。 * NewsFlash 现在会记住应用重新启动时的窗口状态。 * “编辑”对话框已得到改进,更好地支持特殊字符和符号。 你可以浏览开发者的 [官方博客](https://blogs.gnome.org/jangernert/2023/09/22/newsflash-3-0/) 来探索此版本的一些技术细节。 ### ? 下载 NewsFlash 3.0 你可以前往 [Flathub 商店](https://flathub.org/apps/io.gitlab.news_flash.NewsFlash) 获取最新版本的 NewsFlash。 它也有 [Snap](https://snapcraft.io/newsflash) 包。但是,在撰写本文时,它尚未更新到最新版本。 > > **[NewsFlash(Flathub)](https://flathub.org/apps/io.gitlab.news_flash.NewsFlash)** > > > ? 你以前尝试过 NewsFlash 吗? 你更喜欢使用哪种订阅源阅读器?在下面的评论中分享你的想法。 --- via: <https://news.itsfoss.com/newsflash-3-0-release/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/%E6%A0%A1%E5%AF%B9%E8%80%85ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) NewsFlash is a neat program that allows you to follow your favorite news sites and blogs. As a spiritual successor to the now defunct [FeedReader](https://github.com/jangernert/FeedReader?ref=news.itsfoss.com), it integrates well with many existing web-based RSS readers (like Inoreader and Feedly), and also has support for local feeds. Not to forget, NewsFlash is one of the [best feed reader apps for Linux](https://itsfoss.com/feed-reader-apps-linux/?ref=news.itsfoss.com) desktop. With NewsFlash 3.0 upgrade, there are many important improvements to the app. ## 🆕 NewsFlash 3.0: What's New? ![a screenshot of newsflash 3.0](https://news.itsfoss.com/content/images/2023/09/NewsFlash_3.0_1.jpg) NewsFlash features **a tweaked interface layout** with the use of libadwaita 1.4's 'split views' and 'toolbar views'. This has resulted in **a borderless header bar**, with **3 columns slightly differing in appearance**. The re-sizing behavior has also improved for the sidebar and article list. Similarly, the **article list has been improved** with the use of GTK 4.12's 'listview' sections, and the articles are now grouped by day/date. However, those are not the only highlights of this release, here are some notable ones: **Better Performance****Improved Thumbnails****Drag and Drop Functionality****Image Viewer** ### Better Performance NewsFlash 3.0 is **a lot faster now,** thanks to the implementation of the [Tokio runtime](https://tokio.rs/tokio/tutorial?ref=news.itsfoss.com), this has allowed for asynchronous processing on a single Tokio runtime instance. In simple words, the app is snappier, as it handles requests in a more optimized manner. So, actions like syncing, marking articles as read, and scraping full article content are now much faster. ### Improved Thumbnails ![a screenshot of newsflash 3.0 improved thumbnails](https://news.itsfoss.com/content/images/2023/09/NewsFlash_3.0_2.jpg) A **heuristic process** has been added to NewsFlash that now handles the generation of thumbnails from the articles on the feed. It is supposed to gather a “relevant” image from the article's HTML code, and use that as a thumbnail. However, as you can see with our [Element X](https://news.itsfoss.com/element-x-matrix-2/) news article, it grabbed an image from within the article, instead of getting the featured image. This should get better with future updates. **Suggested Read **📖 [7 Best Feed Reader Apps for Linux Desktop [2023]Extensively use RSS feeds to stay updated with your favorite websites? Take a look at the best feed reader applications for Linux.](https://itsfoss.com/feed-reader-apps-linux/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/09/RSS-feeders-apps-for-linux-1.png) ![](https://itsfoss.com/content/images/2023/09/RSS-feeders-apps-for-linux-1.png) ### Drag and Drop Functionality You can now drag/drop elements on the sidebar to move a feed from one category to another and reorder the list. ### Image Viewer ![a screenshot of the image viewer on newsflash 3.0](https://news.itsfoss.com/content/images/2023/09/NewsFlash_3.0_3.jpg) With NewsFlash 3.0 you can now click on images in an article to view them in a **dedicated image viewing window**. The same is used to display image attachments of articles. ### 🛠️ Other Changes and Improvements As for the other changes, here are some technical refinements: - Added support for [Commafeed](https://www.commafeed.com/?ref=news.itsfoss.com). - Subscribing to feed on mobile has been improved. - NewsFlash now remembers the window state on app restart. - The “edit” dialog has been improved with better support for special characters and symbols. You can go through the [official blog post](https://blogs.gnome.org/jangernert/2023/09/22/newsflash-3-0/?ref=news.itsfoss.com) by the developer to explore some technical details for this release. ## 📥 Download NewsFlash 3.0 You can head over to the [Flathub store](https://flathub.org/apps/io.gitlab.news_flash.NewsFlash?ref=news.itsfoss.com) to grab the latest release of NewsFlash. It is also available as a [Snap](https://snapcraft.io/newsflash?ref=news.itsfoss.com). But, at the time of writing, it was not updated to the latest version. *💬 Have you tried NewsFlash before? What feed reader do you prefer to use? Share your thoughts in the comments below.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,240
使用开源工具 CBconvert 转换你的漫画书
https://news.itsfoss.com/cbconvert/
2023-09-30T10:33:00
[ "漫画" ]
https://linux.cn/article-16240-1.html
![](/data/attachment/album/202309/28/223349x20krpnazyplipyl.jpg) > > 这里有一些有趣的东西供你尝试! > > > 这是一款有趣的开源工具,具有非常特定的用途。 **CBconvert 是漫画书转换器**,可以将漫画转换为不同的格式以适合各种设备。 对我个人来说,这将是第一次,因为我以前从未尝试过这样的转换器。在此,我将探讨并重点介绍这款工具的功能。 > > ? 该应用相当新,正在积极开发中。期待事情发生改变。 > > > ### ⭐ CBconvert:概述 ![](/data/attachment/album/202309/28/223440q8zg1ulo78ol4r88.jpg) CBconvert 主要使用 [Go](https://go.dev/) 语言编写,旨在成为满足你所有漫画书转换需求的一站式应用。 它可以读取最常见的文件格式,例如 **CBR**(RAR)、XPS、**CB7**(7Z)、**CBT**(TAR)、**PDF** 等。 你可以将这些文件转换为两种不同的格式:**CBZ**(ZIP)和 **CBT**(TAR)。 不要认为 CBconvert 的唯一目的是转换漫画书,你还可以使用它进行一些视觉调整。我稍后会讨论这个问题。 主要功能: * 有用的编辑工具 * 漫画书转换 * 从漫画中提取封面图片 事不宜迟,让我们深入了解 CBconvert。 ### ?‍? 初步印象 虽然转换器可以在 **Linux、Windows 和 macOS** 上运行,但我在 Linux 系统上进行了尝试。 我首先使用侧边栏菜单中的“<ruby> 添加文件 <rt> Add Files </rt></ruby>”选项向应用添加一些漫画(公共领域获取)。我能够添加多部漫画,没有遇到很多问题。 同样,我继续查看各种功能选项卡。 **第一个选项卡名为“<ruby> 输入 <rt> Input </rt></ruby>”**,包含一些选项,例如**设置最小大小限制**、**仅选择灰度图像**等等。我不需要使用这些,但如果你想向要转换的文件添加先决条件,这些选项肯定很有用。 ![](/data/attachment/album/202309/28/223440y7024x20y3mq7ycm.jpg) **第二个选项卡是你可以进行漫画转换的地方**,它被称为“<ruby> 输出 <rt> Output </rt></ruby>”。我设置了输出目录,并选择了 “ZIP” 存档格式来获取 **.cbz 文件输出**。 它还可以选择向输出文件添加后缀,并从存档中删除任何非图像文件,如下所示。 ![](/data/attachment/album/202309/28/223440otk1bkb3tb6xx9tu.jpg) 设置完所有输出设置后,我单击“<ruby> 转换 <rt> Convert </rt></ruby>”。然后它开始一张一张地处理所有的漫画。操作速度很快,达到了预期的最终结果。 ![](/data/attachment/album/202309/28/223441qi9eyispig3ezpy7.jpg) 你可能想知道:**为什么这个封面看起来和以前的不一样?** 好吧,在转换这些漫画之前,我冒昧地尝试调整漫画书的视觉效果。 感谢“<ruby> 变换 <rt> Transform </rt></ruby>”选项卡,它允许我尝试各种设置,例如**亮度**、**对比度**、**输入/输出级别**等。 ![](/data/attachment/album/202309/28/223441tt6j9t22nsy5wc96.jpg) 我想说,**此功能需要进一步完善**,由于预览时未实时反映更改,因此需要一些时间才能显示更改。 > > ? 请记住,我不必选择其他漫画,所有漫画都与“夜魔侠”一起接受了相同的调整。 > > > 然后,**有第三个选项卡,名为“<ruby> 图像 <rt> Image </rt></ruby>”**,它允许我以各种图像格式导出封面照片,例如 JPEG、PNG、TIFF、WebP 等。 ![](/data/attachment/album/202309/28/223442n44woy8az4rsjz7p.jpg) CBconvert 还具有一些选项来**从封面图片创建缩略图**、**调整图像质量**、**将其变成灰度**,甚至**对其应用一些调整大小的滤镜**。 ### ? 获取 CBconvert 对于其他平台,你可以从 [GitHub](https://github.com/gen2brain/cbconvert) 存储库获取最新版本的 CBconvert,对于 Linux,你可以选择 [Flathub](https://flathub.org/apps/io.github.gen2brain.cbconvert) 中的 Flathub 包。 > > **[CBconvert(Flathub)](https://flathub.org/apps/io.github.gen2brain.cbconvert)** > > > --- via: <https://news.itsfoss.com/cbconvert/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) An interesting open-source tool with a very specific use case. **CBconvert **is **a comic book converter** that can convert comics into different formats to fit all sorts of devices. For me, personally, this will be a first, since I have never tried a converter like this before. Here, I explore and highlight what this tool has to offer. ## CBconvert: Overview ⭐ ![a screenshot of cbconvert](https://news.itsfoss.com/content/images/2023/09/CBconvert_1.jpg) Written primarily in the [Go](https://go.dev/?ref=news.itsfoss.com) programming language, CBconvert aims to act as a one-stop app for all your comic book conversion needs. It can read the most commonly used file formats, such as **CBR** (RAR), XPS, **CB7** (7Z), **CBT** (TAR), **PDF**, and more. You can convert those files into two distinct formats,** CBZ** (ZIP) and** CBT** (TAR). Don't think that CBconvert's only purpose is to convert comic books, you can also use it to make some visual tweaks. I'll talk about that in a second. **Key Features:** **Useful editing tools****Comic book conversion****Extract cover images from comics** Without any further ado, let's dive into CBconvert. ## Initial Impressions 👨💻 While the converter can run on **Linux, Windows, and macOS**, I tried it on a Linux system. I started by adding a few comics (available in the public domain) to the app by using the 'Add Files' option in the sidebar menu. I was able to add multiple comics, without many issues. Likewise, I then moved on to take a look at the various function tabs. The **first tab called 'Input'** housed a few options, such as to **set the minimum size limit**, **opting for only grayscale images**, and more. I didn't need to use those, but the options are certainly useful if you want to add prerequisites to the files you wish to convert. ![a screenshot of cbconvert input tab](https://news.itsfoss.com/content/images/2023/09/CBconvert_2.jpg) The** second tab is where you can do the conversion of comics**, it is called 'Output'. I set the output directory, and selected the 'ZIP' archive format for getting a** .cbz file output**. It also had the option to add a suffix to the output file, and to remove any non-image files from the archive, as shown below. ![a screenshot of cbconvert output tab](https://news.itsfoss.com/content/images/2023/09/CBconvert_3.jpg) After all the output settings were set, I clicked on '**Convert'**. It then started to process all the comics one by one. The operation was quick, with the desired end-results. ![a screenshot of cbconvert converting a comic into the cbt format](https://news.itsfoss.com/content/images/2023/09/CBconvert_6.jpg) You're maybe wondering; *why does this cover look different from the one before? * Well, before converting these comics, I took the liberty of trying my hand at tweaking the visuals of the comic books. Thanks to the '**Transform**' tab that allowed me to play around with various settings such as the **brightness**, **contrast**, **input/output levels**, and more. ![a screenshot of cbconvert transform tab](https://news.itsfoss.com/content/images/2023/09/CBconvert_5.jpg) I would say that **this feature needs more polishing**, as the changes were not being reflected in real-time for a preview, it took some time for the changes to appear. Then, **there's a third tab called 'Image'**, it allowed me to export the cover photo in various image formats such as JPEG, PNG, TIFF, WebP and more. ![a screenshot of cbconvert image tab](https://news.itsfoss.com/content/images/2023/09/CBconvert_4.jpg) CBconvert also features some options to **create a thumbnail from the cover pic**, **tweak the image quality**, **make it into grayscale**, and even **apply some resizing filters** to it. ## 📥 Get CBconvert You can grab the latest release of CBconvert from its [GitHub](https://github.com/gen2brain/cbconvert?ref=news.itsfoss.com) repo for other platforms, and for Linux, you can opt for the Flathub package from [Flathub](https://flathub.org/apps/io.github.gen2brain.cbconvert?ref=news.itsfoss.com). ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,241
Bazzite:专为 Steam Deck 和 PC 上的 Linux 游戏打造的发行版
https://news.itsfoss.com/bazzite/
2023-09-30T11:09:00
[ "游戏", "Steam Deck" ]
https://linux.cn/article-16241-1.html
![](/data/attachment/album/202309/30/150801h5w6wyf7s6s56ynq.jpg) > > 为 Linux 桌面或者 Steam Deck 做好游戏准备,听起来都很刺激! > > > 对于一个专为 Linux 游戏定制的发行版,你是否感兴趣呢? 如果答案是肯定的,那么我们为你准备了绝佳选择。 Bazzite 是一个新推出的基于 Fedora 的发行版,它是为 **Linux 桌面上的游戏**,以及越来越火热的 **[Steam Deck](https://store.steampowered.com/steamdeck/)** 定制的。 在此文章中,我们将对 Bazzite 进行简短总结,并探讨其优势。 ### ⭐ Bazzite:概述 ![](/data/attachment/album/202309/28/231044xlf5ou80pooyl9e0.png) Bazzite 基于最新发布的 [Fedora 38](https://news.itsfoss.com/fedora-38-release/),使用的是 [Universal Blue](https://github.com/ublue-os/main) —— Fedora 的一个 OCI 基础镜像。它提供了扩展硬件支持,如 **微软 Surface 设备**,并预先安装了关键驱动。 > > ? 基于 Fedora 39 的构建也可供测试。你可以关注下个月末发布的稳定版。 > > > 它的一些亮点包括: * 预装专有的英伟达驱动 * 支持硬件加速的 H264 解码 * 引入了 [Waydroid](https://waydro.id/),允许运行安卓应用 * 由于实现了 [xone](https://github.com/medusalix/xone)、[xpadneo](https://github.com/atar-axis/xpadneo) 和 [xpad-noone](https://github.com/ublue-os/xpad-noone),所以支持 Xbox 手柄 ### ?‍? 初步印象 我在 [虚拟机](https://itsfoss.com/virtual-machine/) 上尝试了 Bazzite,发现其安装体验极其接近 Fedora。但在安装过后,你会发现它的独特之处。 Bazzite 默认使用的是 [KDE Plasma 5.27](https://news.itsfoss.com/kde-plasma-5-27-release/) 桌面环境,并在整个操作系统中融入了整洁的 **Steam Deck 风格**。 它还为 PC 和 Steam Deck 提供了 **独立的 ISO**,包括一个面向 **英伟达的版本**,以及一个如果你不喜欢 KDE,可以选择的 **GNOME 版本**。 在设置发行版用于游戏时,我使用了 “Bazzite Portal” 应用,它引导我走过了一些重要的配置步骤。如果你需要,此处你也可以安装 [Open Razer](https://github.com/openrazer/openrazer)。 ![](/data/attachment/album/202309/28/231045wscb11obcilckbo8.png) 首先,它设置了 Bazzite Arch,它是一个自定义的 Arch Linux OCI,运行在 Distrobox 中,支持 [Steam](https://store.steampowered.com/)、[Lutris](https://lutris.net/) 等在其内运行游戏。 ![](/data/attachment/album/202309/28/231046lkqmzcu4n3a2om6u.png) 在配置了一些其他选项之后,开始了应用程序的安装,呈现了许多包含各种类别的特定用例的最热门应用。 ![](/data/attachment/album/202309/28/231047f5h4jqzfjif2izvj.png) 完成设置之后,你就拥有了一款专为游戏设计的操作系统 ? ![在 Bazzite 上运行的 Lutris 和 Steam](/data/attachment/album/202309/28/231048r9uluqhia9q0ycih.png) 最近,通过一个更新,Bazzite 新增了两款预装应用: * [Mission Control](https://gitlab.com/mission-center-devs/mission-center)(系统监视器应用) * [Discover Overlay](https://github.com/trigg/Discover)(一个用于 Discord overlay 的应用) ![带有系统监视器应用的 Bazzite GNOME 版本](/data/attachment/album/202309/28/231048rq1df1b3p31dustr.jpg) 这里还有我跳过的一些其他配置选项。 Bazzite 可以利用 **Nix 包管理器**,**在启动时以大屏幕模式启动 Steam**,**提供了内存调节的选项** 等等。 这个概念听起来极具趣味性,如果你一直在寻找像 [Nobara](https://nobaraproject.org/) 那样,基于 Fedora 的、对游戏进行优化的发行版,你可以试试 Bazzite。 ### ? 下载 Bazzite 如果你对 Bazzite 提供的功能感兴趣,你可以在其 [GitHub 仓库](https://github.com/ublue-os/bazzite/releases) 中下载最新版本。 > > **[Bazzite(GitHub)](https://github.com/ublue-os/bazzite/releases)** > > > 想要获取更多关于 Bazzite 的信息,你也可以去查看其早期的 [博客发布](https://universal-blue.org/blog/2023/08/20/bazzite-10/)。 ? 请在下面的评论区分享你对该项目的看法。 --- via: <https://news.itsfoss.com/bazzite/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Would you be interested in a distro that is tailored for Linux gaming? If yes, then we have just the thing for you. Bazzite is a new Fedora-based distro that has been **tailor-made for gaming on Linux desktops**, and even the increasingly popular, [ Steam Deck](https://store.steampowered.com/steamdeck/?ref=news.itsfoss.com). In this article, we will take a brief look at Bazzite, and see what it has to offer. ## Bazzite: Overview ⭐ ![a screenshot of bazzite neofetch output](https://news.itsfoss.com/content/images/2023/08/Bazzite_1.png) Based on the recently released [Fedora 38](https://news.itsfoss.com/fedora-38-release/), Bazzite is using [Universal Blue](https://github.com/ublue-os/main?ref=news.itsfoss.com), which is an OCI base image of Fedora. It features expanded hardware support like **Microsoft Surface device support**, and has key drivers preinstalled. Some of its highlights include: **Preinstalled proprietary Nvidia drivers****Support for hardware accelerated H264 decoding****Waydroid****implementation, allowing for running Android apps****Support for Xbox controllers due to implementation of**,**xone**, and**xpadneo****xpad-noone** ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ### Initial Impressions 👨💻 I tested Bazzite out on a [virtual machine](https://itsfoss.com/virtual-machine/?ref=news.itsfoss.com) to take a look at it, and the installation experience was quite similar to Fedora's. But, the post-install is where you see the differences. Bazzite uses KDE [Plasma 5.27](https://news.itsfoss.com/kde-plasma-5-27-release/) desktop environment by default, with a neat **Steam Deck-like branding** across the operating system. It also offers **separate ISOs** for PCs and Steam Deck, including an **NVIDIA-focused variant**, and a **GNOME variant** if you do not like KDE. For setting up the distro for gaming use, I used the 'Bazzite Portal' app that took me through some important configuration steps. You also get to install [Open Razer](https://github.com/openrazer/openrazer?ref=news.itsfoss.com) if you need it here. ![a screenshot of bazzite portal](https://news.itsfoss.com/content/images/2023/08/Bazzite_2.png) It first set up 'Bazzite Arch', which is a custom Arch Linux OCI in Distrobox that allows the likes of [Steam](https://store.steampowered.com/?ref=news.itsfoss.com), [Lutris](https://lutris.net/?ref=news.itsfoss.com), and others to run gaming workloads inside it. ![a screenshot of bazzite portal setting up bazzite arch](https://news.itsfoss.com/content/images/2023/08/Bazzite_3.png) After going through a few other config options, came the installation of applications, it showed different categories that contain the most popular apps for specific use cases. ![a screenshot of bazzite portal application installer options](https://news.itsfoss.com/content/images/2023/08/Bazzite_6.png) And, finally, after the setup, you have an OS all set for gaming 😲 ![a screenshot of bazzite running lutris and steam](https://news.itsfoss.com/content/images/2023/08/Bazzite_9.png) Recently, with an update, Bazzite has added two new preinstalled apps: [Mission Center](https://news.itsfoss.com/mission-center/)(system monitoring app)[Discover Overlay](https://github.com/trigg/Discover?ref=news.itsfoss.com)(an app for Discord overlay). There are a few other config options that I skipped over. Bazzite can make use of the **Nix Package Manager**, **start Steam in Big Picture Mode at startup**, **has options for memory tuning** and more. It sounds like an interesting concept, and if you have been wanting something based on Fedora tweaked for gaming like [Nobara](https://nobaraproject.org/?ref=news.itsfoss.com), you can try it. **Suggested Read **📖 [9 Best Linux Gaming Distributions in 2023Wondering which Linux distro is best for gaming? We got a list of 9 gaming Linux OS for you here.](https://itsfoss.com/linux-gaming-distributions/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/wordpress/2022/10/best-linux-gaming-distributions.png) ![](https://itsfoss.com/content/images/wordpress/2022/10/best-linux-gaming-distributions.png) ## 📥 Download Bazzite If you like what Bazzite has to offer, you can grab the latest release from its [GitHub repo](https://github.com/ublue-os/bazzite/releases?ref=news.itsfoss.com). For more info on Bazzite, you can also head over to its early announcement [blog post](https://universal-blue.org/blog/2023/08/20/bazzite-10/?ref=news.itsfoss.com). *💬 Share your thoughts on the project in the comments below.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,244
Richard Stallman 正在与癌症作战
https://news.itsfoss.com/richard-stallman-battling-cancer/
2023-10-01T16:40:25
[ "RMS", "Richard Stallman" ]
https://linux.cn/article-16244-1.html
![](/data/attachment/album/202310/01/163837j5enqwi9a2h6v22e.jpg) > > 让我们共同祈愿他早日康复! > > > 为了纪念 GNU 项目成立 40 周年,自由软件基金会(FSF)已计划在 **10 月 1 日**(即GNU 40)为家庭、学生以及美国的其他人群组织一场黑客马拉松活动。 活动之前,GNU 项目于 9 月 27 日迎来了 40 岁生日,Richard Stallman 和一些社区成员在瑞士<ruby> 比尔 <rt> Biel </rt></ruby>举行了 <ruby> GNU 黑客会议 <rt> GNU Hacker's Meeting </rt></ruby>。 在会议上,他分享了自己的见解,并公开了自己正在与癌症作战的事实。 在主题演讲中,我们看到 **Richard Stallman 已经没有他标志性的长胡子和长发,外貌发生了变化**。他正在接受化疗以对抗癌症,这就能解释这一切。 ![Richard Stallman 在 GNU 黑客会议上(比尔,瑞士) | 源自:GNU.org](/data/attachment/album/202310/01/164025ha7fbba03axxxxyp.jpg) 他对自己的健康状况并没有多做说明,只是说病情是可以控制的,他仍能活很多年。 他特别强调: > > 因此,这一点基本上改变了我的生活方式……我仍在为自由软件基金会和其他的事业持续工作。 > > > ### Richard Matthew Stallman(RMS):愿你早日康复! Richard Stallman 是一位计算机科学家,他在 **1983 年 9 月 27 日**公布了名为 **GNU**(GNU's Not Unix)的类 Unix 操作系统。 因此,如果没有它,Linux 就无从谈起。这也是为何有些人更倾向于用 GNU/Linux 来称呼 Linux 的原因。 值得一提的是,他还创立了 <ruby> 自由软件运动 <rt> Free Software Movement </rt></ruby>,这是如今开源实践的基石。 当然,他在许多事情上都表达了富有争议性的观点,但他在 Linux 和开源上的影响是巨大的! 毫无疑问,得知 Richard 患癌的消息令人难过。然而,尽管面临这样的困境,他以 70 岁的高龄仍然兴致勃勃地出现在了主题演讲中,并发表了演讲。 让我们祝愿 Richard 早日恢复!? --- via: <https://news.itsfoss.com/richard-stallman-battling-cancer/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) To celebrate the GNU Project's 40th anniversary, the Free Software Foundation (FSF) is organizing a hackday on **Oct. 1** (GNU 40) for families, students, and anyone else in the US. Before the event, the project turned 40 on Sept. 27, a part of the community along with Richard Stallman gathered for the GNU Hacker's Meeting in Biel, Switzerland. While he shared his thoughts at the event, he also revealed that he has cancer. Looking at the keynote, **Richard Stallman does not look the same without his iconic beard and long hair**. Considering he is already undergoing chemotherapy to treat cancer, that explains it. ![richard stallman at gnu 40](https://news.itsfoss.com/content/images/2023/09/richard-stallman-gnu-40.jpg) [GNU.org](https://audio-video.gnu.org/video/gnu40/rms-gnu40.webm?ref=news.itsfoss.com) He did not share much about his health condition but said that it is manageable, and he will be alright for many more years. Furthermore, he emphasized: So, it has made a fundamental change in my life.. I am still working for Free Software Foundation and other causes separately. ## Richard Matthew Stallman (rms): Get Well Soon! Richard Stallman is a computer scientist who revealed the Unix-like operating system called **GNU** (GNU's not Unix) on **September 27, 1983**. So, Linux would not have been possible without it. And, that is the reason some prefer to refer Linux as GNU/Linux. If you are curious, he also created the **Free Software Movement**, which is the basis of open-source practice today. Sure, he has been with involved with many controversial takes for different things, but the impact he's had on Linux and open-source is huge! Undoubtedly, it is terrible news to know that Richard is battling cancer now. And, despite all of that, he enthusiastically appeared for a keynote, and gave a speech at the age of 70. All the good wishes to Richard for his quick recovery. 💐 ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,246
修复无法添加 PPA:“This PPA does not support jammy” 错误
https://itsfoss.com/cannot-add-ppa-error/
2023-10-02T11:22:21
[ "PPA" ]
https://linux.cn/article-16246-1.html
![](/data/attachment/album/202310/02/112157nf11fpwhwa4u1hvf.jpg) > > 尝试添加一个 PPA,却在 Ubuntu 中收到 “无法添加 PPA: 此 PPA 不支持 xyz” 的错误?下面是解决这一错误的方法。 > > > 这是一个场景。你正在尝试使用 PPA 在 Ubuntu 中安装软件。 你使用 `sudo add-apt-repository` 添加 PPA 仓库,当它更新包缓存时,会出现错误: > > Cannot add PPA: "This PPA does not support *xyz* > > > 其中 “xyz” 是 [你正在使用的 Ubuntu 版本的代号](https://itsfoss.com/how-to-know-ubuntu-unity-version/)。 ? 这就是发生这种情况的原因以及你可以采取的措施: * PPA 不适用于你正在使用的 Ubuntu 版本 * 你应该寻找其他来源来安装该应用 * 如果绝望了,你可以从 PPA 网页下载 .deb 文件 我将详细讨论以上所有内容。 ### 检查 PPA 是否适用于你的 Ubuntu 版本 首先,在终端中使用以下命令获取 Ubuntu 版本和代号的详细信息: ``` lsb_release -a ``` 输出将包含详细信息: ![Here, I am using Ubuntu version 23.04 that case codename lunar](/data/attachment/album/202310/02/112221vkx4rx773qr8u8ry.png) 现在,访问托管所有 PPA 的 Ubuntu 的 Launchpad 网站: > > **[进入 Launchpad PPA](https://launchpad.net/ubuntu/+ppas)** > > > 在这里,查找困扰你的 PPA。为此,你必须使用 PPA 维护者的名字。 例如,如果 `ppa:jstaf/onedriver` 造成问题,请搜索维护者 `jstaf`。 ![Enter the PPA's maintainer name and search for it](/data/attachment/album/202310/02/112221cee7ch7e8oqlq57q.png) 一名维护者可能拥有多个软件仓库。单击你要安装的那个。 在里,你应该在 “<ruby> 发布于 <rt> Published in </rt></ruby>” 旁边的下拉按钮选择 “<ruby> 所有系列 <rt> Any Series </rt></ruby>”。 ![Click on Any series dropdown button to see the supported Ubuntu versions](/data/attachment/album/202310/02/112221t1a6kax14t7w63e1.png) 检查你是否看到你正在使用的 Ubuntu 版本的代号。如果不存在,那么此 PPA 不适用于你的 Ubuntu 版本。 ### 如果 PPA 不支持你的 Ubuntu 版本,你该怎么办 你会看到,开发人员(或维护人员)创建一个仓库并使该软件可用于他们正在使用的 Ubuntu 版本。 随着时间的推移,Ubuntu 发布了更新的版本。现在,一位活跃的维护者将发布新 Ubuntu 版本的软件。但情况并非总是如此。如果维护者不再活跃,那么将不会更新。像你这样尝试遵循教程说明的人将会看到此错误。 现在,你有两个选择: #### 选项 1:在其他地方寻找该软件 这里有几种可能性。 **新版 Ubuntu 可能也可以通过其他 PPA 获得相同的软件。请在 Launchpad 网站或互联网上查找。** 这是怎么发生的?许多原始软件开发人员只是发布源代码,因此一些志愿者创建 Debian 软件包并从 Launchpad 分发它,以便像你这样的 Ubuntu 用户可以轻松安装该软件。不止一名志愿者可以为同一软件创建自己的个人包存档(PPA)。你应该使用活跃的一个。 例如,如果我查找 `onedriver` 包,我可以看到它可能在另一个名为 [Ubuntu deployment](https://launchpad.net/~remiariro/+archive/ubuntu/misc) 的 PPA 中可用。 ![](/data/attachment/album/202310/02/112222kkkm26ky2ly3ex2l.png) **另一个方式是查看该包是否以其他格式提供,例如 Snap、Flatpak、AppImage。** * [检查 Snap 商店](https://snapcraft.io/store) * [检查 Flatpak 包](https://flathub.org/) * [检查 AppImages](https://www.appimagehub.com/) 在极少数情况下,该软件可能已经在 Ubuntu 仓库中可用。 为此,你必须是一个聪明的用户并在互联网上进行搜索。如果你找到其他包格式,那就太好了。否则,下一步就是绝望。 #### 选项 2:从 PPA 下载 deb 文件 PPA 仓库为你提供 Debian 软件包。添加仓库后,你还可以直接通过系统更新获得更新(如果有)。 如果你的 Ubuntu 版本的 PPA 没有更新,并且你在其他地方找不到该软件,你可以尝试从 PPA Launchpad 页面下载 deb 软件包。 ![](/data/attachment/album/202310/02/112222jw37036zzu38n4n7.png) 在包详细信息页面上,单击展开符号并查找 deb 文件。除非你使用类似树莓派的主板,否则你应该选择 amd64。 ![Download deb package from PPA](/data/attachment/album/202310/02/112222vk2qelzlw6t66a6q.png) > > ? 如果软件太旧,下载的 deb 包可能会因为依赖问题而无法安装成功。此外,你将不会获得已安装软件包的更新(如果已安装)。不过,这个方法还是值得一试。 > > > ### 结论 尽管 Canonical 在大力推动 Snap 打包,PPA 仍然是用户在 Ubuntu 中安装第三方应用的最爱。 但 PPA 也有其自身的麻烦,而不能添加 PPA 错误就是其中之一。同样的问题还会导致 “[仓库没有发布文件](https://itsfoss.com/repository-does-not-have-release-file-error-ubuntu/)” 错误。 我希望现在这个问题更加清楚了。如果你仍有疑问,请告诉我。 *(题图:MJ/d1013502-d518-4bc8-896c-d8dddd15ae22)* --- via: <https://itsfoss.com/cannot-add-ppa-error/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) So, here's the scenario. You are trying to install a software in Ubuntu using a PPA. You add the PPA repository with 'sudo add-apt-repository' and when it updates the package cache, it generates an error: **Cannot add PPA: ''This PPA does not support xyz''** Where XYZ is the [codename of the Ubuntu version you are using](https://itsfoss.com/how-to-know-ubuntu-unity-version/). **:** **Here's why it is happening and what you can do about it**- The PPA is not available for the Ubuntu version you are using - You should look for other sources for installing that application - If desperate, you can download the .deb file from the PPA webpage I'll discuss all the above in detail. ## Check if PPA is available for your Ubuntu version or not First thing first, get the details of your Ubuntu version and codename using this command in the terminal: ``` lsb_release -a ``` The output will have the details: ![Getting Ubuntu version details](https://itsfoss.com/content/images/2023/09/ubuntu-version-details.png) Now, go to Ubuntu's Launchpad website that hosts all the PPAs: Here, look for the PPA that is troubling you. For that you have to use the PPA maintainer's name. For example, if `ppa:jstaf/onedriver` is causing trouble, search for the maintainer `jstaf` . ![Search for PPA on Launchpad](https://itsfoss.com/content/images/2023/09/search-for-ppa-launchpad.png) A maintainer may have more than one software repository. Click on the one you wanted to install. In here, you should **click on the "Any Series" dropdown button** besides "Published in". ![](https://itsfoss.com/content/images/2023/09/check-ppa-supported-version.png) Check if you see the codename of the Ubuntu version you are using. If it's not there, the PPA is not available for your Ubuntu version. ## What should you do if the PPA does not support your Ubuntu version You see, a developer (or maintainer) creates a repository and makes the software available for the Ubuntu version they were using. With time, Ubuntu releases newer versions. Now, an active maintainer will release the software for the new Ubuntu version. But that's not always the case. If the maintainer is not active anymore, the repository won't be updated. People like you who were trying to follow a tutorial instruction will see this error. Now, you have two options: ### Option 1: Look for the software elsewhere There are several possibilities here. **The same software might be available for newer Ubuntu versions from another PPA. Look for it on Launchpad website or the internet.** How does it happen? Many original software developers just release the source code so some volunteers create the Debian package and distribute it from the launchpad so that Ubuntu users like you can install the software easily. More than one volunteer can create their own personal package archive (PPA) for the same software. You should use the active ones. For example, if I looked for `onedriver` package, I can see that it might be available in another PPA named [Ubuntu deployment](https://launchpad.net/~remiariro/+archive/ubuntu/misc). ![](https://itsfoss.com/content/images/2023/09/search-ppa.png) **Another option is to see if the package is available in other formats like Snap, Flatpak, AppImage.** - Check [Snap store](https://snapcraft.io/store) [Check for Flatpak](https://flathub.org/)package[Check for AppImages](https://www.appimagehub.com/) In some rare cases, the software may already be available in the Ubuntu repository. For this, you have to be a smart user and search the internet. If you find another package format, well and good. Otherwise, the next step is for desperation. ### Option 2: Download the deb file from the PPA The PPA repositories provide you the Debian package. With the repository added, you also get updates (if any), directly with the system updates. If the PPA is not updated for your Ubuntu version and you cannot find the software elsewhere, you can try downloading the deb package from the PPA Launchpad page. ![Checking PPA package details](https://itsfoss.com/content/images/2023/09/ppa-package-details.png) On the package details page, click on the carrot symbol and look for the deb files. Unless you are using a Raspberry Pi like board, you should go for amd64. ![Download deb from PPA](https://itsfoss.com/content/images/2023/09/download-deb-from-ppa.png) ## Conclusion Despite all the push behind Snap packaging, PPAs still remain a favourite among users for installing third-party applications in Ubuntu. But PPAs have their fair share of trouble, and this cannot add PPA error is one of them. The same issue also causes ['repository does not have release file](https://itsfoss.com/repository-does-not-have-release-file-error-ubuntu/)' error. I suggest reading this [beginner's guide that answers so many questions about PPA](https://itsfoss.com/ppa-guide/). [PPA in Ubuntu Linux [Definitive Guide]An in-depth article that covers almost all the questions around using PPA in Ubuntu and other Linux distributions.](https://itsfoss.com/ppa-guide/)![](https://itsfoss.com/content/images/2023/05/Understanding-ppa-in-ubuntu.png) ![](https://itsfoss.com/content/images/2023/05/Understanding-ppa-in-ubuntu.png) I hope things are more clear on the issue now. Please let me know if you still have questions.
16,247
哇!树莓派 5 看起来成为动手爱好者的新宠了!
https://news.itsfoss.com/raspberry-pi-5/
2023-10-02T13:00:00
[ "树莓派" ]
https://linux.cn/article-16247-1.html
![](/data/attachment/album/202310/02/125833qdxbb2vgd0x7ccx4.jpg) > > 对于热爱动手实践的你来说,树莓派 5 已经落地,为你绚烂的想法提供热情的舞台! > > > 单板计算机(SBC)领域因树莓派新产品的推出再次活跃起来。 这款被称为 **树莓派 5** 的新产品,是其非常受欢迎的前身树莓派 4(于 2019 年推出)的进化版。 下面,我们来探讨它的新鲜亮点,以及何时何地可以将其买到手。 ### ? 树莓派 5 的新变化是什么? **树莓派 5 是一款足以称得上强大的后继产品**,其全新设计的平台搭载了在英国开发的**自行设计的芯片**。 与树莓派 4 比较,**树莓派 5 的性能提升了一倍以上** ,这主要得益于硬件和软件的改进。他们还补充说: > > 与树莓派 4 相较,我们的 CPU 和 GPU 性能提高了两到三倍,在内存和 I/O 带宽方面也有大约两倍的增长;而且这是我们首次在旗舰树莓派设备上使用了自家的树莓派芯片。 > > > 尽管外形并无明显改变,树莓派 5 **仍然保留了信用卡大小的尺寸**。变化主要体现在端口的位置上。 为了配合这款 SBC 的发布,树莓派团队积极开发了适合的新版本树莓派操作系统。它**基于 [Debian 12 “Bookworm”](https://news.itsfoss.com/debian-12-release/) 版本**,所以你可以期待有很多改进。 这个更新的操作系统预计将在 **2023 年 10 月中旬** 发布,将过渡到 [Wayfire](https://wayfire.org/) Wayland 合成器系统,**摒弃了 X11**。 ### ? 树莓派 5 的关键参数 ![](/data/attachment/album/202310/02/130005nlmkramesrf76e31.jpg) 那么,你可能对树莓派 5 的硬件配置感到好奇。 首先,树莓派 5 是**由 Broadcom 的一款新型 16 纳米应用处理器 BCM2712 驱动**的。 它使用了一颗 **四核 64 位 Arm Cortex-A76 处理器**,在标准运行状态下的频率为 **2.4 GHz**,拥有 **每核 512 KB 的 L2 缓存** 和一个 **2 MB 的共享 L3 缓存**。 这一切都融入了一款新的 GPU 中,那就是 Broadcom 的 **VideoCore VII**。它配备了**完全开源的 Mesa 驱动程序**。 还有新的 **RP1 I/O 控制器**,它**负责操作各种 I/O 端口**,如 **USB 2.0/3.0** 、**千兆以太网**、**MIPI 收发器** 和 **常见的 GPIO 端口**。 > > 项目 RP1 自 2016 年启动以来,已经投资了 1500 万美元。 ? > > > 最后,我们看到了新的 **DA9091 电源管理 IC**,出自 [Renesas](https://www.renesas.com/us/en),它**负责处理主板上的电源分配**,带有 **8 个单独的开关模式电源供应器**,以生成树莓派 5 所需的不同电压。 此外,以下是其他一些值得一提的要点: * 独立电源按钮 * 双频 802.11ac Wi-Fi * 可选 4 GB / 8 GB 内存版本 * 2x 4Kp60 HDMI 显示输出 * 2x 4-通道 MIPI 摄像头 / 显示器收发器 * 蓝牙 5.0 / 低功耗蓝牙(BLE) 树莓派 5 看上去是一款能助你创建出比当前的 [树莓派项目](https://itsfoss.com/raspberry-pi-projects/) 更棒的新项目的设备。 ### 树莓派 5 配件 ? ![树莓派 5 官方配件外壳](/data/attachment/album/202310/02/130006d4m37llg3hmf73o4.jpg) 一如既往,树莓派 5 与各种官方配件一同发布。 以带有**集成风扇的外壳**为例,设计精良,适用于低噪声和长期使用。 还有一种叫做 **主动冷却器** 的冷却配件,它配有一个铝质热散片和可以安装在主板上的风扇。 由于**峰值功率需求的增加**,他们也提供了**一款 27 W 的 USB-C 电源适配器**,以便动手玩家们可以最大限度地使用他们的树莓派 5。 我在这里没有提到的还有一些额外的 [树莓派配件](https://itsfoss.com/raspberry-pi-accessories/),如显示线缆、m.2 连接帽等等。我相信在不久的将来会看到更多的配件。 我强烈建议你浏览官方的 [公告博客](https://www.raspberrypi.com/news/introducing-raspberry-pi-5/) ,进一步了解这款有趣的单板计算机的详细信息。 ### ? 价格和供应信息 树莓派 5 提供**两款版本** ,价格从**4 GB 版本的 60 美元** 开始,**8 GB 版本为 80 美元**。 目前已经在一些 [认证的经销商](https://www.raspberrypi.com/resellers/) 开始接受预订,预计将在十月末出货。 > > **[树莓派 5(认证的经销商)](https://www.raspberrypi.com/resellers/)** > > > 他们被**限制只能销售给个人购买者**,这个限制将持续到今年(2023 年)结束,以避免任何供应链方面的问题。 *(题图:MJ/12b9c1e0-414e-42f8-a61b-466dad831eef)* --- via: <https://news.itsfoss.com/raspberry-pi-5/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) The Single-board computers (SBC) space is livening up again thanks to the launch of a new offering by Raspberry Pi. Called the '**Raspberry Pi 5'**, it is an evolution over its very popular predecessor, the Raspberry Pi 4, which was launched back in 2019. So, let's see what it has to offer and when/where you can get it from. ## 🆕 What's New in Raspberry Pi 5? The** Raspberry Pi 5 is a sufficiently powerful successor** that has a completely redesigned platform, featuring **in-house designed silicon** developed in the UK. In comparison to the Raspberry Pi 4, the **Raspberry Pi 5 is over twice as powerful **thanks to the improvements in hardware and software.** **They also added that: Compared to Raspberry Pi 4, we have between two and three times the CPU and GPU performance; roughly twice the memory and I/O bandwidth; and for the first time we have Raspberry Pi silicon on a flagship Raspberry Pi device. Even the form factor doesn't see much of a change**,** with the Raspberry Pi 5 **retaining the** **credit-card sized footprint**, with changes mostly to the placement of ports. To further complement the release of this SBC, the Raspberry Pi team has been busy readying up **a new release of Raspberry Pi OS**. It is **based on the ****Debian 12 'Bookworm'**** release**, so you can expect loads of improvements. The updated OS is set to launch in **mid-October 2023**, with a transition to the [Wayfire](https://wayfire.org/?ref=news.itsfoss.com) Wayland compositor system, **doing away with X11**. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ## 📝 Raspberry Pi 5: Key Specifications ![a photo of the raspberry pi 5 computer](https://news.itsfoss.com/content/images/2023/09/R_Pi5_1.jpg) So, you are maybe wondering; what hardware the Raspberry Pi 5 is packing? Well, for starters, the Raspberry Pi 5 is **powered by a new 16 nm application processor from Broadcom** called '**BCM2712**'. It features **a** **quad-core 64-bit Arm Cortex-A76 processor** running at a nominal **2.4 GHz**, with **512 KB per-core L2 caches** and a **2 MB shared L3 cache**. All of that is complemented by a new GPU in the form of Broadcom's **VideoCore VII**, with **completely open-source Mesa drivers**. Then there's the new **'RP1' I/O controller** that **handles various I/O ports** such as the **USB 2.0/3.0**, **Gigabit Ethernet**, **MIPI transceivers**, and the** usual GPIO ports**. And finally, we have the new** 'DA9091' power-management IC** by [Renesas](https://www.renesas.com/us/en?ref=news.itsfoss.com) that **handles power distribution** around the board with **eight separate switch-mode power supplies** to generate different voltages according to the Raspberry Pi 5's needs. Other than that, here are some of the other notable highlights: - Dedicated Power Button - Dual-Band 802.11ac Wi-Fi - 4 GB/8 GB Memory Variants - 2x 4Kp60 HDMI Display Output - 2x 4-lane MIPI camera/display transceivers - Bluetooth 5.0 / Bluetooth Low Energy (BLE) Raspberry Pi 5 sounds like something that should enable you to build cool projects, potentially better than existing [Raspberry Pi projects](https://itsfoss.com/raspberry-pi-projects/?ref=news.itsfoss.com). ## Raspberry Pi 5 Accessories 🦾 ![a photo of the official raspberry pi case accessory](https://news.itsfoss.com/content/images/2023/09/R_Pi5_2.jpg) As is tradition, the Raspberry 5 has launched with various official accessories. Take for example **the case, which has an integrated fan**, tuned for low noise, and extended usages. Then there's another cooling accessory in the form of an '**active cooler**', that features an aluminum heat sink with a fan that can be directly mounted on to the board. **Suggested Read **📖 [Best Accessories to Supercharge Your Raspberry PiHere are the best Raspberry Pi accessories that you need to get started with it and take it to the next level!](https://itsfoss.com/raspberry-pi-accessories/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/01/raspberry-pi-accessories.png) ![](https://itsfoss.com/content/images/2023/01/raspberry-pi-accessories.png) Owing to the **increased peak power requirements**, they are also offering **a 27 W USB-C power supply** for tinkerers to push their Raspberry Pi 5 to the limits. There are a few more [Raspberry Pi accessories](https://itsfoss.com/raspberry-pi-accessories/?ref=news.itsfoss.com) available that I didn't mention here, like display cables, m.2 hat, and more. I'm sure there could be more in the near future. I highly suggest you go through the official [announcement blog](https://www.raspberrypi.com/news/introducing-raspberry-pi-5/?ref=news.itsfoss.com) to get into the finer details of this interesting SBC. ### 💰 Pricing and Availability The Raspberry Pi 5 is being offered in **two variants**, and prices start at **$60 for the 4 GB**, and **$80 for the 8 GB variant**. It is **up for pre-order** through various [approved resellers](https://www.raspberrypi.com/resellers/?ref=news.itsfoss.com), with shipping to commence by the end of October. They have **limited sales to just individual buyers** until the end of this year (2023), to avoid any supply chain issues. ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,249
现在,使用 Mozilla Firefox 的理由又增加了一条!
https://news.itsfoss.com/mozilla-firefox-progress/
2023-10-03T00:19:00
[ "Firefox" ]
https://linux.cn/article-16249-1.html
![](/data/attachment/album/202310/03/001913b1hfcfsl34ylcc6h.jpg) > > Firefox 正在不断取得进展,让我们一起看看最新的变化吧! > > > Mozilla Firefox 是一款极棒的开源多平台浏览器,一直以来都以提供最佳的隐私保护功能而广受好评。 更值得一提的是,它成为了大多数 Linux 发行版的默认浏览器,使得它成为了 Linux 用户的自然之选。 ### Firefox 当前的状况 尽管 Firefox 一直以隐私优先的策略,并且是 [谷歌 Chrome 的最佳开源替代品](https://itsfoss.com/open-source-browsers-linux/) 之一,它仍然被大众所冷落。 这听起来令人失望,不是吗? 的确是的,就以市场份额来说,谷歌 Chrome 占据了 **63.56%**,而 Firefox 用户仅占据了 **2.94%** —— 这是来自 [StatCounter](https://gs.statcounter.com/browser-market-share) 的统计数据。 ![](/data/attachment/album/202310/03/001920uofzb8ewwmy7qsaa.png) 为什么会这样? 详细来说,你可以回顾一下 [Firefox 在 2021 年几乎损失了 5000 万用户](/article-13642-1.html)。 简而言之:**Mozilla Firefox 已经尽其所能,但似乎仍然不足以吸引公众的注意**。 ### Firefox 的用户体验在不断改善 幸运的是,在过去的两年中,Mozilla Firefox 似乎专注于一步步提升用户体验,并比平常更多地向公众展示自己。 例如,他们正在为 Firefox 117 提供 [自动翻译功能支持](https://news.itsfoss.com/firefox-117-release/)。 总的来说,最近的更新已经简化了用户界面,并为 [我为什么总是会回到 Firefox](https://news.itsfoss.com/why-mozilla-firefox/) 提供了更多理由。 当然,Firefox 已经提供了 [Firefox Relay](https://relay.firefox.com/)([保护你电子邮箱的工具](https://itsfoss.com/protect-email-address/) 之一)等隐私特性。但是,并非每个用户都在乎那些改善了安全性的底层优化。 许多用户希望能够通过网页浏览器无缝的使用他们喜爱的网络服务。**这无疑是用户体验的核心部分。** Mozilla Firefox 就是一款能提供这一体验的强大且安全的浏览器。 如果浏览器能满足网民使用他们**最喜欢或是主流服务**的体验需求,那么 Firefox 就能保留旗下用户,甚至吸引更多新用户。 ### 谷歌的网络服务在 Firefox 上运行得比以前更好了 好消息是:**Mozilla 正在全力以赴做出改变!** 在最近的 [博客文章](https://blog.mozilla.org/en/products/firefox/google-meet-firefox/) 中,他们宣布,**谷歌 Meet 以及其他谷歌服务如 Workspace、Voice、YouTube、Keep、地图、翻译以及相册** 在 Firefox 上运行得比以往任何时候都要好。 ![](/data/attachment/album/202310/03/001921tmm6gvh8h71vvv7v.png) 他们为此与谷歌的 Workspace 团队一直保持着紧密的合作,他们这样写道: > > 如果你正在考虑切换,但担心兼容性问题,你可以放心 —— 谷歌的服务在 Firefox 上工作得相当出色,我们也在不断的努力满足你的日新月异的需求。 > > > 他们还分享了谷歌 Meet 在 Firefox 上改善后的一些使用体验截图。现在,只需使用 Firefox 115 和更高版本,你就可以在加入视频通话前后应用视效(或背景)。 ![](/data/attachment/album/202310/03/001921mir899tigg8r0m9t.jpg) 许多网络用户都一直在使用谷歌的服务,如果他们在 Firefox 上的用户体验也很棒,那么 Firefox 就可能成为一个适合他们替代 Chrome 的选择。 **所以,谷歌的网络服务在 Firefox 上的体验得到了改进?** **这又是一个使用 Firefox 的理由。** 我认为,Mozilla 为了与谷歌 Chrome 及其他竞方保持竞争力,并增强用户对流行网络服务的网络体验,这么做是明智之举。 ? 你现在正在使用 Firefox 吗?在读了这篇文章后,你决定再试一次吗?在下方留言分享你的想法吧! *(题图:MJ/7427a77e-ed67-4ac4-bc8a-bb9794c34adc)* --- via: <https://news.itsfoss.com/mozilla-firefox-progress/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Mozilla Firefox is a fantastic open-source cross-platform browser with a proven track record of offering you the best privacy-focused features. Not to forget, it comes baked in as the default with most Linux distributions, making it an obvious go-to web browser for Linux users. ## Firefox's Current State Despite its privacy-first approach, and being one of the [best open-source alternatives to Google Chrome](https://itsfoss.com/open-source-browsers-linux/?ref=news.itsfoss.com), it is not the most preferred web browser. Sounds disappointing, right? Well, it is. Google Chrome has a **63.56%** market share, compared to **2.94%** occupied by Firefox users—as per [StatCounter](https://gs.statcounter.com/browser-market-share?ref=news.itsfoss.com). ![browser stats](https://news.itsfoss.com/content/images/2023/09/browser-stat-.png) Why is it the case? Well, if you want to get into the details, you might want to recall that [Firefox lost almost 50 million users](https://news.itsfoss.com/firefox-decline/) in 2021. If you would rather not read everything about it: **Mozilla Firefox has been doing everything it can, with not enough things to attract the masses.** ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ## Firefox's User Experience is Improving Fortunately, in the past two years, Mozilla Firefox seems to be focusing on improving the usability, one step at a time, and presenting itself to the masses than usual. For instance, working towards an [automated translated feature support in Firefox 117](https://news.itsfoss.com/firefox-117-release/). Overall, the recent updates have simplified the user interface and add to the [reasons why I keep coming back to Firefox](https://news.itsfoss.com/why-mozilla-firefox/) whenever I try to switch. Sure, the privacy features like [Firefox Relay](https://relay.firefox.com/?ref=news.itsfoss.com) (*one of the tools to protect your email*) are needed along with it. But, not every user cares about the under-the-hood improvements that make the experience safer. Most of the users want their favorite web services to be accessible seamlessly via the web browser. **That is the biggest part of the user experience.** Undoubtedly, Mozilla Firefox is a capable and secure browser to give you that. If the browser nails the user experience for the netizens using their **favorite or mainstream services**, it will help Firefox retain its users and gain new ones. ## Google's Web Services Work Better Than Ever on Firefox And, the good news? **Mozilla is working more on that now!** In a recent [blog post](https://blog.mozilla.org/en/products/firefox/google-meet-firefox/?ref=news.itsfoss.com), they announced that **Google Meet and other Google services like Workspace, Voice, YouTube, Keep, Maps, Translate, and Photos** will work better than ever on Firefox. ![gmail on firefox](https://news.itsfoss.com/content/images/2023/09/firefox-screenshot.png) To achieve this, **Mozilla has been collaborating with the Google's Workspace team for a while now**. Here's what they mention: So if you’re considering a switch but have had concerns with compatibility, you can be confident that Google services work great with Firefox — and that we’re always working on meeting your ever-changing needs. To give us an example, they shared screenshots of the improved experience with Google Meet. You can now apply visual effects (or background) to your video feed before or after joining the call on Firefox 115 or above. ![google meet screenshot](https://news.itsfoss.com/content/images/2023/09/google-meet-screenshot.jpg) A major chunk of web users utilize Google services, and if they get a great user experience on Firefox, it can be a suitable alternative to Chrome for them. **So, improved Google web services experience on Firefox? ** **Another reason to use Firefox.** I think this is a good move from Mozilla to improve the web experience of popular web services to keep up with Google Chrome and any other competing browsers. *💬* *Are you already using Firefox? Did you decide to give it another try after reading this? Share your thoughts in the comments below!* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,250
Btrfs 详解:子卷
https://fedoramagazine.org/working-with-btrfs-subvolumes/
2023-10-03T11:13:00
[ "Btrfs" ]
https://linux.cn/article-16250-1.html
![](/data/attachment/album/202310/03/111308vdhzh3ddwwjdmyw0.jpg) 这篇文章是《Btrfs 详解》系列文章中的一篇。从 Fedora Linux 33 开始,Btrfs 就是 Fedora Workstation 和 Fedora Silverblue 的默认文件系统。 以防你忘记,这是系列文章中的前一篇:[Btrfs 详解:基础概念](/article-16189-1.html)。 ### 简介 <ruby> 子卷 <rt> Subvolume </rt></ruby> 允许将一个 Btrfs 文件系统划分成多个独立的子文件系统。这意味着你可以从 Btrfs 文件系统挂载子卷,就好像它们是独立的文件系统。除此之外,例如,你还可以通过 <ruby> 限额组 <rt> qgroup </rt></ruby>(我们将在本系列的另一篇文章里介绍)定义子卷能够占据的最大空间,或者用子卷去包含或排除快照中的文件(我们会后面的文章中会讲到)。自 Fedora Linux 33 后每个 Fedora Workstation 和 Fedora Silverblue 默认安装过程中会利用子卷。在这篇文章中我们会介绍它是如何工作的。 下面你会找到很多关于子卷的例子。如果你想跟着操作,你必须拥有访问某些 Btrfs 文件系统的权限和 root 权限。你可以通过下面命令来验证你的 `/home/` 目录是否是 Btrfs 。 ``` $ findmnt -no FSTYPE /home btrfs ``` 这个命令会输出你 `/home/` 目录的文件系统名。如果它是 btrfs,那就可以了。让我们创建一个新的目录去做实验: ``` $ mkdir ~/btrfs-subvolume-test $ cd ~/btrfs-subvolume-test ``` 在下面的文本中,你会看到很多像上面显示的那样的命令输出框。请在阅读/比较命令输出时请记住,**框中的内容在行末会被换行**。这使得识别跨多行的长行变得困难,降低了可读性。如果有疑问,试着调整浏览器窗口的大小,看看文本的变化! ### 创建和使用子卷 我们可以通过以下命令创建一个 Btrfs 子卷: ``` $ sudo btrfs subvolume create first Create subvolume './first' ``` 当我们检查当前目录,我们可以看到现在有一个名为 `first` 的新目录。注意到下面输出的第一个字符 `d`: ``` $ ls -l total 0 drwxr-xr-x. 1 root root 0 Oct 15 18:09 first ``` 我们可以像常规目录一样操作它:我们可以重命名它,移动它,在里面创建新文件和目录,等等。注意到目录属于 root,所以我们必须以 root 身份去做这些事情。 如果它表现和看起来就像个目录,那我们如何知道这是不是一个 Btrfs 子卷呢?我们可以使用 `btrfs` 工具去列出所有子卷: ``` $ sudo btrfs subvolume list . ID 256 gen 30 top level 5 path home ID 257 gen 30 top level 5 path root ID 258 gen 25 top level 257 path root/var/lib/machines ID 259 gen 29 top level 256 path hartan/btrfs-subvolume-test/first ``` 如果你安装的是最新的 Fedora Linux,且未修改过,你很可能会看到和上面一样的输出。我们会在之后检查 `home` 和 `root` ,还有全部数字的含义。现在,我们看到在我们指定的路径下有一个子卷。我们可以将输出限制在我们当前位置下面的子卷: ``` $ sudo btrfs subvolume list -o . ID 259 gen 29 top level 256 path home/hartan/btrfs-subvolume-test/first ``` 让我们重命名子卷: ``` $ sudo mv first second $ sudo btrfs subvolume list -o . ID 259 gen 29 top level 256 path home/hartan/btrfs-subvolume-test/second ``` 我们还可以嵌套子卷: ``` $ sudo btrfs subvolume create second/third Create subvolume 'second/third' $ sudo btrfs subvolume list . ID 256 gen 34 top level 5 path home ID 257 gen 37 top level 5 path root ID 258 gen 25 top level 257 path root/var/lib/machines ID 259 gen 37 top level 256 path hartan/btrfs-subvolume-test/second ID 260 gen 37 top level 259 path hartan/btrfs-subvolume-test/second/third ``` 我们也可以移除子卷,就像移除目录一样: ``` $ sudo rm -r second/third ``` 或者通过特殊的 Btrfs 命令: ``` $ sudo btrfs subvolume delete second Delete subvolume (no-commit): '/home/hartan/btrfs-subvolume-test/second' ``` ### 像单独的文件系统一样操作子卷 前面的简介里说 Btrfs 子卷就好像单独的文件系统。这意味着我们可以挂载子卷并且传递一些挂载选项给它。我们先创建一个小的目录结构去更好的理解发生了什么: ``` $ mkdir -p a a/1 a/1/b $ sudo btrfs subvolume create a/2 Create subvolume 'a/2' $ sudo touch a/1/c a/1/b/d a/2/e ``` 这就是目录结构的样子: ``` $ tree . └── a ├── 1 │ ├── b │ │ └── d │ └── c └── 2 └── e 4 directories, 3 files ``` 验证现在这里有一个新的 Btrfs 子卷: ``` $ sudo btrfs subvolume list -o . ID 261 gen 41 top level 256 path home/hartan/btrfs-subvolume-test/a/2 ``` 为了挂载子卷,我们必须知道 Btrfs 子卷所在的块设备路径。下面的命令会告诉我们: ``` $ findmnt -vno SOURCE /home/ /dev/vda3 ``` 现在我们挂载子卷。确保你将参数替换成你 PC 上的: ``` $ sudo mount -o subvol=home/hartan/btrfs-subvolume-test/a/2 /dev/vda3 a/1/b ``` 观察到我们使用 `-o` 参数去提供额外的选项去挂载程序。在这里我们告诉它挂载在设备 `/dev/vda3` 上 btrfs 文件系统里名为 `home/hartan/btrfs-subvolume-test/a/2` 的子卷。这是 Btrfs 特有的选项,在其他文件系统里没有的。 我们可以看到目录结构变化了: ``` $ tree . └── a ├── 1 │ ├── b │ │ └── e │ └── c └── 2 └── e 4 directories, 3 files ``` 现在文件 `e` 出现了两次, `d` 不见了。我们现在可以用两个不同的路径访问相同的 Btrfs 子卷。在一个路径的所有变化会被立刻反应在其他的位置: ``` $ sudo touch a/1/b/x $ ls -lA a/2 total 0 -rw-r--r--. 1 root root 0 Oct 15 18:14 e -rw-r--r--. 1 root root 0 Oct 15 18:16 x ``` 让我们尝试更多的挂载选项。例如我们可以像这样以只读方式挂载子卷到 `a/1/b`(插入你 PC 的参数): ``` $ sudo umount a/1/b $ sudo mount -o subvol=home/hartan/btrfs-subvolume-test/a/2,ro /dev/vda3 a/1/b ``` 我们和上面使用相同的命令,除了我们加上了 `ro` 在末尾。现在我们不能在这个挂载点上创建文件: ``` $ sudo touch a/1/b/y touch: cannot touch 'a/1/b/y': Read-only file system ``` 但直接访问子卷仍然像之前一样: ``` $ sudo touch a/2/y $ tree . └── a ├── 1 │ ├── b │ │ ├── e │ │ ├── x │ │ └── y │ └── c └── 2 ├── e ├── x └── y 4 directories, 7 files ``` 在下一步之前不要忘记进行清理: ``` $ sudo rm -rf a rm: cannot remove 'a/1/b/e': Read-only file system rm: cannot remove 'a/1/b/x': Read-only file system rm: cannot remove 'a/1/b/y': Read-only file system ``` 天啊,发生了什么?噢,因为我们在上面挂载只读子卷,所以不能删除它。从文件系统的角度来看,删除是一种写入操作:为了删除 `a/2/b/e`,我们从父目录 `a/1/b` 的内容中删除目录项 `e`。换句话来说,我们必须 *写入* `a/1/b` 去表明 `e` 不复存在。所以我们先卸载子卷,然后移除目录: ``` $ sudo umount a/1/b $ sudo rm -rf a $ tree . 0 directories, 0 files ``` ### 子卷 ID 还记得 `btrfs subvolume list` 命令的第一次输出吗?那包含了很多数字,让我们看看这些究竟什么。我在这里复制了输出,以便再次查看: ``` ID 256 gen 30 top level 5 path home ID 257 gen 30 top level 5 path root ID 258 gen 25 top level 257 path root/var/lib/machines ID 259 gen 29 top level 256 path hartan/btrfs-subvolume-test/first ``` 我们看到有三列数字,每个前面有一些字母来描述它们的作用。第一列是子卷 ID 。子卷 ID 在 Btrfs 文件系统是唯一的,而且唯一地标识子卷。这意味着名为 `home` 的子卷也可以用它的 ID **256** 来引用。之前的挂载命令是这样写的: ``` $ sudo mount -o subvol=hartan/... ``` 另外一个完全合法的选择是使用子卷 ID : ``` $ sudo mount -o subvolid=... ``` 子卷 ID 从 **256** 开始,每创建一个子卷依次递增 1 。但是在这里有一个例外:文件系统的根的子卷名称总是为 `/`,并且子卷 ID 是 5 。没错,即使文件系统的根技术上也是一个子卷。这是不言而喻的,因此不会出现在 `btrfs subvolume` 的输出列表里。如果你没有用 `subvol` 和 `subvolid` 参数去挂载一个 Btrfs 文件系统,`subvolid=5` 的顶级子卷就是默认的挂载对象。下面我们会看到一个想要显式挂载文件系统根的例子。 第二列的数字是生成号,并且在每次 Btrfs 事务中递增。这几乎是一个内部的计数器,我们不会在这里讨论。 最后,第三列数字是 *父* 子卷的子卷 ID。在上面的输出我们可以看到子卷 `home` 和 `root` 的父子卷 ID 都是 5。记住 ID 5 的特殊含义:这是文件系统的根。所以我们知道 `home` 和 `root` 都是顶级子卷的子卷。另一方面 `hartan/btrfs-subvolume-test.first` 是子卷 ID 256(也就是 `home`)的子卷。 在下一节我们会看看子卷 `root` 和 `home` 是怎么来的。 ### 检查 Fedora Linux 的默认子卷 当你从头创建一个新的 Btrfs 文件系统,里面是没有子卷的(当然,除了顶级子卷)。所以 Fedora Linux 里的 `home` 和 `root` 子卷是哪里来的? 它们是安装程序在安装时创建的。传统的安装经常会为 `/` 和 `/home` 目录包含单独的文件系统分区。在启动时,它们通过恰当的挂载组成一个完整的文件系统。但这个方法有一个问题:除非你使用像 lvm 这样的技术,想在将来改变分区的大小是非常难的。因而你可能出现 `/` 或 `/home` 用完空间的情况,然而还有很多其他没被使用的分区和空间剩余。 因为 Btrfs 子卷全都是相同文件系统的一部分,它们共享底层文件系统提供的空间。还记得我们在上面创建的子卷吗?我们从未告诉 Btrfs 它们多大:一个子卷可以占据文件系统拥有的全部空间,默认是不会阻止这种行为的。但是,我们 *可以* 通过 Btrfs 的 <ruby> 限额组 <rt> qgroup </rt></ruby> 动态地约束其大小,同时也可以在运行时修改(我们将在后续的文章中了解如何做的)。 另外一个分离 `/` 和 `/home` 的优势是我们可以分别进行 *快照* 。子卷是快照的边界,对一个子卷的快照永远不会包含该子卷下面的其他子卷的内容。快照的更多细节会在后续的文章中介绍。 理论已经足够了!我们来看看这是怎么回事。首先确保你的根文件系统类型是 Btrfs : ``` $ findmnt -no FSTYPE / btrfs ``` 然后我们获取它所在的分区: ``` $ findmnt -vno SOURCE / /dev/vda3 ``` 记住我们可以通过特殊的子卷 ID 5 挂载文件系统的根(适应文件系统分区!): ``` $ mkdir fedora-rootsubvol $ sudo mount -o subvolid=5 /dev/vda3 ./fedora-rootsubvol $ ls fedora-rootsubvol/ home root ``` 而且还有 Fedora Linux 安装的子卷!但 Fedora Linux 是如何知道子卷 `root` 属于 `/` ,而 `home` 属于 `/home` 的呢? 文件 `/etc/fstab` 包含了所谓的文件系统的静态信息。简而言之,在你系统启动的时候会一行一行地读取这个文件,然后挂载那里列出的所有文件系统。在我的系统上,这个文件长这样: ``` $ cat /etc/fstab # [ ... ] # /etc/fstab # Created by anaconda on Sat Oct 15 12:01:57 2022 # [ ... ] # UUID=5e4e42bb-4f2f-4f0e-895f-d1a46ea47807 / btrfs subvol=root,compress=zstd:1 0 0 UUID=e3a798a8-b8f2-40ca-9da7-5e292a6412aa /boot ext4 defaults 1 2 UUID=5e4e42bb-4f2f-4f0e-895f-d1a46ea47807 /home btrfs subvol=home,compress=zstd:1 0 0 ``` (注意上面的 “UUID” 开头行的内容被换行成两行) 每行开头的 `UUID` 用于标识你系统上的硬盘和文件系统分区(大概相当于我在上面使用的 `/dev/vda3` )。第二列是文件系统应该挂载在文件系统树上的路径。第三列是文件系统类型。我们可以看到 `/` 和 `/home` 都是 `btrfs` 类型,正如我们期望的那样!最后,第四列是:这些是挂载选项,这里说通过 `subvol=root` 选项去挂载 `/` 。这正是我们一直在 `btrfs subvolume list /` 里看到的输出! 有了这些信息,我们可以重新构建创建这个文件系统项的 `mount` 命令 ``` $ sudo mount -o subvol=root,compress=zstd:1 UUID=5e4e42bb-4f2f-4f0e-895f-d1a46ea47807 / ``` (再次,上面的 “UUID” 开头行的内容被换行成两行) 这就是 Fedora Linux 如何使用 Btrfs 子卷!如果你对好奇 Fedora Linux 为什么选择 Btrfs 作为默认的文件系统,请参阅下面链接的更改提议 <sup class="footnote-ref"> <a href="#fn1" id="fnref1"> [1] </a></sup>。 ### Btrfs 子卷的更多内容 Btrfs 维基提供了关于子卷的更多信息,其中最重要的是可应用于 Btrfs 子卷的挂载选项。有些选项,比如 `compress` 只能应用到文件系统的层面,因而会影响一个 Btrfs 文件系统的所有子卷。你可以通过下面的链接找到entry <sup class="footnote-ref"> <a href="#fn2" id="fnref2"> [2] </a></sup>。 如果你对哪些目录是普通目录和哪些是子卷有困惑,你可以对你的子卷采用特殊的命名约定。例如,你可以给子卷名加上 `@` 前缀去方便区分。 现在你知道子卷表现得就像文件系统,有人可能会问如何才能最好地将子卷放置在特定位置。比如你想要一个 Btrfs 子卷在 `~/games` 下面,然而你的主目录(`~`)本身就是一个子卷,你该如何实现呢?鉴于上面的例子,你可以使用像 `sudo btrfs subvolume create ~/games` 的命令。这样,你创建了所谓的 *嵌套* 子卷:在你的子卷 `~` 里,有一个子卷 `games` 。这正是一种达成目的的方法。 其他有效的方法就是如同 Fedora 默认行为那样:在根子卷下创建所有子卷(也就是它们的父子卷 ID 是 5 ),然后挂载它们到特定的位置。Btrfs 维基有这些方法的概述和对于各自文件系统管理影响的简短讨论 <sup class="footnote-ref"> <a href="#fn3" id="fnref3"> [3] </a></sup>。 ### 总结 在本文中,我们探索了 Btrfs 子卷,它们像是 Btrfs 文件系统内部的独立的 Btrfs 文件系统。我们学习了如何创建、挂载和删除子卷。最后,我们探讨了 Fedora Linux 如何在我们完全没有注意到的情况下使用子卷。 本系列的下一篇文章将讨论: * 快照 - 回到过去 * 压缩 - 透明地节省存储空间 * 配额组 - 限制文件系统大小 * RAID - 替代 mdadm 配置 如果你还想了解与 Btrfs 相关的其他主题,请查看 Btrfs 维基 <sup class="footnote-ref"> <a href="#fn4" id="fnref4"> [4] </a></sup> 和文档 <sup class="footnote-ref"> <a href="#fn5" id="fnref5"> [5] </a></sup>。不要忘记查看本系列的第一篇文章(如果你还没有看过的话)!如果你认为本系列文章缺少了一些内容,请在下面的评论中告诉我们。再会! ### 参考资料 1. <https://fedoraproject.org/wiki/Changes/BtrfsByDefault#Benefit_to_Fedora> [↩︎](#fnref1) 2. <https://btrfs.readthedocs.io/en/latest/Subvolumes.html> [↩︎](#fnref2) 3. <https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Layout> [↩︎](#fnref3) 4. <https://btrfs.wiki.kernel.org/index.php/Main_Page> [↩︎](#fnref4) 5. <https://btrfs.readthedocs.io/en/latest/Introduction.html> [↩︎](#fnref5) *(题图:MJ/f047ea87-2490-40e5-9f91-d48d236675e5)* --- via: <https://fedoramagazine.org/working-with-btrfs-subvolumes/> 作者:[Andreas Hartmann](https://fedoramagazine.org/author/hartan/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[A2ureStone](https://github.com/A2ureStone) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
This article is part of a series of articles that takes a closer look at Btrfs, the default filesystem for Fedora Workstation and Fedora Silverblue since Fedora Linux 33. In case you missed it, here’s the previous article from the series: [https://fedoramagazine.org/working-with-btrfs-general-concepts/](https://fedoramagazine.org/working-with-btrfs-general-concepts/) ## Introduction Subvolumes allow for the partitioning of a Btrfs filesystem into separate sub-filesystems. This means that you can mount subvolumes from a Btrfs filesystem as if they were independent filesystems. In addition, you can, for example, define the maximum space a subvolume may take up via qgroups (We’ll talk about this in another article in this series), or use subvolumes to specifically include or exclude files from snapshots (We’ll talk about this, too, in another article in this series). Every default Fedora Workstation and Fedora Silverblue installation since Fedora Linux 33 makes use of subvolumes. In this article we will explore how it works. Below you will find a lot of examples related to subvolumes. If you want to follow along, you must have access to some Btrfs filesystem and root access. You can verify whether your */home/* directory is Btrfs via the following command: $ findmnt -no FSTYPE /home btrfs This command will output the name of the filesystem of your */home/* directory. If it says *btrfs*, you’re all set. Let’s create a new directory to perform some experiments in: $ mkdir ~/btrfs-subvolume-test $ cd ~/btrfs-subvolume-test In the text below, you will find lots of command outputs in boxes such as shown above. Please keep in mind while reading/comparing command outputs that the **box contents are wrapped at the end of the line**. This makes it difficult to recognize long lines that are broken across multiple lines for readability. When in doubt, try to resize your browser window and see how the text behaves! ## Creating and playing with subvolumes We can create a Btrfs subvolume with the following command: $ sudo btrfs subvolume create first Create subvolume './first' When we inspect the current directory we will see that it now has a new folder named *first*. Note the first character *d* in the output below: $ ls -l total 0 drwxr-xr-x. 1 root root 0 Oct 15 18:09 first We can handle this like any regular folder: We can rename it, move it, create new files and folders inside, etc. Note that the folder belongs to root, so we must be root to do these things. If it acts like a folder and looks like a folder, how do we know whether it’s a Btrfs subvolume? We can use the *btrfs* tools to list all subvolumes: $ sudo btrfs subvolume list . ID 256 gen 30 top level 5 path home ID 257 gen 30 top level 5 path root ID 258 gen 25 top level 257 path root/var/lib/machines ID 259 gen 29 top level 256 path hartan/btrfs-subvolume-test/first If you’re on a recent and unmodified Fedora Linux installation you will likely see the same output as above. We will inspect *home* and *root* as well as the meaning of all the numbers later. For now, we see that there is a subvolume at the path we specified. We can limit the output to the subvolumes below our current location: $ sudo btrfs subvolume list -o . ID 259 gen 29 top level 256 path home/hartan/btrfs-subvolume-test/first Let’s rename the subvolume: $ sudo mv first second $ sudo btrfs subvolume list -o . ID 259 gen 29 top level 256 path home/hartan/btrfs-subvolume-test/second We can also nest subvolumes: $ sudo btrfs subvolume create second/third Create subvolume 'second/third' $ sudo btrfs subvolume list . ID 256 gen 34 top level 5 path home ID 257 gen 37 top level 5 path root ID 258 gen 25 top level 257 path root/var/lib/machines ID 259 gen 37 top level 256 path hartan/btrfs-subvolume-test/second ID 260 gen 37 top level 259 path hartan/btrfs-subvolume-test/second/third And we can also remove subvolumes, either like we remove folders: $ sudo rm -r second/third or via special Btrfs commands: $ sudo btrfs subvolume delete second Delete subvolume (no-commit): '/home/hartan/btrfs-subvolume-test/second' ## Handling Btrfs subvolumes like separate filesystems The introduction mentioned that Btrfs subvolumes act like separate filesystems. This means that we can mount subvolumes and pass some mount options to them. First we will create a small folder structure to get a better understanding of what happens: $ mkdir -p a a/1 a/1/b $ sudo btrfs subvolume create a/2 Create subvolume 'a/2' $ sudo touch a/1/c a/1/b/d a/2/e Here’s what the structure looks like: $ tree . └── a ├── 1 │ ├── b │ │ └── d │ └── c └── 2 └── e 4 directories, 3 files Verify that there is now a new Btrfs subvolume: $ sudo btrfs subvolume list -o . ID 261 gen 41 top level 256 path home/hartan/btrfs-subvolume-test/a/2 To mount the subvolume we must know the path of the block device where the Btrfs filesystem subvolume resides. The following command tells us: $ findmnt -vno SOURCE /home/ /dev/vda3 Now we can mount the subvolume. Make sure you replace the arguments with the values for your PC: $ sudo mount -o subvol=home/hartan/btrfs-subvolume-test/a/2 /dev/vda3 a/1/b Observe that we use the *-o* flag to give additional options to the mount program. In this case we tell it to mount the subvolume with name *home/hartan/btrfs-subvolume-test/a/2* from the btrfs filesystem on device */dev/vda3*. This is a Btrfs-specific option and isn’t available in other filesystems. We see that the directory structure has changed: $ tree . └── a ├── 1 │ ├── b │ │ └── e │ └── c └── 2 └── e 4 directories, 3 files Note that the file *e* exists twice now and *d* is gone. We are now able to access the same Btrfs subvolume by two different paths. All changes we perform in either of the paths are immediately reflected in all other locations: $ sudo touch a/1/b/x $ ls -lA a/2 total 0 -rw-r--r--. 1 root root 0 Oct 15 18:14 e -rw-r--r--. 1 root root 0 Oct 15 18:16 x Let’s play some more with the mount options. For example we can mount the subvolume as read-only under *a/1/b* like this (Insert arguments for your PC!): $ sudo umount a/1/b $ sudo mount -o subvol=home/hartan/btrfs-subvolume-test/a/2,ro /dev/vda3 a/1/b We use the same command as above, except that we add *ro* at the end. Now we can no longer create files via this mount: $ sudo touch a/1/b/y touch: cannot touch 'a/1/b/y': Read-only file system but accessing the subvolume directly still works like before: $ sudo touch a/2/y $ tree . └── a ├── 1 │ ├── b │ │ ├── e │ │ ├── x │ │ └── y │ └── c └── 2 ├── e ├── x └── y 4 directories, 7 files Don’t forget to clean up before we move on: $ sudo rm -rf a rm: cannot remove 'a/1/b/e': Read-only file system rm: cannot remove 'a/1/b/x': Read-only file system rm: cannot remove 'a/1/b/y': Read-only file system Oh no, what happened? Well, since we mounted the subvolume *read-only* above, we cannot delete it. A deletion from a filesystems’ perspective is a write operation: To delete ** a/1/b/e,** we remove the directory entry for *from the directory contents of its parent directory,* **e***in this case. In other words, we must* **a/1/b***write*to **to tell it that** *a/1/b**doesn’t exist any longer. So first we unmount the subvolume again, and then we remove the folder:* **e**$ sudo umount a/1/b $ sudo rm -rf a $ tree . 0 directories, 0 files ## Subvolume IDs Remember the first output of the *subvolume list* subcommand? That contained a lot of numbers, so let’s see what that is all about. I copied the output here to take another look: ID 256 gen 30 top level 5 path home ID 257 gen 30 top level 5 path root ID 258 gen 25 top level 257 path root/var/lib/machines ID 259 gen 29 top level 256 path hartan/btrfs-subvolume-test/first We see there are three columns of numbers, each prefixed with a few letters to describe what they do. The first column of numbers is a subvolumes ID. Subvolume IDs are unique in a Btrfs filesystem and as such uniquely identify subvolumes. This means that the subvolume named *home* can also be referred to by its ID **256**. In the mount command above we wrote: $ sudo mount -o subvol=hartan/... Another perfectly legal option is to use subvolume IDs: $ sudo mount -o subvolid=... Subvolume IDs start at **256** and increase by 1 for every created subvolume. There is however one exception to this: The filesystem root always has the subvolume name */* and the subvolume ID 5. That is right, even the root of a Btrfs filesystem is technically a subvolume. This is just implicitly known, hence it doesn’t show up in the output of *btrfs subvolume list*. If you mount a Btrfs filesystem without the *subvol* or *subvolid* argument, the root subvolume with *subvolid=5* is assumed as default. Below we’ll see an example of when one may want to explicitly mount the filesystem root. The second column of numbers is the generation counter and incremented on every Btrfs transaction. This is mostly an internal counter and won’t be discussed further here. Finally, the third column of numbers is the subvolume ID of the subvolumes *parent*. In the output above we see that both subvolume *home* and *root* have 5 as their parent subvolume ID. Remember that ID 5 has a special meaning: It is the filesystem root. So we know that *home* and *root* are children to the root subvolume. *hartan/btrfs-subvolume-test/first *on the other hand is a child of the subvolume with ID 256, which in our case is *home*. In the next section we have a look at where the subvolumes *root* and *home* come from. ## Inspecting default subvolumes in Fedora Linux When you create a new Btrfs filesystem from scratch, there will be no subvolumes in it (Except of course for the root subvolume). So where do the *home* and *root* subvolumes in Fedora Linux come from? These are created by the installer at install time. Traditional installations would often include a separate filesystem partition for the */* and */home* directories. During boot, these are then appropriately mounted to assemble one full filesystem. But there is an issue with this approach: Unless you use technologies such as *lvm*, it is very hard to change a partitions size at some point in the future. As a consequence you may end up in a situation where either your */* or */home* runs out of space, while the respective other partition has lots of unused, free space left. Since Btrfs subvolumes are all part of the same filesystem, they will share the space that the underlying filesystem offers. Remember when we created the subvolumes above? We never told Btrfs how big they are: A subvolume can take up all the space the filesystem has, by default nothing keeps it from doing so. However, we *could* dynamically impose size limits via Btrfs qgroups, which can also be modified during runtime (And we’ll see how in a later article in this series). Another advantage of separating */* and */home* is that we can take *snapshots* separately. A subvolume is a boundary for snapshots, and snapshots will never contain the contents of other subvolumes below the subvolume that the snapshot is taken of. More details on snapshots follow in the next article in this series. Enough of the theory! Let’s see what this is all about. First ensure that your root filesystem is in fact of type Btrfs: $ findmnt -no FSTYPE / btrfs And then get the partition it resides on: $ findmnt -vno SOURCE / /dev/vda3 Remember we can mount the filesystem root by its special subvolume ID 5 (Adapt the filesystem partition!): $ mkdir fedora-rootsubvol $ sudo mount -o subvolid=5 /dev/vda3 ./fedora-rootsubvol $ ls fedora-rootsubvol/ home root And there are the subvolumes of our Fedora Linux installation! But how does Fedora Linux know that the subvolume *root* belongs to */*, and *home* belongs to */home*? The file */etc/fstab* contains so-called static information about the filesystem. In simple terms, during booting your system reads this file, line by line, and mounts all the filesystems listed there. On my system, the file looks like this: $ cat /etc/fstab # [ ... ] # /etc/fstab # Created by anaconda on Sat Oct 15 12:01:57 2022 # [ ... ] # UUID=5e4e42bb-4f2f-4f0e-895f-d1a46ea47807 / btrfs subvol=root,compress=zstd:1 0 0 UUID=e3a798a8-b8f2-40ca-9da7-5e292a6412aa /boot ext4 defaults 1 2 UUID=5e4e42bb-4f2f-4f0e-895f-d1a46ea47807 /home btrfs subvol=home,compress=zstd:1 0 0 (Note that the “UUID” lines above have been wrapped into two lines) The *UUID* at the beginning of each line is simply a means to identify disks and filesystem partitions in your system (roughly equivalent to */dev/vda3* as I used above). The second column is the path in the filesystem tree where this filesystem should be mounted. The third column is the filesystem type. We see that the entries for */* and */home* are of type *btrfs*, just what we expect! Finally, in the fourth column we see the magic: These are the mount options, and there it says to mount */* with the option *subvol=root*. That is exactly the subvolume we saw in the output of *btrfs subvolume list /* all the time! With this information, we can reconstruct the call to *mount* that creates this filesystem entry: $ sudo mount -o subvol=root,compress=zstd:1 UUID=5e4e42bb-4f2f-4f0e-895f-d1a46ea47807 / (again, the line above has been wrapped into two) And that is how Fedora Linux uses Btrfs subvolumes! If you’re curious as to why Fedora Linux decided to use Btrfs as the default filesystem, refer to the change proposal linked below [[1]](#sources). ## More on Btrfs subvolumes The Btrfs wiki has additional information on subvolumes and most importantly on the mount options that can be applied to Btrfs subvolumes. Some options, like *compress* can only be applied on a filesystem-wide level and thus affect all subvolumes of a Btrfs filesystem. You can find the entry linked below [[2]](#sources). If you find it confusing to tell which directories are plain directories and which are subvolumes, you can feel free to adopt a special naming convention for your subvolumes. For example, you could prefix your subvolume names with an “@” to make them easily distinguishable. Now that you know that subvolumes behave like filesystems, one may ask how best to place a subvolume in a certain location. Say you want a Btrfs subvolume under *~/games*, where your home directory (*~*) is itself a subvolume, how can you achieve that? Given the example above, you may use a command like *sudo btrfs subvolume create ~/games*. This way, you create so-called *nested* subvolumes: Inside your subvolume *~*, there is now a subvolume *games*. That is a perfectly fine way to approach this situation. Another valid solution is to do what Fedora does by default: Create all subvolumes under the root subvolume (i.e. such that their parent subvolume ID is 5), and mount them into the appropriate locations. The Btrfs wiki has an overview of these approaches along with a short discussion about their respective implications on filesystem management [[5]](#sources). ## Conclusion In this article we discovered Btrfs subvolumes, which act like separate Btrfs filesystems inside a Btrfs filesystem. We learned how to create, mount and delete subvolumes. Finally, we explored how Fedora Linux makes use of subvolumes – without us noticing at all. The next articles in this series will deal with: - Snapshots – Going back in time - Compression – Transparently saving storage space - Qgroups – Limiting your filesystem size - RAID – Replace your mdadm configuration If there are other topics related to Btrfs that you want to know more about, have a look at the Btrfs Wiki [[3]](#sources) and Docs [[4]](#sources). Don’t forget to check out the first article of this series, if you haven’t already! If you feel that there is something missing from this article series, let us know in the comments below. See you in the next article! ## Sources [1]: [https://fedoraproject.org/wiki/Changes/BtrfsByDefault#Benefit_to_Fedora](https://fedoraproject.org/wiki/Changes/BtrfsByDefault#Benefit_to_Fedora) [2]: [https://btrfs.readthedocs.io/en/latest/Subvolumes.html](https://btrfs.readthedocs.io/en/latest/Subvolumes.html) [3]: [https://btrfs.wiki.kernel.org/index.php/Main_Page](https://btrfs.wiki.kernel.org/index.php/Main_Page) [4]: [https://btrfs.readthedocs.io/en/latest/Introduction.html](https://btrfs.readthedocs.io/en/latest/Introduction.html) [5]: [https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Layout](https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Layout) ## Esc Thanks, super ## Stephen Excellent write up, keep them coming! ## Kory Great write up. I learned a lot! ## msandy I think this is the first time i actually am starting to understand what subvolumes are and how they relate to snapshots. I love these articles I always get excited when i see them show in my inbox. ## Jesse too bad it still doesn’t support RAID 5/6 properly. ## Jens Is Andreas Hartmann from Geesthacht, Germany? ## Tomasz Very interested in the RAID article and how you propose to replace mdadm. ## bitlife Keep the articles coming; they are excellent! ## cmurf 🥳 Great! ## condor This is a perfectly timed article! It’s the ideal time of year for some recreational reading. Keep it up! ## robbers alice I didn’t have any expectations concerning that title, but the more I was astonished. The author did a great job. I spent a few minutes reading and checking the facts. Everything is very clear and understandable. I like posts that fill in your knowledge gaps. This one is of the sort. ## shay Seems really complicated I think I’ll go back to FAT32 ## Bill Chatfield Haha! I agree. It’s too complicated. ## Kohlrak Any way to easily move it to Ext4 or something? I didn’t realize how slow it would be and now programs like Steam or anything else that does alot of file access will slow to a crawl and programs go to swap and become unresponsive. ## Gregory Bartholomew If there is a specific directory under which all the high I/O occurs, you might get better performance with something like “sudo chattr +C <path-to-directory>”. See here for more info about disabling Btrfs’ CoW. ## Kohlrak Thank you. ## Geno This is great! Can’t wait for the next in the series 😀 ## Bill Chatfield This is a really good article. I appreciate the author’s work in writing it. But I feel there are too many complicated commands for something that should be happening automatically. That’s a problem with btrfs. The article is great though.
16,252
Linux 内核动手编译实用指南
https://itsfoss.com/compile-linux-kernel/
2023-10-04T11:53:00
[ "Linux", "内核", "编译" ]
https://linux.cn/article-16252-1.html
![](/data/attachment/album/202310/04/115142ggqqhuclvxdxsb14.jpg) > > 一份让你深入体验最新 Linux 内核编译过程的实操指南。 > > > 出于各种原因,自行编译 Linux 内核可能引起你的兴趣。这些原因可能包括但不限于: * 测试一个比你目前的 Linux 发行版更新的内核版本 * 采用一组不同的配置选项、驱动来构建内核 * 学习者的好奇心 ? 此指南将一步步指导你如何亲自编译 Linux 内核,包括你该运行哪些命令,为什么运行这些命令以及这些命令的执行效果。本文篇幅较长,所以请做好准备! > > ? 诸如 [Ubuntu 这样的发行版提供了更简单地安装主线 Linux 内核的方式](https://itsfoss.com/upgrade-linux-kernel-ubuntu/)。但本教程目标是从源码手动完成所有工作。**此教程需要你付出时间、耐心以及丰富的 Linux 命令行使用经验**。本文更注重亲身实践的体验。不管怎么说,我仍建议你在虚拟机或备用系统中尝试此冒险,而非在你的主系统上进行。 > > > ### 前置准备 在软件领域,构建任何事物都有两个基本要求: 1. 源代码 2. 构建依赖 因此,作为预备环节,我们需要下载 Linux 内核的源码压缩包,并安装一些能让我们成功构建 Linux 内核的依赖项。 #### Linux 版本导览 在任何时刻,[~~Freax~~](https://en.wikipedia.org/wiki/History_of_Linux#Naming) Linux 内核都有四种“版本”。 Linux 的这些 “版本”,按照开发流程的顺序是: 1. **linux-next 树:** 所有准备合并到 Linux 代码库的代码首先被合并到 linux-next 树。它代表的是 Linux 内核最新也是“最不稳定”的状态。大多数 Linux 内核开发者和测试人员使用这个来提高代码质量,为 Linus Torvalds 的后续提取做准备。**请谨慎使用!** 2. **发布候选版(RC) / 主线版:** Linus 从 linux-next 树抽取代码并创建一个初始发布版本。这个初始发布版本的测试版称为 RC(<ruby> 发布候选 <rt> Release Candidate </rt></ruby>)版本。一旦 RC 版本发布,Linus 只会接受对它的错误修复和性能退化相关的补丁。基础这些反馈,Linus 会每周发布一个 RC 内核,直到他对代码感到满意。RC 发行版本的标识是 `-rc` 后缀,后面跟一个数字。 3. **稳定版:** 当 Linus 觉得最新的 RC 版本已稳定时,他会发布最终的“公开”版本。稳定发布版将会维护几周时间。像 Arch Linux 和 Fedora Linux 这样的前沿 Linux 发行版会使用此类版本。**我建议你在试用 linux-next 或任何 RC 版本之前,先试一试此版本。** 4. **LTS 版本:** 每年最后一个稳定版将会再维护 [几年](https://news.itsfoss.com/linux-kernel-support/)。这通常是一个较旧的版本,但它会 **会积极地维护并提供安全修复**。Debian 的稳定版本会使用 Linux 内核的 LTS 版版本。 若想了解更多此方面的知识,可参阅 [官方文档](https://www.kernel.org/category/releases.html)。 本文将以当前可用的最新稳定版为例,编写此文时的 Linux 内核版本是 [6.5.5](https://lwn.net/Articles/945378/)。 ### 系统准备 由于 Linux 内核使用 C 语言编写,编译 Linux 内核至少需要一个 C 编译器。你的计算机上可能还需要其他一些依赖项,现在是安装它们的时候了。 > > ? 这个指南主要聚焦于使用 GNU C 编译器(GCC)来编译 Linux 内核。但在未来的文章中(可能会深入介绍 Rust 的支持),我**可能**会介绍使用 LLVM 的 Clang 编译器作为 GCC 的替代品。 > > > 不过,请注意,MSVC 并不适用。尽管如此,我仍期待有微软的员工为此发送修补程序集。我在瞎想啥? > > > 对于 Arch Linux 以及其衍生版本的用户,安装命令如下: ``` sudo pacman -S base-devel bc coreutils cpio gettext initramfs kmod libelf ncurses pahole perl python rsync tar xz ``` 对于 Debian 以及其衍生版本的用户,安装命令如下: ``` sudo apt install bc binutils bison dwarves flex gcc git gnupg2 gzip libelf-dev libncurses5-dev libssl-dev make openssl pahole perl-base rsync tar xz-utils ``` 对于 Fedora 以及其衍生版本的用户,安装命令如下: ``` sudo dnf install binutils ncurses-devel \ /usr/include/{libelf.h,openssl/pkcs7.h} \ /usr/bin/{bc,bison,flex,gcc,git,gpg2,gzip,make,openssl,pahole,perl,rsync,tar,xz,zstd} ``` #### 下载 Linux 内核源码 请访问 [kernel.org](https://kernel.org/),在页面中寻找第一个 <ruby> 稳定 <rt> Stable </rt></ruby> 版本。你不会找不到它,因为它是最显眼的黄色方框哦 ? > > **[点击访问 kernel.org](https://kernel.org/)** > > > ![](/data/attachment/album/202310/04/115421iaaw8wvn85r6no8d.jpg) 通过点击黄色的方框,你就可以下载 Tar 文件。同时,也别忘了下载相匹配的 PGP 签名文件,稍后我们需要用到它来验证 Tar 文件。它的扩展名为 `.tar.sign`。 ##### 校验 Tar 文件的完整性 你如何知道刚下载的 Tar 文件是否被损坏?对于个人来说,一个损坏的 Tar 文件只会浪费你的宝贵时间,如果你是在为一个组织工作,那么可能会危及到组织的安全(这时你可能还有更大的问题需要担忧,但我们并不想让所有人都产生创伤后应激障碍!)。 为了验证我们的 Tar 文件的完整性,我们需要先解压它。目前,它是使用 XZ 压缩算法压缩的。因此,我将使用 `unxz` 工具(其实就是 `xz --decompress` 的别名)来解压 `.tar.xz` 格式的压缩文件。 ``` unxz --keep linux-*.tar.xz ``` 解压完成后,我们需要获取 Linus Torvalds 和 Greg KH 使用的 GPG 公开密钥。这些密钥用于对 Tar 文件进行签名。 ``` gpg2 --locate-keys [email protected] [email protected] ``` 你应该可以得到一个与我在我的电脑上看到的类似的结果: ``` $ gpg2 --locate-keys [email protected] [email protected] gpg: /home/pratham/.gnupg/trustdb.gpg: trustdb created gpg: key 38DBBDC86092693E: public key "Greg Kroah-Hartman <[email protected]>" imported gpg: Total number processed: 1 gpg: imported: 1 gpg: key 79BE3E4300411886: public key "Linus Torvalds <[email protected]>" imported gpg: Total number processed: 1 gpg: imported: 1 pub rsa4096 2011-09-23 [SC] 647F28654894E3BD457199BE38DBBDC86092693E uid [ unknown] Greg Kroah-Hartman <[email protected]> sub rsa4096 2011-09-23 [E] pub rsa2048 2011-09-20 [SC] ABAF11C65A2970B130ABE3C479BE3E4300411886 uid [ unknown] Linus Torvalds <[email protected]> sub rsa2048 2011-09-20 [E] ``` 在导入 Greg 和 Linus 的密钥后,我们可以使用 `--verify` 标志来验证 Tar 的完整性,操作如下: ``` gpg2 --verify linux-*.tar.sign ``` 如果验证成功,你应该会看到如下的输出信息: ``` $ gpg2 --verify linux-*.tar.sign gpg: assuming signed data in 'linux-6.5.5.tar' gpg: Signature made Saturday 23 September 2023 02:46:13 PM IST gpg: using RSA key 647F28654894E3BD457199BE38DBBDC86092693E gpg: Good signature from "Greg Kroah-Hartman <[email protected]>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 647F 2865 4894 E3BD 4571 99BE 38DB BDC8 6092 693E ``` **务必查看是否存在 `gpg: Good signature` 的提示,然后再继续!** > > ? 你可以忽略以下警告:`WARNING: This key is not certified with a trusted signature! There is no indication that the signature belongs to the owner.`。 > > > 我们已根据 Linus 和 Greg 的邮件地址获取了公开密钥,并无需对此警告感到担忧。 > > > ##### 解压 Tar 文件 如果你顺利的进行到这里,意味着你的 Tar 文件完整性检查已经成功完成。接下来,我们将从 Tar 文件中解压出 Linux 内核的源码。 ![The "TAR" xkcd comic: https://xkcd.com/1168/](/data/attachment/album/202310/04/115346wqqq7guguzg7cdgv.png) 这个步骤十分简单,只需对 Tar 文件执行 `tar -xf` 命令,如下: ``` tar -xf linux-*.tar ``` 在这里,`-x` 选项表示解压,`-f` 选项则用来告诉 Tar 文件的文件名。 这个解压过程可能需要几分钟时间,你可以先放松,耐心等待一下。 ### 配置 Linux 内核 Linux 内核的构建过程会查找 `.config` 文件。顾名思义,这是一个配置文件,用于指定 Linux 内核的所有可能的配置选项。这是必需的文件。 获取 Linux 内核的 `.config` 文件有两种方式: 1. 使用你的 Linux 发行版的配置作为基础(**推荐做法**) 2. 使用默认的,通用的配置 > > ? 也有第三种方法,也就是从零开始,手动配置每一个选项,但注意,这需要配置超过 12,000 个选项。并不推荐这种方式,因为手动配置所有选项将花费大量的时间,并且你还需要理解每个启用和禁用选项的含义。 > > > #### 使用发行版提供的配置 **使用你的 Linux 发行版提供的配置是一个安全的选择。** 如果你只是跟随这个指南测试一个不是你的发行版提供的新内核,那么这就是推荐的方式。 你的 Linux 发行版的 Linux 内核配置文件会在以下两个位置之一: * 大多数 Linux 发行版,如 Debian 和 Fedora 及其衍生版,将会把它存在 `/boot/config-$(uname -r)`。 * 一些 Linux 发行版,比如 Arch Linux 将它整合在了 Linux 内核中。所以,可以在 `/proc/config.gz` 找到。 > > ? 如果两者都有,建议使用 `/proc/config.gz`。这是因为它在只读文件系统中,所以是未被篡改的。 > > > 进入含有已经解压出的 Tar 文件的目录。 ``` cd linux-*/ ``` 接着,复制你的 Linux 发行版的配置文件: ``` ### Debian 和 Fedora 及其衍生版: $ cp /boot/config-"$(uname -r)" .config ### Arch Linux 及其衍生版: $ zcat /proc/config.gz > .config ``` ##### 更新配置文件 一旦完成这些步骤,接下来就需要“更新”配置文件了。因为你的发行版提供的配置很可能比你正在构建的 Linux 内核版本要旧。 > > ? **这同样适用于像 Arch Linux 和 Fedora 这样前沿的 Linux 发行版。** 它们并不会因为有新版本可用就立刻发布更新。他们会进行一些质量控制工作,这必然会花费些时间。因此,即便是你的发行版提供的最新内核,相较于你在 [kernel.org](http://kernel.org) 上获取的版本也会滞后几个小版本。 > > > 要更新一个已有的 `.config` 文件,我们使用 `make` 命令搭配 `olddefconfig` 参数。简单解释一下,这个命令的意思是使用 *旧的、默认的、配置*。 这将使用“旧的配置文件”(当前保存为 `.config`,这是你发行版配置的一份直接副本),并检查从上一版本以来 Linux 代码库中新加的任何配置选项。如果找到任何新的、*未配置* 的选项,该选项的默认配置值会被使用,并会对 `.config` 文件进行更新。 原来的 `.config` 文件将被重命名为 `.config.old` 进行备份,并将新的更改写入至 `.config` 文件。 ``` make olddefconfig ``` 以下是我机器上的输出: ``` $ file .config .config: Linux make config build file, ASCII text $ make olddefconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/confdata.o HOSTCC scripts/kconfig/expr.o LEX scripts/kconfig/lexer.lex.c YACC scripts/kconfig/parser.tab.[ch] HOSTCC scripts/kconfig/lexer.lex.o HOSTCC scripts/kconfig/menu.o HOSTCC scripts/kconfig/parser.tab.o HOSTCC scripts/kconfig/preprocess.o HOSTCC scripts/kconfig/symbol.o HOSTCC scripts/kconfig/util.o HOSTLD scripts/kconfig/conf .config:8593:warning: symbol value 'm' invalid for USB_FOTG210_HCD .config:8859:warning: symbol value 'm' invalid for USB_FOTG210_UDC # # configuration written to .config # ``` ##### 针对 Debian 及其衍生版用户 Debian 及其衍生版为内核模块使用一个签名证书。默认情况下,你的计算机并不包含这个证书。 我推荐关闭启用模块签名的选项。具体如下所示: ``` ./scripts/config --file .config --set-str SYSTEM_TRUSTED_KEYS '' ./scripts/config --file .config --set-str SYSTEM_REVOCATION_KEYS '' ``` **如果你不这么做,在后面你进行 Linux 内核构建时,可能会导致构建失败。要注意这点。** #### 使用自定义配置 如果你出于学习内核开发的目的学习如何构建 Linux 内核,那你应该这样做。 > > ? **请注意,偏离你的 Linux 发行版的配置可能无法在实体硬件上“正常”工作。**问题可能是特定硬件无法工作、Linux 内核无法启动等。 > > > 因此,我们只建议在虚拟机中使用。 > > > 你可以通过查看 [make help 的输出](https://www.kernel.org/doc/makehelp.txt) 来查看 *所有* 可用的选项,但我们主要关注三个 `make` 目标: * `defconfig`: 默认配置。 * `allmodconfig`: 根据当前系统状态,尽可能地把项目构建为可加载模块(而非内建)。 * `tinyconfig`: 极简的 Linux 内核。 由于 `tinyconfig` 目标只会构建少数项目,构建时间将会缩短。我个人选择它的原因主要有: 1. 检查我在代码/工具链中做的修改是否正确,以及代码是否可以编译。 2. 在虚拟机中只进行少数选项的测试。 > > ? 在为 ARM 或 RISC-V 机器构建 Linux 内核时,你可能需要 DTB(设备树的二进制文件)。**使用 `tinyconfig` 目标将不会启用构建 DTB 的选项,你的内核很可能无法启动。** > > > 当然,你可以用 QEMU 在没有任何 DTB 的情况下启动 Linux 内核。但这篇文章并不会聚焦在此。或许你可以通过评论,让我在之后的时间里覆盖这个话题 ? > > > **除非你确切地知道自己在做什么,否则你应当使用 `defconfig` 目标。** 以下是我在我的电脑上运行的效果: ``` $ make defconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/confdata.o HOSTCC scripts/kconfig/expr.o LEX scripts/kconfig/lexer.lex.c YACC scripts/kconfig/parser.tab.[ch] HOSTCC scripts/kconfig/lexer.lex.o HOSTCC scripts/kconfig/menu.o HOSTCC scripts/kconfig/parser.tab.o HOSTCC scripts/kconfig/preprocess.o HOSTCC scripts/kconfig/symbol.o HOSTCC scripts/kconfig/util.o HOSTLD scripts/kconfig/conf *** Default configuration is based on 'defconfig' # # configuration written to .config # ``` #### 修改配置 无论你是使用 Linux 发行版的配置并更新它,还是使用 `defconfig` 目标创建新的 `.config` 文件,你都可能希望熟悉如何修改这个配置文件。**最可靠的修改方式是使用 `menuconfig` 或 `nconfig` 目标。** 这两个目标的功能是相同的,只不过提供给你的界面有所不同。这是这两者间唯一的区别。我个人更偏向于使用 `menuconfig` 目标,但近来我发现 `nconfig` 在搜索选项时似乎更具直观性,所以我逐渐转向使用它。 首先,带着 `menuconfig` 目标运行 `make` 命令: ``` $ make menuconfig HOSTCC scripts/kconfig/mconf.o HOSTCC scripts/kconfig/lxdialog/checklist.o HOSTCC scripts/kconfig/lxdialog/inputbox.o HOSTCC scripts/kconfig/lxdialog/menubox.o HOSTCC scripts/kconfig/lxdialog/textbox.o HOSTCC scripts/kconfig/lxdialog/util.o HOSTCC scripts/kconfig/lxdialog/yesno.o HOSTLD scripts/kconfig/mconf ``` 在此界面,你可以根据各选项的类型来进行切换操作。 有两类可切换选项: * 布尔状态选项:这类选项只能关闭(`[ ]`)或作为内建组件开启(`[*]`)。 * 三态选项:这类选项可以关闭(`< >`)、内建(`<*>`),或作为可加载模块(`<M>`)进行构建。 想要了解更多关于某个选项的信息,使用上/下箭头键导航至该选项,然后按 `<TAB>` 键,直至底部的 `< Help >` 选项被选中,然后按回车键进行选择。此时就会显示关于该配置选项的帮助信息。 **在修改选项时请务必谨慎。** 当你满意配置后,按 `<TAB>` 键直到底部的 `< Save >` 选项被选中。然后按回车键进行选择。然后再次按回车键(**记住,此时不要更改文件名**),就能将更新后的配置保存到 `.config` 文件中。 ### 构建 Linux 内核 构建 Linux 内核实际上十分简单。然而,在开始构建之前,让我们为自定义内核构建添加一个标签。我将使用字符串 `-pratham` 作为标签,并利用 `LOCALVERSION` 变量来实施。你可以使用以下命令实现配置: ``` ./scripts/config --file .config --set-str LOCALVERSION "-pratham" ``` 这一命令将 `.config` 文件中的 `CONFIG_LOCALVERSION` 配置选项设为我在结尾指定的字符串,即 `-pratham`。当然,你也不必非得使用我所用的名字哦 ? `LOCALVERSION` 选项可用于设置一个“本地”版本,它会被附加到通常的 `x.y.z` 版本方案之后,并在你运行 `uname -r` 命令时一并显示。 由于我正在构建的是 6.5.5 版本内核,而 `LOCALVERSION` 字符串被设为 `-pratham`,因此,对我来说,最后的版本名将会是 `6.5.5-pratham`。这么做的目的是确保我所构建的自定义内核不会与发行版所提供的内核产生冲突。 接下来,我们来真正地构建内核。可以用以下的命令完成此步骤: ``` make -j$(nproc) 2>&1 | tee log ``` **这对大部分(99%)用户来说已经足够了。** 其中的 `-j` 选项用于指定并行编译任务的数量。而 `nproc` 命令用于返回可用处理单位(包括线程)的数量。因此,`-j$(nproc)` 其实意味着“使用我拥有的 CPU 线程数相同数量的并行编译任务”。 `2>&1` 会将 STDOUT 和 STDIN 重定向到相同的文件描述符,并通过管道传输给 `tee` 命令,这会将输出存储在一个名为 `log` 的文件,并且在控制台打印出完全相同的文本。如果你在构建时遇到错误,并希望回顾日志来检查出了什么问题,这将会十分有用。遇到那种情况,你只需要简单执行 `grep Error log` 命令就能找到线索。 #### 自定义 make 目标 在 Linux 内核的源文件夹中,`make` 命令有一些自定义的目标可供执行各种操作。这些主要作为开发者的参考。如果你的唯一目标是安装一个比你当前发行版更新的 Linux 内核,那么你完全可以跳过这部分内容 ? ##### 构建目标 作为一名开发者,你可能只想构建 Linux 内核,或者只想构建模块,或者只想构建设备树二进制(DTB)。在这种情况下,你可以指定一个构建目标,然后 `make` 命令只会构建指定的项目,而不会构建其他的。 以下是一些构建目标: * `vmlinux`:纯粹的 Linux 内核。 * `modules`:可加载模块。 * `dtbs`:设备树二进制文件(主要用于 ARM 和 RISC-V 架构)。 * `all`:构建所有被标记了星号 `*` 的项目(从 `make help` 的输出中可以查看)。 通常情况下,你并不需要指定构建目标,因为它们都已经在构建列表中。所列出的目标是在你只想要测试某一个构建目标,而不是其他目标时的情况。 依据你的 [计算机架构](https://itsfoss.com/arm-aarch64-x86_64/),构建完成的 Linux 内核镜像(存放在 `/boot` 目录)的名称会有所不同。 对于 `x86_64`,Linux 内核的默认镜像名称是 `bzImage`。因此,如果你只需要构建引导所需的 Linux 内核,你可以像下面这样设定 `bzImage` 为目标: ``` ### 对于 x86_64 $ make bzImage ``` “那么如何在我的架构上找到用来调用 `make` 的目标名称呢?” 有两种方法。要么你可以执行 `make help` 之后查找在 `Architecture specific targets` 下,第一个前面带有星号 `*` 的选项。 或者,如果你希望自动完成,你可以利用 `image_name` 目标得到镜像的完全路径(相对路径),选择性地添加 `-s` 标志来获得有用的输出。 以下是我拥有的三台电脑的输出,一台是 `x86_64`,另一台是 `AArch64`,还有一台是 `riscv` : ``` ### x86_64 $ make -s image_name arch/x86/boot/bzImage ### AArch64 $ make -s image_name arch/arm64/boot/Image.gz ### RISC-V $ make -s image_name arch/riscv/boot/Image.gz ``` 现在,要只构建 Linux 内核镜像,你可以这样进行: ``` make $(make -s image_name | awk -F '/' '{print $4}') ``` ##### 清理目标 如果你需要清理构建产生的文件,你可以用以下的目标来实现你的需求: * `clean`:除了 `.config` 文件外,删除几乎所有其他内容。 * `mrproper`:执行了 `make clean` 的所有操作外,还会删除 `.config` 文件。 * `distclean`:除了执行 `make mrproper` 的所有操作外,还会清理任何补丁文件。 ### 安装 一旦成功编译了 Linux 内核,接下来就是启动安装一些东西的时候了。“*一些* 东西?” 没错,我们至少构建了两种不同的东西,如果你使用的是 ARM 或 RISC-V 架构,那就有三种。我会在以下内容中详细解释。 > > ? 虽然我将告诉你不同的安装方式,尤其是关于如何改变默认安装路径的方法,但**如果你不确定自己在做什么,那么我不建议你这么做!** 请慎重考虑,如果你决定走自定义的路线,那你需要自己负责后果。默认设置之所以存在,是因为它们有其特殊的原因 ? > > > #### 安装内核模块 Linux 内核有部分在系统启动时并非必需的。这些部分被构建为可加载模块,即在需要时才进行加载和卸载。 所以,首先需要安装这些模块。这可以通过 `modules_install` 目标完成。**必须使用 `sudo`**,因为模块会被安装在 `/lib/modules/<kernel_release>-<localversion>` 这个需要 `root` 权限的路径下。 这个过程不仅会安装内核模块,还会对其进行签名,所以可能需要一些时间。好消息是你可以通过之前提到的 `-j$(nproc)` 选项来并行执行安装任务,这样会快一些。? ``` sudo make modules_install -j$(nproc) ``` > > **给开发者的提示:** 你可以通过设定 `INSTALL_MOD_PATH` 变量来指定一个不同的路径存放 Linux 模块,而不用默认的 `/lib/modules/<kernel_release>-<localversion>`,具体如下: > > > > ``` > sudo make modules_install INSTALL_MOD_PATH=<path> > > ``` > > > > **另一个给开发者的提示:** 你可以使用 `INSTALL_MOD_STRIP` 变量来决定是否需要剥离模块的调试符号。如果未设定该变量,调试符号**不会被剥离**。当设为 `1` 时,符号信息将会被使用 `--strip-debug` 选项剥离,随后该选项会传递给 `strip`(或者在使用 Clang 的时候传递给 `llvm-strip`)工具。 > > > #### (可选)安装 Linux 内核头文件 如果你打算使用这个内核来支持树外模块,比如 ZFS 或英伟达 DKMS,或者打算尝试自行编写模块,你可能会需要 Linux 内核提供的头文件。 可以通过以下方式使用 `headers_install` 目标来安装 Linux 内核头文件: ``` sudo make headers_install ``` **应使用 `sudo` 命令**,因为这些头文件会被安装到 `/usr` 目录。同时还会在 `/usr` 目录内创建子目录 `include/linux`,然后将头文件安装到 `/usr/include/linux` 内。 > > **给开发者的提示:** 通过设定 `INSTALL_HDR_PATH` 变量,你可以修改 Linux 内核头文件的安装路径。 > > > #### 安装 DTB(只针对 ARM 和 RISC-V) **如果你使用的是 x86\_64 架构,那么你可以跳过此步骤!** 如果你针对 ARM 或者 RISC-V 构建了内核,那么在运行 `make` 的过程中,设备树的二进制文件可能已经被编译出来了。你可以通过在 `arch/<machine_architecture>/boot/dts` 目录查找 `.dtb` 文件来确认这一点。 这里提供了一个快速检查的技巧: ``` ### 对于 AArch32 $ find arch/arm/boot/dts -name "*.dtb" -type f | head -n 1 > /dev/null && echo "DTBs for ARM32 were built" ### 对于 AArch64 $ find arch/arm64/boot/dts -name "*.dtb" -type f | head -n 1 > /dev/null && echo "DTBs for ARM64 were built" ### 对于 RISC-V $ find arch/riscv/boot/dts -name "*.dtb" -type f | head -n 1 > /dev/null && echo "DTBs for RISC-V were built" ``` 如果你看到出现 `DTBs for <arch> were built` 的消息,那么你可以开始安装 DTB。这可以通过 `dtbs_install` 目标来实现。 **需要使用 `sudo`**,因为它们会被安装在 `/boot/dtb-<kernel_release>-<localversion>` 中,而这个目录是由 `root` 所拥有的。 ``` sudo make dtbs_install ``` > > **给开发者的提示:** 就像安装模块一样,你可以使用 `INSTALL_DTBS_PATH` 变量指定一个自定义的路径来安装设备树二进制文件。 > > > #### 安装 Linux 内核 最后,我们来安装 Linux 内核本身!这可以通过 `install` 目标来完成,就像这样: ``` sudo make install ``` **在这里必须使用 `sudo`**,因为 Linux 内核将被安装在 `/boot` 目录,而这个目录不允许普通用户写入。 > > ? 一般来讲,`install` 目标也会更新引导加载程序,但是如果它没有成功,那可能是不支持你使用的引导加载程序。如果你没有使用 GRUB 作为你的引导加载程序,请一定要阅读你引导加载程序的使用手册 ? > > > > > **给开发者的提示:** 并不奇怪,`INSTALL_PATH` 变量被用来设定 Linux 内核的安装位置,而非默认的 `/boot` 目录。 > > > #### 针对 Arch Linux 用户的说明 如果你尝试执行了 `make install` 命令,可能已经注意到产生了错误。错误如下: ``` $ sudo make install INSTALL /boot Cannot find LILO. ``` 要在 Arch Linux 上实际完成 Linux 内核的安装,我们需要手动复制 Linux 内核镜像文件。别担心,如果你使用的是 Arch Linux,手动操作应该是家常便饭了。( ͡° ͜ʖ ͡°) 可以使用以下命令完成这个步骤: ``` sudo install -Dm644 "$(make -s image_name)" /boot/vmlinuz-<kernel_release>-<localversion> ``` 因为我编译的是 6.5.5 版本的内核,所以我将会执行下面这条命令,你可以根据你的实际情况进行适当调整: ``` sudo install -Dm644 "$(make -s image_name)" /boot/vmlinuz-6.5.5-pratham ``` 虽然不是必须的,但最好复制一份名为 `System.map` 的文件。既然你已经在操作了,一并也复制了 `.config` 文件吧 ? ``` sudo cp -vf System.map /boot/System.map-<kernel_release>-<localversion> sudo cp -vf .config /boot/config-<kernel_release>-<localversion> ``` ##### 生成初始 RAM 磁盘 当你安装 Arch Linux 时,可能已经了解过 `mkinitcpio` 这个工具。现在,我们将使用它来创建初始的 RAM 磁盘。 首先,我们需要创建一个预设文件。向 `/etc/mkinitcpio.d/linux-<localversion>.preset` 文件中添加以下内容,根据实际需要来替换 `<kernel_release>` 和 `<localversion>`。 ``` ALL_config="/etc/mkinitcpio.conf" ALL_kver="/boot/vmlinuz-<kernel_release>-<localversion>" PRESETS=('default' 'fallback') default_image="/boot/initramfs-<kernel_release>-<localversion>.img" fallback_options="-S autodetect" ``` 配置完成后,执行下面的命令来生成初始 RAM 磁盘: ``` sudo mkinitcpio -p linux-<localversion> ``` 我自己的电脑上得到的输出如下,你的结果应该会类似! ``` $ sudo mkinitcpio -p linux-pratham ==> Building image from preset: /etc/mkinitcpio.d/linux-pratham.preset: 'default' ==> Using configuration file: '/etc/mkinitcpio.conf' -> -k /boot/vmlinuz-6.5.5-pratham -c /etc/mkinitcpio.conf -g /boot/initramfs-6.5.5-pratham.img ==> Starting build: '6.5.5-pratham' -> Running build hook: [base] -> Running build hook: [udev] -> Running build hook: [autodetect] -> Running build hook: [modconf] -> Running build hook: [kms] -> Running build hook: [keyboard] ==> WARNING: Possibly missing firmware for module: 'xhci_pci' -> Running build hook: [keymap] -> Running build hook: [consolefont] ==> WARNING: consolefont: no font found in configuration -> Running build hook: [block] -> Running build hook: [filesystems] -> Running build hook: [fsck] ==> Generating module dependencies ==> Creating zstd-compressed initcpio image: '/boot/initramfs-6.5.5-pratham.img' ==> Image generation successful ==> Building image from preset: /etc/mkinitcpio.d/linux-pratham.preset: 'fallback' ==> Using configuration file: '/etc/mkinitcpio.conf' ==> WARNING: No image or UKI specified. Skipping image 'fallback' ``` 初始 RAM 磁盘已成功生成,现在我们可以进入下一步,更新引导加载器! ##### 更新 GRUB 一旦所有必要的文件已成功复制到其对应的位置,接下来,我们将进行 GRUB 的更新。 使用以下命令对 GRUB 引导加载器进行更新: ``` sudo grub-mkconfig -o /boot/grub/grub.cfg ``` > > ? 如果你使用的引导加载器不是 GRUB,请参看 Arch Wiki 中相关的引导加载器文档。 > > > **注意,更新 GRUB 并不会直接使新的内核版本设为默认启动选项。在引导时,请在启动菜单中手动选择新的内核版本。** 你可以通过选择 `Advanced options for Arch Linux` 菜单,并在随后的菜单中选择 `Arch Linux, with Linux <kernel_release>-<localversion>` 来启用新版的 Linux 内核。 ### 重启电脑 恭喜你!你已经完成了获取 Linux 内核源代码、进行配置、构建以及安装等所有步骤。现在只需要通过重启电脑并进入新构建和安装的 Linux 内核,就可以开始享受你的努力成果了。 启动时,请确保从引导加载器中选择正确的 Linux 内核版本。系统启动后,运行 `uname -r` 命令来确认你正在使用预期的 Linux 内核。 以下是我自己的电脑输出的内容: ``` $ uname -r 6.5.5-pratham ``` **是时候开始庆祝了!** ? ### 卸载操作 > > ? 提示:在删除当前正在使用的内核版本之前,你应该首先切换至较旧的内核版本。 > > > 可能你的 Linux 发行版所使用的 Linux 内核版本就是你手动编译的版本,或者你自行编译了新的内核并注意到应卸载旧的内核以节省空间,于是你开始想如何才能卸载。当然,虽然我们无法简单地运行 `make uninstall` 命令,但这并不代表没有其他的方法! 我们清楚各个文件的安装位置,因此删除它们相对简单。 ``` ### 删除内核模块 $ rm -rf /lib/modules/<kernel_release>-<localversion> ### 删除设备树二进制文件 $ rm -rf /boot/dtb-<kernel_release>-<localversion> ### 删除 Linux 内核本身 $ rm -vf /boot/{config,System,vmlinuz}-<kernel_release>-<localversion> ``` ### 总结 这个过程不是一次简单的旅程,是吧?但是现在,我们终于抵达了终点。我们一起学习了手动编译 Linux 内核的全过程,包括安装依赖、获取和验证源码、解压源码、配置 Linux 内核、构建内核以及安装内核。 如果你喜欢这个详细的步骤指南,请给我留言反馈。如果在操作过程中遇到问题,也欢迎提出,让我知道! *(题图:MJ/853481c5-87e3-42aa-8ace-e9ddfa232f75)* --- via: <https://itsfoss.com/compile-linux-kernel/> 作者:[Pratham Patel](https://itsfoss.com/author/pratham/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) You may be interested in compiling the Linux kernel yourself, for many reasons. It might be, but not limited to, one of the following: - Trying out a newer kernel than what your Linux distribution provides - Building the kernel with a different set of configuration options and/or drivers - A learner's curiosity :) This guide will show you how you can compile the Linux kernel yourself, with the commands that you should run, why run these commands and explain what it does. This is a long one, so brace yourself! [Ubuntu have easier ways of installing mainline Linux kernel](https://itsfoss.com/upgrade-linux-kernel-ubuntu/). But this tutorial is about doing things manually from the source code. **. This is more about experiencing things first hand. However, I advise trying this adventure in a VM or on your spare system instead of doing it on your main system.** **You'll need time, patience and good experience with the Linux command line for this tutorial**## Pre-requisites There are two prerequisites to building anything (in context to software). - Source code - Build dependencies So, as the prerequisites, we will be downloading the Linux kernel's source as a tarball and install a few dependencies that will allow us to build the Linux kernel. ### Primer on Linux versions At a given moment, there are 4 "versions" of the [ Freax](https://en.wikipedia.org/wiki/History_of_Linux#Naming) Linux kernel. These "versions" of Linux, in the order of the development flow are: **The**Any code to be merged in the Linux codebase is first merged in the`linux-next` tree:`linux-next` tree. This is the newest but also the "least stable" state of the Linux kernel. Most Linux kernel developers and testers use this to refine the code quality for Linus to pull from, later on.**Tread carefully!****RC/Mainline releases:**Linus pulls from the`linux-next` tree and creates an initial release. The beta version of this release is called an RC release (Release Candidate). Once an RC is released, Linus accepts only bug-fixes and performance regression related patches. Linus keeps releasing an RC kernel every week until he is satisfied with the code (with feedback from users). The`-rc` suffix, followed by a number, is added to indicate the RC release version.**Stable releases:**Once Linus feels that the last RC was stable, he releases the final, "public" release. A stable release is maintained for a few more weeks. This is what bleeding edge Linux distributions like Arch Linux and Fedora Linux use.**I recommend you try this first before**`linux-next` or any RC releases.**LTS releases:**The last stable release of a given year is maintained for[a few more years](https://news.itsfoss.com/linux-kernel-support/). This is usually an older release but it is**actively maintained with security fixes**. A stable release of Debian uses the LTS release of the Linux kernel. You can read more about this in the [official documentation](https://www.kernel.org/category/releases.html). For the purposes of this article, I will be using the latest stable release that is available. Which, at the time of writing this is at [ v6.5.5](https://lwn.net/Articles/945378/). ## Getting the system ready Since the Linux kernel is written in the C programming language, you need at least a C compiler to compile the Linux kernel. There are other such dependencies that might or might not be present on your computer. Time to install those. *in a future article (diving into Rust support), I will cover using LLVM's Clang compiler as an alternative to GCC.* **maybe**And no, MSVC does not count. That said, I do expect a Microsoft employee sending in a patchset for this. What have I done? Install command for users of Arch Linux and its derivatives: `sudo pacman -S base-devel bc coreutils cpio gettext initramfs kmod libelf ncurses pahole perl python rsync tar xz` Install command for users of Debian and its derivatives: `sudo apt install bc binutils bison dwarves flex gcc git gnupg2 gzip libelf-dev libncurses5-dev libssl-dev make openssl pahole perl-base rsync tar xz-utils` Install command for Fedora and its derivatives: ``` sudo dnf install binutils ncurses-devel \ /usr/include/{libelf.h,openssl/pkcs7.h} \ /usr/bin/{bc,bison,flex,gcc,git,gpg2,gzip,make,openssl,pahole,perl,rsync,tar,xz,zstd} ``` ### Fetching the Linux kernel's source Head over to [kernel.org](https://kernel.org/) and on the page, find the first Stable release. You can't miss it since it is the biggest yellow box ;) ![Screenshot of kernel.org showing the list of available kernels](https://itsfoss.com/content/images/2023/09/Screenshot-2023-09-24-at-2.21.00-PM.png) You can download the tarball by clicking on the big yellow box. While you are at it, download the matching PGP signature file too. It will be handy when we verify the tarball at a later point in time. It has the extension `.tar.sign` . #### Verifying the tarball's authenticity How do you know if the tarball you just downloaded is corrupted or not? On an individual level, a corrupted tarball will just waste your precious tinkering hours, but if this is done for an organization, you might be making things easier for an attacker (at which point you have bigger issues to worry about, but let's not give PTSD to everyone!). To verify the integrity of our tarball, we need the tarball. At the moment, it is compressed using the XZ compression algorithm. Hence, I will use the `unxz` utility (merely an alias to `xz --decompress` ) to decompress the `.tar.xz` archive file. `unxz --keep linux-*.tar.xz` Once extracted, we will fetch the public GPG keys that Linus Torvalds and Greg KH use. These keys are used to sign the tarball. `gpg2 --locate-keys `[[email protected]](/cdn-cgi/l/email-protection) [[email protected]](/cdn-cgi/l/email-protection) You should get output that is similar to what I got on my machine: `$ gpg2 --locate-keys `[[email protected]](/cdn-cgi/l/email-protection) [[email protected]](/cdn-cgi/l/email-protection) gpg: /home/pratham/.gnupg/trustdb.gpg: trustdb created gpg: key 38DBBDC86092693E: public key "Greg Kroah-Hartman <[[email protected]](/cdn-cgi/l/email-protection)>" imported gpg: Total number processed: 1 gpg: imported: 1 gpg: key 79BE3E4300411886: public key "Linus Torvalds <[[email protected]](/cdn-cgi/l/email-protection)>" imported gpg: Total number processed: 1 gpg: imported: 1 pub rsa4096 2011-09-23 [SC] 647F28654894E3BD457199BE38DBBDC86092693E uid [ unknown] Greg Kroah-Hartman <[[email protected]](/cdn-cgi/l/email-protection)> sub rsa4096 2011-09-23 [E] pub rsa2048 2011-09-20 [SC] ABAF11C65A2970B130ABE3C479BE3E4300411886 uid [ unknown] Linus Torvalds <[[email protected]](/cdn-cgi/l/email-protection)> sub rsa2048 2011-09-20 [E] Once Greg's and Linus' keys are imported, the integrity of the tarball can be verified using the `--verify` flag; like so: `gpg2 --verify linux-*.tar.sign` If the verification was successful, you should get output similar to following: ``` $ gpg2 --verify linux-*.tar.sign gpg: assuming signed data in 'linux-6.5.5.tar' gpg: Signature made Saturday 23 September 2023 02:46:13 PM IST gpg: using RSA key 647F28654894E3BD457199BE38DBBDC86092693E gpg: Good signature from "Greg Kroah-Hartman < ```[[email protected]](/cdn-cgi/l/email-protection)>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 647F 2865 4894 E3BD 4571 99BE 38DB BDC8 6092 693E **Please do not proceed unless you see a message that says gpg: Good signature!** *WARNING: This key is not certified with a trusted signature! There is no indication that the signature belongs to the owner.*We fetched the keys from Linus' and Greg's emails and have no need to worry about this warning. #### Extracting the tarball If you are here, it means that your tarball's integrity check completed successfully. Now then, it is time to extract the Linux kernel's source out of it. ![The "TAR" xkcd comic: https://xkcd.com/1168/](https://itsfoss.com/content/images/2023/09/tar_2x.png) [https://xkcd.com/1168/](https://xkcd.com/1168/) This one is quite easy, just do a `tar -xf` on the tarball, like so: `tar -xf linux-*.tar` The `-x` option is used to specify extraction, and `tar` is informed about the tarball filename using the `-f` option. The extraction will take a few minutes, adjust and sit straight :) ## Configuring the Linux kernel The Linux kernel's build process looks for a `.config` file. As the name suggests, it is a configuration file that specifies every possible configuration option for the Linux kernel. It is necessary to have one. There are two methods of getting this `.config` file for the Linux kernel: - Using your Linux distribution's configuration as a base ( **recommended**) - Using a default, generic configuration ### Using the distribution-provided configuration **Using the configuration provided by your Linux distribution is a safe bet.** If you are following this guide just to try out a new kernel than what your distribution offers, this is the recommended method. Your Linux distribution's configuration file for the Linux kernel will be in either of the two places: - Most Linux distributions like Debian and Fedora, and their derivatives will store it as `/boot/config-$(uname -r)` . - Some Linux distributions like Arch Linux have it integrated in the Linux kernel itself. Therefore, it will be available at `/proc/config.gz` . **as it is on a read-only filesystem and hence untampered.** **/proc/config.gz**Enter the directory which contains the extracted tarball. `cd linux-*/` Then, copy your Linux distribution's configuration file: ``` ## Debian and Fedora's derivatives: $ cp /boot/config-"$(uname -r)" .config ## Arch Linux and its derivatives: $ zcat /proc/config.gz > .config ``` #### Updating the configuration Once that is done, it is time to "update" the configuration file. You see, there is a high probability that the configuration that your distribution provides is older than the Linux kernel that you are building. **Neither of them release an update just because there is a new version available. They do some QA, which is bound to take time. And hence, even the latest kernel offered by your distribution will be a few minor releases behind, compared to what you will get from kernel.org.** **This applies to bleeding edge Linux distributions like Arch Linux and Fedora too.**To update an existing `.config` file, the `make` command is used with the target `olddefconfig` . Broken down, this is * old default configuration*. This will take the "old configuration file" (which is currently saved as `.config` as a literal copy of your distribution's configuration) and check for any new configuration options that were added to the Linux codebase since. If any new, *unconfigured* options are found, the default configuration value for that option is used and the `.config` file is updated. The original `.config` file is renamed to `.config.old` as the backup and new changes are written to `.config` . `make olddefconfig` Following is the output from my machine: ``` $ file .config .config: Linux make config build file, ASCII text $ make olddefconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/confdata.o HOSTCC scripts/kconfig/expr.o LEX scripts/kconfig/lexer.lex.c YACC scripts/kconfig/parser.tab.[ch] HOSTCC scripts/kconfig/lexer.lex.o HOSTCC scripts/kconfig/menu.o HOSTCC scripts/kconfig/parser.tab.o HOSTCC scripts/kconfig/preprocess.o HOSTCC scripts/kconfig/symbol.o HOSTCC scripts/kconfig/util.o HOSTLD scripts/kconfig/conf .config:8593:warning: symbol value 'm' invalid for USB_FOTG210_HCD .config:8859:warning: symbol value 'm' invalid for USB_FOTG210_UDC # # configuration written to .config # ``` #### For users of Debian and its derivatives Debian and its derivatives use a certificate to sign the kernel modules. This certificate, by default, is absent on your computer. I recommend disabling the option that enables module signing. It can be achieved with the following commands: `./scripts/config --file .config --disable MODULE_SIG` **Failing to do this will result in a build failure later on, when you build the Linux kernel. You have been warned.** ### Using a custom configuration If you are learning about building the Linux kernel for the purposes of learning kernel development, this is the way to follow. **There are no guarantees that deviating away from your Linux distribution's configuration will work "normally" on your** **physical hardware****The issue may range from a particular piece of hardware not working, to the Linux kernel not booting at all.** **.**Therefore, it is recommended only for use inside a VM. You can take a look at the [output of make help](https://www.kernel.org/doc/makehelp.txt) to see *all*the available options, but we will focus on three `make` targets:`defconfig` : The default configuration.`allmodconfig` : Based on the current system state, build items as loadable modules (instead of built-in) when possible.`tinyconfig` : A tiny Linux kernel. Since the `tinyconfig` target will only build a few items, the build times are naturally faster. I personally use it for the following reasons: - Checking if any changes I made in the code/toolchain is correct and that the code compiles. - Testing only a few select features inside a VM. **The** **tinyconfig** **target will not enable the option to build DTBs and your kernel will most likely fail from starting.**Though, you can use QEMU to boot the Linux kernel without any DTB. But this article will not focus on that. Maybe you should comment and let me know to cover it sometime later ;) **You should use the defconfig target unless you know exactly what you're doing.** Following is how it looks on my computer: ``` $ make defconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/confdata.o HOSTCC scripts/kconfig/expr.o LEX scripts/kconfig/lexer.lex.c YACC scripts/kconfig/parser.tab.[ch] HOSTCC scripts/kconfig/lexer.lex.o HOSTCC scripts/kconfig/menu.o HOSTCC scripts/kconfig/parser.tab.o HOSTCC scripts/kconfig/preprocess.o HOSTCC scripts/kconfig/symbol.o HOSTCC scripts/kconfig/util.o HOSTLD scripts/kconfig/conf *** Default configuration is based on 'defconfig' # # configuration written to .config # ``` ### Modifying the configuration You created a `.config` file using some method. Either you used the one that your Linux distribution used and updated it, or you created one using the `defconfig` target. Either way, you are looking for how to modify it. **The most reliable way to do this is via the menuconfig or nconfig target.** Both targets do the same thing but have a different interface for you. That's the only difference between them. I prefer to use the `menuconfig` target but lately I've been leaning towards `nconfig` since it is a bit more intuitive in searching for options. Start with running the `make` command with the `menuconfig` target: ``` $ make menuconfig HOSTCC scripts/kconfig/mconf.o HOSTCC scripts/kconfig/lxdialog/checklist.o HOSTCC scripts/kconfig/lxdialog/inputbox.o HOSTCC scripts/kconfig/lxdialog/menubox.o HOSTCC scripts/kconfig/lxdialog/textbox.o HOSTCC scripts/kconfig/lxdialog/util.o HOSTCC scripts/kconfig/lxdialog/yesno.o HOSTLD scripts/kconfig/mconf ``` Now, in there, modify the configuration options to toogle them based on their type. There are two types of toggleable options: - Boolean-state options: Options that can only be turned off ( `[ ]` ) or on, as built-in (`[*]` ). - Tri-state options: Options that can be off ( `< >` ), or built-in (`<*>` ), or built as loadable-module (`<M>` ). To know more information about an option, navigate to it using the up/down arrow keys and then press the `<TAB>` key until the `< Help >` option at the bottom is selected. And then, press the `<Enter>` key to select it. A help menu about that configuration option item will be displayed. **Please be careful when you modify an option.** Once you have configured it to your heart's content, press the `<TAB>` key until the `< Save >` option at the bottom is selected. Then, press the `<Enter>` key to select it. Press the `<Enter>` key again (**without changing the filename**) to save the updated configuration to the `.config` file. ## Building the Linux kernel Building the Linux kernel is simple. But before we do that, let's tag our custom kernel build. I will use the string `-pratham` as the tag and make use of the `LOCALVERSION` variable to do that. This can be configured using the following command: `./scripts/config --file .config --set-str LOCALVERSION "-pratham"` What this does is, set the `CONFIG_LOCALVERSION` configuration option in the `.config` file to the string I specify at the end, which, in my case is `-pratham` . Don't feel pressured to use my name ;) The `LOCALVERSION` option is used to set a "local" version which gets appended to the usual, *x.y.z* versioning scheme and reported when you run the `uname -r` command. Since I am building the kernel 6.5.5 with the `LOCALVERSION` string set to `-pratham` , for me, it will be `6.5.5-pratham` . This is done to make sure that the custom kernel that I have built does not conflict with the distribution provided kernel. Now, let's build the kernel itself. Following is the command to do so: `make -j$(nproc) 2>&1 | tee log` **This is sufficient for 99% of the users.** The `-j` option is used to specify how many parallel compilation jobs should be created. And the `nproc` command returns a number for the amount of processing units that are available (this includes threads). So `-j$(nproc)` means "use as many parallel compilation jobs as many CPU threads I have". The `2>&1` will redirect STDOUT and STDIN to the same file descriptor and that gets piped to the `tee` command, which will store the output a file called `log` and also print the same text to the console. This is in case you face a build error and want to take a look back at the log to check what went wrong. In that case you can simply do a `grep Error log` . ### Custom 'make' targets There are a few custom targets that you can use with the `make` command to perform various operations in the Linux kernel's source directory. These are as a reference to developers. If your sole intention is to install a newer Linux kernel than what your distribution offers, you can skip this part ;) #### Build targets As a developer, there will be times when you want to build only the Linux kernel, or, only the modules, or only the DTBs. In that case, you can specify a build target and `make` will build only the one(s) specified, and nothing else. The build targets are as following: `vmlinux` : The bare Linux kernel.`modules` : The loadable modules.`dtbs` : Device-tree binaries (mostly for for ARM and RISC-V architectures).`all` : Build everything [that is marked with an asterisk`*` (from the output of`make help` )]. Generally speaking, you do not need to specify either build target since they should automatically be build. These are for times when you want to test something only in one build target, and not in others. Depending on your [computer's architecture](https://itsfoss.com/arm-aarch64-x86_64/), the name of the Linux kernel image that gets built (which is stored in `/boot` ) will vary. For `x86_64` , the Linux kernel's [default] image name is `bzImage` . So, if you only want to build the Linux kernel for the purposes of booting it, you can specify `bzImage` as a target, like so: ``` ## For x86_64 $ make bzImage ``` "And how do I find the target's name to call `make` with, on my architecture?" There are two methods. Either, you can do a `make help` and look for the first option under "Architecture specific targets" that has an asterisk `*` before it. Or, if you want to automate it, you can get the full (relative) path of the image using the `image_name` target. Optionally, add the `-s` flag to keep the output useful. Following is the output from three computers I own, one `x86_64` , another `AArch64` and third one being `riscv` : ``` ## x86_64 $ make -s image_name arch/x86/boot/bzImage ## AArch64 $ make -s image_name arch/arm64/boot/Image.gz ## RISC-V $ make -s image_name arch/riscv/boot/Image.gz ``` And now, to build just the Linux kernel image, you can do this: `make $(make -s image_name | awk -F '/' '{print $4}')` #### Targets for clean-up In case you want to clean build artifacts up, you can use either of the following targets to achieve what you want: `clean` : Remove almost everything except for the`.config` file.`mrproper` : Everything that`make clean` does, but also delete the`.config` file.`distclean` : Everything that`make mrproper` does but also remove any patch files. ## Installation Once the Linux kernel has been compiled, it is time to install a few things. "A few *things*?" Yes. We build at least 2 different things, 3 if you are on ARM or RISC-V. I will explain as we proceed. **Please understand that if you go a custom route, you are on your own. These defaults exist for a reason ;)** **it is not recommended to do it unless you know what you are doing!**### Install the kernel modules There are parts of the Linux kernel that are not necessary during booting. These parts are built as loadable modules (i.e. loaded and unloaded when necessary). So, let's install these modules. This can be achieved with the `modules_install` target. **The use of sudo is necessary** since the modules will be installed in `/lib/modules/<kernel_release>-<localversion>` and that directory is owned by `root` , not your user.This will not only install the kernel modules, but also sign them. So it will take some time. The good news is that you can parallelize this using the previously discussed `-j$(nproc)` option ;) `sudo make modules_install -j$(nproc)` **Note for developers:** You can specify a different path where the Linux modules are stored (instead of `/lib/modules/<kernel_release>-<localversion>` ) using the `INSTALL_MOD_PATH` variable like so: `sudo make modules_install INSTALL_MOD_PATH=<path>` **Another note for developers:** You can use the `INSTALL_MOD_STRIP` variable to specify if the modules should be stripped of debug symbols or not. The debug symbols are **not stripped if it is undefined**. When set to `1` , they are stripped using the `--strip-debug` option, which is then passed to the `strip` (or `llvm-strip` if Clang is used) utility. ### [Optional] Installing the Linux kernel Header files If you intend to use this kernel with out-of-tree modules, like ZFS or Nvidia DKMS, or try writing your own modules, you will most likely need the header files provided by the Linux kernel. The Linux kernel headers can be installed using the `headers_install` target, like so: `sudo make headers_install` **The use of sudo is necessary** because the headers are installed in the `/usr` directory. The child directories `include/linux` are also created inside `/usr` and the headers are installed inside `/usr/include/linux` .**Note for developers:** The path for installing Linux kernel headers can be overridden by using the `INSTALL_HDR_PATH` variable. ### Installing DTBs (only for ARM and RISC-V) **If you are on x86_64, you can skip this step!** If you built for ARM or RISC-V, it is very likely that running `make` also built the device-tree binaries. You can check that by checking for `.dtb` files in `arch/<machine_architecture>/boot/dts` . I have a hack to check this: ``` ## For AArch32 $ find arch/arm/boot/dts -name "*.dtb" -type f | head -n 1 > /dev/null && echo "DTBs for ARM32 were built" ## For AArch64 $ find arch/arm64/boot/dts -name "*.dtb" -type f | head -n 1 > /dev/null && echo "DTBs for ARM64 were built" ## For RISC-V $ find arch/riscv/boot/dts -name "*.dtb" -type f | head -n 1 > /dev/null && echo "DTBs for RISC-V were built" ``` If you get a message saying "DTBs for <arch> were built", proceed with installing DTBs. That is done with the `dtbs_install` target. **The use of sudo is necessary** since this will be installed in `/boot/dtb-<kernel_release>-<localversion>` which is owned by `root` .`sudo make dtbs_install` **Note for developers:** Just like installing modules, you can specify a custom path for where the device-tree binaries are installed using the `INSTALL_DTBS_PATH` variable. ### Install the Linux kernel Finally, we are installing the Linux kernel itself! This is done with the `install` target, like so: `sudo make install` **The use of sudo is necessary** here because the Linux kernel gets installed in `/boot` which your normal user does not have permission to write in.**target will also update the bootloader, but if it fails, it means you probably have an unsupported bootloader. If you are not using GRUB as your bootloader, please read the manual of your bootloader ;)** **install****Note for developers:** Not surprising this time; The `INSTALL_PATH` variable is used to specify where the Linux kernel is installed, instead of the default path which is in `/boot` . ### For Arch Linux users If you tried running the `make install` command, you might have noticed that you got an error. Like following: ``` $ sudo make install INSTALL /boot Cannot find LILO. ``` To actually install the Linux kernel on Arch Linux, we need to copy the Linux kernel image manually. Don't worry, if you are using Arch Linux, you're probably used to doing things manually anyways. ( ͡° ͜ʖ ͡°) This can be done with the following command: `sudo install -Dm644 "$(make -s image_name)" /boot/vmlinuz-<kernel_release>-<localversion>` Since I compiled the 6.5.5 kernel, I will run the following command, adjust it as per your needs: `sudo install -Dm644 "$(make -s image_name)" /boot/vmlinuz-6.5.5-pratham` It is not necessary, but you should also copy a file called `System.map` , and while you are at it, copy the `.config` file too ;) ``` sudo cp -vf System.map /boot/System.map-<kernel_release>-<localversion> sudo cp -vf .config /boot/config-<kernel_release>-<localversion> ``` #### Generate the initial ramdisk You might have come across a utility called `mkinitcpio` when you installed Arch Linux. We are going to use it to create the initial ramdisk. To do that, we need a preset first. Do so by adding the following contents to the `/etc/mkinitcpio.d/linux-<localversion>.preset` file. Substitute `<kernel_release>` and `<localversion>` as necessary. ``` ALL_config="/etc/mkinitcpio.conf" ALL_kver="/boot/vmlinuz-<kernel_release>-<localversion>" PRESETS=('default' 'fallback') default_image="/boot/initramfs-<kernel_release>-<localversion>.img" fallback_options="-S autodetect" ``` Once you do that, run the following command to generate the initial ramdisk: `sudo mkinitcpio -p linux-<localversion>` Following is the output from my computer, yours should be similar too! ``` $ sudo mkinitcpio -p linux-pratham ==> Building image from preset: /etc/mkinitcpio.d/linux-pratham.preset: 'default' ==> Using configuration file: '/etc/mkinitcpio.conf' -> -k /boot/vmlinuz-6.5.5-pratham -c /etc/mkinitcpio.conf -g /boot/initramfs-6.5.5-pratham.img ==> Starting build: '6.5.5-pratham' -> Running build hook: [base] -> Running build hook: [udev] -> Running build hook: [autodetect] -> Running build hook: [modconf] -> Running build hook: [kms] -> Running build hook: [keyboard] ==> WARNING: Possibly missing firmware for module: 'xhci_pci' -> Running build hook: [keymap] -> Running build hook: [consolefont] ==> WARNING: consolefont: no font found in configuration -> Running build hook: [block] -> Running build hook: [filesystems] -> Running build hook: [fsck] ==> Generating module dependencies ==> Creating zstd-compressed initcpio image: '/boot/initramfs-6.5.5-pratham.img' ==> Image generation successful ==> Building image from preset: /etc/mkinitcpio.d/linux-pratham.preset: 'fallback' ==> Using configuration file: '/etc/mkinitcpio.conf' ==> WARNING: No image or UKI specified. Skipping image 'fallback' ``` The initial ramdisk has been generated. It is now time to move onto updating the bootloader! #### Update GRUB Once all the necessary files are in their usual destination, it is now time to update GRUB. Update the GRUB bootloader using the following command: `sudo grub-mkconfig -o /boot/grub/grub.cfg` **Updating GRUB won't make the newer kernel the default. Please select it from the boot menu during boot.** You can select the newer version of the Linux kernel by going into the 'Advanced options for Arch Linux' menu item, and then select the menu item that says 'Arch Linux, with Linux <kernel_release>-<localversion>'. ## Reboot Congratulations! You have completed all the steps to getting the Linux kernel's source, configuring it, building it and installing it. It is time to reap the benefits of your hard work by rebooting and booting into the newly built+installed Linux kernel. Please be sure to select the correct Linux kernel version from the bootloader. Once booted, run the `uname -r` command to verify that you booted using the intended Linux kernel. Below is the output from my computer: ``` $ uname -r 6.5.5-pratham ``` **Party time! **🎉 ## Uninstallation Either your Linux distribution shipped the Linux kernel with the version that you compiled manually, or you compiled another, newer kernel yourself and noticed that you should uninstall the older kernel to make space for the newer one(s). And now, you are wondering how you can undo that. Well, there is no `make uninstall` that you can run, but that doesn't mean that all hope is lost! We know where all the files are installed, so that makes it easier to remove it. ``` ## Remove kernel modules $ rm -rf /lib/modules/<kernel_release>-<localversion> ## Remove device-tree binaries $ rm -rf /boot/dtb-<kernel_release>-<localversion> ## Remove the Linux kernel itself $ rm -vf /boot/{config,System,vmlinuz}-<kernel_release>-<localversion> ``` ## Conclusion Quite an adventure, ain't it? But finally, it is concluded. We have looked at the entire process of what it takes to manually compile the Linux kernel. It involved installing the dependencies, fetching the source, verifying it, extracting it, configuring the Linux kernel, building the Linux kernel and then installing it. If you liked this detailed step-by-step guide, please comment and let me know. If you faced any issues, comment and let me know!
16,254
备受欢迎的数字音频工作站 Studio One 新增了对 Linux 的支持
https://news.itsfoss.com/studio-one-linux/
2023-10-04T18:25:13
[ "DAW" ]
https://linux.cn/article-16254-1.html
![](/data/attachment/album/202310/04/182440b2evk5fiqfzv5k4v.jpg) > > 音乐制作人们,这是你们翘首以待的消息。 > > > [数字音频工作站(DAW)](https://en.wikipedia.org/wiki/Digital_audio_workstation) 已经成为音乐制作专业人士重要工具之一。 遗憾的是,对于 Linux 用户而言,选择十分有限。最受欢迎的选择通常是开源 DAW,如 [Ardour](https://news.itsfoss.com/ardour-7-3-release/)、[Audacity](https://news.itsfoss.com/audacity-3-2-release/) 和闭源的 [Bitwig](https://www.bitwig.com/)。 当然,这些工具都有一定的优点。然而像 **Cubase、Nuendo 和 Pro Tools** 这类在音乐产业内广泛使用的热门 DAW 却没有 Linux 版 ? 随着 [Studio One](https://www.presonus.com/en/studio-one.html) 的出现,这个局面正在发生变化 ? [Studio One](https://www.presonus.com/en/studio-one.html) 是专业音响设备制造商 [PreSonus](https://www.presonus.com/en/start) 所推出的一款广受欢迎的 DAW,它**自 2009 年推出以来一直受到许多专业人士的青睐**,被视为 Steinberg Cubase、 Avid Pro Tools、 Apple GarageBand 等软件的有效替代品。 > > ? 需要指出的是,Studio One 并不是 FOSS(自由与开源软件),我们在这里谈论的是其新增的 Linux 支持。 > > > ### Studio One:登陆 Linux! ? ![](/data/attachment/album/202310/04/182513tr7k7ybntnhknpq8.png) 最初作为公开的测试版本发布的是 **[Studio One 6.5](https://blog.presonus.com/2023/09/29/you-can-do-immersive-audio-right-now/),这是首个为 Linux 用户提供的版本。** 官方明确说明了该软件的系统需求为 **Ubuntu 23.04**,并且需要使用 **Wayland 会话**。 作为 DAW,它拥有大量高级特性,用于创作、录制和混音。其中一些关键特性包括: * 多轨工具 * 内置节拍制造器 * 支持 <ruby> 草稿本 <rt> Scratch pad </rt></ruby> * 为音频和 MIDI 提供和声编辑 无论你有没有 PreSonus 音频设备,这个消息都是兴奋的。 想必这会对其他商业上成功的 DAW 考虑 Linux 成为新的平台产生影响 ? 这对于 Linux 的桌面应用肯定会有巨大的推动作用,有望提升 [当前的市场份额](https://itsfoss.com/linux-market-share/) ? 更重要的是,Studio One 支持在所有三个平台上无缝地创作音乐,这也是它的另一大优势。你可以使用自己最喜欢的 DAW 创作音乐,而不需要被依赖于某个特定的平台。这听起来很不错,*对吗?* **需要注意的是**:PreSonus 当前并未提供任何官方的 Linux 方面的支持。而未来的稳定版本可能会改变这个局面。 尽管如此,公司推荐用户在他们的用户论坛的 [Linux 版块](https://forums.presonus.com/viewforum.php?f=419) 中讨论与 Linux 相关的问题,以获得解答和分享社区反馈。 > > ? 请注意,这是一个测试版,**还不应该在实际生产中使用**。开发者已在 Studio One 的 [Linux 支持页面](https://support.presonus.com/hc/en-us/articles/19214558269581-Linux-Getting-Started) 上列出了一些已知的问题。一些功能,如 CD 刻录、视频支持、DDP 导入/导出等,在 Linux 版本中完全不可用。 > > > 尽管 **Studio One 是闭源的**,但它对 Linux 的支持将使 Linux 平台对音频工程师、制作人乃至艺术家更加友好。 ### ? 获取 Studio One 测试版 要想体验这个公开的测试版,你首先需要**注册一份订阅计划**。我建议你首先进行**30 天的免费试用**,看看它在你的 Linux 系统上的表现如何。 想了解更多,欢迎访问他们的 [官方网站](https://www.presonus.com/en/studio-one-compare.html)。 > > **[Studio One](https://www.presonus.com/en/studio-one-compare.html)** > > > ? 对于这个新闻,你有多兴奋?你试用过了吗?欢迎在下方评论留言分享你的想法! 参考来源:[omg! ubuntu](https://www.omgubuntu.co.uk/2023/10/pro-audio-app-studio-one-now-supports-linux) *(题图:MJ/4d6d0f4b-c16d-4164-ad1e-90e6bd2b4843)* --- via: <https://news.itsfoss.com/studio-one-linux/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) [Digital audio workstations](https://en.wikipedia.org/wiki/Digital_audio_workstation?ref=news.itsfoss.com) (DAW) have been an indispensable tool in the arsenal of music production professionals for quite some time now. Sadly, for Linux, the options are limited, with the most popular ones being the open-source DAWs, [Ardour](https://news.itsfoss.com/ardour-7-3-release/) , [Audacity](https://news.itsfoss.com/audacity-3-2-release/), and [Bitwig](https://www.bitwig.com/?ref=news.itsfoss.com) as an interesting closed-source choice. Sure, they are not necessarily bad. However, some of the most popular DAWs like **Cubase, Nuendo, and Pro Tools** used across the music industry are not available for Linux 🥺 But that changes with '** Studio One**' 🎉 It is a very popular DAW by [PreSonus](https://www.presonus.com/en/start?ref=news.itsfoss.com) (manufacturer of professional audio equipment) that has **been around since 2009.** Many professionals prefer to use Studio One as a viable alternative to the likes of Steinberg Cubase, Avid Pro Tools, Apple GarageBand, etc. ## Studio One: Landed on Linux! 🐧 ![a screenshot of studio one linux version](https://news.itsfoss.com/content/images/2023/10/Studio_One_Linux.png) Initially made available as a public beta, [Studio One 6.5](https://blog.presonus.com/2023/09/29/you-can-do-immersive-audio-right-now/?ref=news.itsfoss.com) is being offered as the first release for Linux. It officially mentions **Ubuntu 23.04** as its system requirement, with **Wayland session**. As a DAW, it has a plethora of features that let you create, record and mix music or other types of audio. Some of its key features include: **Multitrack tools****In-built beat maker****Support for Scratch pads****Harmonic editing for audio and MIDI** Whether you own PreSonus audio equipment or not, this is exciting news! It should influence other commercially successful DAWs to consider Linux as one of the platforms for music producers and artists 🤩 And, that could be a massive boost for Linux desktop adoption, improving the [current market share](https://itsfoss.com/linux-market-share/?ref=news.itsfoss.com) 📈 Not just that, having support for all three platforms for a seamless cross-platform experience is also a plus for Studio One! You can create music with the help of your favorite DAW without getting locked on to one platform, that has a nice ring to it, *right?* **The catch**: PreSonus doesn't provide any official Linux-related support for now. That could change with a stable release in the near future. However, the company recommends using the [Linux section](https://forums.presonus.com/viewforum.php?f=419&ref=news.itsfoss.com) in their user forum to discuss any Linux-related topics for troubleshooting and sharing feedback with the community. **you should not use it for production yet**. The developers have noted known issues on the Studio One [Linux support page](https://support.presonus.com/hc/en-us/articles/19214558269581-Linux-Getting-Started?ref=news.itsfoss.com). Some features such as CD burning, video support, DDP import/export, etc. outright do not work in the Linux version. Even though **Studio One is a close-sourced offering**, its release for Linux should result in Linux becoming a more welcoming platform for audio engineers, producers, and even artists! ## 📥 Get Studio One [Beta] For accessing the public beta, you will first have to **sign up for one of the subscription plans**. I suggest you go for the** 30-day free trial** first to see how it works on your Linux system. Head over to the [official website](https://www.presonus.com/en/studio-one-compare.html?ref=news.itsfoss.com) to get started. *💬 How excited are you about this news? Have you tried it yet? Share your thoughts in the comments below!* *Via: omg! ubuntu* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,255
如何制作一个 Linux Mint 立付 USB
https://itsfoss.com/linux-mint-live-usb/
2023-10-05T14:00:00
[ "USB", "Linux Mint", "立付 USB" ]
https://linux.cn/article-16255-1.html
![](/data/attachment/album/202310/05/140006qoqq9jupkczt8vgu.jpg) > > 按照本指南,在 Windows 和 Linux 上用 Linux Mint 轻松创建立付 USB。 > > > Linux Mint 是 [初学者的最佳 Linux 发行版选择](https://itsfoss.com/best-linux-beginners/) 之一。它基于 Ubuntu ,但有些人认为 [Linux Mint 比 Ubunutu 更好](https://itsfoss.com/linux-mint-vs-ubuntu/)。 如果你想尝试使用 Linux Mint,你可以 [在 VirtualBox 内安装 Linux Mint](https://itsfoss.com/install-linux-mint-in-virtualbox/)。 这是体验 Linux Mint 的方法之一。 另一种方法是创建 Linux Mint 的 <ruby> 立付 <rt> Live </rt></ruby> USB。这样,你就可以从 USB 启动,在实时会话中体验 Linux Mint。它不会干扰你当前的操作系统,无论是 Windows 还是 Linux。 > > LCTT 译注:关于我们将 “Live” 翻译为 “立付” 的原因,请参照 [此文](/article-15496-1.html) 说明。简单概括: > > > Live 原意多指“现场”、“实时”,在计算机环境中使用时也多引用此意。但对它的翻译就颇费神,因为无论是在 Live Patch,还是更多见的 Live USB/CD、Live Session,其实都不好翻译为“现场”、“实时”。推荐使用“立付”,在照顾发音的同时,取其“立时交付”之意。而对于 Live Stream,提议者建议依旧翻译为“直播”、“实时流”。对于 Live Patch,还是采用 “热补丁” 这样的意译。 > > > 如果你喜欢它并选择安装至硬盘上,可以使用同一个立付 USB 来进行。创建立付 USB 是安装 Linux Mint 的第一步。 ### 准备工作 如果需要制作一个 Linux Mint 立付 USB,你需要: * 一个 **USB 驱动器**(可以是 U 盘、移动硬盘等),至少需要 8GB 的空间; * 一个可以使用的互联网连接,以便下载 Linux Mint ISO; * 一个帮助你制作立付 USB 的写盘工具。 > > ? 你可以在一个系统上创建立付 USB,然后在其他电脑上使用。 > > > ### 第一步:下载 Linux Mint ISO 这一 ISO 文件是包含 Linux Mint 系统的镜像文件,它将会被写入至 USB 驱动器上。 Linux Mint 有三种 [桌面环境](https://itsfoss.com/what-is-desktop-environment/) 版本:**Cinnamon** 旗舰版本、**MATE** 以及 **XFCE** 的变体。 ![](/data/attachment/album/202310/05/140044e8ssvnv51z39jrso.jpg) 这些 ISO 文件包括了你可以找到 [最佳的桌面环境](https://itsfoss.com/best-linux-desktop-environments/)。**Cinnamon** 是最流行的版本,建议选择它以获得最佳的 Linux Mint 体验,但你也可以尝试其他版本。 不管你选择的是什么版本,ISO 文件的大小都约为 **2.7GB**。 你可以前往 [官方下载页面](https://www.linuxmint.com/download.php) 获取上述的 ISO 文件。你可以选择直接下载或使用 Torrent 种子文件下载。 > > **[Linux Mint 下载](https://www.linuxmint.com/download.php)** > > > 获得 ISO 文件后,你需要一个专用工具将 ISO 映像写入到 USB 驱动器上。我推荐使用 Etcher。 > > ? 有些人喜欢对下载的 ISO 文件 [进行完整性校验](https://itsfoss.com/checksum-tools-guide-linux/)。这是一种确保 ISO 文件在下载过程中不会损坏的方法(可能会因为网络不稳定等因素而损坏)。 > > > ### 第二步:安装 Etcher 以制作立付 USB 对于 Windows 用户来说,Rufus 是一款出色的工具。可惜 Linux 用户无法使用。 为了让本教程简洁明了,我将使用 [Etcher](https://itsfoss.com/install-etcher-linux/)。它是 [Rufus 的替代品](https://itsfoss.com/live-usb-creator-linux/),可用于 Linux 与 Windows。 这样,你就可以在 Windows 和 Linux 平台上使用相同的步骤创建 Linux Mint 立付 USB。唯一不同的是安装 Etcher 的步骤。 #### Windows 教程 从 [官方网站](https://etcher.balena.io/#download-etcher) 下载 Etcher。建议你下载完整的安装程序,除非你真的需要便携式文件。 ![](/data/attachment/album/202310/05/140044d56kyzkjiihfi80i.jpg) 你会找到一个 **.exe** 文件。只需要**双击**安装程序,然后同意说明条款并按照窗口内的步骤进行安装即可。 然后,你可以从搜索菜单中搜索并启动该程序。 ![](/data/attachment/album/202310/05/140044k81vi8mf0tiwvw22.jpg) #### Linux 教程 对于 Linux 用户来说,可以从 [官网](https://etcher.balena.io/#download-etcher) 下载 Etcher 的 AppImage 可执行文件。 你可以参考我们的 [AppImage 指南](https://itsfoss.com/use-appimage-linux/),了解如何将文件作为可执行文件运行。 ![](/data/attachment/album/202310/05/140045rh52w0aa2wjnrr2z.png) 使用 AppImage 文件,你不需要 [安装 Etcher](https://itsfoss.com/install-etcher-linux/),而是在直接运行它。 ### 第三步:使用 Etcher 将 Linux Mint ISO 写入到 USB 驱动器 **插入 USB 驱动器**,并运行上一步安装的 Etcher 工具。 现在,考虑到你已经下载了 Linux Mint ISO,点击 “<ruby> 从文件烧录 <rt> Flash from file </rt></ruby>” 选项,如下图所示。 ![](/data/attachment/album/202310/05/140046fx998fgzuqm0xu87.jpg) 然后使用文件管理器选择 Linux Mint 的 ISO 文件。 ![](/data/attachment/album/202310/05/140046i968rrkmbk3591eo.jpg) 选择 ISO 文件后,需要选择要将要刷入的 USB 驱动器。如果只有一个,Etcher 会自动选择。但仍要确保在 Etcher 中选择了正确的 USB 驱动器。 ![](/data/attachment/album/202310/05/140047rincwzj0jv2t50q5.jpg) 现在,你只需点击 “<ruby> 现在烧录 <rt> Flash </rt></ruby>”,等待程序完成。 ![](/data/attachment/album/202310/05/140047u9it1yooyptkyat1.png) 你将收到接受命令行进程的提示,并选择 “Yes” 以启动刷入进程。 ![](/data/attachment/album/202310/05/140048w7v11uewjr7z6fjy.png) 完成后,它将自动验证刷入的 USB 驱动器是否完整,然后你就可以开始了! ### 第四步:从 USB 驱动器启动 你通过上述方法所制作的 Linux Mint 立付 USB 驱动器应适用于任何具有 UEFI 启动功能的计算机。 当系统启动并显示制造商徽标时,按 `F2` 或 `F10` 或 `F12` 键,即可访问 [UEFI 启动设置](https://itsfoss.com/access-uefi-settings-windows-10/) 访问启动设置后,将启动顺序更改为先从 USB 驱动器启动。 不同的电脑有不同的 BIOS 设置,因此我无法分享此步骤的明确截图。 > > ? 在极少数情况下,安全启动可能不允许启动。这时可以禁用安全启动。 > > > ### 接下来怎么办? 如果你喜欢立付环境下的 Linux Mint,可以使用立付 USB 删除 Windows 来安装 Mint。 或者,你也可以选择 [Linux Mint 和 Windows 双系统共存](https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/) ,在同一台电脑中同时运行两个操作系统。 ? 我希望本教程对你创建 Linux Mint 立付 USB 有帮助。请在评论区告诉我你的问题和建议。 *(题图:MJ/a7bdf228-4928-4171-9250-58ce1ba7545c)* --- via: <https://itsfoss.com/linux-mint-live-usb/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[GenshinMinecraft](https://github.com/GenshinMinecraft) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Linux Mint is one of the [best Linux distribution choices for beginners](https://itsfoss.com/best-linux-beginners/). It is based on Ubuntu and yet some people find [Mint better than Ubuntu](https://itsfoss.com/linux-mint-vs-ubuntu/). If you want to try it, you can [install Linux Mint inside VirtualBox](https://itsfoss.com/install-linux-mint-in-virtualbox/). That's one way. Another way is to create a live USB of Linux Mint. This way, you can boot from the USB and experience Linux Mint in a live session. It won't disturb your current operating system, be it Windows or Linux. If you like it and choose to install it, you can use the same live USB. The creation of live USB is the first step towards Linux Mint installation. Before you proceed to make a live USB, you need to take care of a few things first. ## What do you need? To get started, you need the following: - A **USB drive**(also known as a flash drive or pen drive) with at least 8 GB of space. - An active internet connection to download the Linux Mint ISO. - A tool to help you create the live USB. ## Step 1: Download Linux Mint ISO The ISO is an image file consisting of Linux Mint. This file will be flashed to the USB. Linux Mint offers three ISOs for different [desktop environments](https://itsfoss.com/what-is-desktop-environment/). The flagship **Cinnamon** edition, a **MATE** variant, and **XFCE**. ![linux mint download page](https://itsfoss.com/content/images/2023/08/linux-mint-download-page.jpg) The ISOs include some of the [best desktop environments](https://itsfoss.com/best-linux-desktop-environments/) that you can find. The **popular recommendation is to get the Cinnamon edition** for the best Linux Mint experience, but you can try others. No matter the edition, the ISOs are approximately **2.7 GB** in file size. Head to the [official download page](https://www.linuxmint.com/download.php) and get it. You can choose among the mirrors available for direct download or use the torrent file. Once you have the ISO, you'll need a dedicated tool to flash the ISO image to the USB. I recommend Etcher. [perform an integrity checksum](https://itsfoss.com/checksum-tools-guide-linux/)on the downloaded ISO file. It's a way to ensure that the ISO file is not corrupted during download (may happen due to an inconsistent internet connection). ## Step 2: Install Etcher to create the live USB Rufus is an excellent tool for Windows users. Alas! it is not available for Linux users. To keep this tutorial simple, I'll [use Etcher](https://itsfoss.com/install-etcher-linux/). It's a [Rufus alternative available on Linux](https://itsfoss.com/live-usb-creator-linux/) and Windows both. This way, you can use the same steps for creating live Linux Mint USB on both Windows and Linux platforms. The only step different here is the Etcher installation. ### If you are using Windows Download Etcher from its [official website](https://etcher.balena.io/#download-etcher). It is recommended to download the full installer unless you have a reason to get the portable file. ![balena etcher download page screenshot](https://itsfoss.com/content/images/2023/08/balena-etcher-windows-download.jpg) You will find an **.exe **file. Just **double-click** on the installer and follow the on-screen instructions to agree to the terms, and complete the installation. Next, you can search for it from the search menu and launch the program. ![balenda etcher on windows](https://itsfoss.com/content/images/2023/08/balena-etcher-launch.jpg) ### If you are using Linux For Linux, download Etcher's AppImage file from its [official website](https://etcher.balena.io/#download-etcher). You can refer to our [AppImage guide](https://itsfoss.com/use-appimage-linux/) to know how to run the file as an executable. ![balena etcher appimage file downloaded](https://itsfoss.com/content/images/2023/08/balena-etcher-appimage.png) With AppImage files, you are not [installing Etcher](https://itsfoss.com/install-etcher-linux/), you are directly running it. ## Step 3: Flashing Linux Mint ISO to USB with Etcher **Plug in the USB** drive and run the Etcher tool you installed in the previous step. Now, considering that you already downloaded the Linux Mint ISO, click on the "**Flash from file**" option as shown below. ![etcher flash from file](https://itsfoss.com/content/images/2023/08/etcher-flash-from-file.jpg) And select the ISO file downloaded using your file explorer. ![balena etcher select ISO file screenshot](https://itsfoss.com/content/images/2023/08/balena-iso-selection-windows.jpg) Once you select the ISO, you need to pick the USB device to flash it on. Etcher should automatically pick it if there is just one. Still ensure that the correct USB drive is selected in Etcher. ![balena etcher usb device selection](https://itsfoss.com/content/images/2023/08/balena-etcher-device-select.jpg) Now, all you have to do is hit "**Flash**" and wait for the process to complete. ![balena etcher screenshot windows](https://itsfoss.com/content/images/2023/08/balenaEtcher-flash-windows.png) You will get a prompt to accept a command-line process and proceed with a "**Yes**" to start the flashing process. ![balena etcher flashing in progress](https://itsfoss.com/content/images/2023/08/balenaEtcher-flashing.png) Once done, it will validate that the process was successful, and you should be good to go! ## Step 4: Booting from live USB The live USB you created should work with any computer with UEFI boot. You can [access the UEFI boot settings](https://itsfoss.com/access-uefi-settings-windows-10/) easily by pressing the F2 or F10 or F12 key when your system is booting up and shows the manufacturer's logo. Once you have access to the boot settings, change the boot order to boot from USB first. Different computers have different BIOS settings, so I cannot share a definite screenshot for this step. ## What comes next? If you like Linux Mint in live setting, you can use the live USB to install Mint by deleting Windows. [How to Install Linux Mint [The Simplest Way Possible]Linux Mint is the best Linux distribution for beginners. Learn how to install Linux Mint and make it your main and the only operating system.](https://itsfoss.com/install-linux-mint/)![](https://itsfoss.com/content/images/wordpress/2020/07/install-linux-mint.png) ![](https://itsfoss.com/content/images/wordpress/2020/07/install-linux-mint.png) Alternatively, you may also [dual boot Mint and Windows](https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/), keeping both operating systems in the same computer. [How To Dual Boot Linux Mint And Windows 10 [Beginner’s Guide]Brief: This guide shows you how to dual boot Linux Mint with Windows 10 and enjoy both Linux and Windows together in one system. So you have decided to switch to Linux. Good decision! And if you chose to use Linux Mint, that’s even a better decision. Linux Mint](https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/)![](https://itsfoss.com/content/images/wordpress/2013/12/dual-boot-linux-mint-windows-10.jpeg) ![](https://itsfoss.com/content/images/wordpress/2013/12/dual-boot-linux-mint-windows-10.jpeg) Another useful tip. Later on, if you want to use USB for some other purpose but it only shows 4 MB, you can use this troubleshooting article to fix it. [Format Live Linux USB Destroyed by Rufus or EtcherCannot format the bootable Linux USB properly anymore? Here’s how to get your USB disk back.](https://itsfoss.com/format-live-linux-usb/)![](https://itsfoss.com/content/images/wordpress/2021/10/format-live-linux-usb.jpg) ![](https://itsfoss.com/content/images/wordpress/2021/10/format-live-linux-usb.jpg) 💬* I hope you find this tutorial helpful in creating live Mint USB. Let me know your questions and suggestions in the comment section.*
16,257
任务中心:一款流畅的 Linux 系统监控应用
https://news.itsfoss.com/mission-center/
2023-10-05T18:07:00
[ "系统监视器" ]
https://linux.cn/article-16257-1.html
![](/data/attachment/album/202310/05/180653pnz0nkta1lc1tclz.jpg) > > 这是一款为 Linux 打造的用户友好的系统监控应用。让我们一起来了解! > > > 假如有一天,你发现你的系统开始运行缓慢,你的发行版的默认的系统监控应用又无法给与帮助,你会如何处理? 我能理解当你在试图找出是什么进程引起你的系统运行缓慢,而系统监控器却无法提供帮助是何等烦恼的事。 在此,我初步介绍的这个工具,或许就是你需要的。这就是 “<ruby> 任务中心 <rt> Mission Center </rt></ruby>”,一个为 Linux 打造的系统监控器,旨在提供实用的功能。 下文将一一展示这个应用可以做什么,以及它的一些限制。 > > ? 这个应用还是非常新的,处于积极的开发中。所以,预计会有一些变动。 > > > ### ⭐ 任务中心:概述 ![](/data/attachment/album/202310/05/180716w3mmg6hma9i646tl.png) 主要使用 **内存安全的 Rust 编程语言** 编写的 [任务中心](https://missioncenter.io/) 是一款可以让你监控 CPU、内存、磁盘、网络以及 GPU 的系统监控器。 它的几个关键特性包括: * 实时监控每个线程的 CPU 使用情况。 * 有能力监控 RAM 和 Swap 的使用状况。 * 提供应用和进程的详细使用信息。 * 监控网络的利用率和传输速度。 ### ?‍? 初步印象 我在一个运行着 **[Ubuntu 22.04](https://news.itsfoss.com/ubuntu-22-04-release/) LTS** 的系统上进行了测试,由于这款应用 **提供了 Flatpak 安装方式**,使得整个安装过程相当简洁。 我不得不说,任务中心 **看起来和** [Windows 11](https://www.microsoft.com/en-us/windows?wa=wsignin1.0) **上的任务管理器大体相似**,这并不算是坏事。这种界面布局十分适合以用户友好的方式展示所有重要的信息。 我首先查看的是系统监控的 “<ruby> 性能 <rt> Performance </rt></ruby>” 部分中的 CPU 标签。它向我提供了我处理器的所有关键信息,并配有一个能**展示实时 CPU 使用率的图表**。 我还能切换到 “<ruby> 逻辑处理器 <rt> logical processors </rt></ruby>” 视图,以便**观察每个线程的 CPU 使用情况**。只需在图表上进行右键点击并进入 “<ruby> 改变视图 <rt> Change Graph To </rt></ruby>” 菜单即可切换。 ![](/data/attachment/album/202310/05/180716ch91x5r1zfzht1d1.png) 我接下来查看的是 “<ruby> 内存 <rt> Memory </rt></ruby>” 标签,它提供了**一个内存使用的实时图表**,以及两个正在使用的 RAM 模块的实用信息。 ![](/data/attachment/album/202310/05/180717fk5q99rkrddesinh.png) 然后我查看了 “<ruby> 硬盘 <rt> Disk </rt></ruby>” 标签。即便我在我的系统中有多个存储硬盘,但我只在 Ubuntu 上使用了 “Disk 4”。我对其进行了使用率检查,显示出来的似乎是实时的磁盘使用数据。 不过,[据开发者所述](https://gitlab.com/mission-center-devs/mission-center/-/issues/2),当前**硬盘使用率的百分比仍在开发中**,因此,现在的数据可能尚不准确。 ![](/data/attachment/album/202310/05/180718mkdq2w1uuqbxqel7.png) 最后,我查看了 “<ruby> 以太网 <rt> Ethernet </rt></ruby>” 标签。它向你展示了有关系统的网络活动的实时图表,包括了下载和上传活动的两个信息点。 然而,它对于应用的网络数据使用情况,目前还是**没有应用级的网络数据信息**。这个功能,开发者正 [在着手开发](https://gitlab.com/mission-center-devs/mission-center/-/issues/3)。 ![](/data/attachment/album/202310/05/180719d06hje422wf2jff8.png) 接下来,我查看了 “<ruby> 应用 <rt> Apps </rt></ruby>” 部分。这里包含了系统中运行的大部分(甚至全部)应用和进程。它不有展示了应用/进程的全部有用信息,包括 PID、CPU 使用、内存和磁盘使用情况。 你还能在任何一个应用/进程上进行右键点击,来选择 **停止应用/进程** 或 **强制停止应用/进程**。 ![](/data/attachment/album/202310/05/180719sl9nyj999djdn8za.png) 我还调整了任务中心应用的一些设置,比如: * 调整所有实时图表的更新频率 * 设定合并进程统计数据 * 记住我在 “<ruby> 应用 <rt> Apps </rt></ruby>” 部分所使用的排序顺序。 ![](/data/attachment/album/202310/05/180724fmvxn4d0gq4ds3qd.png) 我注意到一个缺失的数据,关于我的 GPU。任务中心**未能检测到我的英伟达 GPU**。 这是可以理解的,因为 **GPU 的支持目前仍然处于实验阶段**,仅支持 AMD 和英伟达的 GPU。 ### ? 获取任务中心 任务中心可以在 [Flathub 商店](https://flathub.org/apps/io.missioncenter.MissionCenter) 或者 [GitLab](https://gitlab.com/mission-center-devs/mission-center) 上获得,如果你更倾向于从源码来构建的话。 > > **[任务中心(Flathub)](https://flathub.org/apps/io.missioncenter.MissionCenter)** > > > ? 你会考虑用任务中心来替代你 Linux 系统上的默认系统监控器吗? *(题图:MJ/feb84cdf-0719-401a-9c4a-1db7960d4572)* --- via: <https://news.itsfoss.com/mission-center/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) What if, one day, you find that your system is sluggish, and the default system monitor app of your distro is not helpful? I understand that it can be very annoying when you are trying to figure out what pesky process is causing your system to slow down, and the system monitor cannot help. With this first look, I have just the thing for you. It is **a system monitor for Linux** called '**Mission Center**' that aims to provide some really useful functionality. Allow me to take you through it, and show you what it can do, and what it can't. ## Mission Center: Overview ⭐ ![a screenshot of mission center about info](https://news.itsfoss.com/content/images/2023/09/Mission_Center_1.png) Written primarily in the **memory-safe Rust programming language**, [Mission Center](https://missioncenter.io/?ref=news.itsfoss.com) is a system monitor that lets you **monitor your CPU, Memory, Disk, Network, and GPU**. Some of its key highlights include: **Real-time monitoring of per-thread CPU usage.****Ability to monitor RAM and Swap usage.****Detailed apps and process usage information.****Monitoring of network utilization and transfer speeds.** **Suggested Read **📖 [7 System Monitoring Tools for Linux That are Better Than TopTop command is good but there are better alternatives. Take a look at these system monitoring tools that are similar to top, but better than it.](https://itsfoss.com/linux-system-monitoring-tools/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/wordpress/2020/08/system-monitoring-tools-linux.jpg) ![](https://itsfoss.com/content/images/wordpress/2020/08/system-monitoring-tools-linux.jpg) ## Initial Impressions 👨💻 I tested it out on an ** Ubuntu 22.04 LTS** system, and the installation process was pretty straightforward thanks to it being **offered as a Flatpak**. And, I must say, **Mission Center looks very similar to the task manager found on **[Windows 11](https://www.microsoft.com/en-us/windows?wa=wsignin1.0&ref=news.itsfoss.com), and that's not necessarily a bad thing. This interface layout is good for presenting all the important information in a user-friendly manner. The first tab I took a look at was the '**Performance**' section of the system monitor called '**CPU**'. It showed me all the essential info regarding my processor, with a handy **graph showing CPU usage in real-time**. I was also able to switch to the 'logical processors' view to **see CPU usage on a per-thread basis**. You can find it by right-clicking on the graph and going into the 'Change Graph To' menu. ![a screenshot of mission center cpu tab](https://news.itsfoss.com/content/images/2023/09/Mission_Center_2.png) The next one was the '**Memory**' tab, which showed me **a real-time graph with the memory usage**, and useful info regarding the two RAM sticks being used. ![a screenshot of mission center memory tab](https://news.itsfoss.com/content/images/2023/09/Mission_Center_3.png) Thereafter, the '**Disk**' tab, even though I have several storage disks on my system, I only use 'Disk 4' for Ubuntu. I checked the usage on it, and it seemed to show disk usage data in real-time. However, [according to the developer](https://gitlab.com/mission-center-devs/mission-center/-/issues/2?ref=news.itsfoss.com), the **disk usage percentage is in a work-in-progress state** right now, and the accuracy of it cannot be vouched for. ![a screenshot of mission center disk tab](https://news.itsfoss.com/content/images/2023/09/Mission_Center_4.png) And finally, we have the '**Ethernet**' tab. It shows you the **real-time network activity on your system with a handy graph**, with two information points for download and upload activities. However, there is **no per-process network data usage for apps** yet. The developer is [currently working](https://gitlab.com/mission-center-devs/mission-center/-/issues/3?ref=news.itsfoss.com) on that. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![a screenshot of mission center ethernet tab](https://news.itsfoss.com/content/images/2023/09/Mission_Center_5-1.png) I then moved on to the '**Apps**' section. This housed most (if not all) apps and processes running on the system. It shows all the useful information of an app/process, such as the PID, CPU, Memory, and Disk usage. You can also either **stop an app/process** or **force stop an app/process **by right-clicking on one. ![a screenshot of mission center apps section](https://news.itsfoss.com/content/images/2023/09/Mission_Center_6.png) I was also able to **tweak certain settings** of the Mission Center app, such as: - Adjusting the update interval for all the real-time graphs - Set the app to merge process statistics - Remember the sorting order I used in the 'Apps' section. ![a screenshot of mission center preferences menu](https://news.itsfoss.com/content/images/2023/09/Mission_Center_7.png) One thing that I missed was the data related to my GPU, **Mission Center was unable to detect my Nvidia GPU**. However, that checks out, seeing that **GPU support is experimental**, with only AMD and Nvidia GPUs being supported. ## 📥 Get Mission Center Mission Center is available on the [Flathub store](https://flathub.org/apps/io.missioncenter.MissionCenter?ref=news.itsfoss.com), as well as on [GitLab](https://gitlab.com/mission-center-devs/mission-center?ref=news.itsfoss.com), if you want to build it from source. [First Looks](https://news.itsfoss.com/tag/first-look/)coverage. You should find them exciting! *💬 Would you replace the default system monitor on your Linux system with Mission Center?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,258
Linux 游戏的下一个秘密武器:Bottles Next
https://news.itsfoss.com/bottles-next-linux-gaming/
2023-10-06T12:37:16
[ "Bottles", "Wine" ]
https://linux.cn/article-16258-1.html
![](/data/attachment/album/202310/06/123651ctvakzantvupnezt.jpg) > > Bottles 的发展计划充满激动人心,目标是成为在 Linux 上运行 Windows 应用和游戏的更优秀工具。 > > > 如今,Wine 和 Steam 的 Proton 让 Linux 用户获得了升级的游戏体验。 而 Lutris、Heroic Games Launcher 等应用利用这些技术,让你能够轻松管理、安装和启动游戏。 **Bottles** 是一款此类的实用工具,它帮助你在 Linux 上 [运行 Windows 应用和游戏](https://itsfoss.com/use-windows-applications-linux/)。这是在 Linux 上使用 [Epic 游戏商店](https://itsfoss.com/epic-games-linux/) 的最佳方法之一。 我深信,它在不久的将来会成为一个更令人激动的工具!*为什么?* ? 嗯,我发现了一些关于 Bottles 下一代升级计划的有趣更新 ? ### Bottles Next:完全变革 当前版本的 [Bottles](https://usebottles.com/) 是一款简洁且可以定制的应用,帮助你仅需点击几次便可管理和运行 Windows 应用和游戏。 ![Bottles 当前版本的截图](/data/attachment/album/202310/06/123717nyivt1f1cvvhbi7y.png) 根据其未来升级计划(*尽管目前还没有具体的时间表*),开发者们准备提升用户体验,以及提供一个**更强大的后端**。与之配合的是,他们还计划**重新设计用户界面**,以满足初级和资深用户的需求。 现在,我来告诉你更多它的计划信息... #### 用户界面的重新设计 这是其创建者 [Mirko Brombin](https://news.itsfoss.com/interview-mirko-brombin/) 分享的 Bottles Next 的一些效果图: ![Bottles Next 展示两种模式的设计](/data/attachment/album/202310/06/123718n3fvweziwwnxw8jb.jpg) 如你所见,他们的目标是推出两种使用模式,即 “<ruby> Next 模式 <rt> Next Mode </rt></ruby>” 针对初级用户,以及 “<ruby> 经典模式 <rt> Classic Mode </rt></ruby>” 针对资深用户。 > > ? 这些效果图可能不代表 Bottles Next 的最终设计。 > > > Bottles Next 的更新旨在提供更简洁的用户体验,同时依然保持了工具的可定制性。 ![](/data/attachment/album/202310/06/123718ebmnxjcdmrmjjbdp.jpg) 游戏信息界面看起来很吸引人,显示了重要信息,并提供了进入高级设置的选项。 ![](/data/attachment/album/202310/06/123718zk2j7urkq4r1jrtz.jpg) 我个人觉得这个设计不错,*你觉得呢?* #### 核心的变化 计划中的技术变动很大,但当然,你可能无法从用户界面上看出其变化。 后端重写的一些目标包括: * 让后端独立于图形用户界面 * 重新定义应用如何与其创建的 “<ruby> 前置瓶 <rt> bottle </rt></ruby>” 联系,重点是单一应用。 * 引入新功能(如取消创建 “前置瓶” 的能力) (LCTT 译注:Wine 使用一个被称之为 “Wineprefix” 的配置目录来控制使用 Wine 运行的 Windows 程序,这个目录也被比喻作 “bottle”,而 “Bottles” 是一个基于此机制的软件。在此,我将 “Wineprefix” 和 “bottle” 尝试翻译为 “Wine 前置配置” 和 “前置瓶”。) 为了使后端独立于图形用户界面,他们计划使用客户端和本地服务器的概念。因此,其他应用也可以使用 Bottles 服务器来处理已创建的 <ruby> Wine 前置配置 <rt> Wineprefix </rt></ruby>。 > > ? <ruby> Wine 前置配置 <rt> Wineprefix </rt></ruby> 是 Wine 用于存储配置文件及已安装的 Windows 程序的目录(更多关于 Wine 的信息参见 [Arch Linux Wiki](https://wiki.archlinux.org/title/wine))。 > > > 换句话说,他们目标是改变所有的工作方式,同时保证他们的后端对其他应用管理 Wine 是有利的。 关于技术变化,Mirko 提到: > > 这种全新的架构允许在任何需要管理 Wine 前置配置的应用中使用 Bottles。你可以用任何工具包,例如 qt、GTK 等写客户端。我们正朝着 Electron 的道路前进,同时也在开发一个 GTK 客户端。 > > > (计划中)Bottles Next 工作方式的一个**有趣的地方**: > > Bottles Next 将会是第一款能够从内部管理 Wine 前置配置的管理器。我们正在编写一个名为 [WineBridge](https://github.com/bottlesdevs/winebridge) 的项目,它运行在 Wine 前置配置内部,然后通过协议与 Bottles 通信。这样我们便可以避免使用 Shell 命令来启动程序或调整 <ruby> Wine 前置配置 <rt> Wineprefix </rt></ruby>,大大降低了痛苦。 > > > 此外,他提到将基于 Go 编程语言进行重写。 简而言之,即将在底层和前端出现大量重大的变化。这些整合后,必然能够在 Bottles 上提升用户体验。 随着他们透露的关于 Bottles Next 更多的计划和进展信息,我们可能会获得更多值得关注的消息。 ### ? 如果可以,帮助他们! 我敢肯定,至此为止,作为一个 Linux 游戏狂热爱好者,你一定迫不及待想要看到下一代的更新! 然而,已经分享的**开发计划**会需要一段时间去实践,最后才能推出。 **但不用担心,你可以伸出援手!** 你可以在 [GitHub](https://github.com/bottlesdevs) 上为项目做出贡献,提出你的想法/反馈到 [论坛](https://forum.usebottles.com/), 加入他们的 [Discord](https://discord.gg/wF4JAdYrTR) 服务器找出更多参与 **Bottles Next** 项目的方式。 > > **[Bottles](https://usebottles.com/)** > > > ? 你对 Bottles Next 有什么看法?在下方的评论中分享你的观点。 *(题图:MJ/e6b335c1-70d9-4404-b62f-e9b27fd128bb)* --- via: <https://news.itsfoss.com/bottles-next-linux-gaming/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Wine and Steam's Proton have made it possible for Linux users to get an enhanced gaming experience. And apps like Lutris, Heroic Games Launcher, and others help utilize the technologies to let you easily manage, install, and launch games at your convenience. **Bottles** is one such utility that helps you [run Windows apps and games on Linux](https://itsfoss.com/use-windows-applications-linux/?ref=news.itsfoss.com). It is one of the best methods to use the [Epic Games Store on Linux](https://itsfoss.com/epic-games-linux/?ref=news.itsfoss.com). And, I think it will be a more exciting tool in the near future! *Why? *🤔 Well, I came across some interesting updates regarding the next-gen upgrade planned for Bottles 🤯 ## Bottles Next: A Complete Overhaul [Bottles](https://usebottles.com/?ref=news.itsfoss.com) in its current form is a simple and customizable app to help you manage/run Windows apps and games in a couple of clicks. ![Bottles](https://news.itsfoss.com/content/images/2023/10/bottle-dark-screenshot.png) With its planned upgrade (*with no particular schedule presently*), the devs plan to take the user experience a notch up, with a **more capable back-end**. To compliment it, they also plan to **redesign the user interface** to cater to beginners and advanced users. Let me tell you more about it… ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ### The User Interface Redesign Here are some mockups shared by [Mirko Brombin](https://news.itsfoss.com/interview-mirko-brombin/) (the creator) for Bottles Next: ![bottles next mockup screenshot](https://news.itsfoss.com/content/images/2023/10/bottles-next.jpg) As you can see, they are aiming to introduce two modes of usage, i.e., '**Next Mode**' for beginners and a '**Classic Mode**' for advanced users. Bottles Next update aims to give a simpler user experience, and still retain the customizability of the tool. ![](https://news.itsfoss.com/content/images/2023/10/bottles-next-ui.jpg) The game information screen looks interesting with vital information, and the option to head to advanced settings. ![](https://news.itsfoss.com/content/images/2023/10/bottles-next-game-info.jpg) It looks good to me, *what do you think?* **Suggested Read **📖 [Run Windows Applications on Linux [Beginners Guide]Here’s a detailed step-by-step guide with screenshots to show how you can run Windows software on Linux using Wine.](https://itsfoss.com/use-windows-applications-linux/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/06/run-windows-apps-on-linux.png) ![](https://itsfoss.com/content/images/2023/06/run-windows-apps-on-linux.png) ### Under-the-hood Changes The planned technical changes are big, but of course, you may not notice it on the user-facing side. Some goals with the backend rewrite include: **Making the back-end independent of the GUI****Redefining how the app communicates with the created bottles, focusing on a single application.****Introducing new capabilities along with it (like the ability to cancel a bottle creation)** To make the back-end independent of the GUI, they plan to utilize a client and local server concept. So, anyone (other applications) can use Bottles server to work with wineprefix created. [Arch Linux Wiki](https://wiki.archlinux.org/title/wine?ref=news.itsfoss.com)) In other words, they aim to change how it all works, and at the same time, ensure that their back-end could be beneficial for other applications to manage wine. On the technical changes, Mirko mentions: This new structure allows using bottles in any applications which need to handle wine prefixes. It is possible to write clients in any toolkit, like qt, GTK or whatever. We are going the Electron road but also working on a GTK client. One more** interesting bit about how Bottles Next works (planned)**: Bottles Next will be the first wineprefix manager to manage prefixes from the inside. We are writing a project called[WineBridge]which runs from inside the prefix, and then communicate via protocol with Bottles. This way we can avoid using shell commands to launch programs or tweak the prefix, which is painful. Furthermore, he mentions the rewrite will be based on the **Go** programming language. In a nutshell, we have many significant changes coming under-the-hood and on the front-end. Combined, this should level up the user experience that you get on Bottles. You can explore more about the technical details and plans in their [blog post](https://usebottles.com/blog/bottles-next-a-new-chapter/?ref=news.itsfoss.com). ## Help Them Out If You Can! 🙌 I'm sure by now, as a Linux gaming enthusiast, you cannot wait for the next-gen upgrade! However, the **development plans** shared will take a while to be worked on and finally make its way to a release. **Fret not, you can help!** You can contribute to the project on [GitHub](https://github.com/bottlesdevs?ref=news.itsfoss.com), suggest ideas/feedback on [forums](https://forum.usebottles.com/?ref=news.itsfoss.com), and join their [Discord](https://discord.gg/wF4JAdYrTR?ref=news.itsfoss.com) server to explore more ways to get involved with the **Bottles Next** project. *💬 What do you think about Bottles Next? Share your thoughts in the comments below.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,260
elementary OS 7.1 发布,重点关注隐私
https://news.itsfoss.com/elementary-os-7-1/
2023-10-06T23:25:59
[ "elementary OS" ]
https://linux.cn/article-16260-1.html
![](/data/attachment/album/202310/06/232453yxlnckyvn3bb28n9.jpg) > > elementary OS 的精致更新已到来! > > > 2023 年即将结束,而我们得到了一次全新的 elementary OS 更新。今年早些时候,我们对 [elementary OS 7](https://news.itsfoss.com/elementary-os-7-release/) 版本进行了概览,该版本带来了众多改进。 而今,让我们来探索一下新发布的 **elementary OS 7.1**版本。 ### ? elementary OS 7.1: 新增了什么? ![](/data/attachment/album/202310/06/232559g9dopve2x9tccypk.jpg) 作为 [最美 Linux 发行版](https://itsfoss.com/beautiful-linux-distributions/) 之一,这次的 elementary OS 发行版**主要集中在隐私和辅助功能上**。 此版本的一些显著亮点包括: * 隐私优化 * 加强辅助功能 * <ruby> 应用中心 <rt> AppCenter </rt></ruby> 的改进 * 手势和键盘导航有所提升 ### 隐私优化 ![](/data/attachment/album/202310/06/232559b32mt494abt55sbt.png) 在此发行版中,已引入新系统,用于**管理应用程序的自动启动**,并且当应用程序在后台运行时会向你**发出警告**。 因为这个新的 “<ruby> 后台 &amp; 自启动 <rt> Background &amp; Autostart </rt></ruby>” 管理面板的引入,现在众多如日历、邮件和任务等核心应用的自启动行为可以得到控制。 该管理面板还负责管理应用程序的权限,其中 “<ruby> 定位服务 <rt> Location Services </rt></ruby>” 的管理,采用了一个**更安全的方法**来允许应用程序请求位置访问。 符合最新的 [FreeDesktop.org](https://www.freedesktop.org/wiki/) 标准的实现。 ### 加强辅助功能 ![](/data/attachment/album/202310/06/232601fua0kyqaq15oqkea.png) 收到来自**具有视觉障碍用户的反馈**后,elementary OS 团队实施了一些有用的可访问性功能。 一项功能是,安装过程中会自动播放 **音频提示** ,以**让了解用户屏幕阅读器的键盘快捷方式**。这个音频提示在首次安装和设置过程中都会提供。 另一项功能是,为了**帮助 [色觉缺陷](https://en.wikipedia.org/wiki/Color_blindness) 人群**在发行版中导航,实施了**五种不同的显示过滤器**。 这些过滤器是为解决 **红色盲**、**绿色盲** 和 **黄蓝色盲** 这些问题的人们设计的。他们还增添了一些 **高对比度选项** ,并增加了大量的 **辅助文字**。 ### 应用中心的改进 ![](/data/attachment/album/202310/06/232602we6web2g8czmz6e7.png) **<ruby> 应用中心 <rt> AppCenter </rt></ruby> 也有了改进**,现在它会显示所有列出或侧载的 Flatpak 应用运行所需的权限。 现在,它可以显示如位置、发送通知、自启动、读/写系统设置等应用权限。 这让用户在安装应用程序时能更清楚地了解哪些权限是必要的。 ### 提升手势和键盘导航 ![](/data/attachment/album/202310/06/232602vipzlkk7ekeqimmi.png) 同样地,**多点触控手势和键盘导航得到了加强**,这归功于在整个系统中更广泛的实施。 现在,用户可以**使用手势控制工作区**,并**使用新添加的各种键盘快捷键导航**。对键盘行为的设置也有所优化,提供了大量调整选项。 ### ?️ 其他修改和改进 像每个 elementary OS 发布版本一样,许多微妙的改进效果显著。其他的亮点包括: * “<ruby> 文件 <rt> Files </rt></ruby>” 应用的标题栏中新增应用菜单,具有新的缩放控制和能同时重命名多个文件的 “批量重命名” 功能。 * 引入了最新的长期支持,来自 Ubuntu 的 [硬件支持栈](https://wiki.ubuntu.com/Kernel/LTSEnablementStack)。 * “<ruby> 反馈 <rt> Feedback </rt></ruby>” 应用已被改进,现在包含有搜索栏并已迁移到 GTK 4。 * “<ruby> 邮件 <rt> Mail </rt></ruby>” 应用完全重做,带来了更稳定的用户体验。 * 已集成 [GNOME Web 44.6](https://gitlab.gnome.org/GNOME/epiphany/-/releases/44.6)。 * 核心应用得到了各种更新。 我建议你阅读官方的 [发布说明](https://blog.elementary.io/os-7-1-available-now/) ,以更深入地了解此版本。 ### ? 下载 elementary OS 7.1 由于 elementary OS 是一种 “看着给” 发行版,你可以前往 [官方网站](https://elementary.io/) 购买或免费下载它。 > > **[elementary OS 7.1](https://elementary.io/)** > > > 你也可以选择他们网站上列出的一些硬件零售商,他们提供预装发行版的笔记本电脑和台式机。 --- via: <https://news.itsfoss.com/elementary-os-7-1/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Just a few months to go in 2023, and we have a new update of elementary OS. Earlier this year, we took a look at the [elementary OS 7](https://news.itsfoss.com/elementary-os-7-release/) release, which brought about plenty of improvements. And now, we have **elementary OS 7.1** release to check out. Let's see what it has to offer. ## 🆕 elementary OS 7.1: What's New? ![a screenshot of elementary os 7.1 desktop screen with the welcome app open](https://news.itsfoss.com/content/images/2023/10/elementary-OS-7.1_1.jpg) Being one of the [most beautiful Linux distros](https://itsfoss.com/beautiful-linux-distributions/?ref=news.itsfoss.com) around, this release of elementary OS **focuses on the privacy and accessibility side of things**. Some of the most notable highlights of this release include: **Privacy Tweaks****Better Accessibility****AppCenter Improvements****Improved Gesture and Keyboard Navigation** ### Privacy Tweaks ![a screenshot of elementary os 7.1 startup application settings](https://news.itsfoss.com/content/images/2023/10/elementary-OS-7.1_2.png) A new system has been added to the distro that **handles the auto-start of applications**, and even **alerts you when apps are running in the background**. The autostart behavior of many core apps such as Calendar, Mail, and Tasks can now be controlled thanks to this new '**Background & Autostart'** portal. The same portal also handles the permissions for applications, with the '**Location Services**' being improved with **a more secure method** for allowing apps to request location access. It follows the latest [FreeDesktop.org](https://www.freedesktop.org/wiki/?ref=news.itsfoss.com) standard for achieving that. ### Better Accessibility ![a screenshot of elementary os 7.1 color blindness fiters](https://news.itsfoss.com/content/images/2023/10/elementary-OS-7.1_3.png) After receiving **feedback from various users with vision-related disabilities**, the elementary OS team has implemented some useful accessibility features. One feature is that **an audio prompt** is automatically played during the first install t**o let users** **know the keyboard shortcut for the screen reader**. This audio prompt is also available during the initial setup after the installation. And the second is the implementation of **five distinct display filters** for **helping color vision deficient folks **chart their way through the distro. The filters are tailored for people with the **Protanopia**, **Deuteranopia**, and **Tritanopia **issues. They have also added some **additional high contrast options**, with plenty of **assistive text**. ### AppCenter Improvements ![a screenshot of elementary os 7.1](https://news.itsfoss.com/content/images/2023/10/elementary-OS-7.1_4.png) The **AppCenter has also been improved**, with it now showing what permissions are required by any listed or sideloaded Flatpak apps to run properly. It can now show app permissions such as location, sending notifications, autostart, read/write system settings and more. These should make it easier for a user to understand the app they are installing, and to know what kind of access it requires. ### Improved Gesture and Keyboard Navigation ![a screenshot of elementary os 7.1 keyboard settings](https://news.itsfoss.com/content/images/2023/10/elementary-OS-7.1_5.png) Similarly, **multitouch gestures and keyboard navigation have received a boost** thanks to a more widespread implementation across the system. Users can now **use gestures to control workspaces**, **navigate using the various newly added keyboard shortcuts**. The settings for keyboard behavior have also been redone, with loads of options to tweak the experience. ### 🛠️ Other Changes and Improvements Like every elementary OS release, there are many subtle refinements that go a long way. Some other highlights include: - A new app menu in the header bar for 'Files' that features new zoom controls and a 'bulk rename' feature for renaming many files in one go. - Implementation of the latest long-term support [Hardware Enablement stack](https://wiki.ubuntu.com/Kernel/LTSEnablementStack?ref=news.itsfoss.com)from Ubuntu. - The feedback app has been improved, it now features a search bar, and has been ported to GTK 4. - Complete revamp of the 'Mail' app, resulting in a more stable experience. - Inclusion of [GNOME Web 44.6](https://gitlab.gnome.org/GNOME/epiphany/-/releases/44.6?ref=news.itsfoss.com). - Various updates to the core apps. I suggest you go through the official [release notes](https://blog.elementary.io/os-7-1-available-now/?ref=news.itsfoss.com) to dive deeper into this release. ## 📥 Download elementary OS 7.1 As elementary OS is a '**pay-what-you-can**' distro, you can head over to the [official website](https://elementary.io/?ref=news.itsfoss.com) to purchase it or download it for free. You can also opt for one of the listed hardware retailers on their site that offer the distro pre-installed on laptops and desktops. ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,261
Wolfi:改进云软件供应链的 Linux “非”发行版
https://news.itsfoss.com/wolfi-turns-one/
2023-10-07T19:27:23
[ "Wolfi", "供应链" ]
https://linux.cn/article-16261-1.html
![](/data/attachment/album/202310/07/192722wdzz199535h4c983.jpg) > > Wolfi,这个有趣的项目致力于增强软件供应链的安全性,现已走过一载岁月! > > > 这里说的不是 [世界上最小的章鱼](https://en.wikipedia.org/wiki/Octopus_wolfi),而是一款从这个小章鱼那里汲取灵感的 Linux 发行版。 Wolfi 是一个**由社区驱动、以容器为核心的 Linux 发行版**,目的在于保护软件供应链的安全性。创造者([Chainguard](https://www.chainguard.dev/))将其誉为 “**非发行版**”。 Wolfi 的目标是解决构建和分发软件时经常遇到的容器问题。 下面我们一起来回顾下 Wolfi 的历程,以及未来的展望。 ### Wolfi:项目的成就 ? 自从 Wolfi [去年](https://news.itsfoss.com/wolfi-linux-undistro/) 开始启动,它已经取得了长足的进步,例如 **在 Wolfi 的仓库中具有超过 1300 个包配置** ,并且在 Wolfi 的索引中拥有 **超过 18000 的软件包**。 **有 60 名贡献者**参与了这个项目 ,在过去的一年中, **超过 4400 个拉取请求已经成功地合并了** 到 Wolfi 在 [GitHub](https://github.com/wolfi-dev) 上的仓库中。 此外,他们还保证了 80% 的时间内, 在 GitHub 项目中的 **软件包更新间隔少于 24 小时** ,并且还添加了如 [Docker Scout](https://docs.docker.com/scout/) 、[Snyk](https://snyk.io/) 、[Wiz](https://www.wiz.io/) 等漏洞扫描工具。 由于 Wolfi 采用了 [滚动发布](https://itsfoss.com/rolling-release/) 模式,因此它还致力于为新发现的 [CVE](https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures) 快速提供修复。 综上,这些成就使得他们在以下方面实现了技术创新: * 为所有 Wolfi 软件包构建了 64 位 ARM 版本。 * 对 Go 和 Java 实现了全源引导。 * 引入了 [Rustls](https://github.com/rustls/rustls) TLS 库,用于处理内存安全漏洞。 * 分发了一个名称为 “[wolfi-act](https://github.com/wolfi-dev/wolfi-act)” 的新项目,让 Wolfi 包能在 GitHub 操作中动态使用。 你可能会好奇:**未来的计划是什么?** 好吧,Wolfi 的开发团队希望它能发展成为一个**由社区驱动的项目**,并有望成为人们最信赖的容器化工作负载发行版。他们还期望 **广大开发者都能充分利用 Wolfi 的全部潜力,解决各种问题**。 此外,他们还分享了一个 Wolfi 的使用案例: > > 在当前应用中,Wolfi 的一个清晰的示例是 [Chainguard Images](https://www.chainguard.dev/chainguard-images) —— 这正是我们开始构建该项目的原因。Chainguard Images 只是 Wolfi 实现的许多解决方案之一,我们鼓励更多的用户和社区去探寻 Wolfi 所能搭建出的可能性。 > > > 根据他们的新闻发布,他们还提到,在不久的将来 **将为 Rust 和其他语言生态系统加入全源引导**。 ? 你是否有过用 Wolfi 的经验?你对它的体验是如何的? --- via: <https://news.itsfoss.com/wolfi-turns-one/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Wolfi has turned one! I am not talking about the [world's smallest octopus](https://en.wikipedia.org/wiki/Octopus_wolfi?ref=news.itsfoss.com), but a Linux distro taking inspiration from the little one. It is **a community-driven, container-focused Linux distribution** designed to secure the software supply chain. The creators ([Chainguard](https://www.chainguard.dev/?ref=news.itsfoss.com)) call it an “**Undistro**”. Wolfi aims to deal with the shortcomings of containers, primarily used to build and ship software. Let's take a look at its journey so far, and what's in store for the future. **Suggested Read **📖 [Wolfi is a Linux Un(distro) Built for Software Supply Chain SecurityWolfi is a Linux undistro that focuses on resolving security issues with the software supply chain. Explore more here.](https://news.itsfoss.com/wolfi-linux-undistro/)![](https://news.itsfoss.com/content/images/2022/09/wolfi-distro-software-supply-chain-security.png) ![](https://news.itsfoss.com/content/images/2022/09/wolfi-distro-software-supply-chain-security.png) ## Wolfi: Project's Achievements 🐙 ![a banner with the wolfi logo](https://news.itsfoss.com/content/images/2023/09/Wolfi.png) Since Wolfi began its journey [last year](https://news.itsfoss.com/wolfi-linux-undistro/), it has come a long way, with **over 1,300 package configs housed in the Wolfi repo** and **over** **18,000 packages in the Wolfi index**. **60 contributors **have been involved with this project, with **more than 4,400 pull requests being merged** into the Wolfi repo on [GitHub](https://github.com/wolfi-dev?ref=news.itsfoss.com) over the past year. They have also achieved **a solid package update interval of less than 24 hours**, 80 percent of the time on their GitHub projects, with **support for vulnerability scanning tools** such as [Docker Scout](https://docs.docker.com/scout/?ref=news.itsfoss.com), [Snyk](https://snyk.io/?ref=news.itsfoss.com), [Wiz](https://www.wiz.io/?ref=news.itsfoss.com), and more. As Wolfi follows a [rolling release](https://itsfoss.com/rolling-release/?ref=news.itsfoss.com) approach, it also worked on delivering fixes to newly found [CVEs](https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures?ref=news.itsfoss.com) quickly. All of these achievements allowed them** to pioneer some key technical innovations** that include: - Building 64-bit ARM versions of all Wolfi packages. - Implementation of full-source bootstrapping for Go and Java. - Introduction of the [Rustls](https://github.com/rustls/rustls?ref=news.itsfoss.com)TLS library for handling memory safety vulnerabilities. - A new project called ' [wolfi-act](https://github.com/wolfi-dev/wolfi-act?ref=news.itsfoss.com)' that leverages Wolfi packages to be used dynamically within GitHub actions. You're maybe wondering: **what does the future entail?** Well, the folks behind Wolfi want it to improve it as **a community-driven project** that can someday become the most trusted distro for containerized workloads. With hopes that **builders everywhere can make use of Wolfi's full potential** to solve various problems. Furthermore, they share about a use-case of Wolfi: One clear use case of Wolfi in practice today is[Chainguard Images]–which is why we set out to build the project. Chainguard Images is just one of the solutions Wolfi has enabled and we encourage more users and the community to explore what's possible to build with Wolfi for years to come. As per their press release, they also mention that the **full-source bootstrapping for Rust and other language ecosystems will be added in the near future**. *💬 Have you used Wolfi before? How was your experience with it?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,263
Ubuntu 与 Kubuntu:哪一个更适合你?
https://itsfoss.com/ubuntu-vs-kubuntu/
2023-10-08T10:47:00
[ "Ubuntu", "Kubuntu" ]
https://linux.cn/article-16263-1.html
![](/data/attachment/album/202310/08/104715hv9msvt1segmozs4.jpg) > > 对于 Ubuntu 和其相关版本如 Kubuntu 的选择可能会令人迷惑。那就让我们简化这个选择过程吧。 > > > Ubuntu 是桌面用户最选择的 Linux 发行版。其特色是一个定制的 GNOME 桌面,可以提供流畅的用户体验。振奋人心! 而另一方面,Kubuntu 是 [Ubuntu 发行版家族](https://itsfoss.com/which-ubuntu-install/) 中的一员,特色在于其 **KDE Plasma 桌面**。 本质上,这两种发行版非常类似,主要区别在于 [桌面环境](https://itsfoss.com/what-is-desktop-environment/)。 *那么,它二者有何明显不同点?是否一个比另外一个更好?对于你来说,何种发行版更为适合?* 接下来,我们将比较下它们之间的主要不同,并提供一些基本信息以助你做出选择。 > > ? 本篇文章的对比依据是 Ubuntu 23.04 以及 Kubuntu 23.04。随着未来版本的发布,可能会有一些变动,我们也会持续进行更新。 > > > ### 桌面环境 Ubuntu 的特色在于使用了 [GNOME](https://www.gnome.org/) 桌面的定制外观。对于新的 Linux 用户来说,这个布局独特且易用。 ![Ubuntu 23.04 主屏幕截图](/data/attachment/album/202310/08/104749utsnetjmymr8f4z4.jpg) 它并不与 Fedora Linux 的原生 GNOME 体验完全相同。Ubuntu 的桌面环境体验经过了一些改动。 Kubuntu 提供了原生的 [KDE Plasma](https://kde.org/plasma-desktop/) 体验。对于从 Windows 平台转换来的用户,布局会感到相当熟悉,包含开始菜单、系统小工具等等。 ![Kubuntu 23.04 截图](/data/attachment/album/202310/08/104834ucvzpvr9epamqv6e.jpg) 如果你尝试过任何其他带有 KDE Plasma 桌面的发行版,其体验应该差不多。 它们都是一些极为出色的 [桌面环境](https://itsfoss.com/best-linux-desktop-environments/),所以,你基于各种布局、定制性和特性选择它们中的哪一个都没有什么问题。 为了进行更多的参考,下面是 Ubuntu 的登录页面所呈现的样子: ![](/data/attachment/album/202310/08/104750ey5may4q5c5z0qgy.jpg) 接下来,我们看一下带有 X11 桌面会话的 Kubuntu 登录屏幕: ![](/data/attachment/album/202310/08/104750eryitrhx1eajn3to.jpg) 此外,我为你提供了一份详细的指南,如果你想深入研究,可以参考这份 [KDE 与 GNOME](https://itsfoss.com/kde-vs-gnome/) 的对比指南: > > **[KDE 与 GNOME:Linux 桌面终极之选](https://itsfoss.com/kde-vs-gnome/)** > > > > > ? 根据发行版版本,例如 [长期支持版](https://itsfoss.com/long-term-support-lts/)(LTS)还是非 LTS,桌面环境及特征集会有所不同。 > > > 举例来说,如果你选择像 Ubuntu 23.10 或 Kubuntu 23.10 这样的非 LTS 版本,你可以获得更新的桌面版本 —— [GNOME 45](https://news.itsfoss.com/gnome-45/) 或 [KDE Plasma 5.27](https://news.itsfoss.com/kde-plasma-5-27-release/)。 > > > 而对于 Ubuntu 22.04 LTS,提供的则是稍旧一些的桌面版本—— [GNOME 42](https://news.itsfoss.com/gnome-42-features/) 或 [KDE Plasma 5.24](https://news.itsfoss.com/kde-plasma-5-24-lts-release/)。 > > > ### 软件管理 由于 Ubuntu 和 Kubuntu 其核心都是 Ubuntu(或 Debian),因此可以期待在这两个版本上安装同样的应用程序。 但是,你用来管理或安装应用程序的应用商店在每个版本中都是不同的。 ![](/data/attachment/album/202310/08/104750khlsfl6sfxf6b8h5.png) 对于 Ubuntu,它使用 <ruby> 软件中心 <rt> Software Center </rt></ruby> 或者 <ruby> Ubuntu 应用中心 <rt> Ubuntu App Center </rt></ruby>(从 [Ubuntu 23.10](https://news.itsfoss.com/ubuntu-23-10/) 开始的新版本),默认集成了 Snap。因此,如果你更倾向于使用 Snap 而不是 Flatpak,Ubuntu 就可以提供以无缝的安装体验。 ![](/data/attachment/album/202310/08/104751uf7qinrq5ewfjkoi.png) 想要使用 Flathub 的包,你可以按照我们的 [Flatpak 使用指南](https://itsfoss.com/flatpak-guide/) 进行操作,但 Ubuntu 的软件管理器并未提供整合。 提及 Kubuntu,你得到的软件管理器是 “<ruby> 发现 <rt> Discover </rt></ruby>” 应用。你也可以从软件仓库以及 Snap 包中安装应用。 ![](/data/attachment/album/202310/08/104751vp6g0zonmngom89d.png) 与 Ubuntu 的软件商店相较,“发现”应用在轻松整合 Flatpak 方面更具**灵活性**。 你只需多击几下,就可以在设置菜单中通过 **Flatpak 后端插件** 在“发现”应用里列出来自 Flathub 的应用。 ![](/data/attachment/album/202310/08/104752xgem6g3t83g34nen.jpg) ### 软件与功能点差异 有些用户更注重在特定发行版中能做什么,以及开箱即用的软件工具。 ![Kubuntu 中的屏幕截图操作](/data/attachment/album/202310/08/104752sd0d86xk8xi9d0dx.jpg) 他们并不在意桌面布局或锁屏和登录屏幕的界面如何。他们只在乎**功能特性**,就如你在这里看到的图片展示的那样。 ![Ubuntu 的快速切换菜单](/data/attachment/album/202310/08/104752oww3s6dcwb4hldkw.jpg) > > ? 可用的功能会依据发行版的版本和软件而有所不同。然而,我相信,一些让它们各自独特之处值得你了解,这些可能有助于你的选择。 > > > 一些重要的功能点如下: * Kubuntu 的默认屏幕截图工具提供了注释和编辑功能,而 Ubuntu 则没有这功能。 * Kubuntu 的文件管理器比 Ubuntu 的包含更多的特性。 * 作为桌面环境选项,Kubuntu 提供了更多的预装应用。 * 相比于 Ubuntu,Kubuntu 提供了更多的外观定制选项。 * Kubuntu 默认使用 KDE “<ruby> 连接 <rt> Connect </rt></ruby>” 应用连接你的移动设备。你也可以在 Ubuntu 进行相同的安装以获取这个功能。 * 在 Ubuntu 上,简易化并自动化的工作空间增加功能易于改进工作流。你可以在 Kubuntu 上增加虚拟桌面,但需手动操作。 * Ubuntu 具有快捷切换到深色/浅色模式的功能。 * Ubuntu 针对经常被海量选项所困扰的用户,更加注重简单易用的操作方式。 ### 发布周期 如 Ubuntu 18.04 和 Ubuntu 22.04 这类的 Ubuntu LTS 版本,会在其发布之日后的**五年**内接受软件更新和安全补丁。 此外,如果你希望长期使用同一版本,你可以选择开通 [Ubuntu Pro 订阅](https://ubuntu.com/pro)(个人使用免费),它将为你提供**额外五年的更新支持**。 而对于非 LTS 版本,如 Ubuntu 22.10 和 Ubuntu 23.04,则会提供**九个月的维护更新**。 > > ? 对大部分用户来说,我们推荐使用 LTS 版本。只有在你准备好在九个月之后升级你的系统,以获取最新最好的软件时,才推荐尝试非 LTS 版本。 > > > 如果你对这些术语感到不熟,我建议你阅读我们的一些资源,深入理解发布周期: * [Ubuntu 的生命周期终止期指的是什么?](https://itsfoss.com/end-of-life-ubuntu/) * [长期支持版是什么意思?](https://itsfoss.com/long-term-support-lts/) 总的来说,选择 Ubuntu,你可以获得**相当长的支持选项**。 大部分用户可能会认为,由于 Kubuntu 是 Ubuntu 的官方发行版,它们应该具有相同的更新周期。遗憾的是,**并非如此**。 在 Kubuntu 中,其**长期支持版从发布之日起仅支持三年**。非长期支持版的更新维护期仅为**九个月**。并无任何扩展软件更新期的选项。 ### 安装 不论是 Ubuntu 还是 Kubuntu,其安装过程都相当直观且易于理解。 你将注意到的唯一不同之处在于用户界面及其一些选项。 以下是 Kubuntu 的截图: ![](/data/attachment/album/202310/08/104752yw7v566l5nr7cahz.jpg) ![](/data/attachment/album/202310/08/104752na4x6z686k646kd4.jpg) 尽管它们的界面有所不同,但安装过程都极其简便。 这里是 Ubuntu 的一个安装界面截图: ![](/data/attachment/album/202310/08/104752jyxqb5x9ll0959dl.png) ![](/data/attachment/album/202310/08/104752ahy27t27bdd1dr9y.png) Ubuntu 近期发布的版本极大地改进了安装器的用户体验。所以,用户在点击步骤进行安装时,可能会觉得更加简洁明了。 例如,安装 Ubuntu 后,你或许可以立即选择深色或浅色模式,然而在 Kubuntu 中这样的选项并不可用。 ![](/data/attachment/album/202310/08/104753rju7ku4ouu90uj0h.png) ### 系统资源使用 这里不会有赢家或输家,但基本上,Kubuntu 上的桌面环境(KDE Plasma)更轻量也更注重性能。 Ubuntu 的 GNOME 则设计得直观,为你提供了顺畅的用户体验。 举个例子,基于我的测试,Ubuntu 在启动后会马上占用大约 **1.5 GB 的内存**: ![](/data/attachment/album/202310/08/104753w82yo4ya92b4dd7y.png) 而在 Kubuntu 中,启动后占用的内存约为 1.2 GB: ![](/data/attachment/album/202310/08/104753nhyyaxrynqryhdpu.png) 没错,Kubuntu 的系统监控看起来功能稍多一些。但这就是全部了。 因此,在资源使用方面,虽然你在纸面上可能观察到明显的差异,但在实践中,它可能根本不会对你产生影响。 ### 你应该选择哪个? 在选择一个适合日常使用的 Linux 发行版时,你的工作流以及布局都是需要考虑的因素。 **如果你熟悉 Windows 平台,Kubuntu 应是一个好选择**(甚至是从 Windows 平台转换过来的用户)。 **如果你理解并乐意接受 GNOME 的布局,Ubuntu 可以为你提供简单且现代的体验。** 但不管是哪种情况,**如果你希望能有高度的可定制性和大量实用工具,Kubuntu 会是一个理想的选择**。反而,**如果你更偏爱简约清晰的布局,选择 Ubuntu 一定不会错**。 ? 你更偏好哪一个 Linux 发行版,是什么让你做出这样的选择呢? *(题图:MJ/dbde3529-ecea-4411-a53e-6e75b4e388db)* --- via: <https://itsfoss.com/ubuntu-vs-kubuntu/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Ubuntu is the most popular Linux distribution for desktop users. It features a customized GNOME desktop to provide a seamless user experience. Exciting On the other hand, Kubuntu is one of the [Ubuntu flavours](https://itsfoss.com/which-ubuntu-install/) featuring the **KDE Plasma desktop**. At its core, both distributions are similar, with the [desktop environment](https://itsfoss.com/what-is-desktop-environment/) as the striking difference. *What exactly are the differences? Is one of them better than the other? What is the perfect distro for your use-case?* Here, we shall highlight the key differences along with essentials to help you pick one. ## Desktop Environments Ubuntu features a customized look using the [GNOME](https://www.gnome.org) desktop. The layout is unique for new Linux users, and yet easy to use. ![ubuntu 23.04](https://itsfoss.com/content/images/2023/10/ubuntu-23-04-home-with-wallpaper.jpg) It is not the same as the vanilla GNOME experience you get with the Fedora Linux. The entire desktop environment experience of Ubuntu is tweaked. Kubuntu comes baked with a vanilla [KDE Plasma](https://kde.org/plasma-desktop/) experience. The layout could seem familiar to users switching away from Windows, with a start menu, system widgets, and more. ![kubuntu 23.04](https://itsfoss.com/content/images/2023/10/kubuntu-23-04-home.png) If you have tried any other distribution with KDE Plasma desktop, it will feel more or less the same. Both are some of the [best desktop environments](https://itsfoss.com/best-linux-desktop-environments/) available. So, you cannot go wrong picking one based on their layout, customizability, and features. To give you some more idea, here's how the log-in screen for Ubuntu looks like: ![ubuntu 23.04 log in screen](https://itsfoss.com/content/images/2023/10/ubuntu-log-in-screen.jpg) And, here's Kubuntu login screen with an X11 desktop session: ![kubuntu 23.04 login](https://itsfoss.com/content/images/2023/10/kubuntu-login.jpg) Moreover, I got you! We have a detailed guide to help you compare [KDE vs GNOME](https://itsfoss.com/kde-vs-gnome/) if you want to dive in deep: [KDE vs GNOME: What’s the Ultimate Linux Desktop Choice?Curious about the desktop environment to choose? We help you with KDE vs GNOME here.](https://itsfoss.com/kde-vs-gnome/)![](https://itsfoss.com/content/images/wordpress/2022/02/gnome-vs-kde.png) ![](https://itsfoss.com/content/images/wordpress/2022/02/gnome-vs-kde.png) [Long-Term Support](https://itsfoss.com/long-term-support-lts/)(LTS) or non-LTS; the desktop experience and feature-set will differ. For instance, with a non-LTS release like Ubuntu 23.10 or Kubuntu 23.10, you can expect a more recent desktop version [GNOME 45](https://news.itsfoss.com/gnome-45/)or [KDE Plasma 5.27](https://news.itsfoss.com/kde-plasma-5-27-release/). And, with Ubuntu 22.04 LTS, you get a slightly older desktop version [GNOME 42](https://news.itsfoss.com/gnome-42-features/)or [KDE Plasma 5.24](https://news.itsfoss.com/kde-plasma-5-24-lts-release/). ## Software Management Considering both are Ubuntu (or Debian-based) at its core, you can expect to install the same applications on both distributions. However, the store that you will be using to manage or install the apps in the distro is different. ![ubuntu software center](https://itsfoss.com/content/images/2023/10/ubuntu-23-04-software-center.png) For Ubuntu, it is the **Software Center** or the **Ubuntu App Center **(in newer versions starting from [Ubuntu 23.10](https://news.itsfoss.com/ubuntu-23-10/)), which includes Snap integration by default. So, if you prefer using Snaps over Flatpak, Ubuntu can give you a seamless experience installing them. ![rocket chat app info in ubuntu software center](https://itsfoss.com/content/images/2023/10/ubuntu-softwar-center-app.png) To use packages from Flathub, you can follow our [guide on using Flatpak](https://itsfoss.com/flatpak-guide/), but there are no baked in integration options with Ubuntu's software manager. When it comes to Kubuntu, you get "**Discover**" as the software manager. You get applications from the repositories and Snap packages as well. ![screenshot of kde plasma discover](https://itsfoss.com/content/images/2023/10/kde-discover.png) Compared to Ubuntu's software store, Discover is a bit **more flexible with an available add-on to easily integrate Flatpak**. All you need is a few clicks to list apps from Flathub on Discover with the **Flatpak back-end add-on** under the Settings menu. ![kubuntu discover](https://itsfoss.com/content/images/2023/09/kubuntu-discover-23-04.jpg) **Suggested Read 📖** [Flatpak vs. Snap: 10 Differences You Should KnowFlatpak vs Snap, know the differences and gain insights as a Linux user to pick the best.](https://itsfoss.com/flatpak-vs-snap/)![](https://itsfoss.com/content/images/2023/01/snap-vs-flatpak.png) ![](https://itsfoss.com/content/images/2023/01/snap-vs-flatpak.png) ## Software and Feature Differences I know, some users care about what they can do in the distro, and the software utilities available out-of-the-box. ![kde spectacle app](https://itsfoss.com/content/images/2023/10/kde-spectacle.jpg) They aren't concerned about the layout of the desktop or the way the lock screen and log-in screen look like. Just **features**, like the ones shown in the images here. ![quick toggle on ubuntu](https://itsfoss.com/content/images/2023/10/quick-toggles-on-ubuntu.jpg) Some important ones include: - The default screenshot tool on Kubuntu provides annotation and edit capabilities, Ubuntu does not offer this. - The file manager on Kubuntu has more features than the one on Ubuntu. - Kubuntu offers more pre-installed apps as part of its desktop environment offerings. - More appearance tweaks available on Kubuntu compared to Ubuntu. - Ability to connect to your mobile on Kubuntu using its KDE Connect app by default. You can install the same app on Ubuntu for the functionality. - Adding a workspace to improve workflow is easy and automated on Ubuntu. You can add 'Virtual Desktops' on Kubuntu, but you will have to add them manually. - Quick toggle to use dark/light mode on Ubuntu. - Ubuntu focuses on a simpler approach for users who often get overwhelmed by a plethora of options displayed. [Icedrive - Next-Generation Cloud Storage - Get 10GB FreeNext-Generation cloud storage with Icedrive. Get started right away with a massive 10GB free space.](https://icedrive.net/?pt=q7io5geg9t)![](https://icedrive.net/frontend/img/icon-sm.png) ![](https://icedrive.net/frontend/img/icon-sm.png) Partner Link ## Release Cycle Ubuntu LTS editions like Ubuntu 18.04 and Ubuntu 22.04 receive software updates and security fixes for **five years** (from its release date). Furthermore, if you want to keep using the same version for longer, you can opt for [Ubuntu Pro subscription](https://ubuntu.com/pro) (free for personal use) which extends** five more years of updates.** And, the non-LTS versions like Ubuntu 22.10 and Ubuntu 23.04 are limited to **nine months of maintenance updates**. If you are new to these terms, I suggest you go through some of our resources to understand the release cycle in detail: In a nutshell, with Ubuntu, **you get a pretty long support option**. Most users believe that just because Kubuntu is an official Ubuntu flavour, it will also receive updates for the same duration as Ubuntu. **Unfortunately, that is not true.** With Kubuntu, the **LTS editions are supported for three years** from release. And, the non-LTS releases are maintained for **nine months**. There are no options to extend the software update duration. ## Installation The installation is easy and similar for both the distributions. The only differences you will notice is with the user interface, and a couple of options. Here are a couple of screenshots for Kubuntu: ![kubuntu installation screenshot setting the timezone](https://itsfoss.com/content/images/2023/10/kubuntu-installation-1.jpg) ![kubuntu installation setting up disks](https://itsfoss.com/content/images/2023/10/kubuntu-installation.jpg) It is incredibly easy to get both of them installed, no matter how they look. Here's how Ubuntu installation looks with their modern installer: ![ubuntu installation screenshot setting up timezone](https://itsfoss.com/content/images/2023/10/8-location.png) ![ubuntu installation screenshot setting up disk](https://itsfoss.com/content/images/2023/10/6-Disk-layout.png) Canonical's Ubuntu has improved the user experience for its installer in the recent releases. So, a user might find it a tad bit easier (with a modern touch) to click through the steps to install it. For instance, you may get the option to choose between dark/light mode right after installing Ubuntu, but not Kubuntu. ![ubuntu installation screenshot choosing dark and light theme](https://itsfoss.com/content/images/2023/10/10-light-and-dark-mode.png) ## System Resource Usage I will not declare a winner here, but in general, the desktop environment (KDE Plasma) on Kubuntu is a lightweight and performance-focused. GNOME on Ubuntu is tailored to give you an intuitive user experience. To give you an idea, Ubuntu, right after boot, takes **1.5 GB of memory **when I checked using its system monitor: ![ubuntu system resources screenshot](https://itsfoss.com/content/images/2023/10/ubuntu-resources.png) When I look at the same thing on Kubuntu, it occupies 1.2 GB of memory right after boot: ![kubuntu system monitor screenshot](https://itsfoss.com/content/images/2023/10/kubuntu-system-resources.png) Sure, Kubuntu's system monitor looks a bit more functional. And, that's about it. So, in terms of resource usage, you might notice differences on paper, but practically, it may not bother you at all. ## What Should You Pick? When it comes to selecting a Linux distribution to daily drive, you should always consider your workflow and the layout. **Kubuntu should be a nice choice for users familiar with the Windows platform** (or switching away from it). **Ubuntu can be a simple and modern experience** if you do not have a problem getting comfortable with its layout. In either case, if you are looking for** customizability and more utilities, try Kubuntu**.** **Considering you **prefer** **simplicity, you cannot go wrong with Ubuntu**. 💬* What is your favorite Linux distribution among the two and why?*
16,264
使用 Gamerzilla 分享你的游戏成就
https://fedoramagazine.org/share-your-game-achievements-with-gamerzilla/
2023-10-08T19:17:49
[ "Gamerzilla" ]
https://linux.cn/article-16264-1.html
![](/data/attachment/album/202310/08/191724uj7mmjw9ccd7pcl9.jpg) Gamerzilla 是一个开源游戏成就系统,用于存储和共享你的游戏成就。游戏使用 libgamerzilla 轻松添加成就。Gamerzilla 库是用 C 编写的,但也有其他语言的绑定。 两年前,我描述了如何设置 [Gamerzilla 服务器](/article-15389-1.html)。除了 .net 实现之外,还可以使用 php 和 python 实现。但你可能不想运行自己的服务器。这里介绍一个公共服务器和 Gnome 界面。 ### 公共服务器 我的网络服务器现在托管了一个启用了公共注册的 [Gamerzilla](https://identicalsoftware.com/trophy/) 实例。要创建帐户,请单击右上角的 “<ruby> 签到 <rt> Sign In </rt></ruby>” 链接。然后单击 “<ruby> 登录 <rt> Login </rt></ruby>” 按钮旁边的 “<ruby> 注册 <rt> Register </rt></ruby>” 链接。 用户帐户收集的信息非常少。只需输入用户名和密码。你不需要输入你的真实姓名或电子邮件地址。因此,忘记密码没有实现。 账户一开始是不可见的。如果你希望公众在登录后看到你的成就,请单击页面右上角你的用户名,然后选择 “<ruby> 设为可见 <rt> Make Visible </rt></ruby>”。新用户必须经过批准才能上传成就。目前没有显示你是否获得批准的指示。 ### 获得成就 在获得第一个成就之前,你需要使用以下命令安装 Gamerzilla GNOME Shell 扩展: ``` sudo dnf install gnome-shell-extension ``` 安装后,你需要注销并重新登录。需要使用以下命令启用扩展: ``` gnome-extensions enable [email protected] ``` 游戏控制器图标出现在 GNOME Shell 的顶部栏中。 单击控制器图标并选择 “<ruby> 首选项 <rt> preferences </rt></ruby>”。在出现的屏幕上输入你的 Gamerzilla 网址,包括尾部斜杠,但不包含 UI 的“奖杯”地址。如果使用我的服务器,该值将为 `https://identicalsoftware.com/`。填写你的用户名和密码。单击保存。默认情况下启用自动连接。如果你不想始终连接,请禁用此功能。 ![Gamerzilla Controller menu](/data/attachment/album/202310/08/191751k2gyzpmph5p5q5lt.png) 不幸的是,一个错误阻止了该 Shell 扩展立即工作。你需要注销并重新登录。解决这个问题是当务之急。 ### 目前支持的游戏 Fedora 仓库中的多个游戏支持 Gamerzilla 成就。如果你想买一个来尝试一下,我建议试试 Shippy 1984、Seahorse Adventures 或 Anagramarama。一旦你完成一个级别,Seahorse Adventures 就会存储一些进度。如果你玩 Super Tux Kart,你可能已经取得了成就。只需启动游戏即可同步之前完成的任何成就。当成就完成时,Gamerzilla 不会显示任何通知,但游戏可能会自行实现。 ### 更进一步 除了修复第一次连接的错误之外,我还想要一个本地浏览器来查看成就。这样你就可以查看所有游戏成就,而无需强制上传它们。 成就确实有消极的一面。有些人觉得有必要完成它们。如果成就非常困难,这可能会导致负面的游戏体验。我理解这种担忧,但有些人也喜欢这些方面。更重要的是,为了吸引和留住玩家,我觉得开源游戏需要一个游戏成就系统。 我们需要更多游戏来实现 Gamerzilla 成就。我们需要玩家表现出对这个系统的支持。我继续为我的游戏和我尝试的其他开源游戏添加成就。 *(题图:MJ/32ae3f54-b319-4db7-b874-eeacd1dcc4d2)* --- via: <https://fedoramagazine.org/share-your-game-achievements-with-gamerzilla/> 作者:[Dennis Payne](https://fedoramagazine.org/author/dulsi/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Gamerzilla is an open source game achievement system that stores and shares your game achievements. Games use libgamerzilla to easily add achievements. The Gamerzilla library is written in C but bindings exist for other languages. Two years ago I described how to setup a [Gamerzilla server](https://fedoramagazine.org/open-source-game-achievements/). In addition to the .net implementation, php and python implementations are available. But you probably don’t want to run your own server. Here is an introduction to a public server and the Gnome interface. ## Public server My web server now hosts an instance of [Gamerzilla](https://identicalsoftware.com/trophy/) with public registration enabled. To create an account click on the *Sign In* link on the top right corner. From there click the *Register* link next to the *Login* button. The user accounts collect very little information. Simply enter a username and password. You do not need to enter your real name or email address. As a result, forgotten password is not implemented. Accounts start as invisible. If you want the public to see your achievements after login, click on your username on the top right of the page and select *Make Visible*. New users must be approved before they can upload achievements. Currently no indication appears whether you are approved or not. ## Getting an achievement Before you get your first achievement, you need to install the Gamerzilla gnome shell extension with: sudo dnf install gnome-shell-extension After installation you will need to logout and log back in. The extension needs to be enabled with the the following: gnome-extensions enable [email protected] The game controller icon appears in the top bar of the gnome shell. Click on the controller icon and select *preferences*. On the resulting screen enter your gamerzilla url including the trailing slash but without the ‘trophy’ destination for the UI. If using my server, the value will be ‘*https://identicalsoftware.com/* ‘. Fill in your username and password. Click on save. By default Automatic Connect is enabled. If you don’t want to always connect disable this. ![](https://fedoramagazine.org/wp-content/uploads/2023/09/gamerzilla_preferences.png) ![](https://fedoramagazine.org/wp-content/uploads/2023/09/gamerzilla_preferences.png) Unfortunately a bug prevents the shell extension from working right away. You need to logout and log back in again. Fixing this is high priority. ## Currently Supported Games Several games in the Fedora repository support Gamerzilla achievements. If you want to get one to try it out, I suggest Shippy 1984, Seahorse Adventures, or Anagramarama. Seahorse Adventures will store some progress as soon as you complete a single level. If you play Super Tux Kart, you may already have achievements. Simply starting the game will synch any previous completed achievements. Gamerzilla does not display any notification when achievements complete but games may implement it on their own. ## Going Forward Besides fixing the bug with connecting the first time, I want a local browser for achievements. That way you can view all your game achievements without forcing you to upload them. Achievements do have negative aspects. Some people feel compelled to complete them. This can lead to negative play experience, if the achievements are very difficult. I understand this concern but some people enjoy these aspects as well. More importantly, to attract and retain players, I feel open source games need a game achievement system. We need more games to implement Gamerzilla achievements. We need players to show their support for the system. I continue to add achievements to my games and other open source games I try out. ## Darvond So this is worthless to anyone who doesn’t have or refuses to use Gnome? Or did the writer conveniently forget that other options exist? Because as someone currently in an OpenBox session, I’m feeling rather disregarded. ## Dennis Payne It’s not that I conveniently forgot that other options exist. The original plan was not to add the functionality to a game launcher but I couldn’t get Lutris or Gnome Games interested. I did code it up for GameHub but the author has a bigger vision and didn’t want to merge my change. The gnome shell extension became a solution to get it into people’s hands. I only have so much time to devote to this project. Gamerzilla has a hubzilla addon, a react web interface with 3 different backends, the new gnome shell extension and a bunch of games updated to use the system. Gnome happens to be what I use so that is what I decided to implement. ## Jonas well, i guess anyone is free to port it to KDE or anyother plataform with equivalent extension like system like gnome, you should never expect a dev to support everything since it’s a lot of work to do, either DIY or wait. ## IceGuye Ya, I am currently in a server with no X11, no Wayland, no discrete graphic card, no 3D acceleration. I’m feeling rather disregarded because the writer just simply ignores anyone who doesn’t play games. ## Augustus Any plans to port it to KDE? Would you want some help from a system-architecture / Module Developer for C/C++ and Assembly as my main works, but I also know Java, C# and now mostly using Python unless developing modules, etc,. I have over 15 years experience and there’s not one single language i don’t know to the fullest extent. Gnome development I am mediocre in, as only had a few years working experience. All the best, A F. ## Dennis Payne I’d love to have it ported to KDE. I don’t know a lot about KDE. Is there an equivalent extension capability? ## Augustus Edit: Sorry, forgot to mention that KDE development i have over ten years experience with though. ## slope So this is worthless to anyone who doesn’t have or refuses to use Gnome? ## Dennis Payne No. You can still create an account and use the command line gamerzillaserver command to relay achievements. It’s not as nice as the new shell extension but unfortunately I only have so much time. If anyone develops extensions for other desktops I’ll gladly add information on the gamerzilla web site. ## Kyle Gospodnetich Hey there, thanks for making this! I added it to the GNOME builds of Bazzite (https://bazzite.gg) for anyone that would like to use it. PS: I’m getting a 500 error when registering for your instance, would love to do so 🙂 ## Dennis Payne Looks like you get a 500 error if you register a name twice. It doesn’t display anything on success so I suspect you successfully created an account but then tried to create it again. I’ll see if I can improve that experience when I have a chance. ## FeRDNYC (Frank Dana) Missed opportunity to call the extension “GNOMErzilla”, tho.
16,266
Linux 中的 ls 命令使用教程
https://itsfoss.com/ls-command/
2023-10-08T20:02:41
[ "ls", "命令" ]
https://linux.cn/article-16266-1.html
![](/data/attachment/album/202310/08/200201p8sfy8shyyyspxxx.jpg) > > ls 属于 Linux 中那些简单又常用的命令之一。在本教程里,你将学到如何高效使用它。 > > > 对我个人而言,`ls` 无疑是 [最常被使用的 Linux 命令](https://itsfoss.com/essential-ubuntu-commands/),因为我们总是借助它 [列出目录内的内容](https://itsfoss.com/list-directory-content/) 来检验上一步操作的结果。 `ls` 命令是 “<ruby> 列表 <rt> List </rt></ruby>” 的缩写,其功能就是列出你指定目录下的所有内容。 我将在本教程中,通过一系列的实例,带你一步步掌握 `ls` 命令的使用。 另外也会给出一些练习题,以检验你的学习成果。 ### 如何运用 ls 命令 要使用 `ls` 命令,你只需遵循以下简单的命令格式: ``` ls [OPTIONS] Targeted_Directory ``` 这里, * `[OPTIONS]`:用来改变 ls 命令的默认行为。 * `Targeted_Directory`:在这里输入目录名或目录的绝对路径。 你可能会想,如果没有任何选项地使用 `ls` 命令会发生什么。为了回答这个问题,我在当前工作目录中使用了 `ls` 命令: ![使用 ls 命令列出工作目录的内容](/data/attachment/album/202310/08/200241vtij69midd88iq2i.png) 如你所见,它列出了当前工作目录中所有可用的目录和文件。但你可以做的远不止于在当前工作目录中获取名称和文件。 接下来让我给你展示一下。 #### 1、列出带有所有权的文件和目录 `ls` 命令的重要用途之一就是查出具体的文件或目录的权限以及所有权信息。 这就需要你在使用 `ls` 命令时,带上 `-l` 选项(这也被称为长列表格式): ``` ls -l ``` 执行该命令后,你会看到类似的输出: ``` $ ls -lh -rwxrw-r-- 1 sagar sagar 666M Dec 10 18:16 Fedora.iso ``` 注意到我是同时使用了 `–h` 选项吗?我们稍后会详细说明这个。 如果目前为止的输出结果看起来太复杂,那就让我来帮你简化一下: ![利用 ls 命令在 Linux 中解读文件权限和所有权](/data/attachment/album/202310/08/200241v9alyc09cysy9juy.png) 如你所见,每个文本块都有特定的含义,它们分别对应文件拥有者、组和其他用户的各项权限。 对于想对文件权限有更深入理解的朋友,我推荐你阅读 [我们关于 Linux 文件权限的详尽指南](https://linuxhandbook.com:443/linux-file-permissions/)。 #### 2、获取以人类可读的方式显示的信息 默认状态下,文件大小以字节为单位显示,显然不是最佳的查阅方式。那如果想以更易读的方式来得知相同的信息,我们怎么做呢? 其实很简单。你只需使用 `-h` 选项与 `ls` 命令配合: ``` ls -l -h ``` 接下来,我们比较下默认显示状态和可读性更强的显示方式的区别: ![以人类可读的方式通过 ls 命令列出文件](/data/attachment/album/202310/08/200242ji4j4q7zeltjddkd.png) 明显更好了,对吧? > > ? 尽管 `ls` 命令很好地展示了文件大小,但它并不能告诉你文件夹的大小,普遍情况都会显示为 4K(LCTT 译注:这其实是“目录”这个文件所占用的大小,而不是该目录下文件的总计大小。)。如果需要了解文件夹的大小,那么你可以尝试使用 `du` 命令。 > > > #### 3、列出隐藏文件 和其他所有文件管理器一样,`ls` 命令在默认情况下并不会显示隐藏文件(这正是隐藏文件的意义所在,对吧?)。 那么,如果你期望在常规文件之外,一并 [列出隐藏文件](https://itsfoss.com/show-hidden-files-linux/) 呢?只需在使用 `ls` 命令时带上 `-a` 选项就行: ``` ls -a ``` 你会注意到,以 `.` 开头的文件名就是所谓的隐藏文件。 ![用 ls 命令在 Linux 终端列出隐藏文件](/data/attachment/album/202310/08/200242g1zbqvhiboqub4uq.png) > > ? 你还可以使用 `ls -A`,它的功能与 `ls -a` 类似,但它不包括 `.` 和 `..` 这两个目录。 > > > #### 4、递归列出文件 事实上,有 [多种方法可以递归列出文件](https://linuxhandbook.com:443/list-files-recursively/),使用 `ls` 命令就是其中之一。 如果你还不清楚,递归列出文件就是指展示所有子目录中的文件,直到每个子目录的最深层次。 你可以通过使用 `-R` 参数来递归列出文件: ``` ls -R ``` ![在 Linux 中使用 ls 命令递归列出文件](/data/attachment/album/202310/08/200242tstd49xrx5ky9rl2.png) 这种方式实际上为你展示了当前目录的结构,我个人非常喜欢这种方式,但你需要先进行安装。 > > ? 其实你并不需要进入某个目录才能查看其内容,你可以直接通过提供它的绝对路径或相对路径来列出目录内容,比如:`ls /var/log`。 > > > #### 5、在使用 ls 时对文件和目录做区分 通常,不同的颜色就足以区分文件和目录。但是如果你基于某种原因需要给文件和目录添加符号标识,这就有一个办法。 在 `ls` 命令中,使用 `-F` 选项,它会在每个目录名末尾添加一个正斜杠 `/`: ``` ls -F ``` ![使用 ls 命令在文件和目录间做区分](/data/attachment/album/202310/08/200243hzxsur5xt7yffduu.png) #### 6、列出指定扩展名的文件 有些情况下,你可能只希望列出具有特定扩展名的文件,实际上,这是最简单的操作之一。 做到这一点,你无需使用任何选项。只需在星号 `*` 后附上文件扩展名,如 `*.png`,`*.txt` 等: ``` ls *.extension ``` 例如,如果我只想列出 ISO 文件,那么我将使用以下命令: ``` ls *.iso ``` ![列出特定扩展名的文件](/data/attachment/album/202310/08/200243dzqwspuquuz6jqpy.png) #### 7、基于大小对输出内容排序 若希望基于文件大小来对输出内容排序,你需要使用 `-S` 选项,它会以从大到小的方式(降序)列出文件: ``` ls -lhS ``` ![使用 ls 命令基于文件大小排序](/data/attachment/album/202310/08/200243rtc4qu224vtvccc6.png) 相反,如果你想颠倒这个顺序,使得最小的文件首先被列出,你可以利用 `-r` 选项来实现反向排序: ``` ls -lhSr ``` ![使用 ls 命令从小到大排序文件](/data/attachment/album/202310/08/200244y73izpooanph9ii4.png) #### 8、根据日期和时间排序文件 `ls` 命令在列出的内容中包括文件的修改时间。 如果你希望最新的文件最先被列出,可以使用 `-t` 选项,如下所示: ``` ls -lht ``` ![使用 ls 命令最先列出最新文件](/data/attachment/album/202310/08/200244wyjjwycqcjcc4qcf.png) 你也可以像我前面提到的那样,在这里使用 `-r` 选项进行反转排序。 ``` ls -lrt ``` 这会使得最近修改的文件在列表的底部显示,当目录中存在大量文件,而你希望查看最近被修改过的文件时,这一命令会特别有用。我在解决我的软件项目问题时就经常用到它。 ![使用 ls -lrt 命令](/data/attachment/album/202310/08/200244a0tiz96o5zo7mnt0.png) ### 让我们来总结一下至此你已经学习到的! 下面,我会共享一个表列出本教程中介绍过的一些与 `ls` 命令一起使用的选项: | 命令 | 描述 | | --- | --- | | `ls -l` | 长格式列出文件和目录 | | `ls -lh` | 以人类可读的方式显示信息 | | `ls -a` | 在列出的内容中包括隐藏文件 | | `ls -R` | 递归列出文件 | | `ls -F` | 在目录名后添加正斜杠 | | `ls *.ext` | 列出具有特定扩展名的文件 | | `ls -lS` | 根据文件大小排序 | | `ls -lt` | 根据修改时间排序 | | `-r` | 反转排序顺序(与 `-S` 或 `-t` 结合使用) | ### ?️ 并练习你所学 实践你所学总是一个好主意,这就是我们在每一份终端指南中都试图添加实践部分的原因。 所以,这里有一些关于 `ls` 命令的简单练习: * 列出 `/var/log` 的内容 * [将命令的输出](https://itsfoss.com/save-command-output-to-file-linux/) 保存到名为 `output.txt` 的文件中 * 找出最近的 3 个文件(使用基于时间的排序) * 基于大小显示文件,但排序方式要反转 * 检查是否存在任何隐藏文件 这些练习对你来说会很有帮助。期待之后更多关于 Linux 命令的学习。 如果你是初次接触终端,别忘了关注我们的终端基础系列。 祝你日有进益 ? *(题图:MJ/8fb35776-5192-43ca-b96d-31bbd77c3318)* --- via: <https://itsfoss.com/ls-command/> 作者:[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题:[lkxed](https://github.com/lkxed/) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) In my opinion, the ls command is the [most used Linux command](https://itsfoss.com/essential-ubuntu-commands/) as it is often used to verify the outcome of the previous operation by [listing the directory contents](https://itsfoss.com/list-directory-content/). The ls command stands for a list; all it does is list the contents of the specified directory. In this tutorial, I'll walk you through multiple examples of using the ls command. I will also share some practice questions to test the learnings. ## How to use the ls command To use the ls command, you'd have to follow the simple command syntax: `ls [OPTIONS] Targeted_Directory` Here, `[OPTIONS]` : It is used to tweak the default behavior of the ls command.`Targeted_Directory` : This is where you provide the directory name or the absolute path to the directory. You might wonder what happens when you use the ls command without any options. And to answer that, I used the ls command in my current working directory: `ls ` ![use the ls command to list the contents of the working directory](https://itsfoss.com/content/images/2023/07/use-the-ls-command-to-list-the-contents-of-the-working-directory.png) As you can see, it listed all the directories and files available in the current working directory. But you can do a lot more than just getting the names and files present in the current working directory. Let me show you how. ### 1. List files and directories with ownership One of the primary use of the ls command to find the permissions and ownership of a particular file or a directory. For that you'd have to use the `-l` option (also called long listing) with the ls command: `ls -l` Once you do that, you can expect similar output: ``` sagar@itsFOSS:~$ ls -lh -rwxrw-r-- 1 sagar sagar 666M Dec 10 18:16 Fedora.iso ``` Notice how I used an addition `-h` option? I'll discuss it in the next section. For now, if the output looks too complicated, then let me simplify things for you: ![explain read write permissions with file ownership in Linux using the ls command](https://itsfoss.com/content/images/2023/07/explain-read-write-permissions-in-linux-filesystem.png) As you can see, each text block has its own meaning such as the permissions for owner, group, and others. If you want to dive deep into file permissions, I would recommend [our detailed guide on file permissions in Linux:](https://linuxhandbook.com/linux-file-permissions/) [Linux File Permissions and Ownership Explained with ExamplesLinux file permissions explained in simpler terms. Also learn how to change the file permissions and ownership in Linux in this detailed beginner’s guide.](https://linuxhandbook.com/linux-file-permissions/)![](https://linuxhandbook.com/content/images/2020/06/linux-file-permission-featured.jpeg) ![](https://linuxhandbook.com/content/images/2020/06/linux-file-permission-featured.jpeg) ### 2. Get information in a human-readable format By default, the file size is shown in bytes which is not the best way to know your file size. So how do you get the same info but in human-readable form? Simple. You use the `-h` option with the ls command: `ls -l -h` And here's the comparison between the default and the human-readable form: ![list files using the ls command in human readable format](https://itsfoss.com/content/images/2023/07/list-files-using-the-ls-command-in-human-readable-format.png) Much better. Isn't it? The ls command is good to see the file sizes. However, it won't give you the directory size which is almost always displayed as 4K. To get directory size, use the du command. ### 3. List hidden files Like any other file manager, the ls command won't list the hidden files (I mean they are supposed to be hidden. Right?). But what if you want to [list the hidden files](https://itsfoss.com/show-hidden-files-linux/) along with the regular files? To do so, you can use the `-a` option: `ls -a` As you can see, the filename starting with a dot `.` are hidden files. ![list hidden files in Linux terminal using the ls command](https://itsfoss.com/content/images/2023/07/list-hidden-files-in-Linux-terminal-using-the-ls-command.png) You may also use `ls -A` which works almost the same as `ls -a` except it won't include the `.` and `..` directories. ### 4. List files recursively There are [multiple ways to list files recursively](https://linuxhandbook.com/list-files-recursively/) and using the ls command is one of them. In case you don't know, listing files recursively means listing files of all the sub-directories present until the last element of every sub-directory is shown. And to list files recursively, you can use the `-R` flag as shown: `ls -R` ![list files recursilvely in Linux using the ls command](https://itsfoss.com/content/images/2023/07/list-files-recursilvely-in-Linux-using-the-ls-command.png) In a way, it gives you the current directory structure. Personally, I prefer the for this purpose but you'll have to install it first. You don't have to be in the directory to list its content. You can also list directory contents by providing its absolute or relative path like this: `ls /var/log` ### 5. Differentiate between files and directories while using ls While the different colors for files and directories should do the job. But due to some reason, if you want to symbolize files and directories here you have it. In the ls command, you have a `-F` flag that adds a forward slash `/` to every directory name: `ls -F` ![differenciate between files and directories while using the ls command](https://itsfoss.com/content/images/2023/07/differenciate-between-files-and-directories-while-using-the-ls-command.png) ### 6. List only files with certain file extensions There are times when you only want to list files with specific file extensions and trust me this is the easiest of all. To do that, you don't have to use any options. Just append the file extension to the Asterisk `*` such as `*.png` , `*.txt` , etc: `ls *.extension` For example, if I only want to list the ISO files, then, I will be using the following command: `ls *.iso` ![list files of a specific file extensions](https://itsfoss.com/content/images/2023/07/list-files-of-a-specific-file-extensions.png) ### 7. Sort output based on size To sort the output based on the file size, you'd have to use the `-S` flag and it will list files from largest to the smallest manner (descending): `ls -lhS` ![sort files based on their file size using the ls command](https://itsfoss.com/content/images/2023/07/sort-files-based-on-their-file-size-using-the-ls-command.png) Similarly, if you want to reverse this order to list the smallest files first, you can use the `-r` flag to reverse the order: `ls -lhSr` ![sort files from smallest to largest using the ls command](https://itsfoss.com/content/images/2023/07/sort-files-from-smallest-to-largest-using-the-ls-command.png) ### 8. Sort files based on date and time The ls commands includes the modified time in its listing. To list the newest files first, you can use the `-t` flag as shown: `ls -lht` ![show newest files first while using the ls command](https://itsfoss.com/content/images/2023/07/show-newest-files-first-while-using-the-ls-command.png) You can use the `-r` flag as I explained previously to reverse the order here too. `ls -lrt` This will give you the latest modified files at the bottom of the display. This is particularly helpful if you have too many files in the directory and want to see which files were modified recently. I used this while troubleshooting my software project. ![Using ls -lrt command](https://itsfoss.com/content/images/2023/07/output_for_ls_-lrt-1.png) ## Let's summarize what you've learned so far! Here, I will share a table with multiple options that were used with the ls command in this tutorial: Command | Description | ---|---| `ls -l` | Long list of files and directories | `ls -lh` | Prints information in human-readable form | `ls -a` | Include hidden files in listing | `ls -R` | List files recursively | `ls -F` | Add a forward slash to the directory name | `ls *.ext` | List files having specific extensions | `ls -lS` | Sort files based on file size | `ls -lt` | Sort files based on time | `-r` | Reverse the sorting (combined with S or t) | ## 🏋️And practice your learning Practicing what you've learned is always a good idea, which is why we try to add a practice section in each terminal guide. So here are some simple practice exercise of the ls command: - List the contents of the `/var/log` [Save the command output](https://itsfoss.com/save-command-output-to-file-linux/)in a file named output.txt- Identify the 3 most recent files (Use time based sorting) - Display the files based on their size but in reverse order - Check if there are any hidden files That would be good practice for you. Stay tuned for more Linux command learning. And if you are new to the terminal, don't forget to follow our Terminal Basics series [Linux Command Tutorials for Absolute BeginnersNever used Linux commands before? No worries. This tutorial series is for absolute beginners to the Linux terminal.](https://itsfoss.com/tag/terminal-basics/)![](https://itsfoss.com/content/images/2023/03/terminal-basics-series-tag.png) ![](https://itsfoss.com/content/images/2023/03/terminal-basics-series-tag.png) Enjoy :)
16,267
使用 Btrfs 快照方便升级 Fedora Linux 且易于回退
https://fedoramagazine.org/make-use-of-btrfs-snapshots-to-upgrade-fedora-linux-with-easy-fallback/
2023-10-09T11:37:24
[ "Btrfs" ]
https://linux.cn/article-16267-1.html
![](/data/attachment/album/202310/09/113654ba1kp126nzn6tpjv.jpg) 在 2018 年的一篇 [早前的文章](https://fedoramagazine.org/use-lvm-upgrade-fedora/) 中,我们介绍了在升级 Fedora Linux 前如何利用 LVM 复制根文件系统,以便在可能出现错误的情况下能有一个回退机制。然而如今,Fedora 工作站的默认安装已经是 Btrfs 文件系统了。现在,你可以利用 Btrfs 快照来更简便地创建一个可引导的回退系统。注意,本文不涉及会如何从其它文件系统转换或迁移到 Btrfs 上。 ### 确认根文件系统是否为 Btrfs 本示例采用的是 Pinebook aarch64 笔记本电脑。在开始前,务必确认你的根文件系统是否采用 Btrfs。要明确,不是所有的定制版或者镜像文件默认都使用 Btrfs。 ``` $ df -T Filesystem Type 1K-blocks Used Available Use% Mounted on devtmpfs devtmpfs 4096 0 4096 0% /dev tmpfs tmpfs 998992 0 998992 0% /dev/shm tmpfs tmpfs 399600 6360 393240 2% /run /dev/mmcblk2p3 btrfs 56929280 39796116 15058348 73% / tmpfs tmpfs 998996 24 998972 1% /tmp tmpfs tmpfs 5242880 0 5242880 0% /var/lib/mock /dev/mmcblk2p3 btrfs 56929280 39796116 15058348 73% /f34 /dev/mmcblk2p3 btrfs 56929280 39796116 15058348 73% /home /dev/mmcblk2p2 ext4 996780 551888 376080 60% /boot /dev/mmcblk2p1 vfat 194348 31648 162700 17% /boot/efi tmpfs tmpfs 199796 100 199696 1% /run/user/1000 tmpfs tmpfs 199796 84 199712 1% /run/user/0 ``` ### 列出当前的 Btrfs 子卷 以上的示例输出显示挂载在 “根”(`/`)的文件系统类型是 Btrfs。你会注意到,有三个挂载点显示了相同的备份设备以及 *已用* 和 *可用* 的块数。这是因为它们是从同一 Btrfs 文件系统挂载的不同部分(子卷)。比如,`/f34` 子卷是我去年创建的那个可引导快照。 默认的 Fedora Btrfs 安装会创建一个 Btrfs 文件系统,并在其上分别挂载两个子卷,`root` 和 `home` ,挂载路径分别为 `/` 和 `/home`。让我们一起来看看我还添加了哪些其它的子卷: ``` $ sudo btrfs subvol list / ID 272 gen 110428 top level 5 path root ID 273 gen 110426 top level 5 path home ID 300 gen 109923 top level 5 path f34 ID 301 gen 95852 top level 5 path home.22Jul26 ID 302 gen 95854 top level 5 path f36.22Jul26 ``` 在这里,我们有一个来自最近一次系统升级的 `f34` 子卷,以及两个只读快照 `home` 和 `f36`。要添加和删除这些快照,最简单的方法就是挂载 Btrfs 的根目录。我会更新系统并创建当前 f36 `root` 子卷的新快照。如果你已经重命名了你的 `root` 子卷,我相信你知道该如何调整以下的示例以适应你的系统。 ### 创建 Btrfs 的回退快照 ``` $ sudo dnf update --refresh ...更新了很多部分(如果升级了内核还需要重启) $ sudo mkdir -p /mnt/root $ sudo mount /dev/mmcblk2p3 /mnt/root $ cd /mnt/root $ ls f34 f36.22Jul26 home home.22Jul26 root $ sudo btrfs subvol snapshot root f36 Create a snapshot of 'root' in './f36' ``` 因为 Btrfs 快照是以文件系统为基础的,所以并不需要在创建快照之前进行 “同步”,正如我在 LVM 中建议的。要从新的子卷引导为回退,你需要使用你喜欢的编辑器编辑 `/mnt/root/f36/etc/fstab`。如果你是刚入门的话,nano 就是一款十分简单的文本编辑器,功能基本够用。以下是我 `fstab` 文件中的一些行: ``` LABEL=PINE / btrfs subvol=root,compress=zstd:1 1 1 UUID=e31667fb-5b6f-48d9-aa90-f2fd6aa5f005 /boot ext4 defaults 1 2 UUID=75DB-5832 /boot/efi vfat umask=0077,shortname=winnt 0 2 LABEL=PINE /home btrfs subvol=home,compress=zstd:1 1 1 LABEL=SWAP swap swap discard=once 0 0 ``` 将 `subvol=root` 更改为 `subvol=f36`。这个改动是作用在快照中的文件,而并非你实际运行中的 `fstab` 文件。你可以通过 `diff /etc/fstab /mnt/root/f36/etc/fstab` 对比它们的区别。在我的情况下,我还使用了 `sudo btrfs subvol delete f34` 来删除我去年的 `f34` 快照。 ### 测试 Btrfs 的回退快照 你现在可以进行回退的测试了。你可以使用 [grubby](https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/) 或在 `/boot/loader/entries` 中编辑一项来将 `subvol=root` 替换为 `subvol=f36`。然而,为了初学者的安全起见,我们更建议你在启动时编辑 GRUB 进行操作。你可以参考 [关于 GRUB 的这篇文章](https://fedoramagazine.org/boot-earlier-kernel/) 了解如何进入 GRUB 菜单。在你到达那里后,按下 `e` 键编辑默认的内核启动项。放心 —— 你所做的更改都只存在于内存中,如果你弄错了,重启电脑即可重新开始。就像编辑 `fstab` 文件一样,找到 `subvol=root` 并将其更改为 `subvol=f36`。然后,按 `F10` 或 `Ctrl + X` 来引导你修改过的项目。通过这些更改,你的系统应该能够引导进入你的新快照。你可以查看 `/etc/fstab` 确保你正在引导至正确的子卷,或键入 `mount | grep subvol` 查看此时在 `/` 上挂载的子卷。 ### 进行 Fedora Linux 的系统升级 如果你的回退功能没问题,重启并返回你的正常根文件系统(并像上面所述,进行确认)。然后,按照 [维基页面](https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/) 上的指南进行标准的系统升级。提示:在运行 `dnf system-upgrade reboot` 之前,给 `root` 子卷创建另一个快照,你可以给它命名为 `root.dl`。这样,如果你发现硬盘空间不够,你不必再下载五个 GB 的文件包。因为除了下载的包以外,所有的内容都将与 `root` 和 `f36` 共享,因此它不会占用任何额外的空间。然后说到磁盘块的共享问题…… 因为在 `root` 子卷中的 `f36` 文件和 `f36` 子卷中的相同文件都使用的是相同的磁盘位置,所以在处理 Btrfs 报告的可用空间时,`dnf system-upgrade` 会感到困惑。因此在升级过程中从 `root` 子卷中删除它们并不会真正释放任何空间。如果你耗尽了所有空间,并且决定重启电脑,那么图形用户界面(GUI)将无法启动。此时,你需要使用 `Ctrl + Alt + F2` 进入文本控制台并登录,这将是你磨练命令行技能的好机会。如何清空空间或扩展根文件系统在这里先不做讨论(我的文件系统经常在一个 LVM 的卷上,可以被扩展)。通常,为升级保留超过 50% 的空闲空间是比较保险的。 ### 恢复环节 如果不幸出现问题,你可以重启电脑,并编辑 GRUB 条目以引导启动回退快照。如果你是新手,一旦需要在磁盘上修改 GRUB 条目(这样你就不需要每次启动时都进行编辑),可能需要一些指导。删除或重命名损坏的 `root` 子卷是非常直接的。你可以为 `f36` 子卷(或 `root.dl` 快照)创建一个快照,然后尝试再一次进行系统升级。以下是在子卷 f36 上启动到回退系统后重新开始的示例: ``` $ mount | grep subvol $ sudo mount /dev/mmcblk2p3 /mnt/root $ cd /mnt/root $ sudo mv root root.failed $ sudo btrfs subvol snapshot f36 root Create a snapshot of 'f36' in './root' Don't forget to edit /mnt/root/root/etc/fstab to change the subvol mounted on "/" to "root". ``` 事实证明,新的 f38 版本的 kernel-6.2.11 在我的 Pinebook 上进行系统升级后并未成功启动!(不过请不要担心,ARM 只是 Fedora Linux 的可选 CPU 架构——在主流设备上,你很少会遭遇此类问题。)的确,我成功地按照前文所述,在启动时编辑了 GRUB 条目并恢复到了 f36 的 kernel-6.2.10。现在,我继续使用着 f38,但同时搭载了 f36 的 kernel-6.2.10。 **更新**:kernel-6.2.12 已经发布,且我已确认它在 Pinebook 上运行正常。 ### 过期问题 随着你不断更新 f38 系统,它最终可能会希望删除 `/boot` 下的最后一个 f36 内核。通常来说,这并不是问题,因为到那个时候,你已经完全熟悉 f38,而 `f36` 快照只是一个存档。然而,如果你希望你的复刻版本(即 `f36` 的快照)能无限期地启动,那么你应当在 `/boot` 下保存一个能正常工作的 f36 内核。最简单的方法是在 `/etc/dnf/dnf.conf` 文件中设置 `installonly_limit=0` 并手动移除旧的内核,这种方法既简单又安全(尽管可能稍显繁琐)。 这里还有一个更复杂的解决方案(不适合新手):运行 `find /boot -name "*fc36*"` 指令,列举出所有在 `f36` 子卷快照中的内核及 GRUB 文件(这些文件并未包含在快照之内)。将这些文件备份至安全位置(例如我会挂载 `f36` 子卷,并将文件备份至其下的一个目录)。当 f38 系统启动后,对于每一个 f36 内核版本,都需使用 `dnf` 删除特定版本的内核(例如,使用 `dnf remove kernel-core-5.19.11-200.fc36`)。千万不要删除 f38 的内核!然后将你先前备份的 f36 内核恢复至 `/boot` 下。此时,f38 系统已经无法再识别 f36 的内核,因此也不会将其从 `/boot` 中删除。 然而,使用此方法有一个缺点,那就是你可能会不小心删除正在运行的 f38 内核。如果大家有更佳的解决办法,欢迎在评论区分享。 ### 展望未来 对于习惯于修改 GRUB 条目的用户,他们可能会考虑创建一个命名为 `f38` 的快照子卷。将当前的 GRUB 条目进行修改,以便启动到这个子卷,重启后,在这个子卷中进行系统升级。此后,总是根据它所包含的 Fedora Linux 版本来命名根文件系统的子卷。但在本文中,我没有采用这种作法,原因有两点: 1. 将当前活动的子卷命名为 `root`,这是遵循 Fedora Linux 的默认设置。 2. 坚持使用 `root` 作为当前子卷,这样在进行正常的系统升级操作之外,并不需要任何永久性的更改。 正如本文所展示的,针对重大系统更改(如系统版本升级)可能引发问题时,只读快照作为本地恢复点,非常有用。这些快照还可以通过 Btrfs 的 `send` 子命令,发送至远程备份。(如果远程备份设备已经包含了先前的备份数据,Btrfs 可以进行增量发送,仅传输发生变更的文件,这样就能节省时间和空间。)如果你打算长期存档这些快照,保持清晰不混淆且能明确恢复顺序的关键,就是要使用一套一致的命名规则。关于如何使用 Btrfs 的 `send` 命令来创建备份的更多信息,你可以参考关于 [Btrfs 快照备份](https://fedoramagazine.org/btrfs-snapshots-backup-incremental/) 的文章。 *(题图:MJ/6aed1d19-f1dd-4935-ad6f-61f6a868f150)* --- via: <https://fedoramagazine.org/make-use-of-btrfs-snapshots-to-upgrade-fedora-linux-with-easy-fallback/> 作者:[Stuart D Gathman](https://fedoramagazine.org/author/sdgathman/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Back in 2018, a [previous article](https://fedoramagazine.org/use-lvm-upgrade-fedora/) demonstrated how to use LVM to clone the root filesystem before upgrading Fedora Linux so as to have a fallback in the unlikely event that something goes wrong. Today, the default Fedora Workstation install uses Btrfs. Now you can use a Btrfs snapshot to make creating a bootable fallback much easier. Note that converting or migrating a system to Btrfs from another filesystem is outside the scope of this article. ## Check that root filesystem is Btrfs This example uses a Pinebook aarch64 laptop. Before proceeding, first make sure that Btrfs is being used for the root (system) filesystem. Not every spin or image uses Btrfs by default. $ df -T Filesystem Type 1K-blocks Used Available Use% Mounted on devtmpfs devtmpfs 4096 0 4096 0% /dev tmpfs tmpfs 998992 0 998992 0% /dev/shm tmpfs tmpfs 399600 6360 393240 2% /run /dev/mmcblk2p3 btrfs 56929280 39796116 15058348 73% / tmpfs tmpfs 998996 24 998972 1% /tmp tmpfs tmpfs 5242880 0 5242880 0% /var/lib/mock /dev/mmcblk2p3 btrfs 56929280 39796116 15058348 73% /f34 /dev/mmcblk2p3 btrfs 56929280 39796116 15058348 73% /home /dev/mmcblk2p2 ext4 996780 551888 376080 60% /boot /dev/mmcblk2p1 vfat 194348 31648 162700 17% /boot/efi tmpfs tmpfs 199796 100 199696 1% /run/user/1000 tmpfs tmpfs 199796 84 199712 1% /run/user/0 ## List the existing Btrfs subvolumes The above example output shows that the file system mounted on “root” (“/”) is type Btrfs. Notice that three mountpoints show the same backing device and the same *Used* and *Available* blocks. This is because they are parts (subvolumes) mounted from a single Btrfs filesystem. The */f34* subvolume is my bootable snapshot from last year. A default Fedora Btrfs install creates one Btrfs filesystem with two subvolumes — *root* and *home* — mounted on / and /home respectively. Let’s see what other subvolumes I’ve added: $ sudo btrfs subvol list / ID 272 gen 110428 top level 5 path root ID 273 gen 110426 top level 5 path home ID 300 gen 109923 top level 5 path f34 ID 301 gen 95852 top level 5 path home.22Jul26 ID 302 gen 95854 top level 5 path f36.22Jul26 There is an *f34* subvol from the last system-upgrade and two readonly snapshots of *home* and *f36*. The easiest way to add and delete snapshots is to mount the Btrfs root. I will update the system and create a new snapshot of the current f36 *root* subvolume. If you have renamed your *root* subvolume, then you presumably know enough to adjust the following example accordingly for your system. ## Create the Btrfs fallback snapshot $ sudo dnf update --refresh ... lots of stuff updated (reboot if kernel updated) $ sudo mkdir -p /mnt/root $ sudo mount /dev/mmcblk2p3 /mnt/root $ cd /mnt/root $ ls f34 f36.22Jul26 home home.22Jul26 root $ sudo btrfs subvol snapshot root f36 Create a snapshot of 'root' in './f36' Because Btrfs snapshots are filesystem based, it is not necessary to “sync” before the snapshot, as I recommended for LVM. To boot from the new subvol as a fallback, you will need to edit /mnt/root/f36/etc/fstab with your favorite editor. If you are a beginner, nano is a dirt simple text editor with minimal features. Here are some lines from my *fstab* file: LABEL=PINE / btrfs subvol=root,compress=zstd:1 1 1 UUID=e31667fb-5b6f-48d9-aa90-f2fd6aa5f005 /boot ext4 defaults 1 2 UUID=75DB-5832 /boot/efi vfat umask=0077,shortname=winnt 0 2 LABEL=PINE /home btrfs subvol=home,compress=zstd:1 1 1 LABEL=SWAP swap swap discard=once 0 0 Change *subvol=root* to *subvol=f36*. This change is to the file in the snapshot, not your production *fstab*. You can compare them with `diff /etc/fstab /mnt/root/f36/etc/fstab`. In my case, I also deleted my *f34* snapshot from last year with `sudo btrfs subvol delete f34`. ## Test the Btrfs fallback snapshot Now you are ready to test the fallback. You could use [grubby](https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/) or edit an entry in /boot/loader/entries to change *subvol=root* to *subvol=f36*. But in the interest of safety for beginners, I will have you edit the GRUB entry at boot time instead. Check out [this article on GRUB](https://fedoramagazine.org/boot-earlier-kernel/) for tips on getting to the GRUB menu. Once you are there, press the **e** key to edit the default kernel entry. Don’t worry — your changes are in volatile memory only. If you mess up, reboot to start over. Just like with fstab, find *subvol=root* and change it to *subvol=f36*. Press **F10** or **Ctrl**+**X** to boot your modified entry. With these changes, the system should boot into your new snapshot. Look at /etc/fstab to make sure you are booting from the right subvol, or enter `mount | grep subvol` to see what subvolume is mounted on “/”. ## Do the Fedora Linux system upgrade If your fallback is working, reboot back to your normal root filesystem (and confirm as above). Then proceed with the standard system-upgrade outlined on the [wiki page](https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/). TIP: Before running `dnf system-upgrade reboot`, make another snapshot of root. Call it something like *root.dl*. That way, you don’t have to download five gigabytes of packages again should you discover that there wasn’t enough free space. The snapshot will not take up any additional space because all but the downloaded packages are shared with *root* and *f36*. About that sharing of disk blocks … `dnf system-upgrade` gets confused about free space as reported by Btrfs because the f36 files in the *root* subvolume use the same disk locations as the same files in the *f36* subvolume. So removing them from the *root* subvolume during the upgrade process doesn’t actually free up any space. If you run out of space, and you reboot — the graphical user interface (GUI) won’t start. Use **Ctrl**+**Alt**+**F2** to login on a text console and practice your command line interface skills. Figuring out what to remove to free up space or how to expand the root filesystem is beyond the scope of this article (mine is often on an LVM volume and can be expanded). Having more than 50% free for the upgrade is a safe bet. ## Recovery Should something go wrong, you can reboot and edit the GRUB entry to boot the fallback. If you are a beginner, you’ll want some hand holding if you do end up needing to change the GRUB entry on disk (so you don’t have to edit at each boot). It is straight forward to delete or rename the broken *root* subvol. Snapshot the *f36* subvol (or the *root.dl* snapshot) to try the system-upgrade process again. Here is an example of starting over after booting into the fallback system on subvol f36: $ mount | grep subvol $ sudo mount /dev/mmcblk2p3 /mnt/root $ cd /mnt/root $ sudo mv root root.failed $ sudo btrfs subvol snapshot f36 root Create a snapshot of 'f36' in './root' Don't forget to edit /mnt/root/root/etc/fstab to change the subvol mounted on "/" to "root". As it turns out, the new kernel-6.2.11 for f38 did not boot on my Pinebook after the system-upgrade! (Don’t worry, ARM is an alternative CPU architecture for Fedora Linux — this is very unlikely to happen to you on a mainstream device.) I was indeed able to boot back to f36 by editing the GRUB entry for kernel-6.2.10 at boot time as described above. I am now using f38 again — but with kernel-6.2.10 from f36. **Update**: *kernel-6.2.12 is out and it works on the Pinebook.* ## Expiration As you update the f38 system, it will eventually want to delete the last f36 kernel from /boot. That is normally not a problem, as by that time you have settled into f38, and the f36 snapshot is just an archive. If you want to keep your fork (f36 snapshot) bootable indefinitely, you should preserve a working f36 kernel under /boot. The simplest way to do so is to set *installonly_limit=0* in /etc/dnf/dnf.conf and manually remove old kernels. It is simple and safe (but annoying). Outline of a more complex solution (not for beginners): Run `find /boot -name "*fc36*"` to list all the kernel and GRUB files for your f36 subvolume snapshot that are under /boot (which is not in the snapshot). Copy them to a backup location (I would mount the f36 subvolume and copy to a backup directory there). While booted from f38, for each f36 kernel version, use dnf to remove that specific kernel version (for example, `dnf remove kernel-core-5.19.11-200.fc36`). Do not remove the f38 kernels! Now restore the f36 kernels you saved to /boot. The f38 system doesn’t know about f36 kernels anymore, and it will not remove them from /boot. The problem with that method is the danger of accidentally removing the running f38 kernel. If anyone has a better method, let me know in the comments. ## Future directions Those comfortable with modifying GRUB entries might consider creating a snapshot subvolume named *f38*, modifying the current GRUB entry to boot into that, rebooting, and running the system-upgrade in that subvolume. Then always name the subvol for the root filesystem after the Fedora Linux release it contains. I did not do that for this article for two reasons. - Naming the current active subvolume *root*matches the Fedora Linux default. - Sticking with *root*for the current subvol does not require any permanent changes outside of the normal system-upgrade procedure. As this article has demonstrated, readonly snapsnots are useful as local restore points in case things go wrong when making significant system changes (such as a system release upgrade). These snapshots can also be sent to a remote backup using Btrfs’ *send* subcommand. (And if the remote backup device already contains previous backups, Btrfs can do an incremental send that only transmits changed files to save time and space.) If you intend to archive these snapshots long term, the key to not getting confused about which ones are which and what order to restore them is to use a consistent naming convention. See the article on [Btrfs snapshots for backup](https://fedoramagazine.org/btrfs-snapshots-backup-incremental/) for more information about using Btrfs’ *send* command to create backups. ## Jesse Only after they finish fixing the foundations which was still broken the last time I was looking. ## Blutch112 The Fedora project should integrate BTRFS Snapshot with Snapper or the house solution. As on OpenSuse. ## nehemiah I came here just to say this. Why didn’t they do this? ## Stuart Gathman The linked Btrfs snapshots for backup article mentions in the comments: btrbk – a utility to automate snapshots for remote backup , and timeshift – a gui doing similar. ## nehemiah Timeshift seems to be archived & unmaintained. I could, however, Btrfs Assistant on Flathub https://gitlab.com/btrfs-assistant/btrfs-assistant ## Bruno Just to clarify so others don’t get the wrong idea. Timeshift in Github and from the main dev has been archived because it is now handled by the Linux Mint project. It’s still active and in development though — https://github.com/linuxmint/timeshift ## James There is this package. However, I could never get it to work and gave up about a year ago. Anyone having more success and want to share? [moin@fedora ~]$ sudo dnf se dnf | grep snap Last metadata expiration check: 8:11:21 ago on Sat 27 May 2023 11:09:51 AM CEST. python3-dnf-plugin-snapper.noarch : Snapper Plugin for DNF ## James I would like to update on this and to help Blutch112, since I was frustrated also. Install snapper and python3-dnf-plugin-snapper. Create a snapper root config (snapper create-config /) Do any change to the system with dnf (for example: dnf update -y) Check the newly created snap shots (snapper list) I know, this is not the “Fedora way”, but it works like a charm. This was the last thing that was bugging me since I switched over from SUSE to Fedora/RHEL about 3 years ago. I’m really glad this is resolved now. This article and the comments really pushed me to try it again, thanks guys! ## Stuart Gathman Does Snapper support bootable snapshots and manage kernels? I didn’t see anything about it in a quick read of the man pages. It sounds like a backup solution, as mentioned in Future Direction (Btrfs snapshots for backup). Yes, it would be nice to automate a consistent naming pattern with automatically running btrfs send and btrfs recv for incremental remote backups. ## nehemiah yes, it worked with Zypper to allow “system rollbacks” https://documentation.suse.com/sles/12-SP4/html/SLES-all/cha-snapper.html#sec-snapper-snapshot-boot it seemed to emulate the use of Solaris Boot Environments, wrapping up kernel versions with btrfs snapshots to create rollback points. ## James Yes. ## Klaas I think that is what boom is for https://github.com/snapshotmanager/boom ## Boogiepop There should be a more user-friendly solution like Snapper. I hope the Fedora Team considers this for Fedora 39 or later. ## Ahmed Why fedora try to make every thing so difficult. built in roll back feature ( from boot menu) should be built in and default. I tried fedora couple of times but every time something will happen after update then system would not boot again and did not want to waste a lot time in trouble shooting. ## Stuart Gathman I literally rolled back from the boot menu. Just pick the subvolume. If you use the alternate naming convention at the end (each subvolume named after release, no ‘root’ subvolume for root fs), then you don’t even need to edit the subvolume in grub. If you want rollback by default (without having to take a snapshot yourself), you might try the ostree versions (silverblue, or whatever it’s called now). ## Richard England Ahmed, if you wish to have some help with your problems booting after an update you might be able to get some assistance on https://ask.fedoraproject.org/ ## SirIan at /boot/loader/entries i have the following ┌──(SirIan㉿k-r-a-t-o-s)-[~] └─$ sudo ls /boot/loader/entries/ 979cb034f8734391bb12aec3390ee2e0-0-rescue.conf 979cb034f8734391bb12aec3390ee2e0-6.0.18-200.fc36.x86_64.conf 979cb034f8734391bb12aec3390ee2e0-6.0.18-300.fc37.x86_64.conf 979cb034f8734391bb12aec3390ee2e0-6.2.15-200.fc37.x86_64.conf where do i do this part “edit an entry in /boot/loader/entries to change subvol=root to subvol=f36” in order to test my snapshot. ## Stuart Gathman If you are currently on fc36, then the fc36entry. If, as I suspect, you are coming from fc37, then either or both of thefc37entries – and hopefully you named your snapshot f37 in that case to avoid confusion, and should change subvol=root to subvol=f37.If you mistakenly named the snapshot of your f37 system f36, you can go to the /mnt/root directory (where I had you mount the btrfs root) and “mv f36 f37”.
16,268
开源应用 Pomatez 使你保持专注
https://news.itsfoss.com/pomatez/
2023-10-09T13:53:00
[ "番茄工作法" ]
https://linux.cn/article-16268-1.html
![](/data/attachment/album/202310/09/135249tc48b4ophxcbcxuz.jpg) > > Pomatez 应用可以提升你的效率,它为你的时间管理带来了巨大帮助。 > > > 你是否对 “番茄工作法” 有所了解呢? 这是一种 **时间管理方法**,于 1980 年代末期开发,通过定时器将工作划分为一定的时间间隔,每间隔 25 分钟后进行短暂的休息,如此循环直至任务完成。 这种方法在近些年变得越来越流行,有很多应用程序以 <ruby> <a href="https://en.wikipedia.org/wiki/Pomodoro_Technique"> 番茄工作法 </a> <rt> Pomodoro Technique </rt></ruby> 作为主要的卖点。 这里我们将介绍一个采用这种方法的应用,它名为 “Pomatez”,并且是 **原生支持 Linux 平台的开源应用**。Pomatez 为时间管理提供了所需的全部工具。 其实这并不是我们第一次介绍这种应用,之前有一种应用叫 “Reminders”,功能类似,但并未采用番茄工作法。 > > **[Reminders:一个漂亮的开源 Linux 应用,可帮助你完成工作](/article-15852-1.html)** > > > 现在我来详述一下你可以用 Pomatez 应用做些什么。 ### Pomatez: 概述 ⭐ ![](/data/attachment/album/202310/09/135313g1w31wecz1rqv03r.png) Pomatez 使用 TypeScript 编程语言编写,是一款极好的工具,能让你在执行重要任务的同时安排适时的休息,保持专注。 Pomatez 的关键特性包括: * 内置的任务列表 * 桌面通知 * 可定制的规则 #### 初次使用感受 ?‍? 我在我的 Ubuntu 22.04 LTS 系统上安装了它,体验了它的功能表现。 首先,我在 “<ruby> 任务列表 <rt> Task List </rt></ruby>” 部分填充了一些当日必须完成的重要任务和一些不太重要的任务。 一切就绪后,你将不会感到失望的 ? ![](/data/attachment/album/202310/09/135313n30syi740yynth17.png) 然后,我进入 “<ruby> 配置 <rt> Config </rt></ruby>” 栏,按照自己的喜好进行了规则调整。 “<ruby> 保持专注 <rt> Stay focus </rt></ruby>” 为执行任务的时间长度,“<ruby> 短暂休息 <rt> Short break </rt></ruby>” 为短暂的休息时间,“<ruby> 长休息 <rt> Long break </rt></ruby>” 为更长的休息时间,以及 “<ruby> 会话轮次 <rt> Session rounds </rt></ruby>” 为定时器的会话数量。 这里还有一个 “<ruby> 特殊休息 <rt> Special Breaks </rt></ruby>” 部分,可以用来安排比如午餐、晚餐的特定休息时间。 ![](/data/attachment/album/202310/09/135314jbhizdjj09bo52ee.png) 接下来,我进入 “<ruby> 计时器 <rt> Timer </rt></ruby>” 栏,此处显示了首个待处理任务,一列显示的是会话数以及控制定时器/会话的选项。 这里有一个重置定时器的按钮,一个开始/停止定时器的按钮,一个按规则进入下一阶段的按钮,一个调节音量的按钮,以及一个切换至 “<ruby> 精简模式 <rt> Compact mode </rt></ruby>”(位于右下角)的按钮。 ![](/data/attachment/album/202310/09/135314uiygawwe7lsavlxe.png) 我按下 “开始” 按钮启动了定时器,并开始查看了任务的可执行操作。我可以标记任务为 “<ruby> 完成 <rt> Done </rt></ruby>”,跳过任务,或者从应用中删除任务。 ![](/data/attachment/album/202310/09/135314dbzqgevmn1qwnm1p.png) 随着任务的推进,我通过按下带一个框和向下箭头图标的按钮,将 Pomatez 切换到了 “<ruby> 精简模式 <rt> Compact mode </rt></ruby>”。 这样我得到了一个更小巧的,节省空间的界面。当我完成任务后,我停止了计时器并将任务标记为 “<ruby> 完成 <rt> Done </rt></ruby>”。 ![](/data/attachment/album/202310/09/135315ay2xveybubu8vu2e.png) 随后,我转到 “<ruby> 设置 <rt> Settings </rt></ruby>” 栏,看看我可以调整哪些选项,我发现它给我了不少惊喜。 我可以调整应用行为,如设置为 “<ruby> 始终在顶部 <rt> Always On Top </rt></ruby>”, 启用“<ruby> 深色主题 <rt> Dark Theme </rt></ruby>” 和 “<ruby> 语音助手 <rt> Voice Assiastance </rt></ruby>” 等。 ![](/data/attachment/album/202310/09/135315c7t767o99wvsvkwt.png) Pomatez 还支持键盘快捷键,虽然我期望它能提供通过键盘快捷键控制计时器的功能。 或许他们可以考虑在未来的版本中参考我的反馈意见?我希望他们可以! ![](/data/attachment/album/202310/09/135316ksm5mhszngz9n3z5.png) 总体而言,如果你希望改进日常工作流程,这款应用值得尝试。 最好的是,它是一个跨平台的应用,不仅可以在 Linux 所有现代发行版上运行,你在 Windows 和 macOS 系统上也可以试用。 ### ? 下载 Pomatez Pomatez 提供了 Linux 平台的 .deb、AppImage 和 .rpm 安装包。你还可以找到它的 Snap 包。 你可以从官方网站,Snap 商店 或其在 GitHub 上的仓库获取你需要的包。 > > **[Pomatez(GitHub)](https://zidoro.github.io/pomatez/)** > > > 你之前用过这样的应用吗?请在下方的评论区告诉我们吧! *(题图:MJ/af06ca24-ec64-471f-92e0-76cedf3837ea)* --- via: <https://news.itsfoss.com/pomatez/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Are you familiar with the 'Pomodoro Technique'? Well, it is **a time management method** developed in the late 1980s that uses a timer to break work into set intervals, usually 25 minutes, followed by short breaks, then repeat until the task is done. This has been growing in popularity over the years, with various apps featuring the [Pomodoro Technique](https://en.wikipedia.org/wiki/Pomodoro_Technique?ref=news.itsfoss.com) as their main selling point. Here, we will be covering one such app that is **available natively for Linux**, called '**Pomatez**'. It is **an open-source app** that features all the tools required to follow such an approach for time management. You know this is not the first time we are covering an app like this, there's an app called '** Reminders'** that serves a similar purpose, though without the Pomodoro approach. [Reminders: A Nifty Open-Source Linux App To Help You Get Things DoneYou’re doing the best you can, but reminders can still help!](https://news.itsfoss.com/reminders/)![](https://news.itsfoss.com/content/images/2023/05/reminders-first-look.png) ![](https://news.itsfoss.com/content/images/2023/05/reminders-first-look.png) Let me highlight what you can do with the Pomatez app. ## Pomatez: Overview ⭐ ![a screenshot of the pomatez website](https://news.itsfoss.com/content/images/2023/09/Pomatez_1.png) Written in the [ TypeScript](https://www.typescriptlang.org/?ref=news.itsfoss.com) programming language, Pomatez is **a neat tool for staying focused while also taking those much-needed breaks**during important tasks. Some of its key features include: **Built-in Task Lists****Desktop Notifications****Customizable Rules** ### Initial Impressions 👨💻 I set it up on my [Ubuntu 22.04](https://news.itsfoss.com/ubuntu-22-04-release/) LTS system to see what it had to offer. First and foremost, I populated the '**Task List**' section with some super important tasks and some unimportant tasks that I wanted to accomplish before the end of the day. Take a look, you won't be disappointed 👇 ![a screenshot of pomatez task list page](https://news.itsfoss.com/content/images/2023/09/Pomatez_2.png) Then, I headed over to the '**Config**' tab, where I could tweak the rules according to my preference. The '**Stay focus**' was for setting the task duration, the '**Short break**' was to set a short time off, '**Long break**' for a longer time off, and '**Session rounds**' to set the number of sessions for the timer. There was even a '**Special Breaks**' section that could be used to set specific breaks such as lunch, dinner, or whatever you want. ![a screenshot of pomatez config page](https://news.itsfoss.com/content/images/2023/09/Pomatez_3.png) Next, I proceeded to the '**Timer**' section, where I was shown the first task at hand, with the number of sessions being shown below along with the controls to handle the timer/session. There was a button to reset the timer, one to start/stop the timer, another to go into the next phase per the rules. Another one for changing the volume, and a button to go into the '**Compact mode**' (at the bottom right). ![a screenshot of pomatez timer page](https://news.itsfoss.com/content/images/2023/09/Pomatez_4.png) I started the timer by using the 'Play' button, and proceeded to check out the possible actions for the task. I can mark it as 'Done', skip it, or even delete it from the app. ![a screenshot of pomatez timer running](https://news.itsfoss.com/content/images/2023/09/Pomatez_5a.png) As the task progressed, I switched Pomatez into the **'Compact mode**' by using the button with a box/downwards arrow logo. Doing that gave me a smaller, more space-conscious interface. After I was done with the task, I stopped the timer and marked the task as 'Done'. ![a screenshot of pomatez compact mode](https://news.itsfoss.com/content/images/2023/10/Pomatez_5b.png) I then headed over to the '**Settings**' section to see what kind of options I could tweak, and I must say I was not disappointed. I was able to tweak app behavior such as **always on top**, **switch to dark mode**, **enable** **voice assistance** and more. ![a screenshot of pomatez seettings](https://news.itsfoss.com/content/images/2023/09/Pomatez_6.png) Pomatez also features **support for keyboard shortcuts**, though I was expecting the ability to control the timer via a keyboard shortcut. *Maybe they can consider my feedback for future releases? Hopefully!* ![a screenshot of pomatez keyboard shortcuts](https://news.itsfoss.com/content/images/2023/09/Pomatez_7.png) Overall, it is an interesting app if you want to streamline your daily workflow. The best thing is, it is **a cross-platform app**, not limited to Linux. So, you can also try it on your Windows and macOS systems. ## 📥 Download Pomatez Pomatez is available as a **.deb**, **AppImage**, and **.rpm**, packages for Linux. You can also find a Snap package for it. Grab the package of your choice from the [official website](https://zidoro.github.io/pomatez/?ref=news.itsfoss.com), [Snap store](https://snapcraft.io/pomatez?ref=news.itsfoss.com) or its [GitHub](https://github.com/zidoro/pomatez/releases/tag/v1.3.0?ref=news.itsfoss.com) repo. *💬 Have you used such an app before? Let us know in the comments below!* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,270
修复 Arch Linux 中的 “Bash: man command not found” 错误
https://itsfoss.com/man-command-not-found/
2023-10-09T23:17:39
[ "man" ]
https://linux.cn/article-16270-1.html
![](/data/attachment/album/202310/09/231716f6ehhv6u9sueuts4.jpg) > > 我遇到 “找不到 man 命令” 错误的小插曲,以及我是如何解决的。 > > > 多年后,我再次尝试 Arch Linux。我忘记了 [pacman 命令的用法](https://itsfoss.com/pacman-command/),所以我尝试访问它的手册页。 接下来发生的事情让我震惊(是的!我一直在阅读 BuzzFeed ?)。它向我展示了这个错误: > > bash: man: command not found > > > 当然,这不仅是 pacman,所有命令都是这样。 ![](/data/attachment/album/202310/09/231740x9oeyy99ifeafmdo.png) 这让我感到困惑,因为我以前从未遇到过无法使用 `man` 命令的情况。 如果你发现自己处于找不到 `man` 命令的类似情况,我向你保证,修复很简单: * 安装 `man-db` 包(安装手册页) * 更新 `mandb` 缓存(用于索引所有命令的手册页) 让我们更详细地看看。 ### 在 Linux 中安装手册页 我从未想过我必须明确安装手册页。但是 [Arch Linux](https://archlinux.org/) 将你带入未知领域。这在某种程度上是件好事,因为你会发现以前从未遇到过的事情。 **这里的关键是安装手册页的包名为 `man-db`**。这对我来说也是一个发现。 你可以使用发行版的包管理器来安装它。 [对于 Arch 和 Manjaro](https://itsfoss.com/manjaro-vs-arch-linux/),使用: ``` sudo pacman -S man-db ``` ![](/data/attachment/album/202310/09/231740cw5g7v3t7l8787ow.png) 对于 Ubuntu 和 Debian,请使用: ``` sudo apt install man-db ``` 对于 Fedora,请使用: ``` sudo dnf install man-db ``` 对于 Red Hat Linux,请使用: ``` sudo yum install man-db ``` **你明白了要点**。为手册页构建缓存也是明智的一步。 ### 构建手册页缓存 要刷新或构建手册页缓存,请运行 [mandb 命令](https://www.man7.org/linux/man-pages/man8/mandb.8.html): ``` sudo mandb ``` 它将在不同位置查找手册页并构建缓存,以便你可以快速访问手册页。 ![](/data/attachment/album/202310/09/231740h1rltlx44p4tr81t.png) 完成后,我就可以像往常一样使用 `man` 命令。 ### 结论 这确实让我感到震惊,因为我一直认为手册页是 Linux 的核心部分。从未想过我必须安装它们。 我应该将其添加到 [安装 Arch Linux 后要做的事情列表](https://itsfoss.com/things-to-do-after-installing-arch-linux/) 吗?我还没有把握。 也许我是在 Arch 中遇到这个缺少 `man` 命令问题的极少数用户之一。也许不是。如果你遇到过这样的“意外错误”,请在评论中告诉我。 *(题图:MJ/a582366a-ee9d-4583-9025-eed6a4e96108)* --- via: <https://itsfoss.com/man-command-not-found/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) After years, I have been experimenting with Arch Linux again. I had forgotten the [usage of the pacman command](https://itsfoss.com/pacman-command/) so I tried accessing its man page. What happened next shocked me (yeah! I have been reading BuzzFeed 😜). It showed me this error: **bash: man: command not found** And it was not just for pacman but for all commands, of course. ![bash man command not found error in Linux](https://itsfoss.com/content/images/2023/10/bash-man-command-not-found-error.png) It baffled me because I have never been in a situation before where man command was not available to use. If you find yourself in a similar situation where man command is not found, let me assure you that t**he fix is easy**: - Install `man-db` package (to install man pages) - Update `mandb` cache (for indexing the man pages for all commands) Let's see it in a bit more deatil. ## Install man pages in Linux I never imagined that I would have to install man pages explictely. But [Arch Linux](https://archlinux.org/) puts you in uncharted territory. Which is good in a way, as you discover things you never encountered before. **The key here is that the package that installs the man pages is named man-db**. That was also a discovery for me. You can use your distribution's package manager to install it. [For Arch and Manjaro](https://itsfoss.com/manjaro-vs-arch-linux/), use: `sudo pacman -S man-db` ![Install man command in Arch Linux](https://itsfoss.com/content/images/2023/10/installing-man-command-arch-linux.png) For Ubuntu and Debian, use: `sudo apt install man-db` For Fedora, use: `sudo dnf install man-db` For Red Hat Linux, use: `sudo yum install man-db` **You get the gist**. It is also a wise step to build the cache for manpages. ## Build man page cache To refresh or build the man page cache, run the [mandb command](https://www.man7.org/linux/man-pages/man8/mandb.8.html): `sudo mandb` It will look for the manual pages at different locations and build the cache so that you can access the man pages quickly. ![mandb cache updated in Linux](https://itsfoss.com/content/images/2023/10/updating-man-command-database-linux.png) Once that is done, I was able to use the man command as usual. ## Conclusion This did come as shock to me because I always thought that manpages were a core part of Linux. Never imagined that I would have to install them explicitely. Should I add it to the [list of things to do after installing Arch Linux](https://itsfoss.com/things-to-do-after-installing-arch-linux/)? Not sure. Perhaps I am one of the rare few users who encountered this missing man command issue in Arch. Perhaps not. Do let me know in the comments if you ever encounted such an 'unexepected error'.
16,271
Cloudflare 推出免费的、更注重隐私的替代验证码系统
https://news.itsfoss.com/cloudflare-captcha-replacement/
2023-10-10T10:43:46
[ "验证码", "CAPTCHA" ]
https://linux.cn/article-16271-1.html
![](/data/attachment/album/202310/10/104321aioinl13v7i9nz6b.jpg) > > Cloudflare 最终提出了一种可结束视觉难题的解决方案。 > > > 自 [去年](https://news.itsfoss.com/cloudflare-pat/) 以来,Cloudflare 一直在研发一种更加注重隐私的验证码(CAPTCHA)替代系统。 可恶的验证码(尤其是谷歌的 reCAPTCHA)的问题是其无必要地收集用户数据、延迟体验时间、在网络导航中造成不便。 当然,验证码在一定程度上具有其用处。如果我声称它一无是处,无疑会显得无知。然而,随着技术的发展,以及为了提供无缝体验,我们所有的 [隐私保护工具](https://itsfoss.com/privacy-tools/) 都在不断进步,我们也需要一个连贯的系统来保护网站免受机器人的侵扰。 令人感兴趣的是,Cloudfare 设法整合了一项**每个人都可以免费使用作为替代品的技术**,那就是**Cloudflare Turnstile**。和每个 Cloudflare 的产品一样,你可以得到一个 "*Enterprise*" 计划,能够移除其品牌标识,并做一些其他操作。 ### Cloudflare Turnstile:彻底摆脱验证码! 有了 [Cloudflare Turnstile](https://www.cloudflare.com/en-in/products/turnstile/),你将永远不再需要解答任何视觉难题。 一开始,即使是它的自家隐私优先的验证码系统也会向部分用户展示难题。 现在,所有这些都已被他们的新产品替换。你只需进行一次点击,就可以验证你是人类: ![来源:Cloudflare 博客](/data/attachment/album/202310/10/104346jtarcmcn5wambrv5.gif) 为了确保隐私保护目标的实现,Cloudflare 作出了以下说明: > > 我们创立 Turnstile 就是为了保护隐私。Turnstile 达到了 <ruby> <a href="https://www.cloudflare.com/learning/privacy/what-is-eprivacy-directive/"> 电子隐私指令 </a> <rt> ePrivacy Directive </rt></ruby>、[GDPR](https://www.cloudflare.com/learning/privacy/what-is-the-gdpr/) 及 [CCPA](https://www.cloudflare.com/learning/privacy/what-is-the-ccpa/) 的合规性要求,也符合我们自己严格的隐私承诺。此外,Cloudflare 的 [FedRAMP Moderate 授权套餐](https://marketplace.fedramp.gov/products/FR2000863987)、"Cloudflare for Government" 现在也包括 Turnstile。我们并不依赖于追踪用户数据,比如用户访问过其他哪些网站,来判断用户是人还是机器人。我们的业务是保护网站,而不是卖广告,因此,运营商可以放心部署 Turnstile,知道他们的用户数据安全无虞。 > > > 此外,Cloudflare 认为,即使不向用户提供任何交互元素,它也能比现有的验证码系统更有效。它可以保护网站免受机器人流量,以及欺诈行为的侵害。 所以,有些人可能甚至不会看到人类验证的挑战,因为 Cloudflare 已经通过后台进行了一系列的检查和分析以发现可疑行为。 **有什么更让人兴奋的吗?** ![](/data/attachment/album/202310/10/104346zvz3ancqqamvvcgd.jpg) 所有这些都是免费提供的。任何不使用 Cloudflare 作为防火墙或 CDN 的网站或平台,只需添加**几行代码**,即可选择使用本服务。 > > **[Cloudflare Turnstile](https://www.cloudflare.com/en-in/products/turnstile/)** > > > 你还可以按照官方 [文档](https://developers.cloudflare.com/turnstile/migration/) 的指南,从 [reCAPTCHA](https://www.google.com/recaptcha/about/) 或 [hCAPTCHA](https://www.hcaptcha.com/) 迁移到该系统。 欲了解更多技术信息,你可以查看 [Cloudflare 的公告](https://blog.cloudflare.com/turnstile-ga/)。 ? 你如何评价 Cloudflare 的新系统,能在无需验证码的情况下阻挡机器人并提升用户体验呢? --- via: <https://news.itsfoss.com/cloudflare-captcha-replacement/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Cloudflare has been working on a privacy-focused alternative to the annoying CAPTCHA system since [last year](https://news.itsfoss.com/cloudflare-pat/). The problem with the dreaded CAPTCHA (especially: Google's reCAPTCHA) is its ability to collect users' data (unnecessarily), add a delay to the experience, and make things inconvenient when navigating the web. Sure, it was useful to some extent. It would be ignorant if I said it was not. However, as technology progresses and all the [tools to protect our privacy](https://itsfoss.com/privacy-tools/?ref=news.itsfoss.com) thrive to offer seamless experiences, we also need a coherent system to protect websites from bots. Interestingly, Cloudfare has managed to piece together a tech that **everyone can use for free as a replacement, **i.e., **Cloudflare Turnstile**. Like every Cloudflare offering, you get an “*Enterprise*” plan with the ability to remove its branding and a few more things. [Proton Mail: Get a private, secure, and encrypted email account | ProtonProton Mail is the world’s largest secure email service with over 100 million users. Available on Web, iOS, Android, and desktop. Protected by Swiss privacy law.](https://proton.go2cloud.org/aff_c?offer_id=15&aff_id=1173&ref=news.itsfoss.com)![](https://proton.me/images/social/proton-mail-og.png) ![](https://proton.me/images/social/proton-mail-og.png) ## Cloudflare Turnstile: No More CAPTCHAs! With [Cloudflare Turnstile](https://www.cloudflare.com/en-in/products/turnstile/?ref=news.itsfoss.com), you will no longer get any visual puzzles to solve, ever. Initially, even its own privacy-focused CAPTCHA system displayed puzzles to some users. Now, all of that has been replaced with their new product offering. All you need to do is to perform a single click to verify that you are a human: ![cloudflare turnsite](https://news.itsfoss.com/content/images/2023/10/cloudflare-turnstile.gif) [Cloudflare blog](https://blog.cloudflare.com/turnstile-ga/?ref=news.itsfoss.com) To ascertain its privacy goals, Cloudflare explains: We also created Turnstile to be privacy focused. Turnstile meets[ePrivacy Directive],[GDPR]and[CCPA]compliance requirements, as well as the strict requirements of our own privacy commitments. In addition, Cloudflare's[FedRAMP Moderate authorized package], "Cloudflare for Government" now includes Turnstile. We don’t rely on tracking user data, like what other websites someone has visited, to determine if a user is a human or robot. Our business is protecting websites, not selling ads, so operators can deploy Turnstile knowing that their users’ data is safe. In addition, Cloudflare believes that it is as effective or more than the CAPTCHA system without needing to offer users any interactive elements. It will protect websites from bot traffic, and fraud as well. So, some of us may not even get the human verification challenge because of several background checks/analysis done by Cloudflare to detect suspicious behavior. **What's more exciting?** ![turnsite sites cloudflare dashboard screenshot](https://news.itsfoss.com/content/images/2023/10/turnsite-dashboard.jpg) All of this is for free. And, any website/platform that does not use Cloudflare as a firewall or CDN can choose to use it by adding **a few lines of code**. **Suggested Read **📖 [11 Cloudflare Alternatives to Boost Your Website PerformanceCloudflare is not the only service that helps you boost your website’s speed and secure it. Here are some alternatives.](https://linuxhandbook.com/cloudflare-alternatives/?ref=news.itsfoss.com)![](https://linuxhandbook.com/content/images/2022/06/cloudflare.png) ![](https://linuxhandbook.com/content/images/2022/06/cloudflare.png) You can also migrate from [reCAPTCHA](https://www.google.com/recaptcha/about/?ref=news.itsfoss.com) and [hCAPTCHA](https://www.hcaptcha.com/?ref=news.itsfoss.com) by following the instructions in its [official documentation](https://developers.cloudflare.com/turnstile/migration/?ref=news.itsfoss.com). For more technical details, you can check out [Cloudflare's announcement](https://blog.cloudflare.com/turnstile-ga/?ref=news.itsfoss.com). *💬 What do you think about Cloudflare's new system to block bots and improve the user experience without CAPTCHAs?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,273
GNOME 活动搜索:你可能从未了解过的 7 个功能
https://itsfoss.com/gnome-search/
2023-10-10T22:43:00
[ "搜索", "GNOME" ]
https://linux.cn/article-16273-1.html
![](/data/attachment/album/202310/10/224338y0d7dgqlez0e0nmz.jpg) > > GNOME 的桌面环境中隐藏着丰富的搜索特性,爱探索的你不妨尝试寻找。挖掘新知,将是一场乐趣无穷的旅程。 > > > 在我之前的 [一篇文章](https://itsfoss.com/nautilus-file-search/) 中,分享过在 Nautilus 文件管理器中如何掌握搜索的技巧。 在这次的教程中,我将介绍 GNOME 活动区域中一些被忽视的搜索功能。 如果 “<ruby> GNOME 活动 <rt> GNOME Activities </rt></ruby>” 这个术语你并不熟悉,你可以在 GNOME 桌面环境的左上角找到并点击 “<ruby> 活动 <rt> Activities </rt></ruby>” 按钮,进入相应界面。 ![点击活动以访问](/data/attachment/album/202310/10/224343kmrt22922rccjhrq.png) 你也可以通过按下 `Super` 键(即:`Windows` 键)来快速访问。 ![GNOME 搜索界面](/data/attachment/album/202310/10/224344x8yyt85ecc8ts8gu.png) 尽管 GNOME 内置了强大的搜索功能,但大部分人却仅仅用它来搜索和运行应用。 ![大部分人用 GNOME 活动来搜索和运行应用](/data/attachment/album/202310/10/224344zfgtiltv3vf31nkf.png) 而实则,它还有更多的功能等待你去探索,这些可能在你使用过程中派上大用场,同时让你带上专业用户的范儿。 就让我们逐个介绍这些隐藏功能吧。 ### 1、全局文件搜索 这个功能和打开应用非常类似。当你在搜索区域开始输入,你会发现搜索结果在不断的变化。如果有文件与你的搜索关键词匹配上,你可以点击文件名,也可以按回车,以默认的应用打开它。 ![文件搜索](/data/attachment/album/202310/10/224345kxqz9vxtnq9zopzg.png) 在同一界面中,你可以看到每个文件都有一个小型的预览。并且,列表中的每个文件都会标注其完整路径。 如果你细看,你会发现这里有一个文件管理器的图标,点击它。 ![文件管理器图标](/data/attachment/album/202310/10/224346e48wi15l1nglffyw.png) 点击后,会打开 Nautilus 文件管理器,并进入搜索模式,你可以看到所有匹配到的文件。 ![Nautilus 文件管理器的搜索模式](/data/attachment/album/202310/10/224346whrhr7qooow96r9a.png) 同样的,如果你点击了搜索结果中的某个应用图标,将打开这个应用,并同时展示相应的搜索结果。 > > ? 如果你已经安装了 GNOME Sushi,你甚至可以在开始使用这些文件前,使用全屏模式预览它们。 > > > ### 2、复制表情符和特殊字符 GNOME 提供了一个名为 `gnome-characters` 的应用,它包含了许多表情符以及相关字符。如果你还未安装这个应用,可以使用以下命令进行安装: ``` sudo apt install gnome-characters ``` 安装完成后,这个应用将配置自己的搜索提供器。这意味着你能够搜索任何字符的名称,并且在输入过程中,系统会为你提供各种搜索建议。 ![搜索概览中的字符](/data/attachment/album/202310/10/224347azftrm9ompp4p34r.png) 一旦你找到了想要的字符,按回车键,就可以将其复制到剪贴板。然后使用 `CTRL+V` 进行粘贴。 ![字符已复制](/data/attachment/album/202310/10/224348wh8mvqnhve3krmqm.png) ### 3、不必打开计算器便能进行计算 你完全可以利用 GNOME shell 的搜索功能当作一个快捷的计算器。对于一些简单的数学运算,并无必要额外打开计算器应用。 相反,你可以直接在 GNOME 活动区域内完成计算。 ![获取计算结果](/data/attachment/album/202310/10/224349yiy3jcjfbyeycplm.png) 此外,你还可以将计算结果复制到剪贴板。 ### 4、轻松获取全球时间 想要知道另一个城市现在的具体时间吗?不必使用其他小工具或程序,仅仅输入城市名称,GNOME shell 就能告诉你该地的时间。 ![GNOME Shell 搜索中的世界时钟](/data/attachment/album/202310/10/224349sxx02uhd2zjgl7cl.png) ### 5、方便地在运行中的终端窗口之间切换 假设你同时运行了多个终端窗口,或者在同一终端窗口中打开多个标签,各自运行了不同的活动命令,例如 `top`,或者用 `bat` 或 `less` 在读取某个文件等, 你可以通过在 GNOME shell 搜索中输入命令名称,快速定位到正在运行该命令的终端窗口。 ![获取运行中的终端窗口](/data/attachment/album/202310/10/224350nh3e8d7iehahzdd6.png) 你会发现,我在其中一个终端中运行了 `top` 可以直接跳转到此终端窗口。若这是在不同的标签中,它也能帮你切换到运行着这个特定命令的标签页。 ### 6、执行网络搜索 你可以通过 GNOME Shell 直达 Firefox 的网页搜索。为能实现这个功能,你需要先在后台打开 Firefox。 ![设置中的 Firefox 角色——搜索提供器](/data/attachment/album/202310/10/224350nn4aapzcsucekpks.png) 启动 Firefox 后,你可以在活动概览中搜索并找到网页结果。除此之外,你还可以在系统设置中,根据你的喜好对 Firefox 的显示顺序进行调整。 ![Firefox 搜索结果](/data/attachment/album/202310/10/224351by577tvoohhvht5q.png) > > ? 遗憾的是,在我使用的 Fedora 38 系统中,虽然 Firefox 是搜索提供器,但我无法从中获得任何搜索结果。但在 Manjaro 上,一切运行正常。 > > > 如果你使用的是其他的发行版,你可以在 GNOME shell 搜索中,通过 Epiphany 或 GNOME Web 浏览器来访问网络搜索结果。首先,你可以使用你的包管理器来安装 Epiphany: ``` sudo apt install epiphany ``` 或者,你也可以从 Flathub 安装: ``` flatpak install flathub org.gnome.Epiphany ``` 安装完成后,打开设置,找到搜索功能。这时,你会看到 GNOME Web 已经出现在列表中了。 ![搜索设置中的 GNOME Web](/data/attachment/album/202310/10/224351ps5l7n0gsgpgjuyu.png) 如果它未被激活,只需开启这个开关。即使 GNOME Web 并没有被打开,它仍能正常工作。 ![使用 GNOME Web 搜索得到的网络结果](/data/attachment/album/202310/10/224351kuyfqy0yiukuuzui.png) > > ? 如果一个新安装的应用程序提供了某种搜索功能,它将会出现在搜索标签页中。 > > > ### 7、管理搜索结果的显示顺序 你可以使用系统设置对显示的搜索结果进行重新排序,禁用某些结果等操作。 #### 在系统设置应用中访问搜索设置 打开系统设置,然后进入搜索选项卡。 ![设置中的搜索选项卡](/data/attachment/album/202310/10/224352xx35x8z5xg35zp5i.png) #### 重新排序搜索结果显示的顺序 打开搜索设置后,你可以看到列出了所有可用的搜索提供器。每一个项目的左侧有一个把手,右侧有三个点的菜单。 ![用于排列项目的按钮和把手](/data/attachment/album/202310/10/224353tsd91zyy1yg1j6jq.png) 你可以直接拖拽左侧的把手来调整项目顺序,将其放到你希望的位置。 ![拖拽调整项目显示的顺序](/data/attachment/album/202310/10/224353pq73jv897rn8ynvr.gif) 或者,你也可以点击右侧三点菜单,然后选择“<ruby> 向上移动 <rt> Move Up </rt></ruby>”或“<ruby> 向下移动 <rt> Move Down </rt></ruby>”。 ![使用按钮上下移动](/data/attachment/album/202310/10/224354wsgu3dzqcjbuztuf.gif) 调整后的设置将会作为 GNOME shell 搜索结果新的显示顺序。 #### 管理各个文件的搜索位置 通过搜索选项卡里的“<ruby> 搜索位置 <rt> Search Locations </rt></ruby>”选项,你可以调整系统应用,如文件、照片、视频等的搜索位置。 ![](/data/attachment/album/202310/10/224354vgogennjjdnentug.png) 现在,你可以开启或者关闭已有的搜索位置。或者点击添加按钮,添加新的位置。 ![添加或移除位置](/data/attachment/album/202310/10/224354a5jqy2mm222fqz5d.png) #### 从搜索中启用或禁用搜索提供器 如果你并未使用某些搜索提供器,你可以通过禁用未使用的搜索提供器在搜索界面释放一些空间。具体操作是,使用每个项目右侧的切换按钮关闭指定提供器。 ![启用 - 禁用开关](/data/attachment/album/202310/10/224355m9tcdu5rqgs9z8zd.png) 如果需要,你可以随时重新开启它们,只需切换相同的按钮至开启状态。 #### 整体禁用搜索 你可以通过关闭 **应用搜索** 按钮来彻底禁用 GNOME Shell 中的应用内搜索。 ![在概览中禁用搜索](/data/attachment/album/202310/10/224355krvzwp3j7j325p87.png) 在这种情况下,只有应用程序可以进行搜索,搜索结果会被隐藏。 ![应用内搜索被禁用状态](/data/attachment/album/202310/10/224356bslyst1134qclyj5.png) ### 额外技巧:扩展插件增强搜索效能 有一些 GNOME 扩展件可以使你的搜索更便捷、有效。 #### 快速网络搜索 这是一个名为 “Quick Web Search” 的扩展,它会为 DuckDuckGo 提供一个搜索选项。每当我们在 GNOME shell 搜索中输入一些词汇时,DuckDuckGo 的图标就会出现。单击它,将在你的首选浏览器中打开搜索结果。 ![Shell 中的 DuckDuckGo 搜索](/data/attachment/album/202310/10/224356rfrq2rf9olwan1oz.png) 即使所有的浏览器实例都已关闭,这个功能也可以正常工作。此外,你可以通过扩展设置将搜索提供器更改为谷歌或其他选项。 > > **[获取 Quick Web Search 扩展](https://extensions.gnome.org/extension/6051/quick-web-search/?ref=itsfoss.com)** > > > #### GNOME 模糊应用搜寻 此扩展为 GNOME 搜索提供了模糊应用搜寻结果。因此,即便你输错或拼错了某些名字,它都会尽力为你找到匹配的结果。 ![使用模糊搜索的 GNOME 搜索](/data/attachment/album/202310/10/224357oj8517x790jx2525.png) > > **[获取 GNOME 模糊应用搜索](https://extensions.gnome.org/extension/3956/gnome-fuzzy-app-search/?ref=itsfoss.com)** > > > ### 充分利用 GNOME 如你所见,你可能从未充分地利用过所有的 GNOME 搜索特性,或者可能未曾对其给予足够的关注。 ? 期望你能喜欢这些技巧。欢迎在评论区留下你的建议。 *(题图:MJ/81a823e0-ed00-4988-a0a8-47c88e4ed188)* --- via: <https://itsfoss.com/gnome-search/> 作者:[Sreenath](https://itsfoss.com/author/sreenath/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) In an earlier article, I shared tips for [mastering search in the Nautilus file manager](https://itsfoss.com/nautilus-file-search/). In this tutorial, I'll tell you many of the ignored search features in the GNOME Activity area. If you are not aware of the technical term 'GNOME Activities', you can access it by clicking the Activities button in the top left corner in the GNOME desktop environment, ![Click on Activities button on top left to get to GNOME search interface](https://itsfoss.com/content/images/2023/08/click-on-activities.png) You can also press the Super key (Windows key) to get the same. ![The search interface of GNOME](https://itsfoss.com/content/images/2023/08/GNOME-Search-interface.png) Yes. GNOME has quite a powerful built-in search feature and yet many people use it to search for applications and run them. ![Search among installed apps in GNOME shell search](https://itsfoss.com/content/images/2023/08/installed-apps-in-search.png) But it has several more features that may come in handy and make you feel like a pro user. Let's see them one by one. ## 1. Desktop wide file search This is similar to opening apps. When you start typing something in the search area, you can see things changing continually. If some file is matched with your query, you can open it using the default application, by clicking on the name of the file, or pressing Enter. ![File Search results in GNOME Shell search](https://itsfoss.com/content/images/2023/08/file-search.png) On the same interface, you can see that there is a small preview for each file. Also, each file listed here is associated with its absolute location. If you look closely, you can also find the file manager icon here. Now, click on the file manager icon. ![File manager icon in GNOMEshell file search results](https://itsfoss.com/content/images/2023/08/file-manager-icon-highlighted.png) This will open the Nautilus file manager in search mode, where you can see all the files matched by the query. ![Clicking on the file manager icon on GNOME shell file search results page will get a nautilus file manager instance in search mode](https://itsfoss.com/content/images/2023/08/nautilus-file-manager-in-search-mode.png) Similarly, if you press the icon of the app associated with the bulk search result, then that application, along with the suggested results, is opened. ## 2. Copy emojis and special characters GNOME has an application called `gnome-characters` . This provides you with several emojis and related characters. If you don't have this application, you can install it using: ``` sudo apt install gnome-characters ``` Once installed, this application has its own search provider. This means that you can search for any character name. You can see various suggestions as you type. ![Characters are shown in GNOME search results](https://itsfoss.com/content/images/2023/08/characters-in-search-overview.png) Once you find some character, press Enter so that the selected character will be copied to your clipboard. You can paste it using CTRL+V. ![Character copied to clipboard message](https://itsfoss.com/content/images/2023/08/character-copied-to-clipboard-message.png) **Suggested Read 📖** [13 Keyboard Shortcuts Every Ubuntu User Should KnowKnowing keyboard shortcuts increase your productivity. Here are some useful Ubuntu shortcut keys that will help you use Ubuntu like a pro.](https://itsfoss.com/ubuntu-shortcuts/)![](https://itsfoss.com/content/images/wordpress/2018/09/ubuntu-keyboard-shortcuts.jpeg) ![](https://itsfoss.com/content/images/wordpress/2018/09/ubuntu-keyboard-shortcuts.jpeg) ## 3. Calculate without opening calculator app Use the GNOME Shell search as a quick calculator. If you have to do some simple math calculations, there is no need to open the calculator app for this. Instead, do it in GNOME activity itself. ![Doing simple mathematical calculation in GNOME Shell](https://itsfoss.com/content/images/2023/08/get-math-result.png) You can copy the result to clipboard also. ## 4. Get world clock Want to know what time it is in another city? Why use some widgets and programs when GNOME shell can give you the time in a city by entering its name? ![Get time of various cities using GNOME Shell Search Feature](https://itsfoss.com/content/images/2023/08/get-time.png) ## 5. Move between running terminal windows Let's say you are running multiple terminal windows or multiple tabs in one terminal window with different active commands, like `top` , reading a file using `bat or less` etc., You can move to a particular terminal window, that is running a specific command by entering the command name in shell search. ![Get terminal window by entering the active command it is running](https://itsfoss.com/content/images/2023/08/get-terminal.png) You can see that I am running `top` in one of my terminals and I can go directly into that. If it's different tabs, it will switch you to the particular tab running that particular command. ## 6. Perform a web search You can access the Firefox web search directly through the GNOME Shell. In order to make this work, you should need to open Firefox in the background. ![Firefox listed as a search provider in system setting search tab](https://itsfoss.com/content/images/2023/08/firefox-as-a-search-provider-in-settings.png) Once Firefox runs, you can search for web results on the activities overview. Also, you can reorder the Firefox appearance as you like in the system settings. ![Firefox search results in GNOME Shell Search](https://itsfoss.com/content/images/2023/08/firefox-search.png) If you are using other distros, you can access web search results on shell search using Epiphany or GNOME Web browser. First, install Epiphany, either using your Package manager: `sudo apt install epiphany` Or, from Flathub: `flatpak install flathub org.gnome.Epiphany` Once installed, open the settings and go to the search features. You can see that, an entry for GNOME Web has been appeared there. ![GNOME Web s listed as an entry in search settings in system settings](https://itsfoss.com/content/images/2023/08/GNOME-Web-in-search-settings.png) Simply toggle on, if it's off. It will work even if GNOME Web is closed. ![GNOME Web providing search results in GNOME Shell](https://itsfoss.com/content/images/2023/08/gnome-web-results-in-search.png) ## 7. Managing Search Appearance It is possible to reorder the appearance, disable some results, etc. using system settings. ### Access search settings in System Settings app Open System settings and go to the search tab. ![Open the searches tab in system settings](https://itsfoss.com/content/images/2023/08/search-tab-in-settings.png) ### Reorder Search Results Appearance Upon opening the searches, you can see all the available providers listed. On each of the item, you can see a handle to the left side and three dots menus on the right side. ![Buttons and Handles to arrange items in search view inside system settings](https://itsfoss.com/content/images/2023/08/button-to-arrage-items.png) Either drag one item with the left side handle and place it to the required space. ![Arrange order of Appearance of results by drag and drop](https://itsfoss.com/content/images/2023/08/arrage-order-in-searches.gif) Or, click on the three dot menu and select “Move Up” or “Move Down”. ![Move up or down a particular search item using buttons](https://itsfoss.com/content/images/2023/08/move-up-and-down.gif) This arranged settings will be the new order in which the searches will appear on GNOME shell search results. ### Manage Individual File Locations Tweak the locations searched by system apps like Files, Photos, Videos etc. by going to **Search Locations** on the searches tab. ![](https://itsfoss.com/content/images/2023/08/search-locations.png) Now, toggle on or off for disabling existing locations. Or Add new locations by clicking on the Add button. ![Add or Remove Locations searched by system apps such as files](https://itsfoss.com/content/images/2023/08/Add-remove-locations.png) ### Enable or disable a search provider from the search If you are not using some of the search providers, you can free up some space on the search interface by disabling some unused search providers. For this, toggle off the particular provider using the toggle button on the right side of each item. ![The toggle button to enable or disable a particular service to appear in GNOME search](https://itsfoss.com/content/images/2023/08/enable-disable-toggle-button.png) You can always turn it back on, by toggling the same button to on position. ### Disable search altogether Disable the in-app searches in GNOME Shell altogether by toggling off the **App Search **button. ![Disable Search in Overview](https://itsfoss.com/content/images/2023/08/Disable-search-rsults.png) Only Applications can be searched, and the search results will be hidden from view. ![Inside App search is disabled, and only application name can be searched](https://itsfoss.com/content/images/2023/08/no-in-app-searches.png) ## Bonus Tip: Extensions to make search more effective There are several GNOME extensions that will make your search more accessible and productive. ### Quick web search This extension, called Quick Web Search, will add a search option for DuckDuckGo. Whenever we search some terms on the shell search, a DuckDuckGo icon will appear. Click on it, to open it on your preferred browser. ![An icon of DuckDuckGo in shell, so that we can search using DDG through GNOME Shell](https://itsfoss.com/content/images/2023/08/ddg-web-search-plugin.png) This works even if all the browser instances are closed. Also, you can change the search provider to Google and others by using the extension settings. ### GNOME Fuzzy app search It gives fuzzy application search results for Gnome Search. So even if you have misspelled or wrongly typed some names, it will try its best to match with a result. ![](https://itsfoss.com/content/images/2023/08/no-result-in-misspell.png) ![](https://itsfoss.com/content/images/2023/08/result-even-if-mispelled.png) GNOME search using Fuzzy Search ## Get more out of GNOME As you can see, you probably never used all of these GNOME search features. Or perhaps never paid enough attention to them. At It's FOSS we take pride and feel joy in sharing such lesser-known features with our readers. Here are a few more such articles that a GNOME user may find interesting. [Mastering Nautilus File Search in Linux DesktopBecome a pro finder with these handy tips to improve your file search experience with GNOME’s Nautilus file search.](https://itsfoss.com/nautilus-file-search/)![](https://itsfoss.com/content/images/2023/08/nautilus-file-search.png) ![](https://itsfoss.com/content/images/2023/08/nautilus-file-search.png) [13 Ways to Tweak Nautilus File Manager in LinuxNautilus, aka GNOME Files, is a good file manager with plenty of features. You can further enhance your experience by using these extensions, tweaks and tips.](https://itsfoss.com/nautilus-tips-tweaks/)![](https://itsfoss.com/content/images/wordpress/2022/07/customizing-GNOME-Nautilus-File-Manager.png) ![](https://itsfoss.com/content/images/wordpress/2022/07/customizing-GNOME-Nautilus-File-Manager.png) [Install and Use GNOME Tweak Tool in Ubuntu and Other LinuxLearn to install GNOME Tweak too in Ubuntu. You’ll also learn how to use GNOME Tweaks to customize your Linux desktop.](https://itsfoss.com/gnome-tweak-tool/)![](https://itsfoss.com/content/images/2023/03/customise-ubuntu-with-gnome-tweaks.png) ![](https://itsfoss.com/content/images/2023/03/customise-ubuntu-with-gnome-tweaks.png) [Customize Task Switching Experience on GNOME Desktop With These Nifty ToolsUnless you’re new to Linux, you know that there are several popular desktop environment choices for users. And if you’re that newbie, I recommend you to learn what a desktop environment is along with this tutorial. Here, I shall be focusing on tweaking the task switching experience on](https://itsfoss.com/customize-gnome-task-switcher/)![](https://itsfoss.com/content/images/wordpress/2020/11/gnome-task-switcher-customization.png) ![](https://itsfoss.com/content/images/wordpress/2020/11/gnome-task-switcher-customization.png) 🗨 I hope you liked this collection of tips. Please leave your suggestion in the comment section.
16,275
Linux Mint 21.2 Edge:为更新的硬件提供支持
https://news.itsfoss.com/linux-mint-21-2-edge/
2023-10-11T22:41:21
[ "Linux Mint" ]
https://linux.cn/article-16275-1.html
![](/data/attachment/album/202310/11/224116oso9krhjqqoq5qji.jpg) > > Linux Mint 21.2 Edge ISO 来了! > > > Linux Mint 背后的人们一直在努力推出主要版本,例如 [Linux Mint 21.2](https://news.itsfoss.com/linux-mint-21-2/) 和 [LMDE 6](https://news.itsfoss.com/lmde-6/)。 一系列的发布似乎并没有停止,因为我们现在以 “**Linux Mint 21.2 Edge**” 的形式得到了另一个版本。 请允许我告诉你更多相关信息。 ### Linux Mint 21.2 Edge:可以期待什么? ![](/data/attachment/album/202310/11/224122vc9crbdjhjcdclcc.png) Linux Mint 21.2 Edge 采用 [Linux 内核 6.2](https://news.itsfoss.com/linux-kernel-6-2-release/),**为那些希望运行较新硬件**而不喜欢 [Linux 内核 5.15](https://news.itsfoss.com/linux-kernel-5-15-release/) LTS(常规 Linux Mint 21.2 版本的特性)的用户量身定制。 现在对于 Intel Arc 显卡用户来说绝对是一个不错的 Linux 发行版选择! 如果你对 “*Edge*” ISO 感到好奇,请参阅 [文档](https://linuxmint-user-guide.readthedocs.io/en/latest/edge.html): > > 除了常规 ISO 镜像之外,Linux Mint 有时还会为其最新版本提供 “Edge” ISO 镜像。该镜像附带更新的组件,能够支持最现代的硬件芯片组和设备。 > > > 此外,此 ISO 还**恢复了对安全启动的支持**。对于那些想要它的人来说,这应该是一个有用的附加组件。 不要忘记,Linux Mint 21.2 Edge **仅提供 “Cinnamon” 风格桌面**,没有任何 XFCE 或 MATE 风格。 不过,除了更新的硬件支持之外,与常规版本相比,使用 Edge 版本时你不会发现任何差异。 **想要试一试?** 前往 [官方网站](https://www.linuxmint.com/edition.php?id=310) 从众多可用的下载镜像之一获取 ISO。 > > **[Linux Mint 21.2 Edge](https://www.linuxmint.com/edition.php?id=310)** > > > 请注意,此版本**仅提供 64 位版本**,没有 32 位选项。 ? 你会尝试 Edge ISO 吗? 请在下面告诉我们! *(题图:MJ/f49e0353-86d5-4ebb-a503-58716d8b54fb)* --- via: <https://news.itsfoss.com/linux-mint-21-2-edge/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/%E6%A0%A1%E5%AF%B9%E8%80%85ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) The folks behind Linux Mint have been on a roll, pushing out major releases such as the [Linux Mint 21.2 release](https://news.itsfoss.com/linux-mint-21-2/), and [LMDE 6](https://news.itsfoss.com/lmde-6/). And the flurry of releases doesn't seem to be stopping, as we now have another release from them in the form of '**Linux Mint 21.2 Edge'**. Allow me to tell you more about it. ## Linux Mint 21.2 Edge: What to Expect? ![a screenshot of the neofetch output on linux mint 21.2 edge](https://news.itsfoss.com/content/images/2023/10/LinuxMint_21.2_Edge.png) Powered by [Linux kernel 6.2](https://news.itsfoss.com/linux-kernel-6-2-release/) release, Linux Mint 21.2 Edge is **tailored for users who want to run newer hardware** not acting nice with [Linux kernel 5.15](https://news.itsfoss.com/linux-kernel-5-15-release/) LTS, which is what the regular 21.2 release of Linux Mint features. Definitely a good Linux distro option for Intel Arc graphics users now! If you are curious about the "*Edge*" ISO, here's what the [documentation](https://linuxmint-user-guide.readthedocs.io/en/latest/edge.html?ref=news.itsfoss.com) says: In addition to its regular ISO images, Linux Mint sometimes provides an “edge” ISO image for its latest release. This image ships with newer components to be able to support the most modern hardware chipsets and devices. Additionally, this ISO also **brings back support for secure boot**. This should come in as a useful add-on for those who want it. Not to forget, the Linux Mint 21.2 Edge release is **solely being offered in the 'Cinnamon' desktop flavor**, without any XFCE or MATE flavors. Though, you won't find any differences when using the Edge variant compared to the regular one, apart from the newer hardware support. **Want to give it a try?** Head over to the [official website](https://www.linuxmint.com/edition.php?id=310&ref=news.itsfoss.com) to grab the ISO from one of the many available download mirrors. Do note that this release is **only available as a 64-bit release**, with no 32-bit options. *💬 Will you be trying out the edge ISO? Let us know below!* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,276
FreeDOS 基础:从 A 到 Z
https://opensource.com/article/22/6/26-freedos-commands
2023-10-12T10:30:16
[ "FreeDOS" ]
https://linux.cn/article-16276-1.html
![](/data/attachment/album/202310/12/102950rnookbm1124y54k1.jpg) > > 我很高兴分享我最喜欢的 26 个 FreeDOS 命令。 > > > 我家最早的一批计算机中有一台运行着一款名称为 DOS 的命令行操作系统,即 “<ruby> 磁盘操作系统 <rt> Disk Operating System </rt></ruby>”。我是在 DOS 系统环境中长大的,学会了利用命令行来使我的工作更轻松。很多其他的人也是如此。我们非常爱 DOS ,所以在 1994 年 6 月 29 日,我们创建了 FreeDOS 工程。 如果你的 FreeDOS 的初学者,你可能会对如何使用其附带的不同的命令行程序感到困惑。让我们从我最喜欢的 26 个 FreeDOS 命令开始吧。要学习更多的信息,在大部分命令的后面添加 `/?` 选项来获取更多的信息: ``` C:\>attrib /? ATTRIB v2.1 - 显示或更高文件属性。 版权所有 (c) 1998-2003,遵循 GPL2 协议。 语法:ATTRIB { options | [path][file] | /@[list] } 选项: +H 设置隐藏属性。 -H 清除隐藏属性。 +S 设置系统属性。 -S 清除系统属性。 +R 设置只读属性。 -R 清除只读属性。 +A 设置存档属性。 -A 清楚存档属性。 /S 处理具体指定路径中的所有目录中的文件。 /D 处理带有通配符的参数的目录名称。 /@ 处理文件,文件列在具体指定文件 中 [或 stdin]。 示例: attrib file -rhs attrib +a -r dir1 dir2*.dat /s attrib -hs/sd /@list.txt *.* ``` ### A 是 ATTRIB `ATTRIB` 程序显示或更改文件的 *属性* 。属性可以是以下四个值之一:隐藏(`H`)、系统 `S`)、只读(`R`)、存档(`A`)。 标记为隐藏的文件将不会在目录列表中显示。例如,假设你想隐藏一个名称为 `SECRET.TXT` 的文件,这样就不会有人它在那里。首先,你可以显示该文件的属性,以便查看它的当前设置: ``` C:\FILES>attrib secret.txt [----A] SECRET.TXT ``` 为隐藏这个文件,使用加号(`+`)操作符来开启用隐藏属性,像这样: ``` C:\FILES>attrib +h secret.txt [----A] -> [-H--A] SECRET.TXT C:\FILES>dir Volume in drive C is FREEDOS2022 Volume Serial Number is 333D-0B18 Directory of C:\FILES . <DIR> 05-27-2022 9:22p .. <DIR> 05-27-2022 9:22p 0 file(s) 0 bytes 2 dir(s) 279,560,192 bytes free ``` `ATTRIB` 的另一种常见使用方法是操作只读属性,这样你就不会意外地覆盖重要的文件。假设你想要保护 `SECRET.TXT` 文件,这样你就不能删除或更改它。使用 `+R` 修饰符 ,打开只读属性,像这样: ``` C:\FILES>attrib +r secret.txt [----A] -> [---RA] SECRET.TXT C:\FILES>del secret.txt C:\FILES\SECRET.TXT: Permission denied no file removed. ``` ### B 是“哔哔”声 如果你需要在一个批处理文件中添加一些激情活力,你可以使用 `BEEP` 命令来获取用户的注意力。`BEEP` 不会在屏幕上显示任何内容,但是会简单地发出一个 “哔哔” 的声音信号。 注意:`BEEP` 使用个人计算机内置的扬声器来发出 “哔哔” 声。如果你使用一台虚拟机器来引导启用 FreeDOS,检查你的系统是否建立正确的模拟个人计算机扬声器。否则,你将不会听到任何声音。 ### C 是 CD 像 Linux 一样,FreeDOS 支持目录,这会允许你以一种来你有帮助的方式来组织你的文件。例如,你可以在一个名称为 `FILES` 的目录中存放你的全部文件,对于某些类型的文件,你可能会有其它的目录,例如,针对字处理器文件的 `DOCS` ,或者针对表格文件的 `SPRDSHT`。 你可以使用 `CD`(即 “<ruby> 更改目录 <rt> change directory </rt></ruby>”) 命令来导航到一个目录。`CHDIR` 命令和 `CD` 命令一样,如果你更喜欢使用这种语法的话。 为更改到一个新的目录,使用 `CD` 目录和目标目录: ``` C:\>cd files C:\FILES>cd sprdsht C:\FILES\SPRDSHT>dir Volume in drive C is FREEDOS2022 Volume Serial Number is 333D-0B18 Directory of C:\FILES\SPRDSHT . <DIR> 05-27-2022 9:59p .. <DIR> 05-27-2022 9:59p FIB WKS 2,093 05-27-2022 10:07p LAB1 WKS 2,087 05-27-2022 10:10p MIS100 WKS 2,232 05-27-2022 10:05p 3 file(s) 6,412 bytes 2 dir(s) 279,527,424 bytes free ``` 你不必一次导航一层目录。相反,你可以使用一个 `CD` 命令和提供完整的你想要更改到的目录路径: ``` C:\>cd \files\sprdsht C:\FILES\SPRDSHT>dir Volume in drive C is FREEDOS2022 Volume Serial Number is 333D-0B18 Directory of C:\FILES\SPRDSHT . <DIR> 05-27-2022 9:59p .. <DIR> 05-27-2022 9:59p FIB WKS 2,093 05-27-2022 10:07p LAB1 WKS 2,087 05-27-2022 10:10p MIS100 WKS 2,232 05-27-2022 10:05p 3 file(s) 6,412 bytes 2 dir(s) 279,527,424 bytes free ``` ### D 是 DELTREE 如果需要删除一个单个文件,你可以使用 `DEL` 命令。为删除一个空的目录,你可以使用 `RMDIR` 或 `RD` 命令。但是,如果你想删除一个有很多文件和子目录的目录? 一个包含有其它目录的目录称为 *目录树* 。你可以使用 `DELTREE` 命令来删除整个目录树。例如,为删除你的 `FILES` 目录,包括其中包含的所有的文件和目录,输入这个命令: ``` C:\>deltree files [DEFAULT-BUILD v1.02g] of DELTREE. The "ROOT-SAFETY-CHECK" is enabled. Delete directory "C:\FILES" and all its subdirectories? [Y] [N] [Q], [ENTER] ? Y ==> Deleting "C:\FILES" ... ``` 你可以使用一个单一的 `DELTREE` 命令来轻松快捷地完成很多工作,因此,FreeDOS 的 `DELTREE` 提示会询问你是否真的想要这样做。谨慎地使用这个命令。 ### E 是 EDIT 如果你需要在 FreeDOS 上编辑一个文本文件,`EDIT` 程序会让你轻松快速地完成任务。例如,要开始编辑一个名称为 `HELLO.TXT` 的文件,输入 `EDIT HELLO.TXT` 。如果 `HELLO.TXT` 文件已经存在,`EDIT` 打开文件并开始编辑。如果 `HELLO.TXT` 尚未存在,那么 `EDIT` 为你开启一个新的文件。 ![Image of edit](/data/attachment/album/202310/12/103016ctybjctav77ifrza.png) FreeDOS 的 `EDIT` 使用了一种友好的界面,对大多数人来说应该很容易使用。使用菜单来访问 `EDIT` 的各种特色功能,包括保存文件、打开一个新的文件、或者退出编辑器。为访问菜单,在你的键盘上按下 `Alt` 按键,然后使用箭头按键来避开和进入选择的动作。 ![Image of save menu](/data/attachment/album/202310/12/103016h2420yx0x5xfs8pf.png) ### F 是 FIND 如果你需要在一个文件中查找文本,`FIND` 命令可以完成这项工作。类似于在 Linux 上的 `fgrep` ,`FIND` 会打印一些包含一个字符串的行。例如,为检查 `FDCONFIG.SYS` 文件中的 "Menu Default" 条目项,像这样使用 `FIND` : ``` C:\>find "MENUDEFAULT" fdconfig.sys ---------------- FDCONFIG.SYS MENUDEFAULT=2,5 ``` 如果你不确定你想要查找的字符串是使用的大写字母还是小写字母,添加 `/I` 选项来忽略字母的大小写情况: ``` C:\>find /i "menudefault" fdconfig.sys ---------------- FDCONFIG.SYS MENUDEFAULT=2,5 ``` ### G 是 GRAPHICS 如果你想要捕捉屏幕,你可以使用你键盘上的 `PrtScr`(<ruby> 打印屏幕 <rt> Print Screen </rt></ruby>)按键来直接将你显示器上的文本打印到打印机上。不过,这只对纯文本来说有效。如果你要打印图形屏幕,你需要加载 `GRAPHICS` 程序。 `GRAPHICS` 支持不同的打印机类型,包括 HP 的 PCL 打印机、Epson 的点阵打印机,和兼容 PostScript 的打印机。例如,如果有一台连接到你的计算机的 HP 的激光打印机,你可以通过输入这条命令来为这台打印机加载支持: ``` C:\>graphics hpdefault Running in MS GRAPHICS compatibility mode... Using HPPCL type for type hpdefault If you think this is not correct, mail me (see help text). Printing black as white and white as black which internally uses /I of this GRAPHICS. You can use the following command directly instead of GRAPHICS [your options] in the future: LH GRAPH-HP /I Note that GRAPH-HP allows extra options: /E economy mode, /1 use LPT1, /2 use LPT2, /3 use LPT3, /R for random instead of ordered dither /C for 300dpi instead of 600dpi Driver to make 'shift PrtScr' key work even in CGA, EGA, VGA, MCGA graphics modes loaded, in HP PCL mode. ``` ### H 是 HELP 如果你刚刚来到 FreeDOS 的世界,你可以通过输入 `HELP` 来获取如何使用不同命令的提示。这将带来 FreeDOS 的帮助系统,包含所有命令的文档: ![Image of FreeDos help system](/data/attachment/album/202310/12/103017upqlqr0exavgbxex.png) ### I 是 IF 你可以使用 `IF` 语句来将条件语句添加到你的命令行或*批处理文件* 。`IF` 进行一次简短的测试,然后执行一个单个命令。例如,如果存在某个文件,那么打印结果 “It's there”,你可以输入: ``` C:\>if exist kernel.sys echo It's there It's there ``` 如果你想要测试相反的东西,在测试内容前,使用 `NOT` 关键字。例如,如果两个字符串的值不相同,那么打印结果 “Not equal” ,输入这条语句: ``` C:\>if not "a"=="b" echo Not equal Not equal ``` ### J 是 JOIN 早期的 DOS 版本是相当简单的;DOS 的第一个版本甚至不支持目录。为向这些较旧的程序提供向后兼容性,我们需要 `JOIN` 程序来作为一种巧妙的应变方法。`JOIN` 使用驱动器字母代替路径,这样,你可以将旧程序放入其自己的子目录中,但是,使用一个单个驱动器字母来访问它。 让我们假设你有一个名称为 `VC` 的旧应用程序,它不懂目录。为保持 `VC` 的工作,你可以将它的路径 <ruby> 连接 <rt> join </rt></ruby> 到一个驱动器字母。例如: ``` JOIN V: D:\VC ``` FreeDOS 将 `JOIN` 实施为 `SWSUBST`,它也兼备类似 `SUBST` 命令的特色功能。为将 `D:\VC` 路径链接到到一个名称为 `V:` 的驱动器字母,输入: ``` C:\>swsubst v: d:\vc C:\>dir v: Volume in drive V is DATA Volume Serial Number is 212C-1DF8 Directory of V:\ . <DIR> 02-21-2022 10:35p .. <DIR> 02-21-2022 10:35p VC COM 27,520 07-14-2019 4:48p 1 file(s) 27,520 bytes 2 dir(s) 48,306,176 bytes free ``` ### K 是 KEYB DOS 默认采用美式英语键盘布局。你的键盘是不同的,你可以使用 `KEYB` 命令来加载新的键盘语言布局。例如,为为加载一种德语键盘布局,输入: ``` C:\>keyb gr FreeDOS KEYB 2.01 - (c) Aitor Santamaría Merino - GNU GPL 2.0 Keyboard layout : C:\FREEDOS\BIN\KEYBOARD.SYS:GR [858] (3) ``` ### L 是 LABEL FreeDOS 使用 <ruby> 标签 <rt> label </rt></ruby> 来命名每个软盘驱动器和硬盘驱动器。这些标签提供了一种识别磁盘可能包含内容的方法。当你需要将文件存储到单个不同的软盘上时,`LABEL` 命令是非常有用的,你可以标记一个软盘 “Data”,另一个软盘为 “Games” 。 为分配一个新的标签到一个驱动器。或者更改在一个驱动器上的现存标签。像这样使用标签: ``` D:\>label d: data D:\>dir /w Volume in drive D is DATA Volume Serial Number is 212C-1DF8 Directory of D:\ [123] [ABILITY] [ASEASY] [GAMES2] [QUATTRO] [SRC] [TEMP] [THE] [VC] [WORD] [WS400] EDLIN16.EXE EDLIN32.EXE MYENV.BAT 3 file(s) 113,910 bytes 11 dir(s) 48,306,176 bytes free ``` ### M 是 MEM 运行程序和加载驱动程序会占用内存。可以查看你的系统有多少内存,以及有多少可用来运行 DOS 程序,使用 `MEM` 命令: ``` C:\>mem Memory Type Total Used Free ---------------- -------- -------- -------- Conventional 639K 11K 628K Upper 104K 18K 86K Reserved 281K 281K 0K Extended (XMS) 15,224K 537K 14,687K ---------------- -------- -------- -------- Total memory 16,248K 847K 15,401K Total under 1 MB 743K 29K 714K Total Expanded (EMS) 8,576K (8,781,824 bytes) Free Expanded (EMS) 8,192K (8,388,608 bytes) Largest executable program size 628K (643,104 bytes) Largest free upper memory block 84K ( 85,728 bytes) FreeDOS is resident in the high memory area. ``` ### N 是 NANSI 如果你想添加一点颜色到 FreeDOS 命令行,你可以使用 ANSI 转义序列。这些序列之所以叫“转义”,是因为每个序列都以代码 33(转义字符 `ESC`)和一个由美国国家标准化协会(ANSI)定义的特殊字符序列为开头。 FreeDOS 通过 `NANSI.SYS` 驱动程序来支持 ANSI 转义序列。随着 `NANSI` 的加载,你的 FreeDOS 控制台将解释 ANSI 转义序列,例如,设置文本颜色。 ![Image of Nansi](/data/attachment/album/202310/12/103017hvxf3zrraynrn3sm.png) ### O 是 oZone FreeDOS 是一款命令行操作系统,但是一些人们更喜欢使用可备选的图形化用户界面。这就是为什么 FreeDOS 的 1.3 发行版包含一些图形化桌面的原因。我喜欢的一款名称为 oZone 的图形化桌面,它提供一种时尚、现代化外观的界面。 ![Image of Ozone GUI](/data/attachment/album/202310/12/103017y6gh36h7i66zf4hi.png) 注意,oZone 有一点烦人的错误,可能还需要一些来自外部开发者的关爱。如果你想让 oZone 变得更好,可以下载源文件代码做些贡献。 ### P 是 PROMPT 标准的 FreeDOS 命令行提示符会告诉你:你所在文件系统中的位置。当你第一次启动 FreeDOS 时,你的提示符看起来像 `C:\>`, 这意味着 `\`(根)目录在 `C:` 驱动器。`>` 字符表示着你可以在那里输入命令。 在你的提示符中,如果你更喜欢不同的信息,使用 `PROMPT` 目录来更改它。你可以使用一个带有 `$` 的开头的特殊代码来显示不同的信息,例如,`$D` 用于日期、`$T` 用于时间。例如,你可以使用 `$$` 指令来使你的 FreeDOS 命令行看起来像一个 Linux 提示符,来打印一个单个美元符号: ``` C:\>prompt $$ $ ``` 输入 `PROMPT /?` 来查看一份全部特殊代码的列表。 ### Q 是 QBASIC FreeDOS 实际上没有 QBASIC 。它是针对 MS-DOS 的专有 BASIC 语言环境。作为备选方案,我们提供一些开放源文件的编译器,包括一些针对 BASIC 编程的编译器。 FreeBASIC 编译器可以编译外来的大多数 QBASIC 程序。这里有一个简单的 “猜数” 示例: ``` dim number as integer dim guess as integer randomize timer number = int( 10 * rnd() ) + 1 print "Guess the number from 1 to 10:" do input guess if guess < number then print "Too low" if guess > number then print "Too high" loop while guess <> number print "That's right!" ``` 使用 `FBC` 命令来编译 FreeBASIC 程序: ``` C:\DEVEL\FBC>fbc guess.bas ``` 这里是这个简单游戏的快速演示: ``` C:\DEVEL\FBC>guess Guess the number from 1 to 10: ? 5 Too high ? 3 Too low ? 4 That's right! ``` ### R 是 REM 在编写程序时,注释是极好的;注释帮助我们理解程序应该要做什么。可以在批处理文件中使用 `REM` 来做同样的事。在批处理文件中,在 `REM` 的后面的任何东西都将会被忽略。 ``` REM this is a comment ``` ### S 是 SET FreeDOS 命令行使用一系列称为 <ruby> 环境变量 <rt> environment variables </rt></ruby> 的变量,让你来自定义你的系统。你可以使用 `SET` 命令来设置这些变量。例如。使用 `DIRCMD` 变量来控制 `DIR` 如何排列目录列表。为设置 `DIRCMD` 变量,使用 `SET` 命令: ``` SET DIRCMD=/O:GNE ``` 这告诉 `DIR` 先按照目录分组(`G`)来排序(`O`)输出,然后再按照名称(`N`)和扩展名(`E`)来排序结果。 ### T 是 TYPE `TYPE` 命令是最常使用的 DOS 命令之一。`TYPE` 显示一个文件的内容,类似于在 Linux 上的 `cat` 。 ``` C:\DEVEL>type hello.c #include int main() { puts("Hello world"); return 0; } ``` ### U 是 UNZIP 在 Linux 上,你可能更熟悉标准的 Unix 存档命令: `tar`。在 FreeDOS 上也有一个 `tar` 版本(和其它大量的流行的存档程序),但是,在 DOS 上的事实上的标准的存档命令是 `ZIP` 和 `UNZIP` 。两者都默认安装在 FreeDOS 1.3 之中。 比如说,我有一些文件的一个 zip 存档。如果我想提取整个 Zip 文件,我可以只使用 `UNZIP` 命令,并将 Zip 文件作为命令行的选项来提供。这将在我当前工作目录中开始提取存档文件。除非我正在恢复一些东西的先前版本,我通常不希望覆盖我的当前文件。在这种情况下,我将提取存档到一个新的目录。你可以使用 `-d`(“<ruby> 目标 <rt> destination </rt></ruby>”)命令行选项来具体指定目标路径: ``` D:\SRC>unzip monkeys.zip -d monkeys.new Warning: TZ environment variable not found, cannot use UTC times!! Archive: monkeys.zip creating: monkeys.new/monkeys/ inflating: monkeys.new/monkeys/banana.c inflating: monkeys.new/monkeys/banana.obj inflating: monkeys.new/monkeys/banana.exe creating: monkeys.new/monkeys/putimg/ inflating: monkeys.new/monkeys/putimg/putimg.c inflating: monkeys.new/monkeys/putimg/putimg.obj inflating: monkeys.new/monkeys/putimg/putimg.exe ``` 为学习更多关于 `ZIP` 和 `UNZIP` 命令的信息,可以阅读 [如何在 FreeDOS 上存档文件](https://opensource.com/article/21/6/archive-files-freedos)。 ### V 是 VER 在 DOS 的古老岁月中,`VER` 命令会报告你正在运行的 DOS 发行版本,例如:“MS-DOS 5.0.D”。对于 FreeDOS,`VER` 命令将给予你额外的详细信息,例如 FreeDOS Shell 的版本: ``` C:\DEVEL>ver FreeCom version 0.85a - WATCOMC - XMS_Swap [Jul 10 2021 19:28:06] ``` 如果你还想查看 FreeDOS 内核版本和 DOS 兼容性等级,添加 `/R` 选项: ``` C:\DEVEL>ver /r FreeCom version 0.85a - WATCOMC - XMS_Swap [Jul 10 2021 19:28:06] DOS version 7.10 FreeDOS kernel 2043 (build 2043 OEM:0xfd) [compiled May 14 2021] ``` ### W 是 WHICH FreeDOS 命令行可以运行来自记录在 `PATH` 变量中的不同的目录列表的程序。你可以使用 `WHICH` 命令来准确地识别出程序的位置。只需要输入 `WHICH` 加上你想要定位的程序名称: ``` C:\>which xcopy xcopy C:\FREEDOS\BIN\XCOPY.EXE ``` ### X 是 XCOPY `COPY` 命令只能将文件从一个位置复制到另一个位置。如果你想扩大复制的范围来包括一些目录,使用 `XCOPY` 命令。我通常添加 `/E` 选项来包含所有的子目录,包括空的子目录,这样,我可以复制整个目录树。这样就可以有效地备份我正在工作的任意工程: ``` D:\SRC>xcopy /e monkeys monkeys.bak Does MONKEYS.BAK specify a file name or directory name on the target (File/Directory)? d Copying D:\SRC\MONKEYS\PUTIMG\PUTIMG.C Copying D:\SRC\MONKEYS\PUTIMG\PUTIMG.OBJ Copying D:\SRC\MONKEYS\PUTIMG\PUTIMG.EXE Copying D:\SRC\MONKEYS\BANANA.C Copying D:\SRC\MONKEYS\BANANA.OBJ Copying D:\SRC\MONKEYS\BANANA.EXE 6 file(s) copied ``` ### Y 是 Yellow 这不是一个命令,而是关于 DOS 如何显示颜色的有趣的百科知识。如果你仔细留心过 FreeDOS,你可能已经注意到,文本只能获取有限的颜色范围—— 十六种文本颜色、八种背景颜色。 IBM 的 5153 彩色显示器,通过点亮不同亮度等级的微小的红、绿、蓝荧光点的方式创建 16 种文本颜色和 8 种背景颜色来为用户显示颜色。早期的个人计算机只能以“标准强度”级别来显示背景颜色;只有文本颜色可以使用明亮颜色。 如果你查看文本颜色,你有黑色、蓝色、绿色、蓝绿色、红色、品红色、橙色和白色。这些颜色的“明亮”版本有亮黑色(暗灰色)、亮蓝色、亮绿色、亮蓝绿色、亮红色、亮品红色、黄色和亮白色。橙色的“明亮”版本有实际上是黄色。没有“亮橙色”。 如果你想要学习更多关于文本颜色的信息,阅读我们关于 [FreeDOS 为什么有 16 种颜色](https://opensource.com/article/21/6/freedos-sixteen-colors) 的文章。 ### Z 是 ZIP 你可以在 DOS 命令行中使用 `ZIP` 来创建文件和目录的存档。这是一种很便利的方法:可以备份你的工作,或者发布一个 “软件包” 来在未来的 FreeDOS 发行版中使用。例如,比如说,我想备份我的工程源文件代码,其中包含这些源文件文件: ``` D:\SRC>zip -9r monkeys.zip monkeys zip warning: TZ environment variable not found, cannot use UTC times!! adding: monkeys/ (stored 0%) adding: monkeys/banana.c (deflated 66%) adding: monkeys/banana.obj (deflated 26%) adding: monkeys/banana.exe (deflated 34%) adding: monkeys/putimg/ (stored 0%) adding: monkeys/putimg/putimg.c (deflated 62%) adding: monkeys/putimg/putimg.obj (deflated 29%) adding: monkeys/putimg/putimg.exe (deflated 34%) ``` ZIP 支持很多命令行选项来完成不同的工作,但是,我使用最多的命令行选项是: `-r` 用于递归处理目录和子目录、`-9` 用于提供尽可能大的压缩比。`ZIP` 和 `UNZIP` 使用类 Unix 命令行,因此,你可以在短划线后面合并选项: `-9r` 将在 Zip 文件中给予最大压缩比和包括子目录。 关于如何使用 `ZIP` 和 `UNZIP` 命令的更多详细信息,阅读 [如何在 FreeDOS 上存档文件](https://opensource.com/article/21/6/archive-files-freedos)。 ### 新的 FreeDOS 指南 准备好你的 FreeDOS 旅程的下一步了吗?查看我们的新的电子书,现在开始尝试我们的 FreeDOS ! > > **[FreeDOS 使用指南](https://opensource.com/downloads/guide-using-freedos)** > > > > > **[深入 FreeDOS 高级指南](https://opensource.com/downloads/advanced-freedos)** > > > *(题图:MJ/0b21dcc8-4c8d-457b-9e0d-fbbe5dd08c60)* --- via: <https://opensource.com/article/22/6/26-freedos-commands> 作者:[Jim Hall](https://opensource.com/users/jim-hall) 选题:[lkxed](https://github.com/lkxed) 译者:[robsean](https://github.com/robsean) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
One of my family's first computers ran a command-line operating system called DOS, the "Disk Operating System." I grew up with DOS, and learned to leverage the command line to make my work easier. And so did a lot of other people. We loved DOS so much that in 1994, we created the FreeDOS Project. Today on June 29, we celebrate 28 years of FreeDOS. If you're new to FreeDOS, you may be confused about how to use the different command line programs that come with it. Let's get started with 26 of my favorite FreeDOS commands. To learn more, add the /? option after most commands to get more information: ``` `````` C:\>attrib /? ATTRIB v2.1 - Displays or changes file attributes. Copyright (c) 1998-2003, licensed under GPL2. Syntax: ATTRIB { options | [path][file] | /@[list] } Options: +H Sets the Hidden attribute. -H Clears the Hidden attribute. +S Sets the System attribute. -S Clears the System attribute. +R Sets the Read-only attribute. -R Clears the Read-only attribute. +A Sets the Archive attribute. -A Clears the Archive attribute. /S Process files in all directories in the specified path(es). /D Process directory names for arguments with wildcards. /@ Process files, listed in the specified file [or in stdin]. Examples: attrib file -rhs attrib +a -r dir1 dir2*.dat /s attrib -hs/sd /@list.txt *.* ``` ## A is for ATTRIB The `ATTRIB` program displays or changes a file's *attributes*. An attribute can be one of four values: Hidden (H), System (S), Read-only (R), and Archive (A). Files marked as Hidden don't display in a directory listing. For example, suppose you want to "hide" a file called `SECRET.TXT` so no one would know it was there. First, you can show the attributes on that file to see its current settings: ``` `````` C:\FILES>attrib secret.txt [----A] SECRET.TXT ``` To hide this file, turn on the Hidden attribute by using the plus (`+` ) operator, like this: ``` `````` C:\FILES>attrib +h secret.txt [----A] -> [-H--A] SECRET.TXT C:\FILES>dir Volume in drive C is FREEDOS2022 Volume Serial Number is 333D-0B18 Directory of C:\FILES . <DIR> 05-27-2022 9:22p .. <DIR> 05-27-2022 9:22p 0 file(s) 0 bytes 2 dir(s) 279,560,192 bytes free ``` Another common way to use `ATTRIB` is by manipulating the Read-only attribute, so you don't accidentally overwrite an important file. Suppose you want to protect the `SECRET.TXT` file so you can't delete or change it. Turn on the Read-only attribute like this, with the `+R` modifier: ``` `````` C:\FILES>attrib +r secret.txt [----A] -> [---RA] SECRET.TXT C:\FILES>del secret.txt C:\FILES\SECRET.TXT: Permission denied no file removed. ``` **[ Related read: How I use the attr command with my Linux filesystem ]** ## B is for BEEP If you need to add a little pizzazz to a batch file, you can use the `BEEP` command to get the user's attention. `BEEP` doesn't display anything to the screen, but simply generates a classic “beep” tone. Note that `BEEP` uses the PC's built-in speaker to make the “beep” sound. If you boot FreeDOS using a virtual machine, check that your system is set up to correctly emulate the PC speaker. Otherwise, you will not hear anything. ## C is for CD Like Linux, FreeDOS supports directories, which allow you to organize your files in a way that makes sense to you. For example, you might keep all of your files in a directory called `FILES` , and you might have other directories inside `FILES` for certain kinds of files, such as `DOCS` for word processor files, or `SPRDSHT` for spreadsheet files. You can navigate into a directory using the `CD` or *change directory* command. The `CHDIR` command is the same as `CD` , if you prefer to use that syntax. To change into a new directory, use the `CD` command with the destination directory: ``` `````` C:\>cd files C:\FILES>cd sprdsht C:\FILES\SPRDSHT>dir Volume in drive C is FREEDOS2022 Volume Serial Number is 333D-0B18 Directory of C:\FILES\SPRDSHT . <DIR> 05-27-2022 9:59p .. <DIR> 05-27-2022 9:59p FIB WKS 2,093 05-27-2022 10:07p LAB1 WKS 2,087 05-27-2022 10:10p MIS100 WKS 2,232 05-27-2022 10:05p 3 file(s) 6,412 bytes 2 dir(s) 279,527,424 bytes free ``` You don't have to navigate one directory at a time. You can instead provide the full directory path you want to change to, with one `CD` command: ``` `````` C:\>cd \files\sprdsht C:\FILES\SPRDSHT>dir Volume in drive C is FREEDOS2022 Volume Serial Number is 333D-0B18 Directory of C:\FILES\SPRDSHT . <DIR> 05-27-2022 9:59p .. <DIR> 05-27-2022 9:59p FIB WKS 2,093 05-27-2022 10:07p LAB1 WKS 2,087 05-27-2022 10:10p MIS100 WKS 2,232 05-27-2022 10:05p 3 file(s) 6,412 bytes 2 dir(s) 279,527,424 bytes free ``` ## D is for DELTREE If you need to delete a single file, you can use the `DEL` command. To remove an empty directory, you can use the `RMDIR` or `RD` commands. But what if you want to delete a directory that has lots of files and subdirectories inside it? A directory with other directories inside it is called a *directory tree*. You can delete an entire directory tree with the `DELTREE` command. For example, to delete your `FILES` directory, including all the files and directories it contains, type this command: ``` `````` C:\>deltree files [DEFAULT-BUILD v1.02g] of DELTREE. The "ROOT-SAFETY-CHECK" is enabled. Delete directory "C:\FILES" and all its subdirectories? [Y] [N] [Q], [ENTER] ? Y ==> Deleting "C:\FILES" ... ``` You can easily and quickly wipe out a lot of work with a single `DELTREE` command, so the FreeDOS `DELTREE` prompts you to ask if this is really something you want to do. Use this command carefully. ## E is for EDIT If you need to edit a text file on FreeDOS, the `EDIT` program lets you do that quickly and easily. For example, to start editing a file called `HELLO.TXT` , type `EDIT HELLO.TXT` . If the `HELLO.TXT` file already exists, `EDIT` opens the file for editing. If `HELLO.TXT` doesn't exist yet, then `EDIT` starts a new file for you. ![Image of edit](https://opensource.com/sites/default/files/2022-06/FREEDedit_0.png) (Jim Hall, CC BY-SA 40) FreeDOS `EDIT` uses a friendly interface that should be easy for most people to use. Use the menus to access the various features of EDIT, including saving a file, opening a new file, or exiting the editor. To access the menus, tap the Alt key on your keyboard, then use the arrow keys to get around and Enter to select an action. ![Image of save menu](https://opensource.com/sites/default/files/2022-06/Freededit-save.png) (Jim Hall, CC BY-SA 40) ## F is for FIND If you need to find text in a file, the `FIND` command does the job. Similar to `fgrep` on Linux, `FIND` prints lines that contain a string. For example, to check the "Menu Default" entry in the `FDCONFIG.SYS` file, use `FIND` like this: ``` `````` C:\>find "MENUDEFAULT" fdconfig.sys ---------------- FDCONFIG.SYS MENUDEFAULT=2,5 ``` If you aren't sure if the string you want to find uses uppercase or lowercase letters, add the `/I` option to ignore the letter case: ``` `````` C:\>find /i "menudefault" fdconfig.sys ---------------- FDCONFIG.SYS MENUDEFAULT=2,5 ``` **[ Download the cheat sheet: Linux find command ]** ## G is for GRAPHICS If you want to capture a screen, you might use the **PrtScr** (Print Screen) key on your keyboard to print the text on your monitor directly to a printer. However, this only works for plain text. If you want to print graphic screens, you need to load the `GRAPHICS` program. `GRAPHICS` supports different printer types, including HP PCL printers, Epson dot matrix printers, and PostScript-compatible printers. For example, if you have an HP laser printer connected to your computer, you can load support for that printer by typing this command: ``` `````` C:\>graphics hpdefault Running in MS GRAPHICS compatibility mode... Using HPPCL type for type hpdefault If you think this is not correct, mail me (see help text). Printing black as white and white as black which internally uses /I of this GRAPHICS. You can use the following command directly instead of GRAPHICS [your options] in the future: LH GRAPH-HP /I Note that GRAPH-HP allows extra options: /E economy mode, /1 use LPT1, /2 use LPT2, /3 use LPT3, /R for random instead of ordered dither /C for 300dpi instead of 600dpi Driver to make 'shift PrtScr' key work even in CGA, EGA, VGA, MCGA graphics modes loaded, in HP PCL mode. ``` ## H is for HELP If you're new to FreeDOS, you can get hints on how to use the different commands by typing `HELP` . This brings up the FreeDOS Help system, with documentation on all the commands: ![Image of FreeDos help system](https://opensource.com/sites/default/files/2022-06/Freedhelp.system.png) (Jim Hall, CC BY-SA 40) **[ Read also: The only Linux command you need to know ]** ## I is for IF You can add conditional statements to your command line or *batch file* using the `IF` statement. `IF` makes a simple test, then executes a single command. For example, to print the result "It's there" if a certain file exists, you can type: ``` `````` C:\>if exist kernel.sys echo It's there It's there ``` If you want to test the opposite, use the `NOT` keyword before the test. For example, to print "Not equal" if two strings are not the same value, type this: ``` `````` C:\>if not "a"=="b" echo Not equal Not equal ``` ## J is for JOIN Early DOS versions were fairly simple; the first version of DOS didn't even support directories. To provide backwards compatibility for those older programs, we have the `JOIN` program as a neat workaround. `JOIN` replaces a path with a drive letter, so you can put an old program in its own subdirectory, but access it using a single drive letter. Let's say you had an old application called `VC` that doesn't understand directories. To keep working with `VC` , you can "join" its path to a drive letter. For example: ``` `````` JOIN V: D:\VC ``` FreeDOS implements `JOIN` as `SWSUBST` , which also combines features from the similar `SUBST` command. To join the `D:\VC` path to a new drive letter called `V:` , type: ``` `````` C:\>swsubst v: d:\vc C:\>dir v: Volume in drive V is DATA Volume Serial Number is 212C-1DF8 Directory of V:\ . <DIR> 02-21-2022 10:35p .. <DIR> 02-21-2022 10:35p VC COM 27,520 07-14-2019 4:48p 1 file(s) 27,520 bytes 2 dir(s) 48,306,176 bytes free ``` ## K is for KEYB DOS assumes a US keyboard layout by default. If your keyboard is different, you can use the `KEYB` command to load a new keyboard language layout. For example, to load a German keyboard layout, type: ``` `````` C:\>keyb gr FreeDOS KEYB 2.01 - (c) Aitor Santamaría Merino - GNU GPL 2.0 Keyboard layout : C:\FREEDOS\BIN\KEYBOARD.SYS:GR [858] (3) ``` ## L is for LABEL FreeDOS names each floppy drive and hard drive with a *label*. These labels provide a handy way to identify what a disk might contain. The `LABEL` command was immensely useful when you needed store files across a number of different floppy disks, where you might label one floppy "Data" and another floppy as "Games." To assign a new label to a drive, or to change the existing label on a drive, use LABEL like this: ``` `````` D:\>label d: data D:\>dir /w Volume in drive D is DATA Volume Serial Number is 212C-1DF8 Directory of D:\ [123] [ABILITY] [ASEASY] [GAMES2] [QUATTRO] [SRC] [TEMP] [THE] [VC] [WORD] [WS400] EDLIN16.EXE EDLIN32.EXE MYENV.BAT 3 file(s) 113,910 bytes 11 dir(s) 48,306,176 bytes free ``` ## M is for MEM Running programs and loading drivers takes memory. To see how much memory your system has, and how much memory is free for running DOS programs, use the `MEM` command: ``` `````` C:\>mem Memory Type Total Used Free ---------------- -------- -------- -------- Conventional 639K 11K 628K Upper 104K 18K 86K Reserved 281K 281K 0K Extended (XMS) 15,224K 537K 14,687K ---------------- -------- -------- -------- Total memory 16,248K 847K 15,401K Total under 1 MB 743K 29K 714K Total Expanded (EMS) 8,576K (8,781,824 bytes) Free Expanded (EMS) 8,192K (8,388,608 bytes) Largest executable program size 628K (643,104 bytes) Largest free upper memory block 84K ( 85,728 bytes) FreeDOS is resident in the high memory area. ``` ## N is for NANSI If you want to add a little color to the FreeDOS command line, you can use ANSI escape sequences. These sequences are so named because each starts with code 33 (the `ESC` character) and a special sequence of characters, as defined by the American National Standards Institute, or ANSI. FreeDOS supports ANSI escape sequences through the `NANSI.SYS` driver. With `NANSI` loaded, your FreeDOS console interprets the ANSI escape sequences, such as setting the text colors. ![Image of Nansi](https://opensource.com/sites/default/files/2022-06/FreeDnansi.png) (Jim Hall, CC BY-SA 40) ## O is for oZone FreeDOS is a command line operating system, but some folks prefer to use a graphical user interface instead. That's why FreeDOS 1.3 includes several graphical desktops. One desktop I like is called oZone, which provides a sleek, modern-looking interface. ![Image of Ozone GUI](https://opensource.com/sites/default/files/2022-06/FreeDozone.png) (Jim Hall, CC BY-SA 40) Note that oZone has a few annoying bugs, and could use some love from a developer out there. If you're interested in making oZone even better, feel free to download the source code. ## P is for PROMPT The standard FreeDOS command-line prompt tells you where you are in the filesystem. When you first boot FreeDOS, your prompt looks like `C:\>` , which means the "\" (root) directory on the "C:" drive. The ">" character indicates where you can type a command. If you prefer different information on your prompt, use the `PROMPT` command to change it. You can represent different information with a special code preceded with `$` , such as `$D` for the date and `$T` for the time. For example, you can make your FreeDOS command line look like a Linux prompt with the `$$` instruction, to print a single dollar sign: ``` `````` C:\>prompt $$ $ ``` Type `PROMPT /?` to see a list of all special codes. ## Q is for QBASIC FreeDOS doesn't actually have QBASIC. That was a proprietary BASIC programming environment for MS-DOS. Instead, we provide several open source compilers, including some for BASIC programming. The FreeBASIC Compiler should compile most QBASIC programs out there. Here's a simple "guess the number" example: ``` `````` dim number as integer dim guess as integer randomize timer number = int( 10 * rnd() ) + 1 print "Guess the number from 1 to 10:" do input guess if guess < number then print "Too low" if guess > number then print "Too high" loop while guess <> number print "That's right!" ``` Use the `FBC` command to compile the program with FreeBASIC: ``` `````` C:\DEVEL\FBC>fbc guess.bas ``` Here's a quick demonstration of that simple game: ``` `````` C:\DEVEL\FBC>guess Guess the number from 1 to 10: ? 5 Too high ? 3 Too low ? 4 That's right! ``` **[ Read next: Learn Fortran by writing a "guess the number" game ]** ## R is for REM Comments are great when writing programs; comments help us understand what the program is supposed to do. You can do the same in batch files using the `REM` command. Anything after the `REM` is ignored in a batch file. ``` `````` REM this is a comment ``` ## S is for SET The FreeDOS command line uses a set of variables called *environment variables* that let you customize your system. You can set these variables with the `SET` command. For example, use the `DIRCMD` variable to control how `DIR` arranges directory listings. To set the `DIRCMD` variable, use the `SET` command: ``` `````` SET DIRCMD=/O:GNE ``` This tells `DIR` to order (O) the output by grouping (G) directories first, then sorting the results by name (N) and extension (E). ## T is for TYPE The `TYPE` command is one of the most-often used DOS commands. `TYPE` displays the contents of a file, similar to `cat` on Linux. ``` `````` C:\DEVEL>type hello.c #include <stdio.h> int main() { puts("Hello world"); return 0; } ``` ## U is for UNZIP On Linux, you may be familiar with the standard Unix archive command: `tar` . There's a version of tar on FreeDOS too (and a bunch of other popular archive programs), but the de facto standard archiver on DOS is `ZIP` and `UNZIP` . Both are installed in FreeDOS 1.3 by default. Let's say I had a zip archive of some files. If I want to extract the entire Zip file, I could just use the `UNZIP` command and provide the Zip file as a command-line option. That extracts the archive starting at my current working directory. Unless I'm restoring a previous version of something, I usually don't want to overwrite my current files. In that case, I will want to extract the archive to a new directory. You can specify the destination path with the `-d` ("destination") command-line option: ``` `````` D:\SRC>unzip monkeys.zip -d monkeys.new Warning: TZ environment variable not found, cannot use UTC times!! Archive: monkeys.zip creating: monkeys.new/monkeys/ inflating: monkeys.new/monkeys/banana.c inflating: monkeys.new/monkeys/banana.obj inflating: monkeys.new/monkeys/banana.exe creating: monkeys.new/monkeys/putimg/ inflating: monkeys.new/monkeys/putimg/putimg.c inflating: monkeys.new/monkeys/putimg/putimg.obj inflating: monkeys.new/monkeys/putimg/putimg.exe ``` To learn more about the `ZIP` and `UNZIP` commands, read [How to archive files on FreeDOS](https://opensource.com/article/21/6/archive-files-freedos). ## V is for VER In the old days of DOS, the `VER` command reported the DOS distribution you were running, such as "MS-DOS 5.0.D" With FreeDOS, the `VER` command gives you additional details, such as the version of the FreeDOS Shell: ``` `````` C:\DEVEL>ver FreeCom version 0.85a - WATCOMC - XMS_Swap [Jul 10 2021 19:28:06] ``` If you also want to see the FreeDOS kernel version and the DOS compatibility level, add the `/R` option: ``` `````` C:\DEVEL>ver /r FreeCom version 0.85a - WATCOMC - XMS_Swap [Jul 10 2021 19:28:06] DOS version 7.10 FreeDOS kernel 2043 (build 2043 OEM:0xfd) [compiled May 14 2021] ``` ## W is for WHICH The FreeDOS command line can run programs from a list of different directories, identified in a `PATH` variable. You can use the `WHICH` command to identify exactly where a program is located. Just type `WHICH` plus the name of the program you want to locate: ``` `````` C:\>which xcopy xcopy C:\FREEDOS\BIN\XCOPY.EXE ``` ## X is for XCOPY The `COPY` command copies only files from one place to another. If you want to extend the copy to include any directories, use the `XCOPY` command instead. I usually add the `/E` option to include all subdirectories, including empty ones, so I can copy the entire directory tree. This makes an effective backup of any project I am working on: ``` `````` D:\SRC>xcopy /e monkeys monkeys.bak Does MONKEYS.BAK specify a file name or directory name on the target (File/Directory)? d Copying D:\SRC\MONKEYS\PUTIMG\PUTIMG.C Copying D:\SRC\MONKEYS\PUTIMG\PUTIMG.OBJ Copying D:\SRC\MONKEYS\PUTIMG\PUTIMG.EXE Copying D:\SRC\MONKEYS\BANANA.C Copying D:\SRC\MONKEYS\BANANA.OBJ Copying D:\SRC\MONKEYS\BANANA.EXE 6 file(s) copied ``` ## Y is for Yellow This isn't a command, but interesting trivia about how DOS displays colors. If you've looked carefully at FreeDOS, you've probably noticed that text only comes in a limited range of colors—sixteen text colors, and eight background colors. The IBM 5153 color display presented color to the user by lighting up tiny red, green, and blue phosphor dots at different brightness levels to create a palette of 16 text colors and 8 background colors. Early PCs could only display the background color in the "normal intensity" level; only text colors could use bright colors. If you look at the text colors, you have black, blue, green, cyan, red, magenta, orange, and white. The "bright" versions of these colors are bright black (a dull gray), bright blue, bright green, bright cyan, bright red, bright magenta, yellow, and bright white. The "bright" version of orange is actually yellow. There is no "bright orange." If you want to learn more about text colors, read our article about [Why FreeDOS has 16 colors](https://opensource.com/article/21/6/freedos-sixteen-colors). ## Z is for ZIP You can use `ZIP` at the DOS command line to create archives of files and directories. This is a handy way to make a backup copy of your work or to release a "package" to use in a future FreeDOS distribution. For example, let's say I wanted to make a backup of my project source code, which contains these source files: ``` `````` D:\SRC>zip -9r monkeys.zip monkeys zip warning: TZ environment variable not found, cannot use UTC times!! adding: monkeys/ (stored 0%) adding: monkeys/banana.c (deflated 66%) adding: monkeys/banana.obj (deflated 26%) adding: monkeys/banana.exe (deflated 34%) adding: monkeys/putimg/ (stored 0%) adding: monkeys/putimg/putimg.c (deflated 62%) adding: monkeys/putimg/putimg.obj (deflated 29%) adding: monkeys/putimg/putimg.exe (deflated 34%) ``` ZIP sports a ton of command-line options to do different things, but the command line options I use most are `-r` to process directories and subdirectories recursively, and `-9` to provide the maximum compression possible. `ZIP` and `UNZIP` use a Unix-like command line, so you can combine options behind the dash: `-9r` gives maximum compression and include subdirectories in the Zip file. For more details about how to use the `ZIP` and `UNZIP` commands, read [How to archive files on FreeDOS](https://opensource.com/article/21/6/archive-files-freedos). ## New FreeDOS guides Ready for the next step in your FreeDOS journey? Check out our new eBooks and start experimenting with FreeDOS now! ## 1 Comment
16,278
Ubuntu 23.10:全新版本来袭!
https://news.itsfoss.com/ubuntu-23-10-release/
2023-10-13T09:58:00
[ "Ubuntu", "Ubuntu 23.10" ]
https://linux.cn/article-16278-1.html
![](/data/attachment/album/202310/13/095752pfbbxdci1xoqcfb1.jpg) > > Ubuntu 23.10 “Mantic Minotaur” 再度亮相,搭载了 GNOME 45,以及众多引人瞩目的升级。 > > > 又一次,一如既往的一年一度,我们迎来全新的 Ubuntu 发布! 这次发布的版本是 **Ubuntu 23.10** ,这不是一个 [长期支持](https://itsfoss.com/long-term-support-lts/)(LTS)版本,它的代号是 “Mantic Minotaur” (预言牛头人)。 非 LTS 版本更偏向于满足那些想要获取到 Ubuntu 最新以及最出众特性的用户。 对于那些希望长时间坚守一个版本的用户,我们建议使用 LTS 版本,比如 [Ubuntu 20.04](https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/) 和 [Ubuntu 22.04](https://itsfoss.com/ubuntu-22-04-release-features/)。 总之,让我们深入了解这次发布的新版本,去发现其中的亮点。 > > ? Ubuntu 23.10 将会 **提供九个月的支持**,一直到 2024 年 7 月为止。 > > > ### ⭐ Ubuntu 23.10:新版调整了什么? ![](/data/attachment/album/202310/13/095826lstclmrxdcpd0e1d.png) 即使这是一个非 LTS 发布,但是 **Ubuntu 23.10 却包含了许多有趣的新特性和升级**。 一些主要亮点包括: * 更新升级的安装程序 * 受限的非特权用户命名空间 * GNOME 45 * 全新的壁纸 * 基于 Flutter 的应用商店 * Linux 内核 6.5 ### 更新升级的安装程序 ![](/data/attachment/album/202310/13/095826cz2qv2ovo8vv8p60.png) 首先,Ubuntu 23.10 的安装程序 **开始实验性地支持两大重要功能** : 其一是 [TPM 支持的全盘加密(FDE)](/article-16187-1.html),这意味着采用全新的加密机制。它将与你主板上的 TPM 芯片协同运作。 其二是期待已久的 [ZFS 支持](https://news.itsfoss.com/ubuntu-23-10-zfs/) 再次回归到安装程序中,它在 [Ubuntu 23.04](https://news.itsfoss.com/ubuntu-23-04-release/) 被移除。 > > ? 更广泛的 TPM 支持的全盘加密硬件支持将在 Ubuntu 24.04 LTS 中推出。 > > > ### 受限的非特权用户命名空间 ![](/data/attachment/album/202310/13/095827dygg312bg44go4qg.png) Ubuntu 23.10 首次推出一项新的安全功能。它限制了内核的 “非特权用户命名空间” 特性,这有助于应用程序创建更安全的沙箱环境。 这个特性很有用,那为什么要限制它呢? 原因在于,这个内核特性可能被攻击者利用。 为了消除与这个特性相关的风险,[AppArmor](https://ubuntu.com/server/docs/security-apparmor) 将被用于有选择地允许/禁止非特权用户命名空间。 这个安全特性默认是关闭的,但可以通过命令行选择开启。Canonical 将搜集用户反馈,然后可能决定通过更新将其设为默认。 ### GNOME 45 ![](/data/attachment/album/202310/13/095827yv2mdq6i00vizc52.png) Ubuntu 23.10 提供了最新发布的 [GNOME 45](/article-16215-1.html) 桌面环境,它包括了 **优化过的系统设置应用**、**更新的核心应用**,并 **新增了两个应用**,名为 <ruby> <a href="/article-15887-1.html"> 放大镜 </a> <rt> Loupe </rt></ruby> 和 <ruby> <a href="/article-15789-1.html"> 快照 </a> <rt> Snapshot </rt></ruby>。 新的 [药丸形工作空间指示器](https://news.itsfoss.com/gnome-activities-indicator/) 也在这次发布中首次亮相,虽然不是每个人都会喜欢。 ### 新的壁纸 ![](/data/attachment/album/202310/13/095828ajrnbo8v8dx7bnpv.png) Ubuntu 23.10 版本发布,也不忘继续传统,**推出了全新的壁纸** ,这些壁纸主题都与其代号保持一致。所有壁纸看起来都非常不错,这些都是从几个月前举行的 Mantic Minotaur [壁纸比赛](https://discourse.ubuntu.com/t/mantic-minotaur-23-10-wallpaper-competition/37235) 中被选中的。 你可以通过 [官方博客](https://ubuntu.com/blog/into-the-labyrinth) 查找更多有关这些极酷壁纸的信息。 > > ? 我个人特别喜欢 “Bodacious Bovine” 的浅色/深色版本。 > > > ### 基于 Flutter 的应用商店 ![](/data/attachment/album/202310/13/095828mexx3y85eeeo76e6.png) 得益于在 Ubuntu 23.10 上推出了 **全新的 [基于 Flutter 的商店](https://news.itsfoss.com/ubuntu-23-10-ubuntu-store/)** ,Canonical 推将 Ubuntu 各种元素 Flutter 化的努力见到了效果。这个新商店拥有 **更新的布局**、**全新的应用视图** ,以及 **更好的搜索功能**。 你在其中可以找到 Snap 和 Deb 包。 ### Linux 内核 6.5 ![](/data/attachment/album/202310/13/095829nm8j78sdoglzmts1.png) 首先,让我们来了解下让一切变为可能的原动力。Ubuntu 23.10 版本采用了相对更新的 [Linux 内核 6.5](https://news.itsfoss.com/linux-kernel-6-5-release/)。 这一特性让 Ubuntu 能够使用到一些新的硬件支持,如 **Wi-Fi 7**、**USB4**、**针对 AMD FreeSync 视频的即插即用支持**,以及**对 AMD Radeon RX 7000 系列显卡的超频支持** 等。 ### ?️ 其他变动 除了之前提到的特性,还有一些其他值得注意的变动: * 支持最新发布的 [树莓派 5](https://news.itsfoss.com/raspberry-pi-5/) 和 [HiFive Pro P550](https://www.sifive.com/boards/hifive-pro-p550)。 * [为 PPA 提供增强的安全性](https://news.itsfoss.com/ubuntu-23-10-ppa/)。 * 对 Rust 的支持进一步增强。 * 加入了 [Shotwell 0.32](https://gitlab.gnome.org/GNOME/shotwell/-/blob/master/NEWS)。 * 推出了全新升级的平铺辅助工具。 想要了解更多关于此版本的详细信息,你可以查阅我们之前发布的关于 [Ubuntu 23.10 特性](https://news.itsfoss.com/ubuntu-23-10/) 的报告,或者直接阅读官方的版本发布说明。 ### ? 下载 Ubuntu 23.10 > > ? 请注意,在发布公告后,下载可能还需要一段时间。 > > > 你可以在 [官方网站](https://ubuntu.com/download/desktop) 或是 Ubuntu 的镜像 [仓库](https://cdimage.ubuntu.com/ubuntu/releases/) 中获取最新的 ISO 文件。 > > **[Ubuntu 23.10](https://releases.ubuntu.com/23.10/)** > > > **对于现有用户**,你可以参考我们的 [如何升级 Ubuntu](https://itsfoss.com/upgrade-ubuntu-to-newer-version/) 教程来获取此最新版本。 ? 你是否对试用这个版本感到兴奋?在下方告诉我们你的想法吧! (题图:[Ubuntu](https://ubuntu.com/blog/into-the-labyrinth)) --- via: <https://news.itsfoss.com/ubuntu-23-10-release/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) It is that time of the year again, when we get to see a new Ubuntu release! This time it's **Ubuntu 23.10**, which is not a [Long-Term support](https://itsfoss.com/long-term-support-lts/?ref=news.itsfoss.com) (LTS) version, and is code-named as '**Mantic Minotaur**'. Such releases are geared more towards users who want the latest and greatest that Ubuntu has to offer. For users who want to stick with one version for a long time, we suggest LTS releases such as [Ubuntu 20.04](https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/?ref=news.itsfoss.com) and [Ubuntu 22.04](https://itsfoss.com/ubuntu-22-04-release-features/?ref=news.itsfoss.com). Anyway, let's dig into this release and check out its highlights. **supported for nine months**until July 2024. ## ⭐ Ubuntu 23.10: What's New? ![a screenshot of the ubuntu 23.10 desktop](https://news.itsfoss.com/content/images/2023/10/Ubuntu_23.10_1-1.png) Even though this is a non-LTS release,** Ubuntu 23.10 packs in loads of interesting features and improvements**. Some key highlights include: **Installer Upgrades****Restricted unprivileged user namespaces****GNOME 45****New Wallpapers****Flutter-based App Store****Linux Kernel 6.5** ### Installer Upgrades ![a screenshot of the experimental zfs and tpm-packed fde support](https://news.itsfoss.com/content/images/2023/10/Ubuntu_23.10_2.png) For starters, the installer for Ubuntu 23.10 features **experimental support for two major features**: One is the ** TPM-backed full-disk encryption **(FDE) **,**that sees a completely revamped mechanism being implemented for encrypting disks. It works in tandem with the TPM chip on your motherboard. The other is the long-awaited return of [ ZFS support](https://news.itsfoss.com/ubuntu-23-10-zfs/) to the installer, after it was dropped in the [Ubuntu 23.04](https://news.itsfoss.com/ubuntu-23-04-release/)release. ### Restricted unprivileged user namespaces ![ubuntu apparmor](https://news.itsfoss.com/content/images/2023/10/apparmor-ubuntu-23-10.png) Ubuntu 23.10 debuts a new security feature. It restricts the kernel feature '*unprivileged user namespaces*', which is useful to let applications create a more secure sandbox. If it is useful, why restrict it? Well, the kernel feature lets attackers exploit a system. So, to eliminate the risk associated with the feature, [AppArmor](https://ubuntu.com/server/docs/security-apparmor?ref=news.itsfoss.com) will be used to selectively allow/disallow unprivileged user namespaces. This security feature will not be enabled by default but as an opt-in via command line. Canonical will collect user feedback and then may decide to push it as the default with an update. ### GNOME 45 ![a screenshot of software information on ubuntu 23.10](https://news.itsfoss.com/content/images/2023/10/Ubuntu_23.10_3.png) Ubuntu 23.10 features the recently released [ GNOME 45](https://news.itsfoss.com/gnome-45-release/) desktop environment that features a **tweaked system settings app**, **updated core apps**with the **inclusion of two new apps**called ' **' and '** [Loupe](https://news.itsfoss.com/loupe-image-viewer/)**'.** [Snapshot](https://news.itsfoss.com/gnome-snapshot/)Even the new [ pill-shaped workspace indicator](https://news.itsfoss.com/gnome-activities-indicator/) has made a debut with this release, though not everyone might be on board with that. [GNOME 45 Release Ditches the “Activities” ButtonThe latest and greatest of GNOME desktop is here.](https://news.itsfoss.com/gnome-45-release/)![](https://news.itsfoss.com/content/images/2023/09/gnome-45-release.png) ![](https://news.itsfoss.com/content/images/2023/09/gnome-45-release.png) ### New Wallpapers ![a screenshot of the new wallpapers on ubuntu 23.10](https://news.itsfoss.com/content/images/2023/10/Ubuntu_23.10_4.png) As is tradition, the Ubuntu 23.10 release also **features new wallpapers** themed according to its code-name. All of them look quite nice, and these were selected from the Mantic Minotaur [wallpaper competition](https://discourse.ubuntu.com/t/mantic-minotaur-23-10-wallpaper-competition/37235?ref=news.itsfoss.com) that was held a few months prior. You can check the [official blog](https://ubuntu.com/blog/into-the-labyrinth?ref=news.itsfoss.com) to know more about these extremely cool wallpapers. ### Flutter-based App Store ![a screenshot of the new fultter based app store on ubuntu 23.10](https://news.itsfoss.com/content/images/2023/10/Ubuntu_23.10_5.png) Canonical's push for Flutter-basing the various elements of Ubuntu has received a boost thanks to the implementation of **a new Flutter-based store on Ubuntu 23.10**. It features **an updated layout**, **a new application view**, and **better search functionality**. You can find both Snap and Deb packages with it. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ### Linux Kernel 6.5 ![a screenshot of the neofetch output on ubuntu 23.10](https://news.itsfoss.com/content/images/2023/10/Ubuntu_23.10_6.png) And finally, we have the magic sauce that makes it all happen. **Ubuntu 23.10 features the relatively new Linux kernel 6.5**. This allows Ubuntu to take advantage of the newer support such as **Wi-Fi 7**, **USB4**, **out-of-the-box support for AMD FreeSync video**, **overclocking support for AMD Radeon RX 7000 series graphics cards** and more. ### 🛠️ Other Changes Other than the highlights, here are some other changes worth noting: **Support for the recently released**[Raspberry Pi 5](https://news.itsfoss.com/raspberry-pi-5/), and[HiFive Pro P550](https://www.sifive.com/boards/hifive-pro-p550?ref=news.itsfoss.com).[Enhanced security](https://news.itsfoss.com/ubuntu-23-10-ppa/)for PPAs**Better support for Rust.****Inclusion of**[Shotwell 0.32](https://gitlab.gnome.org/GNOME/shotwell/-/blob/master/NEWS?ref=news.itsfoss.com).**Introduction of a vastly improved tiling assistant.** For more details on this release, you can refer to our previous [Ubuntu 23.10 features](https://news.itsfoss.com/ubuntu-23-10/) coverage, or you can go through the official release notes. ## 📥 Download Ubuntu 23.10 You can grab the latest ISO either from the [official website](https://ubuntu.com/download/desktop?ref=news.itsfoss.com), or from Ubuntu's image [repository](https://cdimage.ubuntu.com/ubuntu/releases/?ref=news.itsfoss.com). **For existing users**, you can follow our handy [how to upgrade Ubuntu](https://itsfoss.com/upgrade-ubuntu-to-newer-version/?ref=news.itsfoss.com) guide to get the latest release. [How to Upgrade to Ubuntu 23.04 Right NowUbuntu 23.04 ‘Lunar Lobster’ has just been released. If you are using Ubuntu 22.04 or 22.10, here’s how you can upgrade to Ubuntu 23.04 right away.](https://itsfoss.com/upgrade-ubuntu-to-newer-version/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/04/upgrade-to-lunar-lobster.png) ![](https://itsfoss.com/content/images/2023/04/upgrade-to-lunar-lobster.png) *💬 Are you excited to try out this release? Let us know below!* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,279
微软出品:《如何下载和安装 Linux》
https://learn.microsoft.com/en-us/linux/install
2023-10-13T15:59:30
[ "Linux", "微软", "WSL" ]
https://linux.cn/article-16279-1.html
> > 编者注:本文译自微软官方发布的指南。 > > > ![](/data/attachment/album/202310/13/155914y9m9e31eyni7mb9o.jpg) Linux 是一款操作系统,与 Windows 有许多相似之处,但由于其开源和高度定制化的特性,衍生出众多的版本。安装 Linux 的前提是,你需要决定一个安装方式,并选定一个适合的 Linux 发行版。 要安装 Linux,你需要如下步骤: 1. 首先,确定一个安装方式。你可以选择使用 <ruby> Windows 的 Linux 子系统 <rp> ( </rp> <rt> Windows Subsystem for Linux </rt> <rp> ) </rp></ruby>(WSL)进行安装,也可以选择完全安装在物理硬件上(即裸机安装),或者在本地或云端创建一个虚拟机(VM)来运行 Linux。 2. 其次,选择一个 Linux 发行版。如:Ubuntu、Debian、Kali Linux、OpenSUSE 等。 3. 然后,按照你所选的安装方法进行操作。具体可以是以下四种方式之一: * 使用 Windows 子系统 Linux(WSL)中的安装 Linux 命令 * 在云中创建一个 Linux 虚拟机(VM) * 在本机创建一个 Linux 虚拟机(VM) * 创建一个可引导的 USB,以安装裸机版 Linux 4. Linux 安装完成后,你需要熟悉你所选发行版的包管理器,更新和升级可获取的包,并熟悉微软提供的 Linux 资源,比如培训课程、为 Linux 设计的流行工具、新闻以及开源活动等。 ### 步骤 1:选择一个安装 Linux 的方法 至于如何选择安装 Linux 的方式,这主要取决于你的需求和喜好。 * **如果你是 Linux 新手**,我们推荐你首先尝试 Windows 的 Linux 子系统(WSL),这是入门 Linux 最简单的方法。 * **如果你正在企业环境中工作,或你在处理的业务有更复杂的需求**,如规模或安全性等方面,我们推荐你在云端运行 Linux 虚拟机,并查看 Azure 所能提供的帮助。此建议也适用于想要将 Linux 作为服务器的用户。 * **如果你只想将 Linux 作为你主要的操作系统**,可以选择在物理硬件上裸机安装 Linux,尽管这个安装过程稍微复杂一些,且你可能无法访问到 Windows 的工具(如 Outlook、Teams、Word、PowerPoint 等),但你可以全力发挥你硬件的全部性能,无需承担虚拟化或仿真的开销。 你可以在下文中了解这些选项的详细信息。 #### Windows 的 Linux 子系统(WSL) Windows 的 Linux 子系统(WSL)是一个安装 Linux 的简便方式,适用于使用 Windows 机器的用户。这是安装 Linux 最简单的一种方式。你只需执行 Linux 的安装命令:`wsl --install`,即可安装 Ubuntu 发行版。 此方法通过虚拟技术,将 Windows 和 Linux 操作系统(后者运行在真实的 Linux 内核上)整合到一起。你可以根据需要添加任何数量的 Linux 发行版,并且可以方便地在 Windows 中运行你喜爱的 Linux 工具,包括图形界面应用。此外,你还可以在同一条命令行中混合使用 Bash 和 PowerShell 命令。在这种方式下,项目文件由 Linux 文件系统托管,你可能需要用到的开发工具(如 VS Code)则由 Windows 文件系统托管。此安装方式的效率高且性能优秀。选择 Linux 发行版(或默认的 Ubuntu 发行版)后,你可以按照 Windows 的 Linux 子系统下的 [Linux 安装命令](https://learn.microsoft.com/en-us/linux/install#install-linux-with-windows-subsystem-for-linux) 进行操作,或在 [WSL 文档](https://learn.microsoft.com/en-us/windows/wsl) 中查阅更多信息。 ![WSL install command screenshot](/data/attachment/album/202310/13/155930jsn6dl2ndcvzcrlr.png) #### 创建虚拟机(VM) 创建虚拟机(VM)的选项适合所有人,无论你正在使用 Windows 还是 MacOS。然而,如果你想在云端创建虚拟机,你需要有一个 Azure 账户,或者如果你打算在你的电脑上直接创建虚拟机,你需要安装虚拟化软件。 虚拟机实际上是真实计算机的数字版,对于在可能需要提高硬件支持(例如:需要更多内存和处理能力)以及安全级别(如防病毒、加密、备份、策略管理等)的环境中运行 Linux 的场景非常受欢迎。 就像使用 WSL一样,你可以根据自己的需求创建多个不同 Linux 发行版的虚拟机实例,这些虚拟机在相互独立的环境中运行,它们没有任何冲突,非常适合进行软件开发和测试。虽然在 WSL 上运行 Linux 发行版的性能稍微更优,但 Linux 虚拟机更易于复制和迁移。可以根据你的需求,在 Azure 等云服务上或者通过虚拟化软件(也称为 <ruby> 管理程序 <rp> ( </rp> <rt> hypervisor </rt> <rp> ) </rp></ruby>)在自己的电脑上创建虚拟机。 在 Azure 上创建虚拟机,实际上是在云端的微软的服务器上托管你的虚拟机,你只是在向微软租用计算资源以运行虚拟机。这种方式在当你需要快速配置新的虚拟机或需要运行需求超过你个人电脑能力的任务时,将非常方便。大规模企业,由于其对扩展性、控制和功能需求更高,往往选择 [在 Azure 上运行 Linux 虚拟机](https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/n-tier/linux-vm)。 在本地计算机上创建虚拟机需要使用虚拟化软件,即管理程序。Windows 提供了一个名为 [Hyper-V](https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/) 的 “类型 1” 管理程序,可以直接在你的硬件上运行虚拟化。此外,还有一些在操作系统上运行的“类型 2” 管理程序,比如 VirtualBox 或 VMware。如果你使用的是 Mac,一般推荐使用的管理程序是收费的“Parallels Desktop”。如果你想了解更多关于在配备了苹果硅芯片的 Mac 上如何安装 Linux 虚拟机的信息,可以参考对应的 [安装教程](https://kb.parallels.com/128445)。需要指出的是,[VirtualBox](https://www.virtualbox.org/wiki/Downloads) 支持 Windows 和 MacOS。有关于如何在苹果硅芯片或基于英特尔的 Mac 上设计并运行自定义 Linux 客户机的更多信息,请参考 [这篇](https://developer.apple.com/documentation/virtualization/creating_and_running_a_linux_virtual_machine)。 使用虚拟机管理器时,你需要自行管理虚拟机,包括分配内存、磁盘空间等资源,并确保系统的安全和及时性。相比其他选项,这需要更多的技术专长,并且可能无法达到同等的扩展性和容错容忍度。 一旦你选定了 Linux 发行版,并决定是在 [本地通过虚拟机管理器运行虚拟机](https://learn.microsoft.com/en-us/linux/install#create-a-linux-virtual-machine-locally-using-a-hypervisor),还是 [在云端通过 Azure 运行](https://learn.microsoft.com/en-us/linux/install#create-a-linux-virtual-machine-in-the-cloud),你就可以按照相应的说明,在云上或在本地创建 Linux 虚拟机。 ![Create a Linux VM on Azure screenshot](/data/attachment/album/202310/13/155931k2tq839mn3m0tadd.png) #### 裸机 Linux 所谓的裸机 Linux,意味着 Linux 是直接在设备硬件上运行。要进行裸机安装,你需要从你选择的 Linux 发行版官方网站下载 ISO 安装文件,并从这个文件创建一个可启动的 USB 驱动器。为了完成这个步骤,你需要一个已经安装有操作系统(Windows 或者其他操作系统)的设备。 许多用户选择裸机安装 Linux,并在同一台设备上与 Windows 共存,这就需要利用所谓的“双启动”模式。使 Windows 和 Linux 能双启动,就需要对你的硬盘进行分区,以保证两个操作系统(Linux 和 Windows)都有各自独立的空间。尽管 WSL、虚拟机和裸机 Linux 的性能已经相差无几,但由于双启动方式需要在两个操作系统间切换的时候频繁重启设备,所以这种安装方式并不是首选。此外,如果选择裸机安装 Linux,还需要对可能出现的设备驱动或硬件兼容性问题做好准备。 你可以在 [Linux.org](https://linux.org/pages/download/) 网站上找到各种可供下载的主流 Linux 发行版。在你选定一个发行版之后,按照指南制作一个 [可启动的 USB 驱动器](https://learn.microsoft.com/en-us/linux/install#create-a-bootable-usb-drive-to-install-bare-metal-linux),进行裸机 Linux 的安装就可以了。 ![Create a bootable USB screenshot](/data/attachment/album/202310/13/155931goxb66oi3okkuko3.png) ### 步骤 2:选择一个 Linux 发行版 Linux 的不同版本被称为“发行版”。因此,实际上并没有一个简单的“安装 Linux”的方法,你需要首先选择你想下载和安装哪一个使用了 Linux 内核的发行版。目前存在超过 600 种活跃的 Linux 发行版,如 Ubuntu、Debian、Kali Linux、OpenSUSE 等。在选择发行版时,有许多因素需要考虑,如: #### 需要 Linux 经验 如果你是 Linux 新手,可能会首选 Ubuntu。由于其支持健全且易用,Ubuntu 是 Linux 用户的主要起点之一。Ubuntu 提供了桌面版和服务器版供你选择,具体使用哪个版本由你打算如何使用它决定。操作系统需要负责的具体任务可能帮助你确定使用哪个发行版。Arch Linux 对于希望具有高度自定义、自行决定如何配置,但仍然稳定且得到大用户群支持的用户来说是个不错的选择。从这个地方开始可能会更复杂,但可以帮助你更好地理解 Linux 如何工作。 #### 系统要求 如果需要一个资源消耗较少,或者说“轻量级”的发行版,就需要考虑对内存和处理速度需求较低的发行版。Alpine Linux 是一个热门的选择,用户会发现大部分的功能默认关闭或者没有安装,但这个发行版仍有你运行一个容器化应用所需的所有东西。 #### 安全需求 有些 Linux 用户可能有特殊的安全需求需要考虑。Kali Linux 是设计用于进行安全任务如渗透测试、安全研究、计算机鉴识和逆向工程的发行版的一个例子。 #### 对商业和企业环境的需求 与普通用户环境相比,商业、企业或者学术环境可能有着各自独特的要求。红帽企业 Linux(RHEL)和 Oracle Linux 提供全天候的全球支持和订阅服务。CentOS 也是一款备受欢迎的企业级发行版,它由社区支持,同时与 RHEL 具有良好的兼容性。 #### 社区支持 具有强大用户社区的发行版往往受到青睐,因为这样的社区可以持续对发行版作出贡献,包括修复问题,增加新的功能,解答使用中的问题等。Ubuntu 就是最受欢迎的发行版之一,而 OpenSUSE 的历史比大多数其他发行版更悠久,且仍然在活跃更新中。随着用户需求和喜好的变化,许多其他的发行版也迅速赢得了用户的喜爱。Linux.org 网站提供了一些资源帮助你了解哪些发行版具有良好的支持或正在日益受到欢迎。 ![Screenshot of the list of distributions on Linux.org](/data/attachment/album/202310/13/155931cnm7jnnp7pjjmmnn.png) ### 步骤 3:按照安装方法步骤执行安装 #### 在 Windows 的 Linux 子系统(WSL)中安装 Linux 若在 Windows PC 上安装 Linux,需要执行 Linux 安装命令。 1. 首先,通过右键点击选择 “<ruby> 以管理员身份运行 <rp> ( </rp> <rt> Run as administrator </rt> <rp> ) </rp></ruby>” 来打开 PowerShell 或 Windows 命令提示符。 2. 执行 Linux 安装命令:`wsl --install` 。 3. 然后,重启你的电脑。 ![WSL Linux Install List Command screenshot](/data/attachment/album/202310/13/155931qc7rrc7rx8iigmrg.png) ##### Linux 安装命令的选项 默认情况下,安装命令会选择 Ubuntu 的 Linux 发行版。你可以查看微软商店中的其它可用发行版,方法是输入命令:`wsl -l -o` 。如需安装 Ubuntu 之外的其它发行版,在安装命令后加上 `-d` 参数,然后输入你想安装的发行版的名称: ``` wsl --install -d <发行版名称> ``` 若你想安装的发行版不在微软商店中,你可参照 WSL 文档,学习如何 [导入](https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro) 你想与 WSL 一起使用的任何 Linux 发行版。 若想获取更多关于如何使用 VS Code、Git、Database、Docker、GUI apps、GPU 加速、NodesJS、USB 设备、挂载磁盘、创建自定义发行版、管理磁盘空间、为企业业务设置 WSL 的信息,你可以查阅 [WSL 的文档](https://learn.microsoft.com/en-us/windows/wsl/)。 #### 在云端创建 Linux 虚拟机 若想在 Azure 云上创建由 Linux 支持的虚拟机(VM),你需要登录 Azure Portal,并选择 “<ruby> 创建虚拟机 <rp> ( </rp> <rt> Create a Virtual Machine </rt> <rp> ) </rp></ruby>” 服务。然后,按照指示完成用户名、项目、实例、SSH 密钥、端口设置,并复制 IP 地址。 Azure 提供了多种在云上创建 Linux VM 的选项。你可以选择喜欢的方法创建 Linux VM,快速指南选择方法如下: * [Azure Portal](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal?tabs=ubuntu&source=docs) * [Azure CLI](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-cli) * [Azure PowerShell](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-powershell) * [Terraform](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-terraform) * [Bicep 文件](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-bicep?tabs=CLI) * [Azure 资源管理器(ARM)模板](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-template) 如果你还没有 Azure 订阅账户,可以在开始之前创建一个 [免费账户](https://azure.microsoft.com/free/)。如果这是你第一次在 Azure 上创建 Linux VM,你可以学习更多 [有关 VM 的知识](https://azure.microsoft.com/resources/cloud-computing-dictionary/what-is-a-virtual-machine),或者查看在线培训课程:[在 Azure 上创建 Linux 虚拟机](https://learn.microsoft.com/en-us/training/modules/create-linux-virtual-machine-in-azure/)。 ![Select Linux VM size on Azure screenshot](/data/attachment/album/202310/13/155931kbtpaj2ep2bhvnxj.png) #### 使用虚拟机管理程序在本地创建 Linux 虚拟机 要在你的本地机器上使用虚拟机管理程序创建 Linux 虚拟机,你可以选择使用: * [Windows Hyper-V](https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/) * [VirtualBox](https://www.virtualbox.org/) * [VMware](https://docs.vmware.com/en/VMware-Horizon-7/7.13/linux-desktops-setup/GUID-51C371A9-4D76-4A8C-8645-909E93080B4F.html) 首先,你需要根据你所选择的管理程序检查硬件需求。在管理程序启用或安装后,你需要确定你想要安装的操作系统类型及其安装源(一般为 .iso 或 .vhdx 文件)。给虚拟机命名,选择文件存储的目录,设置分配给虚拟机的内存和虚拟硬盘大小(通常可以在固定或动态分配的硬盘空间中选择)。由于显示驱动和其他硬件依赖关系,有时候整合 Linux 虚拟机可能比较棘手,但大部分的管理程序都有活跃的用户社区,可以提供必要的帮助。如果你希望你的虚拟机能够连接到网络,可能还需要设置一个虚拟网络。 如果你刚接触管理程序,想要了解更多的话,可以尝试免费的在线课程:[配置和管理 Hyper-V 虚拟机](https://learn.microsoft.com/en-us/training/modules/configure-manage-hyper-v-virtual-machines/)。 ![Hyper-V install screenshot](/data/attachment/album/202310/13/155932xpnjx5npz9nrqvj3.png) #### 创建可引导的 USB 驱动器以安装裸机 Linux 如果你需要裸机的 Linux,不论是在设备上单独运行某个发行版,还是在该发行版和 Windows 之间进行双启动,皆可以按照以下步骤进行: 1. 下载你所选的 Linux 发行版的镜像文件,一般是 ISO 文件,例如,你可以在 [Ubuntu 桌面版下载](https://ubuntu.com/download/desktop) 页面下载最新版的 Ubuntu 镜像。有些 Linux 发行版可能在下载前需要你验证镜像签名。 2. 创建一个可引导的 USB 驱动器。你通常需要一个至少有 16GB 空间的 USB 驱动器。同样,你也需要一个可以创建引导驱动器的软件,例如 balenaEtcher、Rufus、UNetbootin 等。通常情况下,你选择的 Linux 发行版的下载页面会推荐使用哪种引导盘创建软件。 3. 从 USB 驱动器启动你的设备。在设备重启时,你需要进入启动菜单,这通常通过在启动期间按下 `F12` 键来实现。然后你可以选择安装包含有你的 Linux 发行版本 ISO 文件的 USB 驱动器。 4. 选择安装选项。通常,你的 Linux 发行版的安装器会包括一系列安装步骤,这些步骤中会包含是否包括某些特性、第三方软件包等的选项。你还可能需要在该 Linux 发行版会是唯一操作系统的情况下选择是否对磁盘进行清除,或者如果你计划运行多个操作系统,你可能需要使用一个分区。你也可能会被询问是否希望启用加密。 5. 最后,与任何 Linux 安装一样,你需要创建一个用户名和密码。 ![Ubuntu install screenshot](/data/attachment/album/202310/13/155932icmp7y2oy83sn2en.png) ### 步骤 4:Linux 安装成功后需要进行的操作 在你成功安装 Linux 发行版后,还需要进行以下几个重要的步骤: 1. 首先,熟悉你选择的 Linux 发行版所使用的首选包管理器。Linux 通过包管理器来下载和更新你打算使用的所有软件。例如,Ubuntu 就使用了 [Advanced Packaging Tool](https://ubuntu.com/server/docs/package-management)(APT)。 2. 进一步,利用你的发行版的包管理器进行发行版的更新和升级。稳定的 Linux 发行版中的软件包往往已经过时,因此我们建议你定期更新你的系统。同时,你可能希望进行升级操作,它会更新你已经安装的所有包文件的版本。如你使用的是 Ubuntu,那么你可以运行命令:`sudo apt update && sudo apt upgrade`。 3. 除此之外,探索 Microsoft 提供的 [Linux 资源](https://learn.microsoft.com/en-us/linux/) 也非常重要,例如针对 Linux 的 Microsoft 工具(如 Visual Studio Code、.NET 和 PowerShell),Learn 目录中可供学习的免费 Linux 相关课程,以及关于事件、新闻和 Linux 组织与 Microsoft 之间的持续伙伴关系的信息,包括 Microsoft 支持的 Mariner 发行版。 *(题图:MJ/36b362bf-a6c5-4e60-b279-65b67e157872/)* --- via: <https://learn.microsoft.com/en-us/linux/install> 作者:[mattwojo](https://github.com/mattwojo) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](/article-16278-1.html) 荣誉推出
200
OK
# How to download and install Linux Linux is an operating system, similar to Windows, but with many different versions due to the nature of being open source and fully customizable. To install Linux, you must choose an install method and choose a Linux distribution. To install Linux: [Choose an install method](#step-1---choose-a-method-to-install-linux): Windows Subsystem for Linux (WSL), Bare metal Linux; or create a Virtual Machine (VM) to run Linux locally or in the cloud.[Choose a Linux distribution](#step-2---choose-a-linux-distribution): Ubuntu, Debian, Kali Linux, openSUSE, etc.[After installing Linux](#step-4---after-installing-linux): Get familiar with your distribution's package manager, update and upgrade the packages available, and get familiar with the other[Linux resources at Microsoft](./), such as training courses, Linux-versions of popular tools, news, and Open Source events. ## Step 1 - Choose a method to install Linux The choice of which method to use for installing Linux depends on your needs and preferences. **New to using Linux?**We recommend starting with Windows Subsystem for Linux (WSL) as it's the easiest way to get up and running.**Work in a business environment with more complex needs related to scale or security?**We recommend running Linux as a Virtual Machine (VM) in the cloud and checking out the support that Azure has to offer. This also applies if you want to run Linux as a server.**Only want to run Linux as your primary operating system?**If you are good with a slightly more complicated install process and don't need access to Windows tools (like Outlook, Teams, Word, PowerPoint, etc), you can run Linux on bare metal to access the full potential of your hardware without any overhead from virtualization or emulation. Learn more about these options below. ### Windows Subsystem for Linux (WSL) Available to those with a Windows machine, this is the most simple way to install Linux. Just run the Linux install command: `wsl --install` to install the Ubuntu distribution. This method uses virtualization to integrate the Windows operating system (OS) with the Linux OS (running on an actual Linux kernel). You can add as many different Linux distributions as you please and run your favorite Linux tools, including GUI apps, alongside your favorite Windows tools. You can also mix and match Bash and PowerShell commands in the same command line. A Linux file system hosts your project files, while a separate Windows file systems hosts any developer tools, such as VS Code, that you'd like to work on the files with. This method of running Linux is highly efficient and performant. Once you choose a Linux distribution or opt to use the default Ubuntu distro, follow the instructions to [Use the install Linux command with Windows Subsystem for Linux](#install-linux-with-windows-subsystem-for-linux) or learn more in the [WSL documentation](/en-us/windows/wsl). ### Create a Virtual Machine (VM) Available to everyone regardless if you're using a Windows or MacOS-based machine, but will require either an Azure account, if creating a VM in the cloud, or virtualization software, if creating a VM directly on your machine (locally). A VM is a digital version of a physical computer and is a popular option for running Linux in environments that may require you to scale the level of hardware support (Memory and processing power required) and the level of Security (antimalware, encryption, backups, policy management, etc). Like with WSL, you can create VM instances of as many different Linux distributions as you'd like, running them in an isolated environment, free from any conflicts and great for software development testing. While running a Linux distribution on WSL has slightly faster performance, a Linux VM is easier to clone or migrate. You can create a virtual machine on a cloud service like Azure or on your local machine, using virtualization software (otherwise known as a hypervisor). Creating a VM on Azure means that it's hosted in the cloud, on Microsoft's servers. You are essentially renting computing resources from Microsoft and using them to run the VM. This can be convenient if you need to quickly provision a new VM or need to run a workload that requires more computing resources than your local computer can provide. Larger businesses with more complex needs often choose to run Linux VMs on Azure for its scalability, control and abundance of features. Learn more about the architecture, workflow, and considerations to [Run a Linux VM on Azure](/en-us/azure/architecture/reference-architectures/n-tier/linux-vm). Creating a VM on your local machine requires virtualization using a hypervisor. Windows includes a "type 1" hypervisor called [Hyper-V](/en-us/virtualization/hyper-v-on-windows/) to run virtualization directly on your device hardware. There are also "type 2" hypervisors that run on top of the operating system, like VirtualBox or VMware. If you are using a Mac, the most commonly recommended hypervisor is "Parallels Desktop", though this is a paid service. See [Install Linux VM on a Mac with Apple M-Series chip](https://kb.parallels.com/128445). [VirtualBox](https://www.virtualbox.org/wiki/Downloads) also supports both Windows and MacOS. See [Creating and Running a Linux Virtual Machine](https://developer.apple.com/documentation/virtualization/creating_and_running_a_linux_virtual_machine) for more about how to design and run custom Linux guests on Apple silicon or Intel-based Macs. You are responsible for managing the virtual machine when using a hypervisor, including allocating resources like memory and disk space, and ensuring that it is secure and up-to-date. This requires more technical expertise than some of the other options and may not be as scalable or fault-tolerant. Once you've chosen a distribution and decided whether you want to run the VM locally, using a hypervisor, or in the cloud, using Azure, follow the instructions to [Create a Linux Virtual Machine in the Cloud](#create-a-linux-virtual-machine-in-the-cloud) or [Create a Linux Virtual Machine locally using a Hypervisor](#create-a-linux-virtual-machine-locally-using-a-hypervisor) ### Bare metal Linux Bare metal Linux just means that Linux is running directly on the device hardware. This install method requires you to create a bootable USB drive by downloading an iso install file from the site hosting your chosen Linux distribution. You will need to use a Windows computer (or any desktop device with an existing OS) to create this drive. Many users choose the traditional method of installing bare metal Linux on a device that is also running Windows and using the **"dual boot"** method. To boot Linux and Windows, you need to partition your hard drive to create separate spaces for both the Linux and Windows OS. The performance speed between WSL, virtual machines, and bare metal Linux has become so close that few developers choose this method due to the overhead of needing to restart (reboot) your device any time you want to switch between the operating systems. If you choose the bare metal Linux install route, you may also need to deal with potential driver issues or hardware compatibility problems that may arise with Linux on some devices. You can find a list of [Popular Linux Distributions available for download on Linux.org](https://linux.org/pages/download/). Once you've chosen a distro, follow the instructions to [Create a bootable USB to install bare-metal Linux](#create-a-bootable-usb-drive-to-install-bare-metal-linux). Warning If you are planning to dual boot or live boot a bare metal Linux distribution and your Windows machine is using [Bitlocker](/en-us/windows/security/operating-system-security/data-protection/bitlocker/) for encryption to protect data theft or exposure, be certain to [retrieve and store your BitLocker encryption keys](https://support.microsoft.com/windows/finding-your-bitlocker-recovery-key-in-windows-6b71ad27-0b89-ea08-f143-056f5ab347d6) prior to installing Linux. Learn more in this Microsoft Q&A: [Can I use Bitlocker with Dual-Boot setup?](https://answers.microsoft.com/en-us/windows/forum/all/can-i-use-bitlocker-with-dual-boot-setup/624f9920-4e9d-4824-abc4-405c60f8e6b0) ## Step 2 - Choose a Linux distribution The different versions of Linux are called "distributions" (sometimes shortened to “distros”). So there isn’t actually a way to just “install Linux”, you first need to choose which distribution that uses the Linux kernel you want to download and install. There are over 600 active Linux distributions, such as Ubuntu, Debian, Kali Linux, openSUSE, and more. There are a number of factors to consider in choosing a distribution, such as: ### Required Linux experience If you’re new to Linux, you may want to start with Ubuntu. This is one of the most common starting places for Linux users due to the level of support and ease of use. Ubuntu offers a desktop-version and a server-version depending on how you plan to use it. The specific tasks that the operating system will be responsible for may help you determine which distribution to use. Arch Linux is a popular choice for those who want a highly customizable, do-it-yourself approach that is still stable and well-supported by a large user base. It is a much more complicated place to start, but can help you to get a better understanding of how Linux works due to the amount of custom configuration. ### System requirements A minimal, or "lightweight", distribution means a small footprint, with lower memory and processing speed requirements. Alpine Linux is a popular option where users will find most features disabled or not installed by default, but still has everything you need for a containerized app. Security needs: Some Linux users may have specific security concerns to consider. Kali Linux is an example of a distro designed for security tasks, such as Penetration Testing, Security Research, Computer Forensics and Reverse Engineering. ### Business and Enterprise requirements Business, corporate, or academic environments may have unique concerns from consumer environments. For example Red Hat Enterprise Linux (RHEL), SUSE Linux Enterprise Server (SLES) and Oracle Linux offer 24/7 global support and subscription-based service. CentOS is another popular enterprise distro that is community-supported but still compatible with RHEL. ### Community support A large user community that consistently contributes to the distribution, fixing bugs, adding features, helping with questions, etc. is another good consideration. Ubuntu is one of the most popular distos. openSUSE has been around longer than most other distributions and offers in addition to the stable version (Leap) a rolling version (Tumbleweed). Many other distros rapidly grow popular as the needs and preferences of the user community change. The Linux.org site has resources to help you assess what's available, well-supported, or growing in popularity. ## Step 3 - Follow install method instructions ### Install Linux with Windows Subsystem for Linux To install Linux on a Windows PC, use the install Linux command. - Open PowerShell or Windows Command Prompt in *administrator mode*by right-clicking and selecting "Run as administrator". - Enter the Linux install command: `wsl --install` . - Restart your machine. #### Install Linux command options By default, the install command will use the Ubuntu distribution of Linux. You can see the other distributions that are available in the Microsoft Store by entering the command: `wsl -l -o` . If you'd like to install a distribution other than Ubuntu, just add `-d` to the command with the name of the distribution you'd like to install: ``` wsl --install -d <Distro Name> ``` If the distribution you want to install isn't available in the Microsoft Store, see the Windows Subsystem for Linux (WSL) documentation on how to [Import any Linux distribution to use with WSL](/en-us/windows/wsl/use-custom-distro). For more information on how to use VS Code, Git, databases, Docker, GUI apps, GPU acceleration, NodesJS, USB devices, or mount a disk, build a custom distribution, manage disk space, or set up WSL for your enterprise business, see the [WSL documentation](/en-us/windows/wsl/). ### Create a Linux Virtual Machine in the cloud To create a Linux Virtual Machine (VM) that is hosted in the cloud on Azure, log-in to the Azure Portal and select the “Create a Virtual Machine” service. Then follow the instructions for creating a user name, project, instance, SSH key, ports, and copying the IP address. Azure supports a variety of options for setting up Linux VMs in the cloud. For a quickstart guide on how to set up a Linux VM, choose your preferred method: [Azure Portal](/en-us/azure/virtual-machines/linux/quick-create-portal?tabs=ubuntu&source=docs)[Azure CLI](/en-us/azure/virtual-machines/linux/quick-create-cli)[Azure PowerShell](/en-us/azure/virtual-machines/linux/quick-create-powershell)[Terraform](/en-us/azure/virtual-machines/linux/quick-create-terraform)[A Bicep file](/en-us/azure/virtual-machines/linux/quick-create-bicep?tabs=CLI)[Azure Resource Manager (ARM) template](/en-us/azure/virtual-machines/linux/quick-create-template) If you don't have an Azure subscription, [create a free account](https://azure.microsoft.com/free/) before you begin. If you're new to creating Linux VMs with Azure, you can [learn more about VMs](https://azure.microsoft.com/resources/cloud-computing-dictionary/what-is-a-virtual-machine) or check out the online training course: [Create a Linux virtual machine in Azure](/en-us/training/modules/create-linux-virtual-machine-in-azure/). ### Create a Linux Virtual Machine locally using a hypervisor To create a Linux VM that is hosted on your local machine using a hypervisor, you can use: You will need to check the hardware requirements for your chosen hypervisor. Once the hypervisor is enabled or installed, you will need to choose the type of OS that you want to install and the installation source (this is typically a .iso or .vhdx file). You will need to give the VM a name, select the directory where files will be hosted, select the amount of memory to allocate to the VM and the size of the virtual hard drive where files will be stored (you can typically choose between a fixed or dynamically allocated amount of drive space). Sometimes integrations with a Linux virtual machine can be tricky due to display drivers and other hardware dependencies, but most hypervisors have an active user community that can help. You may also need to set up a virtual network if you want your VM to connect to the internet. If you're new to hypervisors and want to learn more, try the free online training module: [Configure and manage Hyper-V virtual machines](/en-us/training/modules/configure-manage-hyper-v-virtual-machines/). ### Create a bootable USB drive to install bare-metal Linux If you want bare-metal Linux, whether to run a distribution alone on a device or to dual-boot between the distribution and Windows, here are the steps: - Download an image file for your chosen Linux distribution. This is usually an ISO file. As an example, you can find an image file for the most recent version of Ubuntu at [Download Ubuntu Desktop](https://ubuntu.com/download/desktop). Some Linux distributions may require you to verify the image signature before downloading. Some Linux distributions also cannot be installed unless Windows Secure Boot is disabled (which is not recommended). - Create a bootable USB drive. You will typically need a USB drive with at least 16gb of space. You will also need software to create the bootable drive. There are many options (such as balenaEtcher, Rufus, UNetbootin, etc.). Often the download site for your chosen Linux distribution will recommend which startup disk creater software to use. - Boot your device from the USB drive. When restarting the device, you will need to enter the boot menu. This is typically done by holding down the F12 key during startup. You can then select the USB drive containing your Linux distribution ISO to install from. - Select install options. Typically the installer for your Linux distribution will include a set of installation steps that will involve choosing options about whether you want to include certain features, third-party software packages, etc. You may also need to specify whether to erase the disk in the case that this Linux distro will be the only operating system, or to use a partition, if you plan to run multiple operating systems. You may also be asked about whether you'd like to enable encryption. - Finally, as with any Linux installation, you will be asked to create a user name and password. Important You will need to remove the USB drive after installing, during the reboot. ## Step 4 - After installing Linux Once you have successfully installed a Linux distribution, there are a few more important steps: - Get familiar with the preferred package manager used by your chosen Linux distribution. Linux uses package manager's to download and update any software that you plan to use. For example, Ubuntu uses the [Advanced Packaging Tool (APT)](https://ubuntu.com/server/docs/package-management). - Use your distribution's package manager to update and upgrade your distribution. Software packages in a stable release of a Linux distribution are often outdated. It is recommended to regularly run an update. You may also want to run an upgrade, which installs newer versions of any packages that you've already installed. For example, if you're using Ubuntu, run: `sudo apt update && sudo apt upgrade` . - Learn more about the [Linux resources available at Microsoft](./), such as Linux-specific versions of Microsoft tools like Visual Studio Code, .NET, and PowerShell, free Linux-related training courses available from the Learn catalog, and information about events, news, and the ongoing partnerships between Linux organizations and Microsoft, including the Microsoft-supported Mariner distribution. ## Sudo for Windows If you're using Windows, but accustomed to BASH commands, you may be interested in [Sudo for Windows](/en-us/windows/sudo/), a new way for users to run elevated commands (as an administrator) directly from an unelevated console session on Windows.
16,281
Kubuntu 23.10 版本已发布!
https://news.itsfoss.com/kubuntu-23-10/
2023-10-14T10:42:00
[ "Ubuntu", "Kubuntu", "Ubuntu 23.10" ]
https://linux.cn/article-16281-1.html
![](/data/attachment/album/202310/14/104118g6gqg1cp81gitqg5.jpg) > > Kubuntu 预装了必要的 KDE Plasma 及应用更新。 > > > 如果你期待在 Ubuntu 基础之上更新你的 KDE 体验,那么欢迎尝试 Kubuntu 23.10。 虽然这不是一次重大的发布,但如果你正在从 Kubuntu 23.04 升级,遇到了问题,这个新版本会带来更愉快的使用体验。 > > ? 记住,Kubuntu 23.10 将享有 **九个月**(即至 **2024 年 7 月**)的技术支持。 > > > ### Kubuntu 23.10:有什么新特性? ![](/data/attachment/album/202310/14/104201dmdt1fmfj25pntd4.jpg) 这个版本的亮点包括: * KDE Plasma 5.27.8 * KDE 应用的更新 * Linux 内核 6.5 * Firefox 118 * LibreOffice 7.6 * Thunderbird 115 #### KDE Plasma 5.27.8 可能你会好奇,为何在这次新的更新中还停留在 KDE Plasma 5.27阶段? 这是因为它是 [KDE Plasma 6](https://news.itsfoss.com/kde-plasma-6-dev/) 升级(计划在 *2024 年 2 月* 进行)前的最后一个版本。所以,你不会看到 KDE Plasma 5.28 的发布。 ![](/data/attachment/album/202310/14/104202vdmg4t3zld4awy4o.png) 在 KDE Plasma 5.27.8,做了许多显著的问题修复以及改进,包括对混合睡眠的支持、利用 Plasma <ruby> 系统监视器 <rt> System Monitor </rt></ruby> 对多 GPU 配置中的英伟达 GPU 的监控。 也优化了 KRunner 在 X11 上的性能,系统设置中的关键词搜索更加高效。 ![](/data/attachment/album/202310/14/104202t9z93fr4br40v3es.png) 对于 Kubuntu 的软件中心 “<ruby> 发现 <rt> Discover </rt></ruby>” 应用,改进了一些 Flatpak 错误的处理方式,你将享受更佳的用户体验。 #### Linux 内核 6.5 Linux 内核 6.5 带来了硬件兼容性的改进,以及对英特尔 Arc 图形的全方位支持,你现在可以在最新的系统上尝试 Kubuntu。 [Linux 内核 6.5](https://news.itsfoss.com/linux-kernel-6-5-release/) 引入了一些包括 Wi-Fi 7 和 USB 4 在内的尖端技术支持。关于更多变化,你可以在我们的报道中详细了解: > > **[Linux 内核 6.5 发布,首次支持 Wi-Fi 7 和 USB4](/article-16140-1.html)** > > > #### 应用程序更新 ![](/data/attachment/album/202310/14/104203t0qje2e2kevjj3q8.jpg) Kubuntu 为你预装了最新版 [Firefox 118](https://news.itsfoss.com/firefox-118-release/),你可以试用其内建的翻译功能(LCTT 译注:不支持中文)。 升级版的 [LibreOffice 7.6](https://news.itsfoss.com/libreoffice-7-6/) 也在本次更新中登场,与之前的版本相比,其表现出显著的进步,提供了新的主题、更好的用户体验以及更优的兼容性。 此外,我们还预装了漂亮的 [Thunderbird 115](https://news.itsfoss.com/thunderbird-115/)。 除此之外,你还会获取常规的 KDE 应用更新、问题修复,以及 KDE 框架的改进。 #### 其他改进 随着所有的 KDE 更新、软件包升级和桌面改进,相信你会在用户体验上感受到很多细微的变化。 一些其他的技术更新包括: * Qt 5.15.10 * Kate 23.08.1 ### ? 如何获取 Kubuntu 23.10 你可以在 [官方网站](https://kubuntu.org/getkubuntu/) 或 [Ubuntu 的仓库](http://cdimage.ubuntu.com/kubuntu/releases/23.10) 下载 Kubuntu 23.10 的 ISO 文件。 > > **[Kubuntu 23.10](http://cdimage.ubuntu.com/kubuntu/releases/23.10/release/)** > > > (题图:[Ubuntu](https://ubuntu.com/blog/into-the-labyrinth)) --- via: <https://news.itsfoss.com/kubuntu-23-10/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) If you were waiting for an updated KDE experience on top of Ubuntu, Kubuntu 23.10 is here. It is not a big release, but if you are upgrading from Kubuntu 23.04 and have encountered bugs, it should be a nicer experience. **nine**months until **July 2024**. ## Kubuntu 23.10: What's New? ![kubuntu 23.10](https://news.itsfoss.com/content/images/2023/10/kubuntu-23-10-1.jpg) The best bits of the release include: - KDE Plasma 5.27.8 - KDE App updates - Linux Kernel 6.5 - Firefox 118 - LibreOffice 7.6 - Thunderbird 115 ### KDE Plasma 5.27.8 If you are curious, why is it still KDE Plasma 5.27 in a new upgrade? It is because that's the last series before [KDE Plasma 6](https://news.itsfoss.com/kde-plasma-6-dev/) upgrade (*scheduled for February 2024*). So, you should not expect any KDE Plasma 5.28 release. ![kubuntu 23.10 system info](https://news.itsfoss.com/content/images/2023/10/kubuntu-23-10-sys-info.png) With KDE Plasma 5.27.8, you get various significant bug fixes and refinements to hybrid sleep, and monitoring (via Plasma System Monitor) of NVIDIA GPUs on multi-GPU setups. There are performance improvements for KRunner on X11, and an efficient search for keywords in the system settings. ![kubuntu 23.10 discover](https://news.itsfoss.com/content/images/2023/10/kubuntu-23-10-discover.png) When it comes to Discover (the software center for Kubuntu), there are improvements to how some Flatpak errors are handled, which should give you a better end-user experience. ### Linux Kernel 6.5 With hardware compatibility improvements, and full support of Intel Arc graphics, you should be able to try Kubuntu on newer systems. [Linux Kernel 6.5](https://news.itsfoss.com/linux-kernel-6-5-release/) brings in interesting bleeding edge tech support that includes Wi-Fi 7, and USB 4. You can read more about all the other changes in our coverage: [Linux Kernel 6.5 Released With Initial Support for Wi-Fi 7 and USB4The Linux Kernel 6.5 has dropped with nice improvements. Check it out here.](https://news.itsfoss.com/linux-kernel-6-5-release/)![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ### Application Updates ![kubuntu 23.10](https://news.itsfoss.com/content/images/2023/10/kubuntu-23-10-application-update.jpg) You can expect the latest [Firefox 118](https://news.itsfoss.com/firefox-118-release/) baked in and try the native translation feature. [LibreOffice 7.6](https://news.itsfoss.com/libreoffice-7-6/) is also a part of the upgrade, which is a substantial step up from its previous release with new themes, a better user experience, and compatibility improvements. Not to forget, the stunning [Thunderbird 115](https://news.itsfoss.com/thunderbird-115/) is also included out of the box. Along with these, you get the usual KDE app updates, bug fixes, and refinements to the KDE framework as well. ### Other Improvements With all the KDE updates, package upgrades, and the desktop refinements, I'm sure there are many subtle changes to the user experience. Some other technical bits include: - Qt 5.15.10 - Kate 23.08.1 ## 📥 Getting Kubuntu 23.10 You can download Kubuntu 23.10 ISO from the[ official website](https://kubuntu.org/getkubuntu/?ref=news.itsfoss.com) or [Ubuntu's repository](http://cdimage.ubuntu.com/kubuntu/releases/23.10?ref=news.itsfoss.com). ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,282
Xubuntu 23.10 发布,提供细微但重要的改进
https://news.itsfoss.com/xubuntu-23-10/
2023-10-14T11:32:00
[ "Ubuntu", "Xubuntu", "Ubuntu 23.10" ]
https://linux.cn/article-16282-1.html
![](/data/attachment/album/202310/14/113232y7wgzcj565q57cjl.jpg) > > Xubuntu 23.10 版本包括了问题修复,更新了内核,同时一些应用也进行了升级,使得它成为一个稳定而不错的升级选择。 > > > [Xubuntu 23.04](https://news.itsfoss.com/xubuntu-23-04/) 的生命周期即将结束,新的升级版本正好到来。 Xubuntu 23.10 这个发布版本对其前身进行了进一步的改良,下面我们来看看它提供了哪些新鲜内容。 > > ? 请注意,Xubuntu 23.10 将持续得到**九个月的支持**,一直到 2024 年 7 月。 > > > ### ? Xubuntu 23.10:有什么新内容? ![](/data/attachment/album/202310/14/113256ksis5yuijn594k0z.png) 这个版本的 Xubuntu 基于 **Ubuntu 23.10 “Mantic Minotaur”** 版本,带来了许多崭新的改进。部分重要的亮点包括: * 对 Xfce 的优化 * 应用程序的更新 * Linux 内核 6.5 #### 对 Xfce 的优化 ![](/data/attachment/album/202310/14/113257wmo2xp7pavi5q8os.png) Xubuntu 23.10 搭载了与之前相同的 [Xfce 4.18](https://news.itsfoss.com/xfce-4-18-release/) 桌面环境。但在此基础上,它针对一些如 **garcon**、**libxfce4ui**、**tumbler** 和 **xfconf** 之类的 Xfce 库进行了**多项问题修复**。 此外,对于音频设备处理和媒体播放器,**Xfce PulseAudio 插件** 也进行了大量的修复。 在上一版本中,用户曾遇到的关于 **Xfce 电源管理器** 和 **Xfce 屏幕保护程序** 的一些问题,也在这个版本中得到了修复。 最后, **Xfce 截屏** 新增了对 **AVIF 和 JPEG XL 文件格式的支持**。 > > **[Xfce 4.18 版本发布:令人印象深刻](/article-15355-1.html)** > > > #### 应用程序的更新 在 Xubuntu 23.10 版本中,有了**一整套更新的应用程序**,其中大部分来源于 XFCE、GNOME 和 MATE 的核心应用的更新。 其中一些显著的更新包括: * Catfish 4.16.4 * Mousepad 0.6.1 * Thunar 文件管理器 4.18.7 * MATE 日历 1.26.0 * GNOME 软件 45 * Rhythmbox 3.4.7 * GIMP 2.10.34 #### Linux 内核 6.5 ![](/data/attachment/album/202310/14/113257xhp69wts51y140mt.png) Xubuntu 23.10 由最新发布的 [Linux 内核 6.5](https://news.itsfoss.com/linux-kernel-6-5-release/) 进行驱动,这样便可以支持最新的硬件,比如 **USB4、Wi-Fi 7** ,并且提供了 **良好的 Rust 环境支持**、**AMD FreeSync 视频** 等。 #### ?️ 其他的改进 除了以上提到的内容,还有一些值得一提的变化: * 引入了 [Greybird 3.23.3](https://github.com/shimmerproject/Greybird/releases/tag/v3.23.3),以便得到更好的 GTK 3/4 支持。 * 在 PipeWire 环境下加强了对蓝牙耳机的支持。 * Firefox、Thunderbird 以及其他新的应用程序中现在使用的是彩色表情符。 * 刷新了 [elementary-xfce 0.18](https://github.com/shimmerproject/elementary-xfce/releases/tag/v0.18) 主题,带给你全新的桌面图标体验。 * 引入了 Ristretto 0.13.1,给 Xubuntu 的默认图像查看器添加了打印支持功能。 你可以查阅 [官方发布说明](https://wiki.xubuntu.org/releases/23.10/release-notes) 来更深入地了解 Xubuntu 23.10 发行版特性。 ### ? 如何下载 Xubuntu 23.10 为了获取 Xubuntu 的最新发布版,你可以访问 [官方网站](https://xubuntu.org/download/) 或者 Ubuntu 的 [镜像仓库](https://cdimage.ubuntu.com/xubuntu/releases/23.10/)。 > > **[Xubuntu 23.10](https://cdimage.ubuntu.com/xubuntu/releases/23.10/release/)** > > > 对于现有的用户们,你们可以参阅 [官方升级指南](https://docs.xubuntu.org/latest/user/C/migrating-upgrading.html) 进行版本升级。 *(题图:[Ubuntu](https://ubuntu.com/blog/into-the-labyrinth))* --- via: <https://news.itsfoss.com/xubuntu-23-10/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Considering that the end of life for [Xubuntu 23.04](https://news.itsfoss.com/xubuntu-23-04/) is a few months away, we now have a new upgrade. The '**Xubuntu 23.10**' release features a couple of improvements over its predecessor. Let's see what it has to offer. **supported for nine months**until July 2024. ## 🆕 Xubuntu 23.10: What’s New? ![a screenshot of the xubuntu 23.10 desktop screen](https://news.itsfoss.com/content/images/2023/10/Xubuntu_23.10_1.png) Based on the **Ubuntu 23.10 'Mantic Minotaur'** release, this release of Xubuntu is here with many improvements. Some highlights include: **Xfce Improvements****Updated Applications****Linux Kernel 6.5** ### Xfce Improvements ![a screenshot of the about xfce app on xubuntu 23.10](https://news.itsfoss.com/content/images/2023/10/Xubuntu_23.10_2.png) Xubuntu 23.10 comes equipped with the same [Xfce 4.18](https://news.itsfoss.com/xfce-4-18-release/) desktop environment as before. However, it now features **several bug fixes** for Xfce libraries like **garcon**, **libxfce4ui**, **tumbler**, and **xfconf.** Similarly, the **Xfce PulseAudio Plugin** has also received numerous fixes that affect audio device handling and the media player. Even **Xfce Power Manager** and **Xfce Screensaver** have received updates to **fix the screensaver issues** faced by users in the previous release. And finally, we have **Xfce Screenshooter **that now has support for the **AVIF** and **JPEG XL** file formats. **Suggested Read **📖 [XFCE 4.18 Release Looks Impressive!Xfce 4.18 is here with interesting feature additions and subtle changes.](https://news.itsfoss.com/xfce-4-18-release/)![](https://news.itsfoss.com/content/images/2022/12/xfce-4-18-release.png) ![](https://news.itsfoss.com/content/images/2022/12/xfce-4-18-release.png) ### Updated Applications Xubuntu 23.10 features **an updated application suite**, with most core apps from XFCE, GNOME and MATE being updated. Some of the most notable ones include: - Catfish 4.16.4 - Mousepad 0.6.1 - Thunar File Manager 4.18.7 - MATE Calculator 1.26.0 - GNOME Software 45 - Rhythmbox 3.4.7 - GIMP 2.10.34 ### Linux Kernel 6.5 ![a screenshot of the neofetch output on xubuntu 23.10](https://news.itsfoss.com/content/images/2023/10/Xubuntu_23.10_3.png) Xubuntu 23.10 is powered by the recently released [Linux kernel 6.5 ](https://news.itsfoss.com/linux-kernel-6-5-release/)that allows it to take advantage of **support for newer hardware such as USB4, Wi-Fi 7**, b**etter support for Rust**, **AMD FreeSync video**, and more. **Suggested Read **📖 [Linux Kernel 6.5 Released With Initial Support for Wi-Fi 7 and USB4The Linux Kernel 6.5 has dropped with nice improvements. Check it out here.](https://news.itsfoss.com/linux-kernel-6-5-release/)![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ### 🛠️ Other Improvements Other than that, here are some changes that are worth noting: - Inclusion of [Greybird 3.23.3](https://github.com/shimmerproject/Greybird/releases/tag/v3.23.3?ref=news.itsfoss.com)for better GTK 3/4 support. - Better support for Bluetooth headphones under PipeWire. - Color emojis are now used in Firefox, Thunderbird, and other newer applications. - The refreshed [elementary-xfce 0.18](https://github.com/shimmerproject/elementary-xfce/releases/tag/v0.18?ref=news.itsfoss.com)theme features updated icons across the desktop. - Introduction of Ristretto 0.13.1 for adding print support to Xubuntu's default image viewer. You may go through the [official release notes](https://wiki.xubuntu.org/releases/23.10/release-notes?ref=news.itsfoss.com) to dive deeper into the Xubuntu 23.10 release. ## 📥 Download Xubuntu 23.10 To get the latest release of Xubuntu, you can head over to the [official website](https://xubuntu.org/download/?ref=news.itsfoss.com) or the Ubuntu [image repository](https://cdimage.ubuntu.com/xubuntu/releases/23.10/?ref=news.itsfoss.com). For existing users, you can follow the [official guide](https://docs.xubuntu.org/latest/user/C/migrating-upgrading.html?ref=news.itsfoss.com) to get the upgrade. ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,284
在 Arch Linux 上安装和使用 Yay
https://itsfoss.com/install-yay-arch-linux/
2023-10-14T22:48:09
[ "AUR", "Yay" ]
https://linux.cn/article-16284-1.html
![](/data/attachment/album/202310/14/224808sb66bbdrd4zrqk6q.jpg) > > Yay 是最流行的 AUR 助手之一,用于处理 Arch 用户资源库中的软件包。学习在 Arch Linux 中安装它。 > > > 你可以在 <ruby> <a href="https://itsfoss.com/aur-arch-linux/"> Arch 用户仓库 </a> <rt> Arch User Repository </rt></ruby>(AUR)中找到社区成员打包的大量软件。 由于它来自第三方,纯粹主义者建议从 AUR 手动下载并构建每个所需的包。 但这是一项乏味的任务,这就是为什么会有 AUR 助手来避免麻烦。 Yay 是最受欢迎的 AUR 帮助程序之一,在本教程中,我将分享如何在 Arch Linux 上安装 Yay。我还将分享一些有关使用 Yay 管理 AUR 包的技巧。 > > ? Yay 可在 Manjaro 的仓库中找到。因此,Manjaro 用户只需使用 `pacman -S yay` 即可安装 > > > ### 在 Arch Linux 上安装 Yay 在继续安装 Yay 之前,你需要一些构建它所需的软件包。 让我把它分成几个步骤。 #### 步骤 1:安装必备包 首先刷新包缓存并更新系统是一个好主意: ``` sudo pacman -Syu ``` 安装所需的 `base-devel`(包含 `makepkg` 等工具)和 `git`(克隆 yay 的 Git 仓库所需的)。 ``` sudo pacman -S --needed base-devel git ``` 使用 `--needed` 标志,它不会重新安装已经安装的软件包。 它看起来是这样的: ![](/data/attachment/album/202310/14/224809dpa4pvt60k09bt4k.png) 现在你已经有了所需的软件包,是时候在你的系统上安装 [Yay](https://github.com/Jguer/yay)。 #### 步骤 2:克隆 Yay Git 仓库并切换到它 [使用 git 命令](https://itsfoss.com/basic-git-commands-cheat-sheet/) “克隆” Yay 仓库。你可以在系统中的任何位置执行此操作,无论是主目录还是其他目录。 ``` git clone https://aur.archlinux.org/yay.git ``` 完成后,切换到克隆的目录: ``` cd yay ``` ![](/data/attachment/album/202310/14/224809owwm5kc2cqicz6g6.png) 终于可以安装 Yay 了。 #### 步骤 3:安装 Yay 事实上,你是在构建它。你将在此处看到 `PKGBUILD` 文件。使用以下命令从此处构建包: ``` makepkg -si ``` 按照屏幕上的说明进行操作。当系统要求你确认时,按 `Y`。 ![](/data/attachment/album/202310/14/224810yh0yhlklkym5kzkw.png) 该过程完成后,通过检查其版本来验证 Yay 是否已成功安装。 ``` yay --version ``` 现在你已经成功安装了它,你可以删除克隆的 Yay Git 仓库。不再需要它了。 ### 使用 Yay 进行包管理 Yay 遵循与 [pacman](https://itsfoss.com/pacman-command/) 类似(但不相同)的命令结构。所以你用 Yay 管理 AUR 包应该不难。 搜索软件包: ``` yay search_term ``` 安装软件包: ``` yay -S package_name ``` 删除软件包: ``` yay -R package_name ``` 要删除包及其依赖项: ``` yay -Rns package_name ``` 仅升级 AUR 包: ``` yay -Sua ``` Yay 还能够升级非 AUR 软件包。上面的 `a` 标志将其限制为 AUR。 ### 将 Yay 升级到新版本 现在,你可能想知道如何将 Yay 升级到可用的新版本。 答案是你不需要做任何特别的事情。当你运行以下命令时,Yay 可以自行更新: ``` yay -Sua ``` ### 从 Arch 系统中删除 Yay 如果你不喜欢 Yay 或不再需要它,你可以使用 `pacman` 命令像删除任何其他软件包一样删除它: ``` sudo pacman -Rs yay ``` ### 总结 这是对 Yay AUR 助手的快速介绍。你可以访问其 GitHub 仓库以了解有关其工作的更多详细信息。 Arch 用户仓库(AUR)是[为什么有些人喜欢使用 Arch Linux](https://itsfoss.com/why-arch-linux/) 的原因之一。 虽然纯粹的 Arch 用户一般都会嘲笑 AUR,特别是 [AUR 助手](https://itsfoss.com/best-aur-helpers/),但它们仍然因其提供的易用性而受到欢迎。 我希望你发现这个快速教程有助于在 [Arch Linux](https://archlinux.org/) 上获得 Yay。如果你仍有疑问或发现任何技术错误,请告诉我。 *(题图:MJ/f01331ab-ee70-45c4-8fd1-163e63497a6a)* --- via: <https://itsfoss.com/install-yay-arch-linux/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) You'll find a huge number of software packaged by the community members in [Arch User Repository](https://itsfoss.com/aur-arch-linux/) (AUR). Since it is coming from third parties, purists suggest downloading and building each desired package from AUR manually. But that's a tedious task and that's why AUR helpers were created to save the trouble. Yay is one of the most popular AUR helpers and in this tutorial, I'll share how you can install Yay on Arch Linux. I'll also share a few tips on managing packages from AUR with Yay. ## Installing Yay on Arch Linux Before you go on with Yay installation, you need some packages required to build it. Let me divide it into steps. ### Step 1: Install the prerequisite packages It is always a good idea to refresh the package cache and update the system first: `sudo pacman -Syu` Install the rerquired `base-devel` (contains tools such as `makepkg` etc) and git (required for cloning the yay git repository). ``` sudo pacman -S --needed base-devel git ``` With the `--needed` flag, it will NOT reinstall the already installed packages. Here's what it looks like: ![](https://itsfoss.com/content/images/2023/10/install-prerequisite-yay.png) Now that you have the required packages, it's time to get [Yay](https://github.com/Jguer/yay) on your system. ### Step 2: Clone the Yay git repo and switch to it [Use the git command](https://itsfoss.com/basic-git-commands-cheat-sheet/) to 'clone' the Yay repo. You can do it anywhere in the system, be it your home directory or otherwise. `git clone https://aur.archlinux.org/yay.git` Once done, switch to the cloned directory: `cd yay` ![Clone yay git repo](https://itsfoss.com/content/images/2023/10/git-clone-yay.png) It's time to install yay (finally). ### Step 3: Install yay Actually, you are building it. You'll see a PKGBUILD file here. Use the following command to build the package from here: `makepkg -si` Follow the on-screen instructions. Press Y when you are asked to confirm. ![Build yay package in arch Linux](https://itsfoss.com/content/images/2023/10/building-yay-package.png) Once the process finishes, verify that yay has been installed successfully by checking its version. `yay --version` Now that you have successfully installed it, you may remove the cloned Yay git repository. It is not needed anymore. [Proton Mail: Get a private, secure, and encrypted email account | ProtonProton Mail is the world’s largest secure email service with over 100 million users. Available on Web, iOS, Android, and desktop. Protected by Swiss privacy law.](https://go.getproton.me/aff_c?offer_id=26&aff_id=1173&url_id=267)![](https://proton.me/images/social/proton-mail-og.png) ![](https://proton.me/images/social/proton-mail-og.png) ## Using Yay for package management The yay follows similar (but not identical) command structure as [pacman](https://itsfoss.com/pacman-command/). So it should not be difficult for you to manage AUR packages with Yay. Search for packages with: `yay search_term` Install the packages with: `yay -S package_name` Remove packages with: `yay -R package_name` To delete a package with its dependencies: `yay -Rns package_name` Upgrading (only) the AUR packages: `yay -Sua` ![Updating Yay on Arch Linux](https://itsfoss.com/content/images/2024/02/updating-yay-arch-linux.png) Also, it is recommended to not use sudo with yay. You'll be asked to enter the account password when it actually starts to install a package on your system. ## Upgrading Yay to a new version Now, you may wonder how you can upgrade Yay to a newer version when it's available. The answer is that you don't have to do anything special. Yay can update itself when you run the command: `yay -Sua` ## Removing Yay from your Arch system If you don't like Yay or no longer need it anymore, you can remove it like any other package with the pacman command: `sudo pacman -Rs yay` [Learn Linux Quickly - Linux Commands Book for BeginnersLearn Linux Quickly doesn’t assume any prior Linux knowledge, which makes it a perfect fit for beginners. Nevertheless, intermediate and advanced Linux users will still find this book very useful as it goes through a wide range of topics. Learn Linux Quickly will teach you the following topics:Insta…](https://linuxhandbook.gumroad.com/l/mEsrwA)![](https://public-files.gumroad.com/ecjyjb71cmsww7i7srgezk6cq7tg) ## Conclusion That was a quick introduction to Yay AUR helper. You can visit its GitHub repository for more details on its working. [GitHub - Jguer/yay: Yet another Yogurt - An AUR Helper written in GoYet another Yogurt - An AUR Helper written in Go. Contribute to Jguer/yay development by creating an account on GitHub.](https://github.com/Jguer/yay)![](https://opengraph.githubassets.com/ba2d9f4158efde8c5b028350bc68b04fe0b2f3b0dd5e0960ad415688bed0412f/Jguer/yay) Arch User Repository (AUR) is one of the reasons [why some people love using Arch Linux](https://itsfoss.com/why-arch-linux/). While purists Arch users scoff at AUR in general and [AUR helpers](https://itsfoss.com/best-aur-helpers/) in particular, they remain popular for the ease of use they provide. I hope you find this quick tutorial helpful in getting Yay on [Arch Linux](https://archlinux.org/). Please let me know if you still have questions or if you notice any technical inaccuracies.
16,285
树莓派操作系统升级:基于 Debian 12、淘汰 X11
https://news.itsfoss.com/raspberry-pi-os-bookworm/
2023-10-14T23:31:30
[ "树莓派" ]
https://linux.cn/article-16285-1.html
![](/data/attachment/album/202310/14/233127bc5jlvhkphkgngjh.jpg) > > 为了匹配最新的树莓派 5 硬件,树莓派操作系统已做好准备,该系统中融入了 Debian 12 以及其他重大更新。 > > > 这个新版本的 <ruby> 树莓派操作系统 <rt> Raspberry Pi OS </rt></ruby> 能够完善支持新推出的 [树莓派 5](https://news.itsfoss.com/raspberry-pi-5/)。 为此,开发者们投入了大量的心血和精力。新系统带来了诸多改进,同时还标志着向更现代化的窗口系统的迁移。 下面,我们来看看他们的具体成果。 ### 树莓派操作系统: 新的变化有哪些? ![](/data/attachment/album/202310/14/233130hw8g907911lme80u.png) 开发者基于最新的 [Debian 12 “Bookworm”](https://news.itsfoss.com/debian-12-release/) 版本,对树莓派桌面进行了 **重大的架构更新**。 一些显著的新特性包括: * 全面采用 Wayland * 网络性能显著提升 * 默认使用 PipeWire * 为树莓派优化的 Firefox 显然,你将会享受到 Debian “Bookworm” 的核心优点,同时还能体验到上述提到的一些新变化。 #### 全面采用 Wayland 没错,你没有看错。 树莓派桌面已经默认启用 [Wayland](https://wayland.freedesktop.org/) 窗口系统,正式摒弃了因多种限制不再使用的 [X11](https://en.wikipedia.org/wiki/X_Window_System) 窗口系统。Wayland 的主要优点是其**在现代硬件上有更出色的性能表现**。 这一切的实现离不开 [Wayfire](https://github.com/WayfireWM/wayfire) 合成器的支持,这使得开发者能够在更新中**保持用户熟知的体验**。 以下是开发者在发布公告中的引述: > > 如果你在树莓派 4 或 5 上启动树莓派操作系统,现在你会看到的是一个 Wayfire 桌面。它看起来和你之前在 Bullseye 上使用的桌面几乎一模一样,但在一致的外观背后,我们为了使两个桌面环境看起来一样已进行了大量的工作! > > > **我们对此并不感到惊讶。** 近期,我们注意到有很多桌面正在从 X11 和 [Openbox](https://en.wikipedia.org/wiki/Openbox) 这样的旧窗口系统转向 Wayland。 比如,GNOME 最近的更新开启了向 **[全面使用 Wayland 的未来](https://news.itsfoss.com/gnome-wayland-xorg/)** 的转变。即使是 Fedora Linux 40 也准备弃用 X11 会话,转向使用 [Plasma 6](https://fedoraproject.org/wiki/Changes/KDE_Plasma_6) 的 XWayland 方式。 看到树莓派操作系统已经率先进行了这样的变化,实在是让人感到十分有趣 ? > > ? 不过别担心,**对于仍希望使用 X11/Openbox 显示系统的用户**,他们可以在 `raspi-config` 中的 “<ruby> 高级设置 <rt> Advanced Settings </rt></ruby>” 菜单中重新启用它。 > > > #### 网络性能显著提升 ![](/data/attachment/album/202310/14/233131dh0su8tmddnqmqzj.png) 开发者在之前实现的 [NetworkManager](https://networkmanager.dev/) 网络控制器的基础上进行了优化,他们为 **任务栏增加了网络插件**。 虽然新版本的插件和旧版本看上去差不多,但新增了一个 “<ruby> 高级选项 <rt> Advanced Options </rt></ruby>” 选项,用户可以通过它访问 NetworkManager 提供的更多功能。 #### 默认使用 PipeWire 现在,树莓派 Desktop 使用 [PipeWire](https://pipewire.org/) 来处理所有与音频/视频相关的任务。它取代了 [PulseAudio](https://www.freedesktop.org/wiki/Software/PulseAudio/),使**音频/视频处理迈向更现代化和灵活的方式**。 在用户端,你可以得到**更优化的蓝牙音频设备管理**、**更低的延迟时间**,**和 Wayland 的更好互操作性**等等。 用户也可以通过和切换窗口系统类似的步骤**选择回退使用 PulseAudio**。 #### 为树莓派优化的 Firefox ![](/data/attachment/album/202310/14/233131zrftjrghttxygfy5.png) 这次,我们看到了一个**由官方支持且专门为树莓派优化的 [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/) 版本**,它在这次树莓派操作系统的发布版中首次被引入。 现在,用户可以使用 **V4L2 编码支持** 来启用他们的树莓派上的硬件 h.264 解码器,这将会有助于**实现更好的 HD 视频播放效果**。 此外,他们也启用了 [Widevine DRM](https://www.widevine.com/solutions/widevine-drm),以在主流的视频流媒体平台上提供**无障碍的流媒体观看体验**。 在这次发布的版本中还有其他一些细微的变化。想了解更多,请参考 [官方博客](https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/)。 ### ? 下载树莓派操作系统 由于操作系统细节的大量变化,开发者建议你**从全新安装开始** (重新烧录你的 SD 卡)。 当然,你也可以选择自行升级,但需要自担风险。 你可以访问 [官方网站](https://www.raspberrypi.com/software/operating-systems/) 进行下载。 > > **[树莓派操作系统](https://www.raspberrypi.com/software/operating-systems/)** > > > ? 你对新的树莓派操作系统升级感到兴奋吗?欢迎在评论区告诉我们。 *(题图:MJ/2fe701cd-5ced-41e2-b00e-1454c6f3fa4a)* --- via: <https://news.itsfoss.com/raspberry-pi-os-bookworm/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) A new release of Raspberry Pi OS is here to complement the recently launched [Raspberry Pi 5](https://news.itsfoss.com/raspberry-pi-5/). The developers have worked on it for quite some time now. It features loads of improvements and a major change that signifies the move to a more modern approach to window systems. Let's see what they've accomplished. ## Raspberry Pi OS: What's New? ![a screenshot of raspberry pi os](https://news.itsfoss.com/content/images/2023/10/RaspberryPi_OS_Bookworm_1.png) Based on the latest ** Debian 12 'Bookworm'** release, the developers have had to make **major architectural changes to the Raspberry Pi Desktop**. Some key highlights include: **Wayland Only****Networking Improvements****PipeWire by Default****Raspberry Pi-Optimized Firefox** Naturally, you can expect the core benefits of Debian 'Bookworm' along with the above-mentioned changes. ### Wayland Only Yes, you read that right. The Raspberry Pi Desktop has moved to the [Wayland](https://wayland.freedesktop.org/?ref=news.itsfoss.com) window system as its default, dropping the [X11](https://en.wikipedia.org/wiki/X_Window_System?ref=news.itsfoss.com) window system owing to various limitations, with the primary selling point being that **Wayland performs better on modern hardware**. All of this was made possible thanks to the implementation of the [ Wayfire](https://github.com/WayfireWM/wayfire?ref=news.itsfoss.com) compositor, which also allowed the devs to keep **the** **user experience a familiar one.** Quoting the devs from the release announcement: If you boot Raspberry Pi OS on a Pi 4 or 5, you will now get a Wayfire desktop. It should look pretty much identical to the desktop you are used to from Bullseye, but appearances are deceptive — it has taken a lot of work to get to the point where the two desktop environments look the same! **We are not surprised by this move, though.** Recently, we have been seeing an increase in transition to Wayland from older window systems like X11 and [Openbox](https://en.wikipedia.org/wiki/Openbox?ref=news.itsfoss.com). For instance, the recent move by GNOME that has kick-started the transition to ** a Wayland-only future**. Even **Fedora Linux 40 is all set to drop the X11 session**for an XWayland approach with [Plasma 6](https://fedoraproject.org/wiki/Changes/KDE_Plasma_6?ref=news.itsfoss.com). It is interesting to see Raspberry Pi OS make the move already 😄 **for users who still want to use the older X11/Openbox display systems**, they can do so by re-enabling these from the 'Advanced Settings' menu under 'raspi-config'. ### Networking Improvements ![a screenshot of raspberry pi os networking plugin in the taskbar](https://news.itsfoss.com/content/images/2023/10/RaspberryPi_OS_Bookworm_2.png) Working on the previously implemented [NetworkManager](https://networkmanager.dev/?ref=news.itsfoss.com) network controller, the devs have been able to improve it by having **the networking plugin on the taskbar**. It looks almost the same as in the previous versions but with a new 'Advanced Options' element that allows users to access the new functions made available by NetworkManager. ### PipeWire by Default Raspberry Pi Desktop now features [PipeWire](https://pipewire.org/?ref=news.itsfoss.com) for handling all audio/video-related tasks. It replaces [PulseAudio](https://www.freedesktop.org/wiki/Software/PulseAudio/?ref=news.itsfoss.com), for **a more modern and flexible approach** to audio/video handling. On the user side, you can take advantage of **better Bluetooth audio device management**,** lower latency**, **better interoperability with Wayland, **and more. Users do have** the option to revert to PulseAudio** by following the same steps mentioned above for switching the windowing systems. ### Raspberry Pi-Optimized Firefox ![a screenshot of raspberry pi os running the raspberry pi-optimized firefox](https://news.itsfoss.com/content/images/2023/10/RaspberryPi_OS_Bookworm_3.png) For the first time, an **officially supported, Raspberry Pi-optimized version of Mozilla Firefox** is being made available through this release of Raspberry Pi OS. Users can now utilize the** V4L2 codec support** **for** **using the hardware h.264 decoder** on their Raspberry Pi, which should help in **better HD video playback.** They have also enabled [Widevine DRM](https://www.widevine.com/solutions/widevine-drm?ref=news.itsfoss.com) for **a hassle-free streaming experience** on major video streaming platforms. There are a few other subtle changes in this release. Refer to the [official blog](https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/?ref=news.itsfoss.com) to learn more. ## 📥 Download Raspberry Pi OS As the changes to the operating system are significant, the developers recommend that you **start with a fresh installation** (re-image your SD card). Sure, you can upgrade at your own risk. You can head over to the [official website](https://www.raspberrypi.com/software/operating-systems/?ref=news.itsfoss.com) to get started. *💬 Are you excited about the new Raspberry Pi OS upgrade? Let us know in the comments.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,287
Btrfs 详解:快照
https://fedoramagazine.org/working-with-btrfs-snapshots/
2023-10-16T09:24:00
[ "Btrfs" ]
https://linux.cn/article-16287-1.html
![](/data/attachment/album/202310/16/092244yog42vb0l3v5h33h.jpg) 这篇文章会探讨什么是 Btrfs 快照,它们如何工作的,你在日常生活中进行快照的好处。这篇文章是《Btrfs 详解》系列文章中的一篇。从 Fedora Linux 33 开始,Btrfs 就是 Fedora Workstation 和 Fedora Silverblue 的默认文件系统。 如果你错过了,这里是本系列的上一篇文章:[Btrfs 详解:子卷](/article-16250-1.html) ### 简介 想象一下,你长时间处理一个文件,反复添加和撤销修改。然后,在某个时刻你意识到:两小时前你撤销的部分修改,现在会非常有用。而昨天在你销毁那个设计之前,你也已经修改了这个特殊的部分。当然,由于你会定期保存文件,所以旧的改动会丢失。很多人可能都遇到过这样的情况。如果能恢复旧版本的文件,而无需定期手动复制,岂不美哉? 这是一个 Btrfs 快照可以帮助你的特别场景。当你使用正确的话,快照同时也为你的电脑提供了很好的备份方案。 下面你会找到一些关于快照的例子。如果你想跟着操作,你必须拥有访问某些 Btrfs 文件系统的权限和 root 权限。你可以通过下面命令来验证一个目录的文件系统。 ``` $ findmnt -no FSTYPE /home btrfs ``` 这个命令会输出你 `/home/` 目录的文件系统名称。如果它是 `btrfs`,那就可以了。让我们创建一个新的目录去做实验: ``` $ mkdir ~/btrfs-snapshot-test $ cd ~/btrfs-snapshot-test ``` 在下面的文本中,你会看到很多像上面显示的那样的命令输出框。请在阅读/比较命令输出时请记住,**框中的内容在行末会被换行**。这使得识别跨多行的长行变得困难,降低了可读性。如果有疑问,试着调整浏览器窗口的大小,看看文本的变化! ### Btrfs 快照 让我们从一个基本的问题开始:什么是 Btrfs 快照?如果你在文档 <sup class="footnote-ref"> <a href="#fn1" id="fnref1"> [1] </a></sup> 和维基 <sup class="footnote-ref"> <a href="#fn2" id="fnref2"> [2] </a></sup> 中查找,你不会立刻找到这个问题的答案。事实上,从“功能”一节里是找不到的。如果你搜索一下,你会发现快照和 Btrfs 子卷一起被大量地提及 <sup class="footnote-ref"> <a href="#fn3" id="fnref3"> [3] </a></sup>。所以现在做什么呢? 还记得快照在系列前面的文章里两次被提到吗?是这样说的: > > CoW 的优势在哪里?简单的说:文件被修改和编辑的历史被保存了下来。Btrfs 保存文件旧版本的引用(inode)可以轻易地被访问。这个引用就是快照:文件系统在某个时间点的状态镜像。这将是这系列文章里的单独的一篇,所以暂时留到后面介绍。 > > > —— [Btrfs 详解:基础概念](/article-16189-1.html) > > > 以及: > > 另外一个分离 `/` 和 `/home` 的优势是我们可以分别进行 *快照* 。子卷是快照的边界,对一个子卷的快照永远不会包含该子卷下面的其他子卷的内容。快照的更多细节会在后续的文章中介绍。 > > > —— [Btrfs 详解:子卷](/article-16250-1.html) > > > 看起来快照是和 Btrfs 子卷相关的。你可能之前在其他地方听到过快照,比如说 LVM(逻辑卷管理器)。虽然技术角度上它们都是为了同一个目的,但它们在实现方面有所不同。 每个 Btrfs 快照是一个子卷。但是,不是每个子卷都是一份快照。区别在于子卷里面包含的内容。一个快照是子卷加上一些内容:它包含对现在和过去版本的文件的引用(inode)。让我们看看快照是从哪来的! ### 创建 Btrfs 快照 想使用快照功能,你需要一个 Btrfs 子卷来进行快照。让我们在测试目录(`~/btrfs-snapshot-test`)里创建一个: ``` $ cd ~/btrfs-snapshot-test $ sudo btrfs subvolume create demo Create subvolume './demo' $ sudo chown -R $(id -u):$(id -g) demo/ $ cd demo ``` 因为 Btrfs 子卷默认是被 root 所有的,你必须用 `chown` 去修改子卷里的文件的所有权到普通用户上。现在我们在里面新加一些文件: ``` $ touch foo bar baz $ echo "Lorem ipsum dolor sit amet, " > foo ``` 你的目录现在看起来像这样: ``` $ ls -l total 4 -rw-r--r--. 1 hartan hartan 0 Dec 20 08:11 bar -rw-r--r--. 1 hartan hartan 0 Dec 20 08:11 baz -rw-r--r--. 1 hartan hartan 29 Dec 20 08:11 foo ``` 让我们从这里创建第一次快照: ``` $ cd .. $ sudo btrfs subvolume snapshot demo demo-1 Create a snapshot of 'demo' in './demo-1' ``` 这就好了。让我们看看发生了什么: ``` $ ls -l total 0 drwxr-xr-x. 1 hartan hartan 18 Dec 20 08:11 demo drwxr-xr-x. 1 hartan hartan 18 Dec 20 08:11 demo-1 $ tree . ├── demo │ ├── bar │ ├── baz │ └── foo └── demo-1 ├── bar ├── baz └── foo 2 directories, 6 files ``` 这看起来是一份拷贝!为了验证,我们从快照里读取 `foo` 的内容: ``` $ cat demo/foo Lorem ipsum dolor sit amet, $ cat demo-1/foo Lorem ipsum dolor sit amet, ``` 当我们修改原始文件时,真正的效果变得明显: ``` $ echo "consectetur adipiscing elit, " >> demo/foo $ cat demo/foo Lorem ipsum dolor sit amet, consectetur adipiscing elit, $ cat demo-1/foo Lorem ipsum dolor sit amet, ``` 这表明快照仍然持有“旧”版本的数据:`foo` 的内容没有改变。到目前为止,你可以通过一个简单的文件复制来实现完全相同的目标。现在你也可以继续处理旧文件了。 ``` $ echo "sed do eiusmod tempor incididunt" >> demo-1/foo $ cat demo-1/foo Lorem ipsum dolor sit amet, sed do eiusmod tempor incididunt ``` 但是在底层,我们的快照实际上是一个新的 Btrfs 子卷。你可以通过下面的命令来验证这一点: ``` $ sudo btrfs subvolume list -o . ID 259 gen 265 top level 256 path home/hartan/btrfs-snapshot-test/demo ID 260 gen 264 top level 256 path home/hartan/btrfs-snapshot-test/demo-1 ``` ### Btrfs 子卷 vs. 文件复制 这一切有什么意义呢?到目前为止快照看起来是一个更加复杂的复制文件的方式。事实上,快照不仅仅是表面上看起来那么简单。让我们来创建一个更大的文件: ``` $ dd if=/dev/urandom of=demo/bigfile bs=1M count=512 512+0 records in 512+0 records out 536870912 bytes (537 MB, 512 MiB) copied, 1.3454 s, 399 MB/s ``` 现在有一个512 MB 大小的新文件 `demo/bigfile` 。让我们创建另一个快照,这样在你修改数据的时候就不会丢失: ``` $ sudo btrfs subvolume snapshot demo demo-2 Create a snapshot of 'demo' in './demo-2' ``` 现在我们通过追加少量字符串到文件来模拟变化: ``` $ echo "small changes" >> demo/bigfile ``` 这是生效后的文件结构: ``` $ tree . ├── demo │ ├── bar │ ├── baz │ ├── bigfile │ └── foo ├── demo-1 │ ├── bar │ ├── baz │ └── foo └── demo-2 ├── bar ├── baz ├── bigfile └── foo 3 directories, 11 files ``` 但是真正的神奇的发生在其他地方。你已经复制了 `demo/bigfile` ,你现在拥有了两个大约 512 MiB 的文件。但是,因为它们是不同的拷贝,它们应该会占据共 1 GiB 的空间。记住两个文件的差异不超过 10 字节 —— 和原文件大小相比这几乎没什么差别。 Btrfs 快照工作原理与文件复制不同:而是它们保持对当前和过去的 inode 的引用。当你在文件追加更新时,在底层 Btrfs 分配更多的空间去存储更新,同时在原来的 inode 增加对新数据的引用。之前的内容保持不变。为了便于理解,你可以认为这是仅仅“存储”原文件和修改版本的差异。 让我们看看这个效果: ``` $ sudo compsize . Processed 11 files, 5 regular extents (9 refs), 3 inline. Type Perc Disk Usage Uncompressed Referenced TOTAL 100% 512M 512M 1.0G none 100% 512M 512M 1.0G ``` 这个有趣的数字出现在 `TOTAL` 一行: * `Referenced` 是当前目录下所有文件大小的总和 * `Disk Usage` 是用于在磁盘上存储文件分配空间的大小 你有一共 1 GiB 的文件,但存储它们仅仅占据了 512 MiB。 ### Btrfs 快照和备份 目前为止,在这篇文章中,你已经看到如何创建 Btrfs 快照和它们的特别之处。有人可能会想:如果我在我的 PC 本地进行一系列的快照,我就有一个可靠的备份策略。 **其实不是这样的** 。如果 Btrfs 子卷共享的底层数据被偶然破坏了(被 Btrfs 之外的东西影响,比如宇宙射线),所有指向这些数据的子卷都会存在相同的错误。 为了让快照成为真正的备份,你应该将它们存储到一个不同的 Btrfs 系统上,例如在一个外部驱动器上。为了本文的目的,让我们在一个文件里创建一个新的 Btrfs 系统,并挂载它来模拟一个外部驱动。如果你有一个格式为 Btrfs 的外部驱动器,请随意替换以下命令中提到的所有路径来试试!让我们创建一个新的 Btrfs 文件系统: **注意**:下面的命令会在你的文件系统上创建一个 8 GB 大小的新文件。如果你想跟着下面的步骤,请确保你的磁盘空间至少有 8 GB 剩余。请不要分配小于 8 GB 到这个文件,否则 Btrfs 可能在挂载时会遇到问题。 ``` $ truncate -s 8G btrfs_filesystem.img $ sudo mkfs.btrfs -L "backup-drive" btrfs_filesystem.img btrfs-progs v5.18 See http://btrfs.wiki.kernel.org for more information. [ ... ] Devices: ID SIZE PATH 1 8.00GiB btrfs_filesystem.img ``` 这些命令创建了名为 `btrfs_filesystem.img` 的 8 GB 新文件,同时在上面格式化了一个 Btrfs 文件系统。现在你可以像外部驱动器一样挂载它: ``` $ mkdir backup-drive $ sudo mount btrfs_filesystem.img backup-drive $ sudo chown -R $(id -u):$(id -g) backup-drive $ ls -lh total 4.7M drwxr-xr-x. 1 hartan hartan 0 Dec 20 08:35 backup-drive -rw-r--r--. 1 hartan hartan 8.0G Dec 20 08:37 btrfs_filesystem.img drwxr-xr-x. 1 hartan hartan 32 Dec 20 08:14 demo drwxr-xr-x. 1 hartan hartan 18 Dec 20 08:11 demo-1 drwxr-xr-x. 1 hartan hartan 32 Dec 20 08:14 demo-2 ``` 妙,现在挂载在 `backup-drive` 下面有一个独立的 Btrfs 文件系统!让我们尝试进行快照并且把快照放进去: ``` $ sudo btrfs subvolume snapshot demo backup-drive/demo-3 Create a snapshot of 'demo' in 'backup-drive/demo-3' ERROR: cannot snapshot 'demo': Invalid cross-device link ``` 发生了什么?噢,你尝试对 `demo` 进行一次快照并把它存在不同的 Btrfs 文件系统里(从 Btrfs 视角来看是一个不同的设备)。还记得一个 Btrfs 子卷仅持有对文件和内容的引用(inode)?这正是问题所在:文件和内容存在于我们的 `home` 文件系统,但不在新创建的 `backup-drive` 。你得找到一种方式去传输子卷和其内容到新的文件系统里。 #### 在不同的 Btrfs 文件系统存储快照 针对这个目的 Btrfs 工具有两个特殊的命令。让我们首先来看看它们是如何工作的: ``` $ sudo btrfs send demo | sudo btrfs receive backup-drive/ ERROR: subvolume /home/hartan/btrfs-snapshot-test/demo is not read-only ERROR: empty stream is not considered valid ``` 另一个错误!这时它告诉你我们想要传输的子卷不是只读的。这是对的:你可以写入新内容到所有目前为止创建的快照/子卷。你可以像这样创建一个只读的快照: ``` $ sudo btrfs subvolume snapshot -r demo demo-3-ro Create a readonly snapshot of 'demo' in './demo-3-ro' ``` 不像之前那样,这里 `-r` 选项被加到了 `snapshot` 子命令里。这创建一个只读的快照,这很容易去验证: ``` $ touch demo-3-ro/another-file touch: cannot touch 'demo-3-ro/another-file': Read-only file system ``` 现在你可以重新尝试传输子卷: ``` $ sudo btrfs send demo-3-ro | sudo btrfs receive backup-drive/ At subvol demo-3-ro At subvol demo-3-ro $ tree ├── backup-drive │ └── demo-3-ro │ ├── bar │ ├── baz │ ├── bigfile │ └── foo ├── btrfs_filesystem.img ├── demo [ ... ] └── demo-3-ro ├── bar ├── baz ├── bigfile └── foo 6 directories, 20 files ``` 成功了!你成功传输原来子卷 `demo` 的一个只读快照到一个外部的 Btrfs 文件系统。 #### 在非 Btrfs 文件系统存储快照 上面你已经看到你如何能存储 Btrfs 子卷/快照到其他的 Btrfs 文件系统。但如果你没有其他的 Btrfs 文件系统并且不能新创建一个,比如说外部驱动器需要一个和 Windows 或 MacOS 兼容的文件系统,你可以做什么呢?在这种情况下你可以存储子卷在文件里: ``` $ sudo btrfs send -f demo-3-ro-subvolume.btrfs demo-3-ro At subvol demo-3-ro $ ls -lh demo-3-ro-subvolume.btrfs -rw-------. 1 root root 513M Dec 21 10:39 demo-3-ro-subvolume.btrfs ``` 文件 `demo-3-ro-subvolume.btrfs` 现在包含了随后重建 `demo-3-ro` 子卷需要的所有东西。 #### 增量地发送快照 如果你对不同的子卷重复执行这个操作,你会发现在某些时间点不同的子卷不再共享它们的文件内容。这是因为像上面一样发送一个子卷,去重建这个单独的子卷的所有数据将被传送到目标位置。但是,你可以引导 Btrfs 只向目标位置发送不同子卷的差异!所谓的增量发送将保证共享的引用在子卷中仍然共享。为了展示这一点,新增一些变动到我们原来的子卷: ``` $ echo "a few more changes" >> demo/bigfile ``` 然后创建另一个只读子卷: ``` $ sudo btrfs subvolume snapshot -r demo demo-4-ro Create a readonly snapshot of 'demo' in './demo-4-ro' ``` 然后现在发送它: ``` $ sudo btrfs send -p demo-3-ro demo-4-ro | sudo btrfs receive backup-drive At subvol demo-4-ro At snapshot demo-4-ro ``` 在上面的命令,`-p` 选项指定了一个父子卷用来计算差异。重要的是记住原 Btrfs 文件系统和目标 Btrfs 文件系统都必须包含相同的、未被修改过的父子卷!确保新的子卷真的在那里: ``` $ ls backup-drive/ demo-3-ro demo-4-ro $ ls -lR backup-drive/demo-4-ro/ backup-drive/demo-4-ro/: total 524296 -rw-r--r--. 1 hartan hartan 0 Dec 20 08:11 bar -rw-r--r--. 1 hartan hartan 0 Dec 20 08:11 baz -rw-r--r--. 1 hartan hartan 536870945 Dec 21 10:49 bigfile -rw-r--r--. 1 hartan hartan 59 Dec 20 08:13 foo ``` 但你怎样知道增量发送只传输了子卷间的差异呢?让我们传输数据流到一个文件里然后看看它有多大: ``` $ sudo btrfs send -f demo-4-ro-diff.btrfs -p demo-3-ro demo-4-ro At subvol demo-4-ro $ ls -l demo-4-ro-diff.btrfs -rw-------. 1 root root 315 Dec 21 10:55 demo-4-ro-diff.btrfs ``` 根据 `ls` ,这个文件仅仅只有 315 字节大小!这意味着增量传输只传输子卷间的差异,和额外的 Btrfs 相关的元数据。 #### 从快照中恢复子卷 在继续之前,让我们清理掉这时候不再需要的东西: ``` $ sudo rm -rf demo-4-ro-diff.btrfs demo-3-ro-subvolume.btrfs $ sudo btrfs subvolume delete demo-1 demo-2 demo-3-ro demo-4-ro $ ls -l total 531516 drwxr-xr-x. 1 hartan hartan 36 Dec 21 10:50 backup-drive -rw-r--r--. 1 hartan hartan 8589934592 Dec 21 10:51 btrfs_filesystem.img drwxr-xr-x. 1 hartan hartan 32 Dec 20 08:14 demo ``` 到目前为止你已经成功创建了可读/写和只读的 Btrfs 子卷快照,并把它们发送到外部。但是,为了把这作为备份策略,还要有一种方式去发送子卷回原来的文件系统和让它们再次变为可写。出于这个目的,我们移动 `demo` 子卷到其他地方并且尝试从最近的快照中重建它。第一步:重命名为 `broken` 子卷。一旦恢复成功它会被删除: ``` $ mv demo demo-broken ``` 第二步: 传回最近的快照到这个文件系统: ``` $ sudo btrfs send backup-drive/demo-4-ro | sudo btrfs receive . At subvol backup-drive/demo-4-ro At subvol demo-4-ro [hartan@fedora btrfs-snapshot-test]$ ls backup-drive btrfs_filesystem.img demo-4-ro demo-broken ``` 第三步: 从快照创建一个可读写的子卷: ``` $ sudo btrfs subvolume snapshot demo-4-ro demo Create a snapshot of 'demo-4-ro' in './demo' $ ls backup-drive btrfs_filesystem.img demo demo-4-ro demo-broken ``` 上一步非常重要:你不能重命名 `demo-4-ro` 为 `demo` ,因为这仍然是一个只读子卷!最后你可以检查你所有你想要的东西是不是在那里: ``` $ tree demo demo ├── bar ├── baz ├── bigfile └── foo 0 directories, 4 files $ tail -c -19 demo/bigfile a few more changes ``` 最后的命令告诉你 `bigfile` 的最后 19 个字符实际上是上次变更执行的结果。这个时候,你可能想从 `demo-broken` 复制最近的更新到新的 `demo` 子卷。因为你没有执行任何更新,你可以过时的子卷: ``` $ sudo btrfs subvolume delete demo-4-ro demo-broken Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo-4-ro' Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo-broken' ``` 就是这样!你成功从一个之前存在不同 Btrfs 文件系统(外部介质)的快照中恢复 `demo` 子卷。 ### 子卷作为快照的边界 在本系列的第二篇文章中我提到子卷作为快照的边界,但这到底是什么意思呢?简单来说,子卷的一份快照仅包含这个子卷的内容,而不是下面嵌套的子卷。让我们来看看这个: ``` $ sudo btrfs subvolume create demo/nested Create subvolume 'demo/nested' $ sudo chown -R $(id -u):$(id -g) demo/nested $ touch demo/nested/another_file ``` 让我们像以前一样进行一次快照: ``` $ sudo btrfs subvolume snapshot demo demo-nested Create a snapshot of 'demo' in './demo-nested' ``` 然后查看里面的内容: ``` $ tree demo-nested demo-nested ├── bar ├── baz ├── bigfile ├── foo └── nested 1 directory, 4 files $ tree demo demo ├── bar ├── baz ├── bigfile ├── foo └── nested └── another_file 1 directory, 5 files ``` 注意到 `another_file` 不见了,仅仅是目录 `nested` 还在。这是因为 `nested` 是一个子卷:`demo` 的快照包含嵌套子卷的目录(挂载点),但里面的内容是缺失的。目前没有方法递归地执行快照去包含嵌套子卷。但是,我们可以利用这个优势去从快照中排除一些目录!这通常对那些你容易再现的数据有用,或者它们很少变化。例子有虚拟机或者容器镜像,电影,游戏文件等等。 在总结之前,我们移除所有测试过程中创建的东西: ``` $ sudo btrfs subvolume delete demo/nested demo demo-nested Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo/nested' Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo' Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo-nested' $ sudo umount backup-drive $ cd .. $ rm -rf btrfs-snapshot-test/ ``` ### 基于 Btrfs 备份最后思考 如果你决定使用 Btrfs 来执行数据的定期备份,那么你可能需要使用一个工具来自动完成这项任务。Btrfs 维基有一个专门针对 Btrfs <sup class="footnote-ref"> <a href="#fn4" id="fnref4"> [4] </a></sup> 的备份工具列表。在那里,你还将看到另一个手动执行 Btrfs 备份步骤的摘要。就我个人而言,我对 `btrbk` <sup class="footnote-ref"> <a href="#fn5" id="fnref5"> [5] </a></sup> 有很多很好的体验,我正在使用它来执行我自己的备份。除了备份之外,`btrbk` 还可以在你的 PC 本地保存 Btrfs 快照列表。我使用它来防止意外的数据删除。 如果你想要了解更多有关使用 Btrfs 进行备份的内容,欢迎在下面评论,我会考虑写一篇专门讨论这个话题的后续文章。 ### 总结 本文研究了 Btrfs 快照,它们本质上是 Btrfs 子卷。你了解了如何创建可读写和只读快照,以及这种机制如何有助于防止数据丢失。 本系列的后续文章将讨论: * 压缩 - 透明地节省存储空间 * 配额组 - 限制文件系统大小 * RAID - 替代 mdadm 配置 如果你还想了解与 Btrfs 相关的其他主题,请查看 Btrfs 维基 <sup class="footnote-ref"> <a href="#fn2" id="fnref2:1"> [2:1] </a></sup> 和文档 <sup class="footnote-ref"> <a href="#fn1" id="fnref1:1"> [1:1] </a></sup>。不要忘记查看本系列的前两篇文章!如果你认为本文缺少了一些内容,请在下面的评论中告诉我们。再会! ### 参考资料 1. <https://btrfs.readthedocs.io/en/latest/Introduction.html> [↩︎](#fnref1) [↩︎](#fnref1:1) 2. <https://btrfs.wiki.kernel.org/index.php/Main_Page> [↩︎](#fnref2) [↩︎](#fnref2:1) 3. <https://btrfs.readthedocs.io/en/latest/Subvolumes.html> [↩︎](#fnref3) 4. <https://btrfs.wiki.kernel.org/index.php/Incremental_Backup#Available_Backup_Tools> [↩︎](#fnref4) 5. <https://github.com/digint/btrbk> [↩︎](#fnref5) *(题图:MJ/ad8a61ed-ce6f-409e-b503-69104dd71149)* --- via: <https://fedoramagazine.org/working-with-btrfs-snapshots/> 作者:[Andreas Hartmann](https://fedoramagazine.org/author/hartan/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[A2ureStone](https://github.com/A2ureStone) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
This article will explore what Btrfs snapshots are, how they work, and how you can benefit from taking snapshots in every-day situations. This is part of a series that takes a closer look at Btrfs, the default filesystem for Fedora Workstation and Fedora Silverblue since Fedora Linux 33. In case you missed it, here’s the previous article from this series: [https://fedoramagazine.org/working-with-btrfs-subvolumes/](https://fedoramagazine.org/working-with-btrfs-subvolumes/) ## Introduction Imagine you work on a file over extended periods of time, repeatedly adding changes and undoing them. Then, at some point you realize: Parts of the changes you undid two hours ago would be very helpful now. And yesterday you had already changed this particular bit, too, before you trashed that design. But of course, because you regularly save your files, old changes are lost. Many people have probably experienced a situation like this before. Wouldn’t it be great if you could recover old file versions without having to manually copy them at regular intervals? This is just one typical situation where Btrfs snapshots can help you out. When used correctly, snapshots also give you a great backup solution for your PC. Below you will find a lot of examples related to snapshots. If you want to follow along, you must have access to a Btrfs filesystem and root access. You can check the file system of a directory using the following command: $ findmnt -no FSTYPE /home btrfs Here the *findmnt * command shows the type of filesystem for your */home/* directory. If it says *btrfs*, you’re all set. Let’s create a new directory in which to perform some experiments: $ mkdir ~/btrfs-snapshot-test $ cd ~/btrfs-snapshot-test In the text below, you will find lots of command responses in boxes such as shown above. Please keep in mind while reading/comparing command output that the **box contents may be wrapped at the end of the line**. This may make it difficult to recognize long lines that are broken across multiple lines for readability. When in doubt, try to resize your browser window and see how the text behaves! ## Snapshots in Btrfs Let’s start with an elementary question: What is a Btrfs snapshot? If you look in the Docs [[1]](#sources) and Wiki [[2]](#sources), you won’t immediately find an answer to this question. In fact, it is nowhere to be found in the “Features” section. If you search a little, you will find snapshots mentioned extensively along with Btrfs subvolumes [[3]](https://btrfs.readthedocs.io/en/latest/Subvolumes.html). So now what? Remember that snapshots were both mentioned in the previous articles of this series? There it said: What is the advantage of CoW? In simple terms: a history of the modified and edited files can be kept. Btrfs will keep the references to the old file versions (inodes) somewhere they can be easily accessed. This reference is a snapshot: An image of the filesystem state at some point in time.[Working with Btrfs: General Concepts] and also: Another advantage of separating /and/homeis that you can takesnapshotsseparately. A subvolume is a boundary for snapshots, and snapshots will never contain the contents of other subvolumes below the subvolume that the snapshot is taken of.[Working with Btrfs: Subvolumes] It seems snapshots have something to do with Btrfs subvolumes. You may have heard about snapshots in other contexts before, for example with LVM, the Logical Volume Manager. While technically they serve the same purpose, they are different in terms of how they reach their goal. Every Btrfs snapshot is a subvolume. However, not every subvolume is a snapshot. The difference is in what the subvolume contains. A snapshot is a subvolume with added content: it holds references to current and/or past versions of files (inodes). Let’s see where snapshots come from! ## Creating Btrfs snapshots To use snapshots, you need a Btrfs subvolume to take snapshots of. Let’s create one inside our test folder (~/btrfs-snapshot-test): $ cd ~/btrfs-snapshot-test $ sudo btrfs subvolume create demo Create subvolume './demo' $ sudo chown -R $(id -u):$(id -g) demo/ $ cd demo Since by default Btrfs subvolumes are owned by root, you must call *chown* to modify the files in the subvolume to be owned by a regular user. Now add a few files inside it: $ touch foo bar baz $ echo "Lorem ipsum dolor sit amet, " > foo Your directory now looks something like this: $ ls -l total 4 -rw-r--r--. 1 hartan hartan 0 Dec 20 08:11 bar -rw-r--r--. 1 hartan hartan 0 Dec 20 08:11 baz -rw-r--r--. 1 hartan hartan 29 Dec 20 08:11 foo Let’s create the very first snapshot from that: $ cd .. $ sudo btrfs subvolume snapshot demo demo-1 Create a snapshot of 'demo' in './demo-1' And that’s it. Let’s see what was achieved: $ ls -l total 0 drwxr-xr-x. 1 hartan hartan 18 Dec 20 08:11 demo drwxr-xr-x. 1 hartan hartan 18 Dec 20 08:11 demo-1 $ tree . ├── demo │ ├── bar │ ├── baz │ └── foo └── demo-1 ├── bar ├── baz └── foo 2 directories, 6 files It seems it made a copy! To verify, let’s read the contents of *foo* from the snapshot: $ cat demo/foo Lorem ipsum dolor sit amet, $ cat demo-1/foo Lorem ipsum dolor sit amet, The real effect becomes apparent when we modify the original file: $ echo "consectetur adipiscing elit, " >> demo/foo $ cat demo/foo Lorem ipsum dolor sit amet, consectetur adipiscing elit, $ cat demo-1/foo Lorem ipsum dolor sit amet, This shows that the snapshot still holds the “old” version of the data: The content of *foo* hasn’t changed. So far, you could have achieved the exact same thing with a simple file copy. You can now go ahead and continue working on the old file, too: $ echo "sed do eiusmod tempor incididunt" >> demo-1/foo $ cat demo-1/foo Lorem ipsum dolor sit amet, sed do eiusmod tempor incididunt Under the hood, however, our snapshot is in fact a new Btrfs subvolume. You can verify this with the following command: $ sudo btrfs subvolume list -o . ID 259 gen 265 top level 256 path home/hartan/btrfs-snapshot-test/demo ID 260 gen 264 top level 256 path home/hartan/btrfs-snapshot-test/demo-1 ## Btrfs snapshots vs. file copies So what’s the point of all this? Up until now snapshots seem to be a complicated way to copy files around. In fact, there is more to snapshots than meets the eye. Let’s create a bigger file: $ dd if=/dev/urandom of=demo/bigfile bs=1M count=512 512+0 records in 512+0 records out 536870912 bytes (537 MB, 512 MiB) copied, 1.3454 s, 399 MB/s There is now a new file *demo/bigfile* that is 512 MiB in size. Let’s make another snapshot so you don’t lose it when you modify the data: $ sudo btrfs subvolume snapshot demo demo-2 Create a snapshot of 'demo' in './demo-2' Now let’s simulate some changes by appending a small string to the file: $ echo "small changes" >> demo/bigfile Here’s the resulting file structure: $ tree . ├── demo │ ├── bar │ ├── baz │ ├── bigfile │ └── foo ├── demo-1 │ ├── bar │ ├── baz │ └── foo └── demo-2 ├── bar ├── baz ├── bigfile └── foo 3 directories, 11 files But the real magic happens somewhere else. Had you copied *demo/bigfile*, you would now have two files of about 512 MiB in size with mostly the same content. However, since they are distinct copies, they would occupy about 1 GiB of storage total. Keep in mind that the difference between both files is hardly more than 10 Bytes – that’s almost nothing compared to the original file size. Btrfs snapshots work different than file copies: They keep references to current and past inodes instead. When you appended the change to the file, under the hood Btrfs allocated some more space to store the changes in and added a reference to this new data to the original inode. The previous contents remain untouched. If it helps your mental model, you can think of this as “storing” merely the difference between the original file and the modified version. Let’s have a look at the effect of this: $ sudo compsize . Processed 11 files, 5 regular extents (9 refs), 3 inline. Type Perc Disk Usage Uncompressed Referenced TOTAL 100% 512M 512M 1.0G none 100% 512M 512M 1.0G The interesting figure here is seen in line “TOTAL”: - “Referenced” is the total size of all the files in the current directory, summed up - “Disk Usage” is the amount of storage space allocated on your disk to store the files While you have a total of 1 GiB files, it takes merely 512 MiB to store them. ## Btrfs snapshots and backups So far, in this article, you have seen how to create Btrfs snapshots and what makes them so special. One may be tempted to think: If I take a series of Btrfs snapshots locally on my PC, I have a solid backup strategy. **This is not the case**. If the underlying data, which is shared by Btrfs subvolumes, is accidentally damaged (by something outside of Btrfs’ influence, e.g. cosmic rays), all the subvolumes pointing to this data contain the same error. To turn the snapshots into real backups you should store them on a different Btrfs filesystem, such as on an external drive. For the purposes of this article let’s create a new Btrfs filesystem contained inside a file and mount it to simulate an external drive. If you have an external drive formatted with Btrfs lying around, feel free to substitute all the paths mentioned in the following commands to try it out! Let’s create a new Btrfs filesystem: **Note**: The commands below will create a new file of 8 GB size on your filesystem. If you want to follow the steps below, please ensure you have at least 8 GB of disk space available. Do not allocate less than 8 GB to the file, as Btrfs may otherwise encounter issues during mounting. $ truncate -s 8G btrfs_filesystem.img $ sudo mkfs.btrfs -L "backup-drive" btrfs_filesystem.img btrfs-progs v5.18 See http://btrfs.wiki.kernel.org for more information. [ ... ] Devices: ID SIZE PATH 1 8.00GiB btrfs_filesystem.img These commands created a new file of 8 GB in size named *btrfs_filesystem.img* and formatted a Btrfs filesystem inside it. Now you can mount it as if it were an external drive: $ mkdir backup-drive $ sudo mount btrfs_filesystem.img backup-drive $ sudo chown -R $(id -u):$(id -g) backup-drive $ ls -lh total 4.7M drwxr-xr-x. 1 hartan hartan 0 Dec 20 08:35 backup-drive -rw-r--r--. 1 hartan hartan 8.0G Dec 20 08:37 btrfs_filesystem.img drwxr-xr-x. 1 hartan hartan 32 Dec 20 08:14 demo drwxr-xr-x. 1 hartan hartan 18 Dec 20 08:11 demo-1 drwxr-xr-x. 1 hartan hartan 32 Dec 20 08:14 demo-2 Great, now there is an independent Btrfs filesystem mounted under *backup-drive*! Let’s try to take another snapshot and place it there: $ sudo btrfs subvolume snapshot demo backup-drive/demo-3 Create a snapshot of 'demo' in 'backup-drive/demo-3' ERROR: cannot snapshot 'demo': Invalid cross-device link What happened? Well, you tried to take a snapshot of *demo* and store it in a different Btrfs filesystem (a different device from Btrfs’ point of view). Remember that a Btrfs subvolume only holds references to files and their contents (inodes)? This is exactly the problem: The files and contents exist in our home filesystem, but not in the newly-created *backup-drive*. You have to find a way to transfer the subvolume along with its contents to the new filesystem. ### Storing snapshots on a different Btrfs filesystem The Btrfs utilities include two special commands for this purpose. Let’s see how they work first: $ sudo btrfs send demo | sudo btrfs receive backup-drive/ ERROR: subvolume /home/hartan/btrfs-snapshot-test/demo is not read-only ERROR: empty stream is not considered valid Another error! This time it tells you that the subvolume we’re trying to transfer is not read-only. This is true: You can write new contents to all of the snapshots/subvolumes created so far. You can create read-only snapshots like this: $ sudo btrfs subvolume snapshot -r demo demo-3-ro Create a readonly snapshot of 'demo' in './demo-3-ro' Unlike previously, here the *-r* option is added to the *snapshot* subcommand. This creates a read-only snapshot, which is easily verified: $ touch demo-3-ro/another-file touch: cannot touch 'demo-3-ro/another-file': Read-only file system Now you can retry transferring the subvolumes: $ sudo btrfs send demo-3-ro | sudo btrfs receive backup-drive/ At subvol demo-3-ro At subvol demo-3-ro $ tree ├── backup-drive │ └── demo-3-ro │ ├── bar │ ├── baz │ ├── bigfile │ └── foo ├── btrfs_filesystem.img ├── demo [ ... ] └── demo-3-ro ├── bar ├── baz ├── bigfile └── foo 6 directories, 20 files It worked! You have successfully transferred a read-only snapshot of our original subvolume *demo* to an external Btrfs filesystem. ### Storing snapshots on non-Btrfs filesystems Above you have seen how you can store Btrfs subvolumes/snapshots on another Btrfs filesystem. But what can you do if you do not have another Btrfs filesystem and cannot create one, for example because the external drives need a filesystem that allows compatibility with Windows or MacOS hosts? In such cases you can store subvolumes in files: $ sudo btrfs send -f demo-3-ro-subvolume.btrfs demo-3-ro At subvol demo-3-ro $ ls -lh demo-3-ro-subvolume.btrfs -rw-------. 1 root root 513M Dec 21 10:39 demo-3-ro-subvolume.btrfs The file *demo-3-ro-subvolume.btrfs* now contains everything that is needed to recreate the *demo-3-ro* subvolume at a later point in time. ### Incrementally sending subvolumes If you perform this action repeatedly for different subvolumes, you will notice at some point that the different subvolumes do not share their file contents any more. This is because when sending a subvolume such as above, all the data needed to recreate this standalone subvolume is transferred to the target. You can, however, instruct Btrfs to only send the difference between two subvolumes to the target! This so-called incremental send will ensure that shared references remain shared between the subvolumes. To demonstrate this, add a few more changes to our original subvolume: $ echo "a few more changes" >> demo/bigfile Next create another read-only snapshot: $ sudo btrfs subvolume snapshot -r demo demo-4-ro Create a readonly snapshot of 'demo' in './demo-4-ro' And now send it: $ sudo btrfs send -p demo-3-ro demo-4-ro | sudo btrfs receive backup-drive At subvol demo-4-ro At snapshot demo-4-ro In the command above, the *-p* option specifies a parent subvolume, against which the differences are calculated. It is important to keep in mind that both the source and target Btrfs filesystem must contain the same, unmodified parent subvolume! Ensure that the new subvolume is really there: $ ls backup-drive/ demo-3-ro demo-4-ro $ ls -lR backup-drive/demo-4-ro/ backup-drive/demo-4-ro/: total 524296 -rw-r--r--. 1 hartan hartan 0 Dec 20 08:11 bar -rw-r--r--. 1 hartan hartan 0 Dec 20 08:11 baz -rw-r--r--. 1 hartan hartan 536870945 Dec 21 10:49 bigfile -rw-r--r--. 1 hartan hartan 59 Dec 20 08:13 foo But how do you know whether the incremental send only transferred the difference between both subvolumes? Let’s transfer the data stream to a file and see how big it is: $ sudo btrfs send -f demo-4-ro-diff.btrfs -p demo-3-ro demo-4-ro At subvol demo-4-ro $ ls -l demo-4-ro-diff.btrfs -rw-------. 1 root root 315 Dec 21 10:55 demo-4-ro-diff.btrfs According to ls, the file is merely 315 bytes in size! This means that the incremental send only transferred the changes between the two subvolumes, along with additional Btrfs-specific metadata. ### Restoring subvolumes from snapshots Before continuing, let’s do some cleaning up of the things you don’t need at the moment: $ sudo rm -rf demo-4-ro-diff.btrfs demo-3-ro-subvolume.btrfs $ sudo btrfs subvolume delete demo-1 demo-2 demo-3-ro demo-4-ro $ ls -l total 531516 drwxr-xr-x. 1 hartan hartan 36 Dec 21 10:50 backup-drive -rw-r--r--. 1 hartan hartan 8589934592 Dec 21 10:51 btrfs_filesystem.img drwxr-xr-x. 1 hartan hartan 32 Dec 20 08:14 demo So far you have managed to create read/write and read-only snapshots of Btrfs subvolumes and send them to an external location. In order to turn this into a backup strategy, however, there has to be a way to send the subvolumes back to the original filesystem and make them writable again. For this purpose, let’s move the demo subvolume somewhere else and try to recreate it from the most recent snapshot. First: Rename the “broken” subvolume. It will be deleted once the restore was successful: $ mv demo demo-broken Second: Transfer the most recent snapshot back to this filesystem: $ sudo btrfs send backup-drive/demo-4-ro | sudo btrfs receive . At subvol backup-drive/demo-4-ro At subvol demo-4-ro [hartan@fedora btrfs-snapshot-test]$ ls backup-drive btrfs_filesystem.img demo-4-ro demo-broken Third: Create a read-write subvolume from the snapshot: $ sudo btrfs subvolume snapshot demo-4-ro demo Create a snapshot of 'demo-4-ro' in './demo' $ ls backup-drive btrfs_filesystem.img demo demo-4-ro demo-broken The last step is important: You cannot just rename *demo-4-ro* to *demo*, because it would still be a read-only subvolume! Finally you can check whether everything you need is there: $ tree demo demo ├── bar ├── baz ├── bigfile └── foo 0 directories, 4 files $ tail -c -19 demo/bigfile a few more changes The last command above tells you that the last 19 characters in *bigfile* are in fact the change last performed. At this point, you may want to copy recent changes from *demo-broken* to the new *demo* subvolume. Since you didn’t perform any other changes, you can now delete the obsolete subvolumes: $ sudo btrfs subvolume delete demo-4-ro demo-broken Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo-4-ro' Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo-broken' And that’s it! You have successfully restored the *demo* subvolume from a snapshot that was previously stored on a different Btrfs filesystem (external media). ## Subvolumes as boundary for snapshots In the second article of this series I mentioned that subvolumes are boundaries for snapshots, but what exactly does that mean? In simple terms, a snapshot of a subvolume will only contain the content of this particular subvolume, and none of the nested subvolumes below. Let’s have a look at this: $ sudo btrfs subvolume create demo/nested Create subvolume 'demo/nested' $ sudo chown -R $(id -u):$(id -g) demo/nested $ touch demo/nested/another_file Let’s take a snapshot as before: $ sudo btrfs subvolume snapshot demo demo-nested Create a snapshot of 'demo' in './demo-nested' And check out the contents: $ tree demo-nested demo-nested ├── bar ├── baz ├── bigfile ├── foo └── nested 1 directory, 4 files $ tree demo demo ├── bar ├── baz ├── bigfile ├── foo └── nested └── another_file 1 directory, 5 files Notice that *another_file* is missing, even though the folder *nested* is present. This happens because *nested* is a subvolume: The snapshot of *demo* contains the folder (mountpoint) for the nested subvolume, but its contents aren’t present. Currently there is no way to perform snapshots recursively to include nested subvolumes. However, we can take advantage of this to exclude folders from snapshots! This is typically useful for data that you can reproduce easily, or that will rarely change. Examples include virtual machine or container images, movies, game files and more. Before we wrap up the article, let’s remove everything we created while testing: $ sudo btrfs subvolume delete demo/nested demo demo-nested Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo/nested' Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo' Delete subvolume (no-commit): '/home/hartan/btrfs-snapshot-test/demo-nested' $ sudo umount backup-drive $ cd .. $ rm -rf btrfs-snapshot-test/ ## Final thoughts on Btrfs-based backups If you decide you want to use Btrfs to perform regular backups of your data, you may want to use a tool that automates this task for you. The Btrfs wiki has a list of backup tools specialized on Btrfs [[4]](#sources). On this page you will also find another summary of the steps to perform Btrfs backups by hand. Personally, I have had a lot of good experiences with *btrbk* [[5]](#sources) and I am using it to perform my own backups. In addition to backups, *btrbk* can also keep a list of Btrfs snapshots locally on your PC. I use this to safeguard against accidental data deletion. If you want to know more about performing backups using Btrfs, leave a comment below and I’ll consider writing a follow-up article that deals exclusively with this topic. ## Conclusion This article investigated Btrfs snapshots, which are Btrfs subvolumes under the hood. You learned how to create read/write and read-only snapshots, and how this mechanism can help safeguard against data loss. The next articles in this series will deal with: - Compression – Transparently saving storage space - Qgroups – Limiting your filesystem size - RAID – Replace your mdadm configuration If there are other topics related to Btrfs that you want to know more about, have a look at the Btrfs Wiki [[2]](#sources) and Docs [[1]](#sources). Don’t forget to check out the first two articles of this series, if you haven’t already! If you feel that there is something missing from this article series, let me know in the comments below. See you in the next article! ## Sources [1]: [https://btrfs.readthedocs.io/en/latest/Introduction.html](https://btrfs.readthedocs.io/en/latest/Introduction.html) [2]: [https://btrfs.wiki.kernel.org/index.php/Main_Page](https://btrfs.wiki.kernel.org/index.php/Main_Page) [3]: [https://btrfs.readthedocs.io/en/latest/Subvolumes.html](https://btrfs.readthedocs.io/en/latest/Subvolumes.html) [4]: [https://btrfs.wiki.kernel.org/index.php/Incremental_Backup#Available_Backup_Tools](https://btrfs.wiki.kernel.org/index.php/Incremental_Backup#Available_Backup_Tools) [5]: [https://github.com/digint/btrbk](https://github.com/digint/btrbk) ## Esc Best tutorial. Thanks ## conrad It looks complicated I think I’ll install the fedora with FAT32 or EXT2 ## Richard England Unless you have a need to get into the details of the file system you can utilize Btrfs like you would ext4 or (shudder) fat32. I ran with the default Btrfs for almost a year before getting interested enough to find out what it might do for me and how to use it. ## Kai Steiner Hello all! And first things first: Happy new year everybody! Very nice article about Btrfs. But something more for experts in my view. Fedora has defaulted to Btrfs since F33, but for the average Jane and Joe, this move didn’t change much at all. My impression is that the community hasn’t yet developed a lot of real ideas about how to use the possibilities of the new file system. The most obvious would be to use Snapper to create system snapshots, as openSUSE has been doing for ages. Even small Linux distributions like the Debian-based SprialLinux and most recently Siduction have managed to integrate Snapper by default. Of course I can also install Snapper in Fedora any day an hope that I will be able to configure the tool properly afterwards. But for a normal user it would be nice if this could be made available preconfigured, e.g. as an opt-in in Anaconda or every time I stick to the default file system Btrfs during the installation. Just a thought. ## Andreas Hartmann You’re right, there isn’t any “default” tooling that makes use of Btrfs such as snapper in Fedora (yet?). Personally I’ve used OpenSUSE and snapper for a while but, since I didn’t understand how Btrfs subvolumes/snapshots work back then, it only filled up my disk and that was that. If you have some particular use case in mind that would benefit Jane and Joe, maybe I can give write an article for that in the future? I have some ideas of my own already, but I’m always curious to hear what other people want/need. ## Arthur There is btrfs-assistant! It’s an awesome easy to use tool to manage btrfs and it integrates with snapper. ## Adam Bolte Loving this series. Eager to read your upcoming RAID and Qgroups coverage. I’ve recently replaced an mdadm+LVM2+Xen VM setup with systemd/machinectl containers in btrfs subvolumes on btrfs RAID10, and the more I read, the more considerations there are that I become aware of, and the more confidence I gain in this new(-ish, to me anyway,) technology. And Happy New Year! ## Emanuele Thanks and congratulations for this tutorial! Only a clarification: “Since by default Btrfs subvolumes are owned by root, you must call chown to modify the files in the subvolume to be owned by a regular user. Now add a few files inside it:” I’ve been using Btrfs for years and can create subvolumes per user, did I miss something? emanu@fedora ~/test> btrfs subvolume create pippo Create subvolume ‘./pippo’ emanu@fedora ~/test> ls -l totale 0 drwxr-xr-x. 1 emanu emanu 0 4 gen 21.06 pippo/ emanu@fedora ~/test> cd pippo emanu@fedora ~/t/pippo> touch foo bar baz emanu@fedora ~/t/pippo> echo “Lorem ipsum dolor sit amet, ” > foo emanu@fedora ~/t/pippo> ls bar baz foo emanu@fedora ~/t/pippo> cd .. emanu@fedora ~/test> rm -R pippo/ emanu@fedora ~/test> ## Andreas Hartmann You’re right, I honestly wasn’t aware you can create subvolumes as regular user. Thanks for sharing! ## Terrence Kovacs Thanks for the informative and detailed article. I have been using btrfs for several years and one thing still eludes me. When a filesystem fills my attempt to clean up by removing old files often gets me no free space as the snapshots hold onto the blocks. How do you handle that problem? ## Gregory Bartholomew I think you have to delete the snapshots. 🙂 ## Terrrence Kovacs Indeed. Since often the files are old and unused for sometime you end up needing to delete all your snapshots. Not a very satisfying solution. ## Gregory Bartholomew It is easy to transfer them to a larger external device though. And it is often quite quick too, even if the external device is slow, because you can send incremental snapshots that only transfer what has changed since the previous one. That’s what I do — I keep my older snapshots archived on an external device. Not forever though. Files you want to keep need to always be present in the newest snapshots else they’ll be lost when the last snapshot that references them gets deleted. ## Didier Spaier Hello, very god series of articles, on of the best introduction (as : easy to grasp) to btrfs I have found so far (and I have read a lot of docs). A bit opportunistic: I have written a shell script named absm for “a btrfs snpshots manager” (yes, one more!), accessible to the blind (as the Slint distribution that I maintain). It has no dependency on other tools, includes boot entries for snaphosts in the GRUB menu and has been tested in Fedora 37 among others: https://github.com/DidierSpaier/absm ## Chad Dougherty This is an excellent series of articles. Thank you so much for posting them! You might want to add the btrfs tag to them so that they’re more readily accessible. See, for example, https://fedoramagazine.org/btrfs-snapshots-backup-incremental/ Thanks again! ## Richard England Excellent point. The missing tags was an oversight by the editors and has been corrected. Thank you for pointing this out. ## Chad Dougherty I think maybe it’s still missing on the second post in the series: https://fedoramagazine.org/working-with-btrfs-subvolumes/
16,288
Ardour 8.0 发布,加入对 Novation Launchpad Pro 的支持
https://news.itsfoss.com/ardour-8-0-release/
2023-10-16T14:38:00
[ "DAW", "Ardour" ]
https://linux.cn/article-16288-1.html
![](/data/attachment/album/202310/16/143813ue8eue89mt44btum.jpg) > > Ardour 8.0 这个重大升级为我们带来了对新硬件的支持,完善的自动化创建流程等。 > > > Ardour 作为最好的 Linux [数字音频工作站(DAW)](https://itsfoss.com/best-daw-linux/) 之一,允许音频专业人士进行包括创建、录音、混音音乐和其他各类音频的各种工作。 这一次,我们迎来了这款 DAW 的重大升级。 **Ardour 8.0** 的发布距离它的 [7.0 发布](https://news.itsfoss.com/ardour-7-0-release/) 近一年,不过这还是它发展历程中的一次显著进步。 下面就让我们来详细探讨一下它都带来了哪些新的变化。 ### ? Ardour 8.0: 有哪些新功能? ![](/data/attachment/album/202310/16/143839gvd64wolrafwgqzw.png) Ardour 8.0 版本承诺提供丰富的新特性以及大量的修复。 而且,开发者在此次发布时也特别强调,**Ardour 的会话文件格式没有发生改变**,这就意味着,所有在之前 7.x 版本的 Ardour 创建的会话在加载时都不会出现问题。 以下是一些主要亮点: * 支持 Novation Launchpad Pro * MIDI 音轨头部进行了全新设计 * MIDI 动力性的提高 * 支持区域分组功能 * macOS 的公证服务 #### 支持 Novation Launchpad Pro ![](/data/attachment/album/202310/16/143840q8ot55xz5no9o8pj.png) Ardour 8.0 版本的增加了对 Novation 公司发售的 [Launchpad Pro](https://novationmusic.com/products/launchpad-pro) 的支持,它是一款电子乐器,包括一个 8×8 格的 RGB,可以检测力度的触摸垫,可以完成各种各样的任务。 对于 Ardour 来说,它可以用于 **触发音频切片和线索**、**控制音频增益水平**、**操作声音平移** 甚至 **设置音轨/总线的水平**。 #### MIDI 音轨头部全新设计 ![](/data/attachment/album/202310/16/143840pv080ha3hpdl3s8k.png) **全新设计的 MIDI 音轨头** 带来了一些引人注目的变化,最值得注意的包括: * 八度音符如 C3、C4 将会永久显示。 * 可以通过钢琴卷动键来记录 MIDI。 * <ruby> 滚动+缩放 <rt> scroomer </rt></ruby> 功能的直观设计。 * 在 <ruby> 滚动+缩放 <rt> scroomer </rt></ruby> 功能中可以显示音符名称,可以使用 MIDNAM 数据,泛用音符编号或 12TET 名。 #### MIDI 动力学的改进 在一直以来的用户需求驱动下,Ardour 的开发者终于新增了一款 **传统的 <ruby> 动力棒棒糖 <rt> velocity lollipop </rt></ruby>界面**。 这个界面由带有顶部圆点的垂直横条组成,可以用这个横条调节音符力度。我建议你可以在上面的视频中了解更多关于这个在 Ardour 8.0 版本中实施的一项功能。 #### 支持区域分组功能 ![](/data/attachment/album/202310/16/143841tl4tool4addgpw0d.png) 这也是用户长期以来的一项需求。**区域分组** 提供了一个选取多个 [区域](https://manual.ardour.org/working-with-regions/) 并将它们组合成一个单一元素的功能。 这个功能可以赋予你将多个元素整合移动/剪辑的能力,减少对每个元素重复操作的需要。 #### macOS 验证 当你在苹果电脑上安装第三方软件时,计算机会警告你该软件可能会对你的系统产生损害或含有恶意软件,当然,对于用户而言,这可能是一个糟糕的用户体验,他们可能不会尝试运行它。 为了改善用户体验,Ardour 决定参加并支付一个苹果开发者账户以使用它的验证系统 [Notarization](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution)。 因此,下次当你在 macOS 上安装 Ardour 时,你会看到软件已经被苹果检查/验证没有携带恶意软件,这会让用户对 Ardour 有更多的信心。 #### ?️ 其它的改变 最后,以下还有一些其他带来的改变: * 支持自由手绘自动化曲线。 * 新增了三个新的 MIDI 算法插件。 * 集成有序排列组成特性的专专用标尺。 * BBT 标记提供了多项提升。 你也可以查看 [官方发布说明](https://ardour.org/whatsnew.html) 来更多地了解这次发布的信息。 ### ? 下载 Ardour 8.0 由于 Ardour 是一个跨平台的应用程序,你可以在它的 [官方网站](https://community.ardour.org/download) 上找到适用于 **Linux**、**Windows** 和 **macOS** 的软件包。 > > **[Ardour](https://community.ardour.org/download)** > > > 如果你对源代码感兴趣,你也可以查看它的 [GitHub 仓库](https://github.com/Ardour/ardour)。 --- via: <https://news.itsfoss.com/ardour-8-0-release/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Ardour is one of the [best Digital Audio Workstations (DAW) for Linux](https://itsfoss.com/best-daw-linux/?ref=news.itsfoss.com) out there, audio professionals can use it for various use cases such as creating, recording, and mixing music or other types of audio. We now have a major upgrade for the DAW. **Ardour 8.0** release comes almost a year after its [7.0 release](https://news.itsfoss.com/ardour-7-0-release/) as a significant evolution in its development lifecycle. Let's see what it has to offer. **Suggested Read **📖 [Finally! The Popular DAW “Studio One” Adds Linux Support 🥰Music producers, this is the news you have been waiting for!](https://news.itsfoss.com/studio-one-linux/)![](https://news.itsfoss.com/content/images/2023/10/daw-studio-one-linux-support.png) ![](https://news.itsfoss.com/content/images/2023/10/daw-studio-one-linux-support.png) ## 🆕 Ardour 8.0: What's New? ![a screenshot of ardour 8.0](https://news.itsfoss.com/content/images/2023/10/Ardour_8.0_1.png) Ardour 8.0 promises a plethora of new features and big fixes. And, with this release, the developers have also stressed that there are **no changes to Ardour's session file format**, so sessions created in the older versions of Ardour, from the 7.x series, should load without any issues. Some key highlights include: **Support for Novation Launchpad Pro****Redesigned MIDI Track Header****MIDI Velocity Improvements****Region Grouping Support****Notarization for macOS** ### Support for Novation Launchpad Pro ![a screenshot of ardour 8.0 novation launchpad pro support](https://news.itsfoss.com/content/images/2023/10/Ardour_8.0_2.png) Ardour 8.0 features support for Novation's [Launchpad Pro,](https://novationmusic.com/products/launchpad-pro?ref=news.itsfoss.com) which is an electronic music instrument that consists of an 8×8 grid of RGB, velocity-sensitivity pads that can be used to accomplish various tasks. With Ardour, it can be used to **trigger clips and clues**, **control gain levels**,** panning**, and even **send levels for tracks/busses**. ### Redesigned MIDI Track Header ![a screenshot of ardour 8.0 redesigned midi track header](https://news.itsfoss.com/content/images/2023/10/Ardour_8.0_3.png) A **completely resigned MIDI track header** is here that features a couple of interesting changes. The most notable ones include: - Octave numbers like C3, C4 are now shown at all times. - It is now possible to record MIDI using the piano roll. - A more intuitive design approach for the scroomer (scroll+zoom). - Note names can now be displayed in the scroomer, it can either use MIDNAM data, generic note numbers or 12TET names. ### MIDI Velocity Improvements After receiving many requests by users over time, the devs of Ardour have finally added **a traditional velocity lollipop interface**. This interface consists of vertical bars with a dot on top that can be used to change the note velocity. I suggest you go through the video above to know more about its implementation in Ardour 8.0. ### Region Grouping Support ![a screenshot of ardour 8.0 region grouping support](https://news.itsfoss.com/content/images/2023/10/Ardour_8.0_4.png) Similarly, this was also a long-time requested feature by users. '**Region Grouping**', gives you the ability to select multiple [Regions](https://manual.ardour.org/working-with-regions/?ref=news.itsfoss.com) and group them into a single element. These can then be moved/trimmed together to decrease the repetitive task of doing that for each element in the Region. ### Notarization for macOS When you install third-party software on Apple computers, it warns you that it can damage your system or include malware. Of course, for users unaware, this could be a bad user experience, and they may not proceed trying it out. Ardour decided to join and pay for an Apple Developer account to utilize its [Notarization](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution?ref=news.itsfoss.com) system. So, next time you install Ardour on macOS, it will indicate that it has been verified/checked by Apple for malware, giving users more confidence in it. ### 🛠️ Other Changes Here are a few other changes with this release: - Support for freehand automation drawing. - Inclusion of three new MIDI arpeggiator plugins. - A dedicated ruler feature to arrange a composition. - Various improvements for BBT markers. You can go through the [official release notes](https://ardour.org/whatsnew.html?ref=news.itsfoss.com) to learn more about this release. ## 📥 Download Ardour 8.0 As Ardour is a cross-platform app, you can find packages for **Linux**, **Windows**, and **macOS** on its [official website](https://community.ardour.org/download?ref=news.itsfoss.com). You can also check out its [GitHub repo](https://github.com/Ardour/ardour?ref=news.itsfoss.com) if you want to dive into the source code. ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,290
Ubuntu Studio 23.10:致力于简化音频制作
https://news.itsfoss.com/ubuntu-studio-23-10/
2023-10-17T09:11:47
[ "Ubuntu Studio", "Ubuntu 23.10" ]
https://linux.cn/article-16290-1.html
![](/data/attachment/album/202310/17/091121v09u1105s09olbbm.jpg) > > 创作者们,Ubuntu Studio 23.10 来了!它包含了你开始创作旅程所需的一切。 > > > Ubuntu 的新版本如同雨后的春笋般持续涌现!☔ 其中一款新版本就是 Ubuntu Studio 23.10,它带来了一些实用的更新和改进。 下面就让我们详细了解一下它。 > > ? Ubuntu Studio 23.10 将会提供**九个月**的支持,直到 **2024 年 7 月**。 > > > ### ? Ubuntu Studio 23.04: 新增了哪些特性? ![](/data/attachment/album/202310/17/091148j54nnxec6nc5gbd8.jpg) 对于那些刚接触的朋友,[Ubuntu Studio](https://ubuntustudio.org/) 是针对 **内容创作者**特制的官方 [Ubuntu 发行版](https://ubuntu.com/desktop/flavours)。 Ubuntu Studio 预装了许多在音频/视频制作、摄影、网络直播、图形设计等多种领域中使用的应用程序。 Ubuntu Studio 的这个版本基于 Ubuntu 23.10 发行版,进行了一些关键性的改进: * KDE Plasma 的升级提升 * 全新壁纸 * 更新的应用套件 * Linux 内核升级到 6.5 版本 * 安装程序中加入的音频配置工具 #### KDE Plasma 的升级提升 ![](/data/attachment/album/202310/17/091149kupuqdon2ok92kwq.jpg) Ubuntu Studio 23.10 带有新的 **KDE Plasma 5.27.8** 桌面环境,以及新的翻译、各种修复,和三个关键的问题修复: * 系统设置搜索栏中移除了软连字符; * Powerdevil 默认情况下不会在虚拟机中自动挂起; * 提升了在 X11 上运行的 KRunner 启动速度。 你可以通过查阅 [发布说明](https://kde.org/announcements/plasma/5/5.27.8/),来了解所有技术性的变动。 #### Ubuntu Studio 的音频配置 Ubuntu Studio 的安装工具现在包括了一个音频配置向导,让系统级音频设置更为方便。 ![](/data/attachment/album/202310/17/091149qze45f4r5kpe4k1a.png) 你可以根据自己的需求,调整音频的延迟和采样率。 ![](/data/attachment/album/202310/17/091150mozqe88otkkd6nd8.png) 这个功能对于使用 Ubuntu Studio 进行音频制作的创作者会特别实用。 #### 全新壁纸 ![](/data/attachment/album/202310/17/091150j297z5fkd9rirez9.jpg) 新版本的 Ubuntu Studio 引入了一款新壁纸,名为 “Ubuntu Studio Mantic Minotaur”,其设计习得了 Ubuntu 23.10 默认壁纸 “Mantic Minotaur” 的灵感。 我个人很喜欢它的暗色调设计 ? #### 更新的应用套件 ![](/data/attachment/album/202310/17/091150dqdz3e05eajjj1jq.jpg) Ubuntu Studio 23.10 提供了 **一系列更新的应用** ,其中一些重要的应用包括: * Ardour 7.5.0 * Blender 3.6.2 * Inkscape 1.2.2 * Audacity 3.3.3 * Darktable 4.2.1 * Kdenlive 23.08.1 * OBS Studio 29.1.3 #### Linux 内核升级至 6.5 版本 ![](/data/attachment/album/202310/17/091151yv2j28dmwk884b98.jpg) 所有的这些,全都运行在**Linux 内核 6.5**之上,让 Ubuntu Studio 23.10 能够支持如 **USB4/Wi-Fi 7 的初始支持**和**AMD 的各种优化**等。 #### ?️ 其他的改进 此外,还有一些你应该了解的改变: * 由于引入了 0.3.79 版本,提升了 PipeWire 的性能。 * Ubuntu Studio 的安装程序已去掉了 Backports PPA 的选项。 * 将 Carla 升级到了 2.5.6版。 你可以访问 [官方发布说明](https://ubuntustudio.org/ubuntu-studio-23-10-release-notes/) 以了解关于升级和技术变动的更多细节。 ### ? 下载 Ubuntu Studio 23.10 你可以在 [官方网站](https://ubuntustudio.org/download/) 或者 Ubuntu 的 [镜像仓库](https://cdimage.ubuntu.com/ubuntustudio/releases/23.10/) 中下载到最新的Ubuntu Studio版本。 > > **[Ubuntu Studio 23.10](https://cdimage.ubuntu.com/ubuntustudio/releases/23.10/release/)** > > > ? 你以前用过 Ubuntu Studio 吗?你的使用体验如何? *(题图:[Ubuntu](https://ubuntu.com/blog/into-the-labyrinth))* --- via: <https://news.itsfoss.com/ubuntu-studio-23-10/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) It's raining Ubuntu flavor releases! ☔ One such release is the Ubuntu Studio 23.10, introducing some useful updates and improvements. Let's take a look at it. **months until** **nine****.** **July 2024**## 🆕 Ubuntu Studio 23.10: What's New? ![a screenshot of ubuntu studio 23.10 desktop screen](https://news.itsfoss.com/content/images/2023/10/Ubuntu_Studio_23.10_1.jpg) For those who are not familiar, [Ubuntu Studio](https://ubuntustudio.org/?ref=news.itsfoss.com) is an official [Ubuntu flavor](https://ubuntu.com/desktop/flavours?ref=news.itsfoss.com) tailored towards **content creators**. It comes pre-installed with many applications for various purposes, such as audio/video production, photography, streaming, graphics design and more. This release of Ubuntu Studio is based on the Ubuntu 23.10 release, with some key improvements: **KDE Plasma Improvements****New Wallpaper****Updated Application Suite****Linux Kernel 6.5****Audio configuration utility with the installer** ### KDE Plasma Improvements ![a screenshot of the info center on ubuntu studio 23.10](https://news.itsfoss.com/content/images/2023/10/Ubuntu_Studio_23.10_2.jpg) Ubuntu Studio 23.10 features the latest **KDE Plasma 5.27.8** desktop environment that comes with new translations, misc fixes, and three key bug fixes: - Soft hyphens in keywords have been removed from the search bar in system settings. - Powerdevil doesn't automatically suspend by default when running in a virtual machine. - KRunner's debut is faster on X11. You can go through the [release notes](https://kde.org/announcements/plasma/5/5.27.8/?ref=news.itsfoss.com) to know more about the technical changes. ### Ubuntu Studio Audio Configuration The Ubuntu Studio installer now includes a wizard-like audio configuration utility that makes it convenient to set up system-wide audio settings. ![ubuntu studio audio configuration](https://news.itsfoss.com/content/images/2023/10/ubuntu-studio-audio-setup.png) You can tweak the audio latency and sample rate as per your requirements. ![ubuntu studio audio configuration](https://news.itsfoss.com/content/images/2023/10/ubuntu-studio-sample-rate.png) This utility should be helpful for creators who use Ubuntu Studio for audio production. ### New Wallpaper ![a screenshot of the wallpaper settings on ubuntu studio 23.10](https://news.itsfoss.com/content/images/2023/10/Ubuntu_Studio_23.10_3.jpg) A new wallpaper called '**Ubuntu Studio Mantic Minotaur**' has been introduced with this Ubuntu Studio release that takes pointers from the default wallpaper for Ubuntu 23.10 'Mantic Minotaur'. I like the way it looks, with a dark appearance to it 🤓 ### Updated Application Suite ![a screenshot of the various pre-installed application on ubuntu studio 23.10](https://news.itsfoss.com/content/images/2023/10/Ubuntu_Studio_23.10_4.jpg) Ubuntu Studio 23.10 features **a set of updated applications**. Some notable ones include: - Ardour 7.5.0 - Blender 3.6.2 - Inkscape 1.2.2 - Audacity 3.3.3 - Darktable 4.2.1 - Kdenlive 23.08.1 - OBS Studio 29.1.3 ### Linux Kernel 6.5 ![a screenshot of the neofetch output on ubuntu studio 23.10](https://news.itsfoss.com/content/images/2023/10/Ubuntu_Studio_23.10_5.jpg) All of this is powered by **Linux kernel 6.5**, allowing Ubuntu Studio 23.10 to take advantage of things such as** initial support for USB4/Wi-Fi 7**, **various optimizations for AMD stuff**, and more. [Linux Kernel 6.5 Released With Initial Support for Wi-Fi 7 and USB4The Linux Kernel 6.5 has dropped with nice improvements. Check it out here.](https://news.itsfoss.com/linux-kernel-6-5-release/)![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ### 🛠️ Other Refinements As for the rest, here are some other changes that you should know about: - PipeWire has been improved thanks to the implementation of version 0.3.79. - The option for Backports PPA is no longer featured on the Ubuntu Studio installer. - Carla has been upgraded to version 2.5.6. For upgrade information and details on technical changes, you may head over to the [official release notes](https://ubuntustudio.org/ubuntu-studio-23-10-release-notes/?ref=news.itsfoss.com). ## 📥 Download Ubuntu Studio 23.10 You can grab the latest release of Ubuntu Studio from the [official website](https://ubuntustudio.org/download/?ref=news.itsfoss.com) or the Ubuntu [image repository](https://cdimage.ubuntu.com/ubuntustudio/releases/23.10/?ref=news.itsfoss.com). *💬 Have you tried Ubuntu Studio in the past? How was your experience with it?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,291
在 Arch Linux 上安装 Brave
https://itsfoss.com/install-brave-arch-linux/
2023-10-17T10:38:36
[ "Brave" ]
https://linux.cn/article-16291-1.html
![](/data/attachment/album/202310/17/103648le2r0e688pef1v22.jpg) > > 在这篇初学者教程中,学习在 Arch Linux 中安装 Brave 浏览器。 > > > Firefox 和 Brave 是我日常浏览网页的程序。 当我安装带有 GNOME 的 Arch Linux 时,它有 GNOME Web 浏览器。这是一个不错的浏览器,但我不能接受它,因为我需要保存的密码、浏览历史记录和插件。 因此,我开始安装我最喜欢的网络浏览器,因此本教程是关于在 Arch Linux 中安装 Brave。 如果你安装了 Yay(或任何其他 AUR 帮助程序),那么安装 Brave 就像使用以下命令一样简单: ``` yay -S brave-bin ``` 是的!就这么简单。让我们详细看看。 > > ? Manjaro 内置了 AUR 支持。你可以使用 Pamac 软件中心或 `pamac`/`pacman` 命令在 Manjaro 中安装 Brave。 > > > ### 在 Arch Linux 上安装 Brave 浏览器 Brave 在官方 Arch 仓库中不可用。但是,它可以在 AUR(Arch 用户仓库)中使用,并且可以使用 Yay 等 AUR 帮助程序轻松安装。 如果你没有 Yay 或任何其他 AUR 帮助程序,请逐一使用这些命令来 [安装 Yay](https://itsfoss.com/install-yay-arch-linux/): ``` sudo pacman -S --needed base-devel git git clone https://aur.archlinux.org/yay.git cd yay makepkg -si ``` 安装 Yay 后,用它来安装 Brave: ``` yay -S brave-bin ``` 不用担心。它最终会要求你输入密码。 如果这是你第一次安装浏览器,系统可能会要求你选择字体提供方。使用默认选择或选择任何其他选项。 ![](/data/attachment/album/202310/17/103837ipp9rlttr0gmcctr.png) 接下来,它会询问你有关清理构建的问题。Yay 询问你是否应该重新下载软件包(和依赖项)并再次构建它或使用早期构建的缓存(如果有)。 你可以按回车键继续操作,这应该意味着不清理构建。 ![](/data/attachment/album/202310/17/103838fcdl6mflwf9ah6tq.png) 事实上,当你看到默认选项时,你可以继续按回车键。 在实际安装之前,系统会要求你输入帐户密码。输入你的密码并继续该过程。它将下载大小约为 350 MB 的文件: ![](/data/attachment/album/202310/17/103838qyzf2vqbsdv7a5vw.png) 安装后,在系统菜单中查找 [Brave browser](https://brave.com/) 并从那里运行它。 ![](/data/attachment/album/202310/17/103838k46md8u4i6zuals2.png) ### 保持 Brave 更新 你可以使用以下命令更新通过 Yay 安装的 AUR 软件包来保持 Brave 浏览器更新: ``` yay -Sua ``` ### 从 Arch 中删除 Brave 不喜欢 Brave? 不用担心。你可以轻松将其删除。 与任何其他软件一样,使用 `pacman` 命令从 Arch 中删除 Brave: ``` sudo pacman -Rs brave-bin ``` ### 总结 AUR 再次拯救你! 安装 Brave 变得非常简单。 顺便说一句,我注意到 Brave 不知何故成为打开图像的默认应用。这意味着,双击图像将在新的 Brave 窗口中打开它们。 我必须通过右键单击图像并选择“打开方式”选项再次将图像查看器设置为默认值。 ![Somehow Brave becomes the default image viewer. You should change it](/data/attachment/album/202310/17/103839m31iwwhqqjjlvvw8.png) 在接下来的几天里,我将分享更多我的 Arch 经验。敬请关注! *(题图:MJ/46bf8413-5fe1-41aa-b6f3-a5e660efce2b)* --- via: <https://itsfoss.com/install-brave-arch-linux/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Firefox and Brave are my daily drivers for web browsing. When I installed Arch Linux with GNOME, it had GNOME Web browser. It's a decent browser but not something I can live with it as I need my saved passwords, browsing history and plugins. So, I started out to install my favorite web browsers and hence this tutorial on getting Brave in Arch Linux. If you have Yay (or any other AUR helper) installed, installing Brave is as simple as using this command: `yay -S brave-bin` Yeah! That simple. Let's see it in detail. ## Installing Brave browser on Arch Linux Brave is not available in the official Arch repositories. However, it is available in the AUR (Arch User Repository) and can be easily installed using an AUR helper like Yay. If you don't have Yay or any other AUR helper, use these commands one by one to [install Yay](https://itsfoss.com/install-yay-arch-linux/): ``` sudo pacman -S --needed base-devel git git clone https://aur.archlinux.org/yay.git cd yay makepkg -si ``` Once you have got Yay, use it to install Brave: `yay -S brave-bin` Don't worry. It will ask for your password eventually. If this is your first time installing a browser, you may be asked to choose a font provider. Go with the default choice or choose any of the other. ![During Brave installation, you may be asked to choose fonts](https://itsfoss.com/content/images/2023/10/yay-install-brave-font-install.png) Next, it will ask you about clean build. Yay asks you if it should redownload the packages (and dependencies) and build it again or use the cache from an earlier build (if there is any). You can go on with it by pressing enter, which should mean No to clean build. ![No need for clean build with yay](https://itsfoss.com/content/images/2023/10/clean-build-yay.png) In fact, you can just keep on pressing enter when you are presented with choices to with the default one. Just before the actual installation, you'll be asked to enter your account password. Enter your password and go on with the process. It will download files of around 350 MB in size: ![Installing Brave](https://itsfoss.com/content/images/2023/10/installing-brave-arch-linux.png) Once installed, look for [Brave browser](https://brave.com/) in the system menu and run it from there. ![Running Brave in Arch Linux](https://itsfoss.com/content/images/2023/10/run-brave-arch-linux.png) ## Keeping Brave updated You can keep the Brave browser updated by updating the AUR packages installed with yay using this command: `yay -Sua` ## Removing Brave from Arch Don't like Brave? No worries. You can easily remove it. Like any other software, remove Brave from Arch using pacman command: `sudo pacman -Rs brave-bin` ## Conclusion AUR comes to the rescue, once again! Installing Brave becomes an easy task with it. By the way, I noticed that somehow Brave became the default application for opening images. Which means, double clicking on images were opening them in a new Brave window. I had to make Image Viewer default again by right clicking an image, and going to "open with" option. ![Somehow Brave becomes the default image viewer. You should change it](https://itsfoss.com/content/images/2023/10/open-images-in-viewer-not-brave.png) I'll be sharing more of my Arch experience in the coming days. Stay tuned!
16,292
Linux 爱好者线下沙龙:LLUG 2023·相聚成都
https://jinshuju.net/f/VJkeMZ
2023-10-17T16:53:00
[ "LLUG" ]
https://linux.cn/article-16292-1.html
![](/data/attachment/album/202310/17/165303gilg8g57gijm1rj8.jpg) 社群里呼声很高的天府之国,它来了! 经历过 [6 月北京场](/article-15929-1.html)、[7 月上海场](/article-16052-1.html)、[9 月深圳场](/article-16238-1.html) 之后,**10 月 29 日(周日)**,Linux 爱好者沙龙将会在四川成都市高新区菁蓉汇,与 [中国开源年会(COSCON)](https://kaiyuanshe.cn/activity/coscon-2023)同场举办! 本次活动依然由 Linux 中国和龙蜥社区(OpenAnolis)联合主办,中国开源年会提供场地支持,人民邮电出版社提供了书籍赞助。 > > 龙蜥社区(OpenAnolis)是国内的顶尖 Linux 发行版社区,我们希望在普及 Linux 知识的同时,也能让中国的 Linux 发行版,为更多人知晓,推动国产发行版的发展和进步。 > > > ![](/data/attachment/album/202310/17/164007xc6eo9rhe46hhtrh.jpg) *深圳场现场照片* ![](/data/attachment/album/202310/17/164030ndjcrdiudcm9oovx.jpg) *上海场现场照片* 本次活动,我们将设常规的技术分享和闪电演讲两种不同分享的形态。 技术分享会邀请来自 Linux 社区的开发者,分享自己在 Linux 中的技术实践,并配合 Q&A 的环节,帮助大家理解技术难点和实践,如果你有经验和实践想要分享给大家,欢迎报名分享 闪电演讲则不设定主题,每个人有 5 分钟时间来分享自己与 Linux、技术、开源有关的话题,共计 6 个闪电演讲名额,想要试试锻炼自己的演讲能力,不妨从闪电演讲开始。 ![](/data/attachment/album/202310/17/164149tn6kwvmkz16uokkn.png) 如果你对分享感兴趣,欢迎填写下方问卷来提交你的议题: > > **<https://jinshuju.net/f/VJkeMZ>** > > > *(题图:MJ/496a4579-23c7-4376-a0f3-194127b5318c)*
302
Found
null
16,294
六大 Python 解释器
https://opensource.com/article/22/9/python-interpreters-2022
2023-10-17T23:23:26
[ "Python", "解释器" ]
https://linux.cn/article-16294-1.html
![](/data/attachment/album/202310/17/232316oa6pjbza2az2b5hv.jpg) > > 观察你的代码在其他解释器下运行的表现或许是一项有趣的尝试。 > > > 作为最受欢迎的编程语言之一,Python 需要一个解释器来执行其代码所定义的命令。与其他可直接编译成机器代码的语言不同,Python 代码需要解释器读取它并把它转译给进行相关操作的 CPU。那么,哪些解释器有哪些呢?本文将对其中几种进行介绍。 ### 解释器简介 提到 Python 解释器,我们通常会想到 `/usr/bin/python` 这个二进制文件。它使你能够执行 `.py` 文件。然而,解释操作仅仅是其中一环。在 Python 代码真正被 CPU 执行之前,都需要经过以下四个步骤: 1. 词法分析 - 将人类编写的源代码转换为一序列逻辑实体,被称为 <ruby> 词法标记 <rt> lexical token </rt></ruby>。 2. 解析 - 解析器会检查词法标记的语法和语义规则生成 <ruby> 抽象语法树 <rt> abstract syntax tree </rt></ruby>(AST)。 3. 编译 - 编译器会根据 AST 创建 Python 字节码,这些字节码由非常基础的,和平台无关的指令组成。 4. 解释 - 解释器处理字节码并执行特定的操作。 如你所见,在任何实质性的操作发生之前,我们需要走过这些步骤。这也解释了深入研究不同解释器的重要性。 ### 1、CPython 作为 Python 的参考实现,[CPython](https://github.com/python/cpython#general-information) 默认地被许多系统所采用。如其名称所示,CPython 是用 C 语言编写的。这也意味着,我们可以 [以 C 语言编写扩展](https://opensource.com/article/21/4/cython),从而让 Python 打通到广泛使用的 C 语言库代码。CPython 广泛应用于各种平台,包括 ARM 和 RISC。然而,作为 Python 的参考实现,CPython 更注重精细的优化,而非运行速度。 ### 2、Pyston [Pyston](https://github.com/pyston/pyston) 是一个从 CPython 解释器衍生出的分支,其中实现了性能优化。该项目定位自己为标准 CPython 解释器在处理大型、真实世界应用时的替代品,并有可能加速高达 30%。由于缺乏兼容的二进制包,Pyston 在下载过程中需要重新编译。 ### 3、PyPy 采用了 RPython 编写的 [PyPy](https://foss.heptapod.net/pypy/pypy) 是一个专为 Python 配备的 [即时(JIT)](https://en.wikipedia.org/wiki/Just-in-time_compilation) 编译器,RPython 是 Python 的一个静态类型的子集。不同于 CPython 解释器,PyPy 对源代码进行编译,生成 CPU 可直接执行的机器码。PyPy 是 Python 开发者的实验室,在这里他们能更容易地测试新特性。 相较于 CPython,PyPy 的执行速度更快。由于 JIT 编译器的特性,长时间运行的应用更能从缓存中受益。PyPy 可以被视为 CPython 的有效替代。虽然其中存在一些缺点,大部分的 C 扩展模块在 PyPy 中也得到支持,但运行速度会相对慢一些。PyPy 扩展模块使用 Python(而不是 C)编写,这使 JIT 编译器能够对其进行优化。只要你的应用程序不依赖于不兼容的模块,PyPy 就是替换 CPython 的理想选择。你可以在项目官网找到一个专门的页面,详细描述 PyPy 与 CPython 的不同之处:[PyPy 与 CPython 的差异](https://doc.pypy.org/en/latest/cpython_differences.html) ### 4、RustPython 顾名思义,[RustPython](https://github.com/RustPython/RustPython) 是一个由 Rust 编写的 Python 解释器。尽管 Rust 如今还是一个相对年轻的编程语言,但因其优良特性已逐步受到开发者的推崇,甚至被视为 C 和 C++ 的可能接班人。默认情况下,RustPython 的行为与 CPython 的解释器类似,但它也可以选择启用 JIT 编译器。值得一提的是,Rust 工具链能直接编译为 [WebAssembly](https://opensource.com/article/21/3/webassembly-firefox) ,进而允许在浏览器中全面运行解释器。你可以在 [这里](https://rustpython.github.io/demo/) 看到它的在线演示。 ### 5、Stackless Python [Stackless Python](https://github.com/stackless-dev/stackless) 自称是 Python 编程语言的增强版本。该项目基本上是 CPython 解释器衍生的一个项目,其为该语言添加了微线程、通道和调度器。微线程可以帮助你将代码组织成可以并行运行的 “<ruby> 小任务 <rt> tasklet </rt></ruby>”。这与采用 [greenlet](https://pypi.org/project/greenlet/) 模块的绿色线程模型相似。通道可以用作 “小任务” 之间的双向通信。Stackless Python 的一个知名用户是大型多人在线角色扮演游戏 [Eve Online](https://www.eveonline.com/)。 ### 6、Micro Python 如果你的目标平台是微控制器,那么 [MicroPython](https://micropython.org) 将是你的首选。它是一种极简的实现,只需要 16kB 的内存和 256kB 的存储空间。由于其主要面向的是嵌入式环境,MicroPython 的标准库只包含 CPython 丰富的 STL 的一部分。对于开发和测试,或者作为轻量级替代品,MicroPython 也可以在普通的 x86 和 x64 系统上运行。MicroPython 支持 Linux、Windows,以及多种微控制器。 ### 性能 就其设计而言,Python 本质上是一种运行速度不够快的语言。根据任务性质的不同,各种解释器间存在明显的性能差异。要想弄清楚哪种解释器最适合特定任务,可以参考 [pybenchmarks.org](https://pybenchmarks.org/)。与使用解释器相比,另一种选择是直接将 Python 二进制代码编译成机器码,例如,[Nuitka](https://github.com/Nuitka/Nuitka) 就是能够完成这种工作的项目之一,它可以将 Python 代码编译成 C 代码,然后将 C 代码通过常规的 C 编译器编译成机器码。Python 编译器的主题范围广泛,值得一篇独立的文章来详述。 ### 总结 Python 是构建快速原型和自动化任务的优秀语言,同时它又易于学习,对初学者友好。如果你平时维持使用 CPython,那么尝试看看你的代码在另一解释器上运行会是什么样子也许会很有趣。如果你是 Fedora 用户,你可以轻松地测试几种其他解释器,因为其包管理器已经提供了需要的二进制文件。你可以在 [fedora.developer.org](https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html) 上查找更多信息。 *(题图:MJ/9b24f27b-bd2b-4916-9f33-bcfb9e2b1d33)* --- via: <https://opensource.com/article/22/9/python-interpreters-2022> 作者:[Stephan Avenwedde](https://opensource.com/users/hansic99) 选题:[lkxed](https://github.com/lkxed) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Python, one of the most popular programming languages, requires an interpreter to execute the instructions defined by the Python code. In contrast to other languages, which compile directly into machine code, it’s up to the interpreter to read Python code and translate its instructions for the CPU performing the related actions. There are several interpreters out there, and in this article, I’ll take a look at a few of them. ## Primer to interpreters When talking about the Python interpreter, it’s usually the `/usr/bin/python` binary being referred to. That lets you execute a `.py` file. However, interpreting is just one task. Before a line of Python code is actually executed on the CPU, these four steps are involved: **Lexing**- The human-made source code is converted into a sequence of logical entities, the so called lexical tokens.**Parsing**- In the parser, the lexical tokens are checked in regards of syntax and grammar. The output of the parser is an abstract syntax tree (AST).**Compiling**- Based on the AST, the compiler creates Python bytecode. The bytecode consists of very basic, platform independent instructions.**Interpreting**- The interpreter takes the bytecode and performs the specified operations. As you can see, a lot of steps are required before any real action is taken. It makes sense to take a closer look at the different interpreters. ## 1. CPython [CPython](https://github.com/python/cpython#general-information) is the reference implementation of Python and the default on many systems. As the name suggests, CPython is written in C. As a result, it is possible to [write extensions in C](https://opensource.com/article/21/4/cython) and therefore make the widley used C based library code available to Python. CPython is available on a wide range of platforms including ARM, iOS, and RISC. However, as the reference implementation of the language, CPython is carefully optimized and not focused on speed. ## 2. Pyston [Pyston](https://github.com/pyston/pyston) is a fork of the CPython interpreter which implements performance optimizations. The project describes itself as a replacement of the standard CPython interpreter for large, real-world applications with a speedup potential up to 30%. Due to the lack of compatible binary packages, Pyston packages must be recompiled during the download process. ## 3. PyPy [PyPy](https://foss.heptapod.net/pypy/pypy) is a [Just-in-time (JIT)](https://en.wikipedia.org/wiki/Just-in-time_compilation) compiler for Python which is written in RPython, a statically typed subset of Python. In contrast to the CPython interpreter, PyPy compiles to machine code which can be directly executed by the CPU. PyPy is the playground for Python developers where they can experiment with new features more easily. PyPy is faster than the reference CPython implementation. Because of the nature of JIT compiler, only applications that have been running for a long time benefit from caching. PyPy can act as a replacement for CPython. There is a drawback, though. C-extension modules are mostly supported, but they run slower than a Python one. PyPy extension modules are written in Python (not C) and so the JIT compiler is able to optimized them. As long as your application isn't dependent on incompatible modules, PyPy is a great replacement for CPython. There is a dedicated page on the project website which describes the differences to CPython in detail: [Diffrences between PyPy and CPython](https://doc.pypy.org/en/latest/cpython_differences.html) ## 4. RustPython As the name suggest, [RustPython](https://github.com/RustPython/RustPython) is a Python interpreter written in Rust. Although the Rust programming language is quite new, it has been gaining popularity and is a candidate to be a successor of C and C++. By default, RustPython behaves like the interpreter of CPython but it also has a JIT compiler which can be enabled optionally. Another nice feature is that the Rust toolchain allows you to directly compile to [WebAssembly](https://opensource.com/article/21/3/webassembly-firefox) and also allows you to run the interpreter completely in the browser. A demo of it can be found at [rustpython.github.com/demo](https://rustpython.github.io/demo/). ## 5. Stackless Python [Stackless Python](https://github.com/stackless-dev/stackless) describes itself as an enhanced version of the Python programming language. The project is basically a fork of the CPython interpreter which adds microthreads, channels and a scheduler to the language. Microthreads allow you to structure your code into tasklets which let you run your code in parallel. This approach is comparable to using green threads of the [greenlet](https://pypi.org/project/greenlet/) module. Channels can be used for bidirectional communication between tasklets. A famous user of Stackless Python is the MMORPG [Eve Online](https://www.eveonline.com/). ## 6. Micro Python [MicroPython](https://micropython.org) is the way to go if you target micro controllers. It is a lean implementation that only requires 16kB of RAM and 256kB of space. Due to the embedded environment which it is intended for, MicroPython’s standard library is only a subset of CPython’s extensive STL. For developing and testing or as a lightweight alternative, MicroPython also runs on ordinary x86 and x64 machines. MicroPython is available for Linux, Windows, as well as many microcontrollers. ## Performance By design, Python is an inherently slow language. Depending on the task, there are significant performance differences between the interpreters. To get an overview of which interpreter is the best pick for a certain task, refer to [pybenchmarks.org](https://pybenchmarks.org/). An alternative to using an interpreter is to compile Python binary code directly into machine code. [Nuitka](https://github.com/Nuitka/Nuitka), for example, is one of those projects which can compile Python code to C code and from C to machine code. The C code is then compiled to machine code using an ordinary C compiler. The topic of Python compilers is quite comprehensive and worth a separate article. ## Summary Python is a wonderful language for rapid prototyping and automating tasks. Additionally, it is easy to learn and well suited for beginners. If you usually stick with CPython, it could be interesting to see how your code behaves on another interpreter. If you use Fedora, you can easily test a few other interpreters as the package manager already provides the right binaries. Check out [fedora.developer.org](https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html) for more information. ## 3 Comments
16,295
在 GNOME 中添加最小化和最大化按钮
https://itsfoss.com/gnome-minimize-button/
2023-10-18T10:47:00
[ "GNOME" ]
https://linux.cn/article-16295-1.html
![](/data/attachment/album/202310/18/104631i5gbbz3mwkfp5gmu.jpg) > > 缺少了 GNOME 中的最小化按钮选项?下面教你如何轻松找回它。 > > > 与 Ubuntu 不同,[Fedora](https://itsfoss.com/best-fedora-linux-distributions/) 和 Arch Linux 等发行版为你提供了原生的 GNOME,但可能让你烦恼的一件事是应用窗口上缺少最小化和最大化按钮。 ![No minimize or maximize button in application windows, only close button](/data/attachment/album/202310/18/104703fgjycvtrrgrij5df.png) GNOME 希望你使用应用切换器(`Alt+Tab`)或使用活动区(`Super` 键)在正在运行的应用之间切换,而不是最小化它。 好消息是,如果你不喜欢的话,你不必这样。 让我分享一下如何使用 GUI 和命令行选项恢复 GNOME 中的最小化和最大化按钮。 ### 方法 1:使用 GNOME 优化工具启用最小化和最大化按钮 GNOME <ruby> 优化 <rt> Tweaks </rt></ruby> 工具允许你自定义 GNOME 的各个方面。启用最小化窗口按钮就是其中之一。 首先使用发行版的包管理器安装 GNOME 优化工具。 运行应用并从左侧边栏进入 Windows 标题栏。你将在此处看到添加最小化和最大化按钮的选项, ![](/data/attachment/album/202310/18/104704apo9tjwckxyjkjgk.png) 你可以选择其中一个或两者。如果你不再需要它,**你可以在 GNOME 调整工具中以相同的方式禁用按钮**。 > > ? 如果需要,你还可以选择将这些控制按钮放在左侧。该选项位于标题栏按钮选项的末尾。 > > > ### 方法 2:使用命令行启用最小化和最大化按钮 `gsettings` 命令可以选择更改按钮布局并添加最小化和最大化按钮。 ``` gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close" ``` 正如你所猜测的,如果你想要**禁用任何按钮,你可以运行相同的命令,但从命令中省略不需要的按钮**。 > > ? 你还可以通过将冒号放在命令的右侧来将 Windows 控制按钮移动到左侧: > > > > ``` > gsettings set org.gnome.desktop.wm.preferences button-layout "close,minimize,maximize:" > > ``` > > ### 受到 macOS 的启发并不总是一件好事 显然,这种“无最小化按钮”的设计灵感来自苹果的 macOS。我记得大约 10 年前,macOS 曾经将窗口控件放在左侧。因此 Ubuntu Unity 也尝试默认将控件保留在左侧。 苹果很奇怪。他们大多数时候都有很好的设计,但有时他们会优先考虑设计而不是使用体验。“Magic Mouse” 就是一个例子。 > > “Magic Mouse 深受用户喜爱”。你确定? > > > ![](/data/attachment/album/202310/18/105058q42ry0z4sprj76y5.jpg) > > > — Stuart (@stuwieface) [2021 年 4 月 20 日](https://twitter.com/stuwieface/status/1384561367223521286?ref_src=twsrc%5Etfw) > > > 我不明白为什么 GNOME 开发者需要从各种设计中获得灵感,尤其是那些糟糕的设计。 但那只是我的个人意见。我很高兴有一个快速简单的解决方案可以恢复 GNOME 中的最小化和最大化按钮。 *(题图:MJ/f8ce0441-3d9b-498c-8e23-e48f7a90d040)* --- via: <https://itsfoss.com/gnome-minimize-button/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Unlike Ubuntu, [distributions like Fedora](https://itsfoss.com/best-fedora-linux-distributions/) and Arch Linux give you vanilla GNOME and one thing that may bother you is the lack of minimize and maximize buttons on the application windows. ![Missing minimize button in GNOME](https://itsfoss.com/content/images/2023/10/missing-minimize-button-gnome.png) GNOME expects you to use the application switcher (Alt+Tab) or utilize the activities area (Super key) to just switch between running applications, instead of minimizing it. The good thing is that you don't have to live like that if you don't want it. Let me share how you can bring back the minimize and maximize buttons in GNOME using both GUI and command line options. ## Method 1: Enable minimize and maximize buttons using GNOME Tweaks GNOME Tweaks tool allows you customize various aspects of GNOME. Enabling minimize windows buttons is one of them. Install GNOME Tweaks tool using your distribution's package manager first. Run the application and go to the Windows Titlebars from the left sidebar. You'll see the options to add minimize and maximize buttons here, ![Enable minimize and maximize buttons in GNOME applications](https://itsfoss.com/content/images/2023/10/enable-minimize-maximize-windows-option-gnome-tweaks.png) You can choose either or both. If you don't want it anymore, **you can disable the buttons the same way in GNOME Tweaks tool**. ## Method 2: Use command line to enable minimize and maximize buttons The gsettings command has the option to change the button layout and add the minimize and maximize buttons. ``` gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close" ``` As you can guess, if you want **to disable any of the buttons, you run the same command but omit the undesired one from the command**. gsettings set org.gnome.desktop.wm.preferences button-layout "close,minimize,maximize:" ## Getting inspired by macOS is not always a good thing Clearly, this 'no minimize button' design is inspired by Apple's macOS. I remember that around 10 years back, macOS used to have the Windows control on the left. So Ubuntu Unity also tried keeping controls on the left side by default. Apple is weird. They have good designs most of the time but they prioritize design over user experience at times. The 'magic mouse' is an example. “Magic Mouse loved by users”. You sure about that? — Stuart (@stuwieface)[pic.twitter.com/hxGtTxIrlu][April 20, 2021] I don't see why GNOME developers have this need of getting inspired by every design, specially the poor ones. But that's just my opinion. I am happy that there exists a quick and easy solution to bring back the minimize and maximize buttons in GNOME.
16,297
如何在 Linux 中监控用户活动
https://ostechnix.com/monitor-user-activity-linux/
2023-10-19T10:59:47
[ "记账", "监控" ]
https://linux.cn/article-16297-1.html
![](/data/attachment/album/202310/19/105911voe22858b5o7287s.jpg) 作为一位 Linux 管理员,你需要跟踪所有用户的活动。当服务器发生故障时,你可以分析和查看用户活动,以便寻找问题的根源。监控 Linux 用户有多种方式。本指南将专门讨论 **GNU 记账工具**,这是一项用于监视 Linux 用户活动的实用工具。 ### 什么是记账工具? 记账工具可以提供诸如 Linux 系统中的连接、已执行的程序以及系统资源的使用等有底系统使用信息。这些记账工具可以通过 `psacct` 或 `acct` 软件包安装。 `psacct` 和 `acct` 实际上是相同的。在基于 RPM 的系统中,它以 `psacct` 的形式存在;而在基于 DEB 的系统中,它作为 `acct` 提供。 你可能想知道 `psacct` 或 `acct` 工具的作用。通常,用户在命令行的历史记录会保存在他们的 `$HOME` 目录下的 `.bash_history` 文件中。有些用户可能会尝试编辑、修改或删除这些历史记录。 然而,即使他们完全 [清除了命令行历史](https://ostechnix.com/how-to-clear-command-line-history-in-linux/),记账工具依然能够获取用户活动信息。这是因为,**所有进程记账文件都由 root 用户拥有**,而普通用户则无法进行编辑。 ### Linux 中如何安装 psacct 或 acct `psacct`/`acct` 被打包在多种流行的 Linux 发行版本中。 如果要在 Alpine Linux 中安装 `psacct`,请运行以下命令: ``` $ sudo apk add psacct ``` 如果在 Arch Linux 及其变体版本(如 EndeavourOS 和 Manjaro Linux)中安装 `acct`,请运行以下命令: ``` $ sudo pacman -S acct ``` 在 Fedora、RHEL 及其衍生版本(如 CentOS、AlmaLinux 和 Rocky Linux)中安装 `psacct`,请运行以下命令: ``` $ sudo dnf install psacct ``` 在 RHEL 6 以及更早版本中,你应当使用 `yum` 命令而非 `dnf` 来安装 `psacct`。 ``` $ sudo yum install psacct ``` 在 Debian、Ubuntu 以及 Linux Mint 中,通过如下命令来安装 `acct`: ``` $ sudo apt install acct ``` 若在 openSUSE 中安装 `acct`,则运行: ``` $ sudo zypper install acct ``` ### 启动 psacct/acct 服务 要启用并开启 `psacct` 服务,请执行以下命令: ``` $ sudo systemctl enable psacct ``` 接着启动 `psacct` 服务: ``` $ sudo systemctl start psacct ``` 如果你需要检查 `psacct` 服务是否已加载和激活,可以运行: ``` $ sudo systemctl status psacct ``` 在基于 DEB 的系统中,安装完成之后,`acct` 服务会自动启动。 如果你想验证 `acct` 服务是否已经启动,可以执行以下命令: ``` $ sudo systemctl status acct ``` ``` ● acct.service - Kernel process accounting Loaded: loaded (/lib/systemd/system/acct.service; enabled; vendor preset: enabled) Active: active (exited) since Thu 2022-10-13 16:06:35 IST; 28s ago Docs: man:accton(8) Process: 3241 ExecStart=/usr/sbin/accton /var/log/account/pacct (code=exited, status=0/SUCCESS) Main PID: 3241 (code=exited, status=0/SUCCESS) CPU: 879us Oct 13 16:06:35 ubuntu2204 systemd[1]: Starting Kernel process accounting... Oct 13 16:06:35 ubuntu2204 accton[3241]: Turning on process accounting, file set to '/var/log/account/pacct'. Oct 13 16:06:35 ubuntu2204 systemd[1]: Finished Kernel process accounting. ``` ### 利用 psacct 或 acct 来监测 Linux 中的用户活动 `psacct`(进程记账)软件包包含以下用来监测用户和进程活动的工具: * `ac` - 提供用户登录时间的统计信息。 * `lastcomm` - 展示先前执行过的命令的信息。 * `accton` - 开启或关闭进程记账。 * `dump-acct` - 把 `accton` 的输出文件转化为易读的格式。 * `dump-utmp` - 以易读的方式打印 `utmp` 文件。 * `sa` - 汇总信息,关于先前执行的命令。 现在就让我们一起了解如何通过每个工具来监控 Linux 用户的活动。 #### 1、使用 ac 命令 `ac` 工具可以为你提供以小时为单位的连接时间报告,这样你就能知道用户或一组用户连接到系统的时长。 ##### 1.1、展示所有用户的总连接时间 ``` $ ac ``` 上述命令会显示所有用户的总连接时间(单位为小时)。 ``` total 52.91 ``` ![展示所有用户的总连接时间](/data/attachment/album/202310/19/105948osaz5qmicxcmfc65.png) ##### 1.2、按日期排序显示所有用户的总连接时间 你可以通过使用 `-d` 参数,按日期排序显示所有用户的连接时间,操作如下: ``` $ ac -d ``` 示例输出: ``` May 11 total 4.29 May 13 total 3.23 May 14 total 7.66 May 15 total 8.97 May 16 total 0.52 May 20 total 4.09 May 24 total 1.32 Jun 9 total 15.18 Jun 10 total 2.97 Jun 22 total 2.61 Jul 19 total 1.95 Today total 0.29 ``` ![按日期排序显示所有用户的总时间](/data/attachment/album/202310/19/105949glf31izcc9vgo43i.png) ##### 1.3、获取各个用户的总连接时间 使用 `-p` 参数,你可以查看每位用户各自在系统中总的连接时长。 ``` $ ac -p ``` 示例输出: ``` ostechnix 52.85 root 0.51 total 53.36 ``` ![获取各个用户的总连接时间](/data/attachment/album/202310/19/105949l8885sudzuzfbn8r.png) ##### 1.4、显示指定用户的总连接时间 你还可以显示特定用户的总登录时间。 ``` $ ac ostechnix ``` 示例输出: ``` total 52.95 ``` ##### 1.5、显示特定用户各日期的总连接时间 要按日期查看某个用户的登录时间,可以运行: ``` $ ac -d ostechnix ``` 示例输出: ``` May 11 total 4.29 May 13 total 3.23 May 14 total 7.66 May 15 total 8.97 May 16 total 0.01 May 20 total 4.09 May 24 total 1.32 Jun 9 total 15.18 Jun 10 total 2.97 Jun 22 total 2.61 Jul 19 total 1.95 Today total 0.68 ``` ![显示某个用户各日期的总连接时间](/data/attachment/album/202310/19/105950fzyof4nhf7nzuzoe.png) 如需更多详情,可参考手册页面。 ``` $ man ac ``` #### 2、lastcomm 命令使用示例 `lastcomm` 工具用于列出过去执行过的命令,它会按执行的最近程度将命令列在前面。 ##### 2.1、展示过去执行的命令 ``` $ lastcomm ``` 示例输出: ``` systemd-hostnam S root __ 0.06 secs Thu Oct 13 17:21 systemd-localed S root __ 0.06 secs Thu Oct 13 17:22 bash F ostechni pts/1 0.00 secs Thu Oct 13 17:22 awk ostechni pts/1 0.00 secs Thu Oct 13 17:22 bash F ostechni pts/1 0.00 secs Thu Oct 13 17:22 uname ostechni pts/1 0.00 secs Thu Oct 13 17:22 bash F ostechni pts/1 0.00 secs Thu Oct 13 17:22 sed ostechni pts/1 0.00 secs Thu Oct 13 17:22 bash F ostechni pts/1 0.00 secs Thu Oct 13 17:22 bash F ostechni pts/1 0.00 secs Thu Oct 13 17:22 grep ostechni pts/1 0.00 secs Thu Oct 13 17:22 bash F ostechni pts/1 0.00 secs Thu Oct 13 17:22 bash F ostechni pts/1 0.00 secs Thu Oct 13 17:22 grep ostechni pts/1 0.00 secs Thu Oct 13 17:22 bash F ostechni pts/1 0.00 secs Thu Oct 13 17:22 bash F ostechni pts/1 0.00 secs Thu Oct 13 17:22 [...] ``` ##### 2.2、打印特定用户先前执行的命令 上述命令显示的是所有用户的命令。要显示特定用户以前执行的命令,可以使用下面的命令: ``` $ lastcomm ostechnix ``` 示例输出: ``` less ostechni pts/1 0.00 secs Thu Oct 13 17:26 lastcomm ostechni pts/1 0.00 secs Thu Oct 13 17:26 lastcomm ostechni pts/1 0.00 secs Thu Oct 13 17:26 lastcomm ostechni pts/1 0.00 secs Thu Oct 13 17:26 gdbus X ostechni __ 0.00 secs Thu Oct 13 17:24 lastcomm ostechni pts/1 0.00 secs Thu Oct 13 17:24 ac ostechni pts/1 0.00 secs Thu Oct 13 17:24 update-notifier F ostechni __ 0.00 secs Thu Oct 13 17:23 apport-checkrep ostechni __ 0.06 secs Thu Oct 13 17:23 apport-checkrep ostechni __ 0.05 secs Thu Oct 13 17:23 systemctl ostechni __ 0.00 secs Thu Oct 13 17:23 apt-check ostechni __ 0.81 secs Thu Oct 13 17:23 dpkg ostechni __ 0.00 secs Thu Oct 13 17:23 ischroot ostechni __ 0.00 secs Thu Oct 13 17:23 dpkg ostechni __ 0.00 secs Thu Oct 13 17:23 [...] ``` ##### 2.3、打印特定命令的执行次数 你还可以查看特定命令被执行的次数。 ``` $ lastcomm apt ``` 示例输出: ``` apt S root pts/2 0.70 secs Thu Oct 13 16:06 apt F root pts/2 0.00 secs Thu Oct 13 16:06 apt F root pts/2 0.00 secs Thu Oct 13 16:06 ``` 如上述输出所示,root 用户执行了 `apt` 命令三次。 更详细的信息,可参考手册页: ``` $ man lastcomm ``` #### 3、sa 命令示例 `sa` 实用程序将总结关于先前执行的命令的信息。 ##### 3.1、打印所有命令的总结 ``` $ sa ``` 示例输出: ``` 1522 1598.63re 0.23cp 0avio 32712k 139 570.90re 0.05cp 0avio 36877k ***other* 38 163.63re 0.05cp 0avio 111445k gdbus 3 0.05re 0.04cp 0avio 12015k apt-check 27 264.27re 0.02cp 0avio 0k kworker/dying* 2 51.87re 0.01cp 0avio 5310464k Docker Desktop 5 0.03re 0.01cp 0avio 785k snap-confine 8 59.48re 0.01cp 0avio 85838k gmain 5 103.94re 0.01cp 0avio 112720k dconf worker 24 3.38re 0.00cp 0avio 2937k systemd-udevd* 7 0.01re 0.00cp 0avio 36208k 5 3 1.51re 0.00cp 0avio 3672k systemd-timedat 2 0.00re 0.00cp 0avio 10236k apport-checkrep 2 0.01re 0.00cp 0avio 4316160k ThreadPoolForeg* 2 0.00re 0.00cp 0avio 8550k package-data-do 3 0.79re 0.00cp 0avio 2156k dbus-daemon 12 0.00re 0.00cp 0avio 39631k ffmpeg [...] ``` ##### 3.2、查看进程数量和 CPU 分钟数 要打印基于每个用户的进程数量和 CPU 分钟数,运行带 `-m` 标志的 `sa` 命令: ``` $ sa -m ``` 示例输出: ``` 1525 1598.63re 0.23cp 0avio 32651k root 561 647.23re 0.09cp 0avio 3847k ostechnix 825 780.79re 0.08cp 0avio 47788k gdm 117 13.43re 0.06cp 0avio 63715k colord 2 52.01re 0.00cp 0avio 89720k geoclue 1 1.01re 0.00cp 0avio 70608k jellyfin 12 0.00re 0.00cp 0avio 39631k man 1 0.00re 0.00cp 0avio 3124k kernoops 4 104.12re 0.00cp 0avio 3270k sshd 1 0.05re 0.00cp 0avio 3856k whoopsie 1 0.00re 0.00cp 0avio 8552k ``` ##### 3.3、打印用户 ID 和命令名称 对于账户文件中的每个命令,使用 `-u` 标志打印用户 ID 和命令名称。 ``` $ sa -u ``` 示例输出: ``` root 0.00 cpu 693k mem 0 io accton root 0.00 cpu 3668k mem 0 io systemd-tty-ask root 0.00 cpu 3260k mem 0 io systemctl root 0.01 cpu 3764k mem 0 io deb-systemd-inv root 0.00 cpu 722k mem 0 io acct.postinst root 0.00 cpu 704k mem 0 io rm root 0.00 cpu 939k mem 0 io cp root 0.00 cpu 704k mem 0 io rm root 0.00 cpu 951k mem 0 io find root 0.00 cpu 911k mem 0 io gzip root 0.00 cpu 722k mem 0 io sh root 0.00 cpu 748k mem 0 io install-info root 0.00 cpu 911k mem 0 io gzip [...] ``` 如需更多详细信息,请参考手册页: ``` $ man sa ``` #### 4、dump-acct 和 dump-utmp 命令 `dump-acct` 实用工具将 accton 格式的输出文件显示为人类可读的格式。 ``` $ dump-acct /var/account/pacct ``` `dump-utmp` 将 utmp 文件显示为人类可读的格式。 ``` $ dump-utmp /var/run/utmp ``` 如需了解更多详情,请参考手册页: ``` $ man dump-acct ``` ``` $ man dump-utmp ``` #### 5、accton 命令 `accton` 命令将允许你开启或关闭记账。 要开启进程记账,请运行: ``` $ accton on ``` 要关闭它,运行: ``` $ accton off ``` 如需了解更多详情,请参考手册页: ``` $ man accton ``` ### 总结 每个 Linux 管理员都应该知道 GNU 记账实用程序,以便注意所有用户的行为。在故障排除时,这些实用程序会非常有帮助。 ### 资源 * [GNU 记账实用程序官网](https://www.gnu.org/software/acct/manual/accounting.html) *(题图:MJ/da3f7e79-2a53-4121-a2ed-d63a22c3d3f4)* --- via: <https://ostechnix.com/monitor-user-activity-linux/> 作者:[sk](https://ostechnix.com/author/sk/) 选题:[lkxed](https://github.com/lkxed) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
403
Forbidden
null
16,298
如何在 Bash 脚本中添加注释
https://itsfoss.com/bash-comments/
2023-10-19T11:37:26
[ "Bash", "注释", "现场文档" ]
https://linux.cn/article-16298-1.html
![](/data/attachment/album/202310/19/113658dld7b9987xa89l99.jpg) > > 你有要说明的地方吗?请将它们添加到你的 Bash 脚本中。 > > > 在 Bash 脚本中添加注释是保持代码整洁且易于理解的最有效方法之一。 你可能会问为什么。 假设你的脚本包含一个复杂的正则表达式或多个复杂的代码块,在这种情况下,你可以添加注释,以便其他开发人员或你可以了解该代码块的含义。 注释掉部分代码也有助于调试脚本。 在本教程中,我将引导你了解在 Bash 脚本中添加注释的三种方法: * 单行注释 * 行内评论 * 多行注释 那么让我们从第一个开始。 ### Bash 中的单行注释 要添加单行注释,你必须将哈希符号(`#`)放在行的开头并编写注释。 这是一个简单的例子: ``` #!/bin/bash # This is a comment echo "Hello, World!" ``` 执行时,注释将被忽略,当我执行上面的命令时,它看起来像这样: ![](/data/attachment/album/202310/19/113726gw754x4v79jws4al.png) > > ? `#` 注释规则的唯一例外是脚本开头的 `#!/bin/bash` 行。它称为 [释伴](/article-3664-1.html),用于指定运行脚本时要使用的解释器。有不同的 Shell,语法也可能不同。因此,一个好的做法是指定脚本是为哪个 Shell 编写的。例如,如果是 ksh,则可以使用 `#!/bin/ksh`. > > > ### Bash 脚本中的内联注释 或者,你可以将注释放在代码块内以记录该特定行的用途。 > > ? `#` 之后的任何内容在该行结束之前都不会执行,因此请确保在代码末尾添加注释。 > > > 这是一个简单的例子: ``` #!/bin/bash echo "Hello, World!" #Prints hello world ``` ![](/data/attachment/album/202310/19/113726w6ig6u896aara8er.png) ### Bash 中的多行注释 > > ? Bash 中没有内置的多行注释功能。但是,有一些解决方法可以实现多行注释效果。 > > > 顾名思义,Bash 脚本中的多行注释允许你在多行中编写注释,或者通过将它们放在多行注释部分来阻止执行代码块: 1. 在每行的开头使用 `#` 2. [冒号表示法](https://stackoverflow.com/questions/3224878/what-is-the-purpose-of-the-colon-gnu-bash-builtin)(使用冒号后跟单引号) 3. 现场文档(使用 `<<` 后跟分隔符) 那么让我们从第一个开始。 #### 1、对块注释的每一行使用 `#` 如果你的目的是解释脚本的一部分,我建议使用此方法。毕竟,`#` 才是真正的注释功能。 这也是许多开发人员使用的方法。 假设你必须在一开始就解释脚本的用途、作者信息或许可信息。你可以这样写: ``` #!/bin/bash ###################################### ## This script is used for scanning ## ## local network ## ## Licensed under GPL 2.0 ## ###################################### 这个 Bash 脚本的其它部分…… ``` 当你想说明 Bash 脚本的行为方式时这不错。如果你正在调试 Bash 脚本并希望隐藏部分脚本,则在所需代码的每一行开头添加 `#` 并在调试后将其删除是一项耗时的任务。 接下来的两节将帮助你做到这一点。 #### 2、冒号表示法 要使用冒号表示法,请在 `: '` 和结束的 `'` 之间编写块注释,如下所示: ``` #!/bin/bash : ' This is how you can use colon notation And this line too will be ignored ' echo "GOODBYE" ``` 当你执行上面的脚本时,它应该只打印 `GOODBYE`。 ![](/data/attachment/album/202310/19/113727fuuqjuvj7vwjjvm7.png) #### 3、现场文档 到目前为止,这是在 Bash 中编写多行注释的最流行的方法,你可以使用 `<<` 后跟分隔符(一组用于指定注释开始和结束的字符)。 (LCTT 译注:在编程领域,“**here document**” 是一个常见的术语,特指在脚本语言(如 Perl、Bash)中,能够直接在代码内部嵌入并处理一个数据块或文本串的技术。尽管传统上我们将它翻译为“嵌入式文档” 或不翻译,但这个译法似乎并不能完全地体现出原文的感觉和含义。为了让这个概念变得更为直观和易理解,我们建议将 “here document” 翻译为 “**现场文档**”。“现场”相比于“嵌入式”,更好的传达了文档就在代码的当前位置,或代码“现场”的含义。这样的译法也与原文 “here document” 中 “here”(这里)的含义更为契合。我们希望这个译法能够在未来得到更广泛的使用和认可,让编程的世界因语言的精准而变得更美好。PS., 该译法和解释得到了 ChatGPT 的建议和生成。) 使用方法如下: ``` #!/bin/bash <<DELIMITER Comment line 1 Comment line 2 DELIMITER echo "Hello, World!" ``` 还困惑吗? 这是一个简单的例子: ``` #!/bin/bash <<COMMENT This is a multi-line comment using a here document. You can add as many lines as you want between <<COMMENT and the terminating keyword. This block won't be executed by the shell. COMMENT echo "Hello, World!" ``` 在上面的示例中,我使用了 `COMMENT` 作为分隔符,但你可以使用任何内容,但要确保它从注释中脱颖而出,否则会造成混乱。 当我执行上面的脚本时,它给出了以下输出: ![](/data/attachment/album/202310/19/113728w887lssls0j0yaml.png) 正如你所看到的,它忽略了从 `<<COMMENT` 到 `COMMENT` 的所有内容。 我希望本指南对你有所帮助。 *(题图:MJ/7c2a3ef4-5256-405e-b757-23e0ba1f0bc5)* --- via: <https://itsfoss.com/bash-comments/> 作者:[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Adding comments in bash scripts is one of the most effective ways to keep your code clean and understandable. You may ask why. Let's suppose your script contains a complex regex or multiple complex blocks of codes and in that case, you can add comments so other developers or you can have an idea of what that block of code was meant to be. Commenting out part of code also helps in debugging scripts. In this tutorial, I will walk you through three ways to add comments in bash scripts: - Single-line comments - In line comments - Multi-line comments So let's start with the first one. ## Single-line comments in bash To add single-line comments, you have to put the hashtag (#) at the beginning of the line and write a comment. Here's a simple example: ``` #!/bin/bash # This is a comment echo "Hello, World!" ``` While executing, the comments will be ignored and when I executed the above command, it looked like this: ![Use single-line comments in bash](https://itsfoss.com/content/images/2023/10/Use-single-line-comments-in-bash.png) [shebang](https://linuxhandbook.com/shebang/)and it used to specify the interpreter to be used while running the script. There are different shells and the syntax may differ. So, a good practice is to specify for which shell the script was written. For example, if it were for ksh, you would use #!/bin/ksh ## Inline comments in bash scripts Alternatively, you can put the comment inside the code block to document what is the purpose of that specific line. Here's a simple example: ``` #!/bin/bash echo "Hello, World!" #Prints hello world ``` ![How to use the single-line comments in bash](https://itsfoss.com/content/images/2023/10/How-to-use-the-single-line-comments-in-bash.png) ## Multi-line comments in bash As the name suggests, multi-line comments in bash scripting allow you to write comments in multiple lines or prevent executing block of code by putting them in multiline comment section: - Use # at the begnning of eacj line [Colon notation](https://stackoverflow.com/questions/3224878/what-is-the-purpose-of-the-colon-gnu-bash-builtin)(uses colon followed by a single quote)- Here document (uses << followed by delimiter) So let's start with the first one. ### 1. Use # for each line of block comment This is what I suggest to use if your purpose is to explain part of the script. After all, # is the actual commenting feature. And this is what many developers use, too. Suppose you have to explain the purpose of the script, author info or licensing information in the beginning. You can write it like this: ``` #!/bin/bash ###################################### ## This script is used for scanning ## ## local network ## ## Licensed under GPL 2.0 ## ###################################### rest of the bash script code ``` That's fine when you know how your bash script behaves. If you are debugging a bash script and want to hide part of the script, adding # at the beginning of each line of the required code and then removing them after debugging is a time-consuming task. The next two sections help you with that. ### 2. Colon notation To use the colon notation, you write block comments between `: '` and the closing `'` as shown here: ``` #!/bin/bash : ' This is how you can use colon notation And this line too will be ignored ' echo "GOODBYE" ``` When you execute the above script, it should only print GOODBYE: ![Use multi line comments using colon notation in bash](https://itsfoss.com/content/images/2023/10/Use-multi-line-comments-using-colon-notation-in-bash.png) ### 2. Here document By far, this is the most popular way to write multiline comments in bash which you use `<<` followed by a delimiter (a set of characters to specify the start and the end of the comments). Here's how you use it: ``` #!/bin/bash <<DELIMITER Comment line 1 Comment line 2 DELIMITER echo "Hello, World!" ``` Still confused? Here's a simple example: ``` #!/bin/bash <<COMMENT This is a multi-line comment using a here document. You can add as many lines as you want between <<COMMENT and the terminating keyword. This block won't be executed by the shell. COMMENT echo "Hello, World!" ``` In the above example, I have used `COMMENT` as a delimiter but you can use anything but make sure it stands out from the comment or it will create confusion. When I executed the above script, it gave me the following output: ![Use multi-line comments in bash using << and delimeter](https://itsfoss.com/content/images/2023/10/Use-multi-line-comments-in-bash-using----and-delimeter.png) As you can see, it ignored everything inside <<COMMENT ## Learn bash from scratch!! If you are planning to learn bash from scratch or want to skim through all the basics, we made a detailed guide for you: [Learn Bash Scripting For Free With This Tutorial SeriesNew to bash? Start learning bash scripting with this series in am organized manner. Each chapter also includes sample exercises to practice your learning.](https://itsfoss.com/tag/bash-basics/)![](https://itsfoss.com/content/images/2023/07/bash-basics.png) ![](https://itsfoss.com/content/images/2023/07/bash-basics.png) I hope you will find this guide helpful.
16,299
Btrfs 详解:压缩
https://fedoramagazine.org/working-with-btrfs-compression/
2023-10-19T15:34:00
[ "Btrfs" ]
https://linux.cn/article-16299-1.html
![](/data/attachment/album/202310/19/153401dyst48ybibpy3oyd.jpg) 这篇文章将探索 Btrfs 中的透明文件系统压缩,以及它如何帮助节省存储空间。这篇文章是《Btrfs 详解》系列文章中的一篇。从 Fedora Linux 33 开始,Btrfs 就是 Fedora Workstation 和 Fedora Silverblue 的默认文件系统。 如果你错过了,这里是本系列的上一篇文章:[Btrfs 详解:快照](/article-16287-1.html)。 ### 简介 很多人都经历过存储空间用完的情况。也许你想从互联网下载一个大文件,或者你需要快速从你的手机中复制些照片,然后操作突然失败。虽然存储空间成本正在稳步降低,但越来越多的设备要么制造时就是固定数量的存储容量,要么最终用户难以扩展其存储容量。 但当你的存储空间不足时你可以做什么呢?也许你会求助于云存储,或者你可以随身携带一些外部存储设备。 在这篇文章里我会研究该问题的另一种解决方案:透明的文件系统压缩,这是 Btrfs 的一个特性。理想情况下,这将解决你的存储问题,同时几乎不需要对你的系统进行修改!让我们来看看是如何做到的。 ### 透明压缩的解释 首先,让我们来探寻 *透明* 压缩是什么意思。你可以通过像 gzip、xz 或者 bzip2 这些压缩算法去压缩文件。这通常是显式操作:你利用一个压缩工具并且让它操作你的文件。虽然根据文件的内容,节约了空间,这有一个主要的缺点:当你想读取文件或者修改的时候,你得先解压缩。 这不仅是一个乏味的过程,而且也暂时打破了你之前节省的空间。再者,你最终解压了你不想访问的那部分文件内容。明显有比这更好的方法! 相反,透明压缩发生在文件系统级别。在这里,压缩的文件对用户看起来像常规的未压缩文件一样。但是,它们是被压缩后存储在硬盘上的。这之所以可行,是因为操作系统仅仅选择性地访问那部分文件,并且确保在向磁盘写入更新时再次压缩它们。 这里的压缩是透明的在于它不被用户感知,除了在文件访问时可能的 CPU 负载小量增加。因此,你可以应用在已有的系统而不是进行硬件修改或者求助于云存储。 ### 压缩算法对比 Btrfs 提供了多个压缩算法的选择。出于技术原因它不能选用任意的压缩算法。它现在支持: * zstd * lzo * zlib 好消息是,由于透明压缩的工作原理,你不需要安装这些程序供 Btrfs 使用。在下面的文章里,你会看到如何去运行一个简单的性能测试来对比压缩算法。但是,为了运行性能测试,你必须安装必要的可执行文件。事后不需要留着它们,所以你将使用 Podman 容器来确保不会在系统中留下任何痕迹。 **注意** :因为 Btrfs 使用的压缩依赖于内核对这些压缩算法的(重新)实现,用户空间版本的算法得出的结果应该认为是粗略估计。 因为一次次敲重复的命令是枯燥的工作,我已经在 Gitlab 上准备了一个可以运行的 Bash 脚本 (<https://gitlab.com/hartang/btrfs-compression-test>)。这会用上面提到的每个算法在不同的压缩级别运行一次简单的压缩和解压缩。 首先,下载脚本: ``` $ curl -LO https://gitlab.com/hartang/btrfs-compression-test/-/raw/main/btrfs_compression_test.sh ``` 下一步,启动一个 Fedora Linux 容器去挂载你当前的工作目录,以便你可以和主机交换文件同时在那里运行脚本: ``` $ podman run --rm -it --security-opt label=disable -v "$PWD:$PWD" \ -w "$PWD" registry.fedoraproject.org/fedora:37 ``` 最后运行脚本: ``` $ chmod +x ./btrfs_compression_test.sh $ ./btrfs_compression_test.sh ``` 在我机器上的输出是这样: ``` [INFO] Using file 'glibc-2.36.tar' as compression target [INFO] Target file 'glibc-2.36.tar' not found, downloading now... ################################################################### 100.0% [ OK ] Download successful! [INFO] Copying 'glibc-2.36.tar' to '/tmp/tmp.vNBWYg1Vol/' for benchmark... [INFO] Installing required utilities [INFO] Testing compression for 'zlib' Level | Time (compress) | Compression Ratio | Time (decompress) -------+-----------------+-------------------+------------------- 1 | 0.322 s | 18.324 % | 0.659 s 2 | 0.342 s | 17.738 % | 0.635 s 3 | 0.473 s | 17.181 % | 0.647 s 4 | 0.505 s | 16.101 % | 0.607 s 5 | 0.640 s | 15.270 % | 0.590 s 6 | 0.958 s | 14.858 % | 0.577 s 7 | 1.198 s | 14.716 % | 0.561 s 8 | 2.577 s | 14.619 % | 0.571 s 9 | 3.114 s | 14.605 % | 0.570 s [INFO] Testing compression for 'zstd' Level | Time (compress) | Compression Ratio | Time (decompress) -------+-----------------+-------------------+------------------- 1 | 0.492 s | 14.831 % | 0.313 s 2 | 0.607 s | 14.008 % | 0.341 s 3 | 0.709 s | 13.195 % | 0.318 s 4 | 0.683 s | 13.108 % | 0.306 s 5 | 1.300 s | 11.825 % | 0.292 s 6 | 1.824 s | 11.298 % | 0.286 s 7 | 2.215 s | 11.052 % | 0.284 s 8 | 2.834 s | 10.619 % | 0.294 s 9 | 3.079 s | 10.408 % | 0.272 s 10 | 4.355 s | 10.254 % | 0.282 s 11 | 6.161 s | 10.167 % | 0.283 s 12 | 6.670 s | 10.165 % | 0.304 s 13 | 12.471 s | 10.183 % | 0.279 s 14 | 15.619 s | 10.075 % | 0.267 s 15 | 21.387 s | 9.989 % | 0.270 s [INFO] Testing compression for 'lzo' Level | Time (compress) | Compression Ratio | Time (decompress) -------+-----------------+-------------------+------------------- 1 | 0.447 s | 25.677 % | 0.438 s 2 | 0.448 s | 25.582 % | 0.438 s 3 | 0.444 s | 25.582 % | 0.441 s 4 | 0.444 s | 25.582 % | 0.444 s 5 | 0.445 s | 25.582 % | 0.453 s 6 | 0.438 s | 25.582 % | 0.444 s 7 | 8.990 s | 18.666 % | 0.410 s 8 | 34.233 s | 18.463 % | 0.405 s 9 | 41.328 s | 18.450 % | 0.426 s [INFO] Cleaning up... [ OK ] Benchmark complete! ``` 重要的是在根据脚本得出的数据做决定之前注意这些事情: * 不是所有的文件压缩效果都一样好。像图片或电影这种已经压缩过的现代多媒体格式不会压缩得更小。 * 脚本中压缩和解压缩各进行一次。重复运行会产生稍微不同的输出。因此,时间应该被理解为是估计,而不是准确的测量。 鉴于输出的数据,我决定在我的系统上使用压缩级别 3 的 zstd 压缩算法。依据你的需求,你可能想使用更高的压缩级别(比如,如果你存储设备相当的慢)。要估算可达到的读/写速度,可以将源存档大小(约 260MB)除以(解)压缩时间。 压缩测试默认是对 GNU libc 2.36 源码进行的。如果你想看看对指定文件的效果,你可以通过第一个参数传递文件路径给脚本。记住文件一定要可以在容器内访问才行。 如果你想要测试其他东西或者执行更加详细的测试,可以阅读脚本的源码,根据需要修改它。 ### 配置 Btrfs 压缩 Btrfs 里的透明文件系统压缩可以通过几种方式配置: * 作为挂载文件系统的挂载选项(可用于相同 Btrfs 文件系统的所有子卷) * 通过 Btrfs 文件属性 * 在 `btrfs filesystem defrag` 时(不是永久的,不在这里介绍) * 通过 `chattr` 文件属性接口(不在这里介绍) 我只会介绍其中前两个。 #### 在挂载时开启压缩 有一个 Btrfs 挂载选项可以开启文件压缩: ``` $ sudo mount -o compress=<ALGORITHM>:<LEVEL> ... ``` 例如,去挂载一个文件系统,并使用等级 3 的 `ztsd` 算法去压缩,你可以写成: ``` $ sudo mount -o compress=zstd:3 ... ``` 设置压缩等级是可选的。重要的是注意到 `compress` 挂载选项应用到整个 Btrfs 文件系统和它所有的子卷。此外,这是目前唯一支持的指定压缩等级的方式。 为了对文件系统的根应用压缩,必须在 `/etc/fstab` 上指定。例如,Fedora Linux 安装器,默认启用级别 1 的 `zstd` 压缩,在 `/etc/fstab` 里是这样: ``` $ cat /etc/fstab [ ... ] UUID=47b03671-39f1-43a7-b0a7-db733bfb47ff / btrfs subvol=root,compress=zstd:1,[ ... ] 0 0 ``` #### 启用单个文件压缩 另外一种方式指定压缩的方法是通过 Btrfs 文件系统属性。使用下面的命令去查看文件、目录或子卷的压缩设置: ``` $ btrfs property get <PATH> compression ``` 类似的,你可以像这样配置压缩: ``` $ sudo btrfs property set <PATH> compression <VALUE> ``` 例如,对在 `/etc` 下所有文件启用 `zlib` 压缩: ``` $ sudo btrfs property set /etc compression zlib ``` 你可以通过 `man btrfs-property` 得到支持值的列表。记住这个接口不允许指定压缩级别。除此之外,如果设置了一个压缩属性,它会覆盖挂载时的其他压缩配置。 ### 压缩已有文件 在这时,如果你对现有文件系统采用压缩,然后通过 `df` 或类似命令检查空间利用率,你会发现什么都没变。这是因为 Btrfs 自身不会 “重新压缩” 所有已有的文件。压缩只会发生在往磁盘写新数据的时候。有一些方式去执行显式的重压缩: 1. 等待,什么都不做:只要文件被修改并被写回磁盘,Btrfs 根据配置压缩新写入的文件内容。如果我们等待足够长,越来越多的文件被重写,在某个时间点就会被压缩。 2. 移动文件到另一个文件系统然后移动回来:取决于你想压缩哪些文件,这可能是相当乏味的选项。 3. 执行一次 Btrfs 碎片整理。 最后一个选项可能是最方便的,但是它会对已经包含快照的 Btrfs 文件系统提出警告:它会破坏快照间的共享范围。换句话来说,两个快照间所有的共享内容,或者一个快照和它的父子卷,在碎片整理操作后将保存多份。 因此,如果你在你的文件系统里已经有很多快照,你不应该对整个文件系统运行碎片整理。这也没有必要,因为如果你想的话,Btrfs 可以对特定的目录或者单个文件进行碎片整理。 你可以使用以下命令去执行一次碎片整理: ``` $ sudo btrfs filesystem defragment -r /path/to/defragment ``` 例如,你想像这样去整理你主目录的碎片: ``` $ sudo btrfs filesystem defragment -r "$HOME" ``` 如果有疑问,最好从碎片整理单个大文件开始,并在监视文件系统上的可用空间的同时继续处理越来越大的目录。 ### 测量文件系统压缩 有时,你可能会想,文件系统压缩为你节省了多少空间。但如何判断呢?首先,要知道一个 Btrfs 文件系统是否在挂载时启用了压缩,你可以使用以下命令: ``` $ findmnt -vno OPTIONS /path/to/mountpoint | grep compress ``` 如果你得到了结果,那么给定挂载点的文件系统就使用了压缩!下一步,`compsize` 命令会告诉你你的文件需要多少空间: ``` $ sudo compsize -x /path/to/examine ``` 在我的主目录,结果是这样: ``` $ sudo compsize -x "$HOME" Processed 942853 files, 550658 regular extents (799985 refs), 462779 inline. Type Perc Disk Usage Uncompressed Referenced TOTAL 81% 74G 91G 111G none 100% 67G 67G 77G zstd 28% 6.6G 23G 33G ``` 每一行告诉你应用到文件的压缩 “类型” 。\* `TOTAL` 是下面所有行的总计。 另一方面,这些列告诉你我们的文件需要多少空间: * `Disk Usage` 是实际分配在硬盘上的空间, * `Uncompressed` 是如果没有压缩,文件所需要的空间, * `Referenced` 是所有未压缩文件加起来的总大小。 `Referenced` 可以与数据 `Uncompressed` 不同,比如一个文件之前被重复了,或者有快照共享内容。在上面的例子,你可以看到在我的硬盘上总计 91 GB 的未压缩文件仅占据了 74 GB 的存储。取决于在目录里存储的文件类型和应用的压缩等级,这些数字可以有很大差异。 ### 文件压缩的其它注意事项 Btrfs 使用启发式算法去探测压缩文件。这是因为压缩文件通常效果不好,所以没有必要浪费 CPU 周期去尝试进一步的压缩。为了这个目的,Btrfs 在写入压缩数据到磁盘之前测量压缩率。如果文件的第一部分压缩效果不好,文件被标记为不可压缩并且不会有后续的压缩。 如果出于某些原因,你想 Btrfs 压缩所有写入的数据,你可以通过 `compress-force` 选项挂载一个 Btrfs 文件系统,像这样: ``` $ sudo mount -o compress-force=zstd:3 ... ``` 当像这样配置,Btrfs 会用等级 3 的 `zstd` 算法压缩所有写入磁盘的数据。 一个重要的注意事项是挂载一个有很多数据并开启压缩的 Btrfs 文件系统会比没开启压缩耗时更长。这是有技术上的原因的,而且这是一个不会影响文件系统操作的正常行为。 ### 总结 本文详细介绍了 Btrfs 中的透明文件系统压缩。这是一种内置的、相对廉价的方法,可以在不需要修改的情况下从现有硬件中获得一些额外的存储空间。 本系列文章的下一篇将讨论: * Qgroups - 限制文件系统大小 * RAID - 替换 mdadm 配置 (LCTT 译注:后继文章尚未发布,一旦发布我们会尽快翻译。) 如果你想了解与 Btrfs 相关的其他主题,请查看 Btrfs 维基 <sup class="footnote-ref"> <a href="#fn1" id="fnref1"> [1] </a></sup> 和文档 <sup class="footnote-ref"> <a href="#fn2" id="fnref2"> [2] </a></sup>。如果你还没有阅读本系列的前三篇文章,请不要忘记去看看!如果你觉得本文缺少某些内容,请在下面的评论中让我知道。我们下篇文章见! ### 参考资料 1. <https://btrfs.wiki.kernel.org/index.php/Main_Page> [↩︎](#fnref1) 2. <https://btrfs.readthedocs.io/en/latest/Introduction.html> [↩︎](#fnref2) *(题图:MJ/1a45064c-8da5-4b60-87f2-9886d6a3299e)* --- via: <https://fedoramagazine.org/working-with-btrfs-compression/> 作者:[Andreas Hartmann](https://fedoramagazine.org/author/hartan/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[A2ureStone](https://github.com/A2ureStone) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
This article will explore transparent filesystem compression in Btrfs and how it can help with saving storage space. This is part of a series that takes a closer look at Btrfs, the default filesystem for Fedora Workstation, and Fedora Silverblue since Fedora Linux 33. In case you missed it, here’s the previous article from this series: [https://fedoramagazine.org/working-with-btrfs-snapshots](https://fedoramagazine.org/working-with-btrfs-snapshots) ## Introduction Most of us have probably experienced running out of storage space already. Maybe you want to download a large file from the internet, or you need to quickly copy over some pictures from your phone, and the operation suddenly fails. While storage space is steadily becoming cheaper, an increasing number of devices are either manufactured with a fixed amount of storage or are difficult to extend by end-users. But what can you do when storage space is scarce? Maybe you will resort to cloud storage, or you find some means of external storage to carry around with you. In this article I’ll investigate another solution to this problem: transparent filesystem compression, a feature built into Btrfs. Ideally, this will solve your storage problems while requiring hardly any modification to your system at all! Let’s see how. ## Transparent compression explained First, let’s investigate what *transparent* compression means. You can compress files with compression algorithms such as gzip, xz, or bzip2. This is usually an explicit operation: You take a compression utility and let it operate on your file. While this provides space savings, depending on the file content, it has a major drawback: When you want to access the file to read or modify it, you have to decompress it first. This is not only a tedious process, but also temporarily defeats the space savings you had achieved previously. Moreover, you end up (de)compressing parts of the file that you didn’t intend to touch in the first place. Clearly there is something better than that! Transparent compression on the other hand takes place at the filesystem level. Here, compressed files still look like regular uncompressed files to the user. However, they are stored with compression applied on disk. This works because the filesystem selectively decompresses only the parts of a file that you access and makes sure to compress them again as it writes changes to disk. The compression here is transparent in that it isn’t noticeable to the user, except possibly for a small increase in CPU load during file access. Hence, you can apply this to existing systems without performing hardware modifications or resorting to cloud storage. ## Comparing compression algorithms Btrfs offers multiple compression algorithms to choose from. For technical reasons it cannot use arbitrary compression programs. It currently supports: - zstd - lzo - zlib The good news is that, due to how transparent compression works, you don’t have to install these programs for Btrfs to use them. In the following paragraphs, you will see how to run a simple benchmark to compare the individual compression algorithms. In order to perform the benchmark, however, you must install the necessary executables. There’s no need to keep them installed afterwards, so you’ll use a podman container to make sure you don’t leave any traces in your system. **Note**: *Since the compression used by Btrfs relies on an in-kernel (re)implementation of these compression algorithms, the results from these user-space versions of the algorithms should be considered rough approximations.* Because typing the same commands over and over is a tedious task, I have prepared a ready-to-run bash script that is hosted on Gitlab ([https://gitlab.com/hartang/btrfs-compression-test](https://gitlab.com/hartang/btrfs-compression-test)). This will run a single compression and decompression with each of the above-mentioned algorithms at varying compression levels. First, download the script: $ curl -LO https://gitlab.com/hartang/btrfs-compression-test/-/raw/main/btrfs_compression_test.sh Next, spin up a Fedora Linux container that mounts your current working directory so you can exchange files with the host and run the script in there: $ podman run --rm -it --security-opt label=disable -v "$PWD:$PWD" \ -w "$PWD" registry.fedoraproject.org/fedora:37 Finally run the script with: $ chmod +x ./btrfs_compression_test.sh $ ./btrfs_compression_test.sh The output on my machine looks like this: [INFO] Using file 'glibc-2.36.tar' as compression target [INFO] Target file 'glibc-2.36.tar' not found, downloading now... ################################################################### 100.0% [ OK ] Download successful! [INFO] Copying 'glibc-2.36.tar' to '/tmp/tmp.vNBWYg1Vol/' for benchmark... [INFO] Installing required utilities [INFO] Testing compression for 'zlib' Level | Time (compress) | Compression Ratio | Time (decompress) -------+-----------------+-------------------+------------------- 1 | 0.322 s | 18.324 % | 0.659 s 2 | 0.342 s | 17.738 % | 0.635 s 3 | 0.473 s | 17.181 % | 0.647 s 4 | 0.505 s | 16.101 % | 0.607 s 5 | 0.640 s | 15.270 % | 0.590 s 6 | 0.958 s | 14.858 % | 0.577 s 7 | 1.198 s | 14.716 % | 0.561 s 8 | 2.577 s | 14.619 % | 0.571 s 9 | 3.114 s | 14.605 % | 0.570 s [INFO] Testing compression for 'zstd' Level | Time (compress) | Compression Ratio | Time (decompress) -------+-----------------+-------------------+------------------- 1 | 0.492 s | 14.831 % | 0.313 s 2 | 0.607 s | 14.008 % | 0.341 s 3 | 0.709 s | 13.195 % | 0.318 s 4 | 0.683 s | 13.108 % | 0.306 s 5 | 1.300 s | 11.825 % | 0.292 s 6 | 1.824 s | 11.298 % | 0.286 s 7 | 2.215 s | 11.052 % | 0.284 s 8 | 2.834 s | 10.619 % | 0.294 s 9 | 3.079 s | 10.408 % | 0.272 s 10 | 4.355 s | 10.254 % | 0.282 s 11 | 6.161 s | 10.167 % | 0.283 s 12 | 6.670 s | 10.165 % | 0.304 s 13 | 12.471 s | 10.183 % | 0.279 s 14 | 15.619 s | 10.075 % | 0.267 s 15 | 21.387 s | 9.989 % | 0.270 s [INFO] Testing compression for 'lzo' Level | Time (compress) | Compression Ratio | Time (decompress) -------+-----------------+-------------------+------------------- 1 | 0.447 s | 25.677 % | 0.438 s 2 | 0.448 s | 25.582 % | 0.438 s 3 | 0.444 s | 25.582 % | 0.441 s 4 | 0.444 s | 25.582 % | 0.444 s 5 | 0.445 s | 25.582 % | 0.453 s 6 | 0.438 s | 25.582 % | 0.444 s 7 | 8.990 s | 18.666 % | 0.410 s 8 | 34.233 s | 18.463 % | 0.405 s 9 | 41.328 s | 18.450 % | 0.426 s [INFO] Cleaning up... [ OK ] Benchmark complete! It is important to note a few things before making decisions based on the numbers from the script: - Not all files compress equally well. Modern multimedia formats such as images or movies compress their contents already and don’t compress well beyond that. - The script performs each compression and decompression exactly once. Running it repeatedly on the same input file will generate slightly different outputs. Hence, the times should be understood as estimates, rather than an exact measurement. Given the numbers in my output, I decided to use the zstd compression algorithm with compression level 3 on my systems. Depending on your needs, you may want to choose higher compression levels (for example, if your storage devices are comparatively slow). To get an estimate of the achievable read/write speeds, you can divide the source archives size (about 260 MB) by the (de)compression times. The compression test works on the GNU libc 2.36 source code by default. If you want to see the results for a custom file, you can give the script a file path as the first argument. Keep in mind that the file must be accessible from inside the container. Feel free to read the script code and modify it to your liking if you want to test a few other things or perform a more detailed benchmark! ## Configuring compression in Btrfs Transparent filesystem compression in Btrfs is configurable in a number of ways: - As mount option when mounting the filesystem (applies to all subvolumes of the same Btrfs filesystem) - With Btrfs file properties - During *btrfs filesystem defrag*(not permanent, not shown here) - With the *chattr*file attribute interface (not shown here) I’ll only take a look at the first two of these. ### Enabling compression at mount-time There is a Btrfs mount option that enables file compression: $ sudo mount -o compress=<ALGORITHM>:<LEVEL> ... For example, to mount a filesystem and compress it with the *zstd* algorithm on level 3, you would write: $ sudo mount -o compress=zstd:3 ... Setting the compression level is optional. It is important to note that the *compress* mount option applies to the whole Btrfs filesystem and all of its subvolumes. Additionally, it is the only currently supported way of specifying the compression level to use. In order to apply compression to the root filesystem, it must be specified in */etc/fstab*. The Fedora Linux Installer, for example, enables *zstd* compression on level 1 by default, which looks like this in */etc/fstab*: $ cat /etc/fstab [ ... ] UUID=47b03671-39f1-43a7-b0a7-db733bfb47ff / btrfs subvol=root,compress=zstd:1,[ ... ] 0 0 ### Enabling compression per-file Another way of specifying compressions is via Btrfs filesystem properties. To read the compression setting for any file, folder or subvolume, use the following command: $ btrfs property get <PATH> compression Likewise, you can configure compression like this: $ sudo btrfs property set <PATH> compression <VALUE> For example, to enable *zlib* compression for all files under */etc*: $ sudo btrfs property set /etc compression zlib You can get a list of supported values with *man btrfs-property*. Keep in mind that this interface doesn’t allow specifying the compression level. In addition, if a compression property is set, it overrides other compression configured at mount time. ## Compressing existing files At this point, if you apply compression to your existing filesystem and check the space usage with *df* or similar commands, you will notice that nothing has changed. That is because Btrfs, by itself, doesn’t “recompress” all your existing files. Compression will only take place when writing new data to disk. There are a few ways to perform an explicit recompression: - Wait and do nothing: As files are modified and written back to disk, Btrfs compresses the newly written file contents as configured. At some point, if we wait long enough, an increasing part of our files are rewritten and, hence, compressed. - Move files to a different filesystem and back again: Depending on which files you want to apply compression to, this can become a rather tedious operation. - Perform a Btrfs defragmetation The last option is probably the most convenient, but it comes with a caveat on Btrfs filesystems that already contain snapshots: it will break shared extent between snapshots. In other words, all the shared content between two snapshots, or a snapshot and its’ parent subvolume, will be present multiple times after a defrag operation. Hence, if you already have a lot of snapshots on your filesystem, you shouldn’t run a defragmentation on the whole filesystem. This isn’t necessary either, since with Btrfs you can defragment specific directories or even single files, if you wish to do so. You can use the following command to perform a defragmentation: $ sudo btrfs filesystem defragment -r /path/to/defragment For example, you can defragment your home directory like this: $ sudo btrfs filesystem defragment -r "$HOME" In case of doubt it’s a good idea to start with defragmenting individual large files and continuing with increasingly large directories while monitoring free space on the file system. ## Measuring filesystem compression At some point, you may wonder just *how much* space you have saved thanks to file system compression. But how do you tell? First, to tell if a Btrfs filesystem is mounted with compression applied, you can use the following command: $ findmnt -vno OPTIONS /path/to/mountpoint | grep compress If you get a result, the filesystem at the given mount point is using compression! Next, the command *compsize* can tell you how much space your files need: $ sudo compsize -x /path/to/examine On my home directory, the result looks like this: $ sudo compsize -x "$HOME" Processed 942853 files, 550658 regular extents (799985 refs), 462779 inline. Type Perc Disk Usage Uncompressed Referenced TOTAL 81% 74G 91G 111G none 100% 67G 67G 77G zstd 28% 6.6G 23G 33G The individual lines tell you the “Type” of compression applied to files. The “TOTAL” is the sum of all the lines below it. The columns, on the other hand, tell you how much space our files need: - “Disk Usage” is the actual amount of storage allocated on the hard drive, - “Uncompressed” is the amount of storage the files would need without compression applied, - “Referenced” is the total size of all uncompressed files added up. “Referenced” can differ from the numbers in “Uncompressed” if, for example, one has deduplicated files previously, or if there are snapshots that share extents. In the example above, you can see that 91 GB worth of uncompressed files occupy only 74 GB of storage on my disk! Depending on the type of files stored in a directory and the compression level applied, these numbers can vary significantly. ## Additional notes about file compression Btrfs uses a heuristic algorithm to detect compressed files. This is done because compressed files usually do not compress well, so there is no point in wasting CPU cycles in attempting further compression. To this end, Btrfs measures the compression ratio when compressing data before writing it to disk. If the first portions of a file compress poorly, the file is marked as incompressible and no further compression takes place. If, for some reason, you want Btrfs to compress all data it writes, you can mount a Btrfs filesystem with the *compress-force* option, like this: $ sudo mount -o compress-force=zstd:3 ... When configured like this, Btrfs will compress all data it writes to disk with the *zstd* algorithm at compression level 3. An important thing to note is that a Btrfs filesystem with a lot of data and compression enabled may take a few seconds longer to mount than without compression applied. This has technical reasons and is normal behavior which doesn’t influence filesystem operation. ## Conclusion This article detailed transparent filesystem compression in Btrfs. It is a built-in, comparatively cheap, way to get some extra storage space out of existing hardware without needing modifications. The next articles in this series will deal with: - Qgroups – Limiting your filesystem size - RAID – Replace your mdadm configuration If there are other topics related to Btrfs that you want to know more about, have a look at the Btrfs Wiki [[1]](#sources) and Docs [[2]](#sources). Don’t forget to check out the first three articles of this series, if you haven’t already! If you feel that there is something missing from this article series, let me know in the comments below. See you in the next article! ## Sources [1]: [https://btrfs.wiki.kernel.org/index.php/Main_Page](https://btrfs.wiki.kernel.org/index.php/Main_Page) [2]: [https://btrfs.readthedocs.io/en/latest/Introduction.html](https://btrfs.readthedocs.io/en/latest/Introduction.html) ## M.J.G. Note that the “btrfs-compression-test” does not test btrfs-compression at all. It tests the methods which btrfs-compression supports, but as implemented in the external binaries (not in btrfs/the kernel), on a file tree (not on btrfs fs chunks). They may or may not use the exact same algorithm. In particular, they may or may not use the same optimizations on your platform. Or do they happen to rely on the same code base? ## Andreas Hartmann You’re raising a good point, and your observation is entirely correct, thank you! As far as I know, the compression used by Btrfs relies on an in-kernel (re)implementation of said compression algorithms. I’m not aware that they share the same codebase. I’ll get in touch with the editors to update the text to reflect this. Nonetheless, I think the “btrfs-compression-test” is a reasonable “utility” to determine suitable compression levels beforehand. Anyone interested in an exact test will have to create an empty Btrfs filesystem, preferrably on the same disk they intend to use it later on, mount this filesystem with the desired compression, fill it with some data and gather the relevant numbers with some other tools. ## Federico Hi! why didn’t you choose zstd:4? if I’m reading your results correctly, zstd:4 is both faster and more space efficient than zstd:3. [INFO] Testing compression for ‘zstd’ Level | Time (compress) | Compression Ratio | Time (decompress) 3 | 0.709 s | 13.195 % | 0.318 s 4 | 0.683 s | 13.108 % | 0.306 s ## Andreas Hartmann I must have misread something when I ran the benchmark the first time. You’re right, thank you for raising this! ## Irgendeiner I would not dare to use compression because IMHO it has not been tested thoroughly. ## anchorinie Compressed directories with chattr. Although mentioned but not described in the article, that’s I’ve been using (from Fedora 35 to 37). It felt scary to use compression on full /home mount, but I decided it’s safe to compress my “Programming” directory – files are under source control there so no big risk on data loss. As I work with Javascript – I have dozens of projects with huge node_modules directories. They compress so well with btrfs and the experience is seamless. I think next install I would enable compression for the whole volume. ## konradmb Compression has been turned on by default since Fedora 34: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression I’d argue, that this is a thorough test, better than automatic tests. ## Tilmann Bubeck Have you checked, how btrfs compression works on really large files, that are only partially read/written? E.g. large database files or vm diskimages? I am wondering, if btrfs decompresses the whole file before using it or if it is also able to decompress only used parts “in the middle” of the file? ## Federico this is covered in the first lines of the article: “This works because the filesystem selectively decompresses only the parts of a file that you access and makes sure to compress them again as it writes changes to disk.” ## Jesse have they actually fixed the RAID support? ## ArtūrasB. Review from last year still shows rough edges of RAID situation in BTRFS – https://arstechnica.com/gadgets/2021/09/examining-btrfs-linuxs-perpetually-half-finished-filesystem/. There are some fixes in the kernel 6.2 (https://kernelnewbies.org/Linux_6.2#Btrfs_RAID5.2F6_and_performance_improvements), but I’m in doubt that this will resolve all major reliability issues. MD RAID or ZFS are still the best solution if stability, reliability and maintainability are top priorities for your data on filesystems. ## Erkki Ruohtula A compressing file system is a win when you have lots of compressible files, such as source code or plain-text documents (including various markup formats). Unfortunately most of the largest files I have are media files (images, audio and video files) that are already compressed with some algorithm tuned for the kind of data they contain, and the general-purpose compression algorithms that btrfs uses cannot squeeze them any further. It also cannot compress already-compressed archives such as zip and tar.gz. This also includes LibreOffice documents that are implemented as XML files packed into zip archives. Something to keep in mind when deciding whether to use the compression feature. ## Kenric Young Hi, I had some confusion trying to understand that bash scripts results. I made my life easier making some changes to it and decided to push a merge request to the gitlab.
16,300
Ubuntu MATE 23.10 发布: 一个适度的升级
https://news.itsfoss.com/ubuntu-mate-23-10/
2023-10-19T16:03:01
[ "Ubuntu MATE", "Ubuntu 23.10", "Ubuntu" ]
https://linux.cn/article-16300-1.html
![](/data/attachment/album/202310/19/160226cp45xfznfzw2xjj0.jpg) > > Ubuntu MATE 23.10 发布了! > > > 在所有的 Ubuntu 版本中,Ubuntu MATE 的升级总是非常有趣的。 不过,最近发布的 Ubuntu MATE 决定坚持小幅改动,并进行预期的软件包升级和修复。你可能知道为什么! **对于不了解的读者**:这是为了开发我们去年报道过的 [计划中的 Debian MATE 定制版](/article-15119-1.html)。 说到这里,让我重点介绍一下这些变化。 > > ? Ubuntu MATE 23.10 将支持**九个月,直至 2024 年 7 月**。 > > > ### Ubuntu MATE 23.10:有什么新功能? ![](/data/attachment/album/202310/19/160302pia1le1berkyy0nq.jpg) Ubuntu MATE 23.10 受益于 [Ubuntu 23.10](https://news.itsfoss.com/ubuntu-23-10/) 推出的所有好东西。 此外,这里还有一些改进: * MATE 桌面更新至 v1.26.2。 * 添加更多人工智能生成的壁纸。 * 应用更新。 #### MATE 桌面升级 在最新的 MATE 桌面 1.26.2 中,你将获得大量错误修复和一些小的改进。 升级包括以下内容: * 更新 MATE 用户指南 v1.26.2-1 * 改进门户支持 * 改进系统监视器,以便从 `/usr/libexec` 获取 `libexec` 文件 * 修正 MATE 会话管理器,使其更好地与系统监视器配合使用 * mate-utils 1.26.1-1 修复了内存泄漏问题 #### 额外的人工智能生成的壁纸 ![](/data/attachment/album/202310/19/160303h4p4vs2qv4jv4mq4.jpg) 虽然你已经可以从 [Ubuntu 23.10 更新合集](https://ubuntu.com/blog/into-the-labyrinth) 中下载一些有趣的壁纸,但在这里你还能获得额外的壁纸(如上面的截图所示)。 Simon Butcher 是使用前沿的 Diffusion 模型制作这款壁纸的人,他提到: > > 由于牛头人是一种想象中的生物,因此对其的解释往往千差万别。我想制作一个具有漫画小说风格的强大生物图像,尽管不像许多描述那样令人毛骨悚然。 > > > 最新开源的 Stable Diffusion XL 基本模型在更高分辨率下进行了训练,质量上的差异非常明显,尤其是在整体一致性和细节方面,同时减少了图像中的解剖不规则性。图像是使用 Linux 和英伟达 A100 80GB GPU 在本地制作的,从最初的文本提示开始,使用 img2img、修复和放大功能进行完善。 > > > #### Linux 内核 6.5 当然,[Linux 内核 6.5](https://news.itsfoss.com/linux-kernel-6-5-release/) 还能为硬件带来更好的兼容性、新代组件和其他改进。 ![](/data/attachment/album/202310/19/160303ghkhlln62h9ng7g3.jpg) #### 其他改进 主要的应用程序升级包括 [Firefox 118](https://news.itsfoss.com/firefox-118-release/)、Celluloid 0.25、Evolution 3.50 和 LibreOffice 7.6.1。 所有这些都将改善用户体验。 ### ? 获取 Ubuntu MATE 23.10 你可以从 [官方网站](https://ubuntu-mate.org/download/) 或 [Ubuntu 仓库](https://cdimage.ubuntu.com/ubuntu-mate/releases/23.10/) 下载 Ubuntu MATE 23.10 ISO。 > > **[Ubuntu MATE 23.10](https://cdimage.ubuntu.com/ubuntu-mate/releases/23.10/release/)** > > > 如果你是现有用户并希望升级,请按照 [发布说明](https://ubuntu-mate.org/blog/ubuntu-mate-lunar-lobster-release-notes/) 中的官方说明进行操作。 *(题图:[Ubuntu Mate](https://ubuntu-mate.org/blog/ubuntu-mate-mantic-minotaur-release-notes/))* --- via: <https://news.itsfoss.com/ubuntu-mate-23-10/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Among all the Ubuntu flavours, the Ubuntu MATE upgrade is always an interesting one. However, recent Ubuntu MATE releases have decided to stick to minor changes, with the expected package upgrades and fixes. And, you probably know why! **For readers unaware**: it is because of the [planned Debian's MATE spin](https://news.itsfoss.com/ubuntu-mate-debian/) that we covered last year. With that being said, let me highlight the changes. **nine**months until **July 2024**. ## Ubuntu MATE 23.10: What's New? ![ubuntu mate 23.10](https://news.itsfoss.com/content/images/2023/10/ubuntu-mate-23-10.jpg) Ubuntu MATE 23.10 benefits from all the goodies introduced with [Ubuntu 23.10](https://news.itsfoss.com/ubuntu-23-10/). Moreover, here are a couple of refinements: **MATE Desktop updated to v1.26.2****More AI-generated wallpapers added****Application updates** **Suggested Read **📖 [Ubuntu 23.10: Release Date and New FeaturesUbuntu’s next latest and greatest. Here’s what it is expected to pack in.](https://news.itsfoss.com/ubuntu-23-10/)![](https://news.itsfoss.com/content/images/2023/08/ubuntu-23-10-release-ft.png) ![](https://news.itsfoss.com/content/images/2023/08/ubuntu-23-10-release-ft.png) ### MATE Desktop Upgrades With the latest MATE Desktop 1.26.2, you get a slew of bug fixes and some minor improvements. The upgrades involve the following: - Updated MATE user guide v1.26.2-1 - Improved portals support - Improvement to the system monitor to pick up libexec files from /usr/libexec - Fixes to the MATE session manager to work with system monitor better - mate-utils 1.26.1-1 fixes memory leaks ### Another AI-generated Wallpaper ![ubuntu mate 23.10 new wallpaper](https://news.itsfoss.com/content/images/2023/10/ubuntu-mate-23-10-new-wall.jpg) While you can already download some interesting wallpapers from the [Ubuntu 23.10 updated collection](https://ubuntu.com/blog/into-the-labyrinth?ref=news.itsfoss.com), you get an extra here (as shown in the screenshot above). Simon Butcher, the one who created this using bleeding-edge diffusion models, mentions: Since Minotaurs are imaginary creatures, interpretations tend to vary widely. I wanted to produce an image of a powerful creature in a graphic novel style, although not gruesome like many depictions. The latest open source Stable Diffusion XL base model was trained at a higher resolution and the difference in quality has been noticeable, particularly at better overall consistency and detail, while reducing anatomical irregularities in images. The image was produced locally using Linux and an NVIDIA A100 80GB GPU, starting from an initial text prompt and refined using img2img, inpainting and upscaling features. ### Linux Kernel 6.5 Of course, with [Linux Kernel 6.5](https://news.itsfoss.com/linux-kernel-6-5-release/), you can expect better hardware compatibility with new gen components and other improvements. ![ubuntu mate 23.10 neofetch](https://news.itsfoss.com/content/images/2023/10/ubuntu-mate-23-10-neofetch.jpg) [Linux Kernel 6.5 Released With Initial Support for Wi-Fi 7 and USB4The Linux Kernel 6.5 has dropped with nice improvements. Check it out here.](https://news.itsfoss.com/linux-kernel-6-5-release/)![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ### Other Improvements The major app upgrades include [Firefox 118](https://news.itsfoss.com/firefox-118-release/), Celluloid 0.25, Evolution 3.50, and LibreOffice 7.6.1. All of this should improve the user experience. ## 📥 Getting Ubuntu MATE 23.10 You can download Ubuntu MATE 23.10 ISO from the[ official website](https://ubuntu-mate.org/download/?ref=news.itsfoss.com) or [Ubuntu's repository](https://cdimage.ubuntu.com/ubuntu-mate/releases/23.10/?ref=news.itsfoss.com). If you are an existing user and want to upgrade, follow the official instructions in the [release notes](https://ubuntu-mate.org/blog/ubuntu-mate-lunar-lobster-release-notes/?ref=news.itsfoss.com). ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,303
Tor 浏览器 13.0 发布
https://news.itsfoss.com/tor-browser-13-0-release/
2023-10-21T05:57:00
[ "Tor 浏览器" ]
https://linux.cn/article-16303-1.html
![](/data/attachment/album/202310/21/055646urkd0upcknv0znv5.jpg) > > 通过新的 Tor 浏览器更新提升你的私人网络体验! > > > Tor 浏览器是访问 [Tor 网络](https://en.wikipedia.org/wiki/Tor_(network)) 的流行方式之一,它一直是许多想要规避对其施加的限制的人的首选,甚至是那些注重隐私的人的首选。 当然,使用 Tor 浏览器是最简单的 [提高隐私的方法](https://itsfoss.com/improve-privacy/)。 虽然 Tor 浏览器基于 Mozilla Firefox,但它也进行了一些调整。 在最新的主要更新中,让我们看看发生了什么变化。 ### ? Tor 浏览器 13.0:有什么新变化? ![](/data/attachment/album/202310/21/055722r003l3k2y1l45yvj.png) 据开发人员介绍,Tor 浏览器 13.0 基于 [Firefox ESR 115](https://www.mozilla.org/en-US/firefox/115.0esr/releasenotes/),并带来了一年的推送到上游的修改。 过渡到较新的 Firefox 版本还**允许他们利用 [Firefox 113](https://www.mozilla.org/en-US/firefox/113.0/releasenotes/) 中引入的改进的辅助功能引擎**。 因此,使用屏幕阅读器等**辅助技术**的用户现在可以在使用 Tor 浏览器时获得**比以往更好的性能**。 此版本的亮点包括: * 改进的 “<ruby> 信封打印 <rt> Letterboxing </rt></ruby>” 功能 * 更新主页 * 更新徽标 #### 改进的 “<ruby> 信封打印 <rt> Letterboxing </rt></ruby>” 功能 ![](/data/attachment/album/202310/21/055723gfk98ubdrwxajrx0.png) Tor 浏览器 13.0 版本中的 “<ruby> 信封打印 <rt> Letterboxing </rt></ruby>” 功能得到了重要更新。 (LCTT 译注:“<ruby> 信封打印 <rt> Letterboxing </rt></ruby>” 是一种网络浏览隐私保护技术,它通过为浏览器窗口添加白色填充(看起来像一个信封的周围),来防止网站跟踪你的浏览行为。当你改变浏览器窗口的大小时,“信封打印” 功能会在周边提供白色填充,确保窗口大小始终为特定的大众标准尺寸。这意味着即使你改变窗口大小,那些尝试通过窗口尺寸来跟踪你的网站也无法获取独特的信息。) 开发人员发现 **1000×1000 像素的默认 “信封打印” 尺寸**存在问题,许多现代网站无法正常运行,导致这些网站切换到适用于平板电脑和智能手机的布局。 有些网站甚至会显示桌面网站,但只有横向滚动条。为了解决这个问题,他们调整了**窗口的大小**,最大为 1400×900 像素。 对于最终用户来说,这意味着你无需手动调整窗口大小即可获得合适的尺寸。 他们还补充说: > > 桌面版 Tor 浏览器不应再在大屏幕上触发响应断点,并且我们的绝大多数桌面用户将看到熟悉的横向纵横比,更符合现代浏览器的要求。 > > > 通过计算,我们选择了这一特定尺寸,以便为新窗口提供更大的空间,同时又不会增加过多的桶数量。 > > > #### 更新了主页 ![](/data/attachment/album/202310/21/055724e9vr29h996jx44x9.png) Tor 浏览器主页的更新已经等了很长时间了。在此版本中,它展示了更新的徽标(更多内容见下文)以及一个新功能 —— **“洋葱化的” DuckDuckGo**,用于访问其 “.onion 站点”。 这也**与我之前提到的改进的辅助功能引擎**齐头并进,从而为屏幕阅读器和其他辅助技术的用户提供更好的支持。 他们还修复了可怕的“**红屏死亡**”错误,该错误在打开新的主页选项卡时偶尔会弹出。 #### 更新徽标 ![](/data/attachment/album/202310/21/055724l55jiz52ku7iuci0.png) 从文章的开头你就可能已经注意到 Tor 浏览器的徽标有些不同。 实际上,**Tor 浏览器所有版本的徽标都已更新**,外观更加干净和现代。 这个熟悉的“洋葱标志”已经存在了一段时间,它是由当时的社区民意调查选出的。很高兴看到他们仍在努力改进它。 这些只是该版本的主要亮点,你可以通过 [官方发行说明](https://blog.torproject.org/new-release-tor-browser-130/) 了解所有技术修复和其他改进。 ### ? 下载 Tor 浏览器 13.0 此版本的 Tor 浏览器适用于 **Linux**、**Windows**、**Android、** 和 **macOS**。你可以前往[官方网站](https://www.torproject.org/download/)获取你选择的套餐。 > > **[Tor 浏览器 13.0](https://www.torproject.org/download/)** > > > --- via: <https://news.itsfoss.com/tor-browser-13-0-release/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) The Tor Browser is one of the popular ways to access the [Tor network](https://en.wikipedia.org/wiki/Tor_(network)?ref=news.itsfoss.com), it has been the first choice for many who want to circumvent restrictions placed on them, or even those who are privacy-conscious. Of course, using Tor Browser is one of the easiest [ways to improve privacy](https://itsfoss.com/improve-privacy/?ref=news.itsfoss.com). While Tor Browser is based on Mozilla Firefox, it comes with its tweaks. With the latest major update, let's see what has changed. ## 🆕 Tor Browser 13.0: What's New? ![a screenshot of tor browser 13.0 about info](https://news.itsfoss.com/content/images/2023/10/Tor_Browser_13.0_1.png) According to the developers, Tor Browser 13.0 is here with a year's worth of changes that were pushed upstream and is based on **Firefox ESR 115****.** The transition to a newer Firefox release has also **allowed them to take advantage of the revamped accessibility engine** introduced with [Firefox 113](https://www.mozilla.org/en-US/firefox/113.0/releasenotes/?ref=news.itsfoss.com). So, users who use **assistive technologies** such as screen readers can now expect **better performance than ever before **when using Tor Browser. The highlights of this release include: **Improved Letterboxing****Updated Homepage****Refreshed Logos** **Suggested Read **📖 [How to Easily Install Tor Browser in Ubuntu and Other LinuxThis tutorial shows you how to install Tor browser in Ubuntu Linux. You’ll also learn a few tips around effectively using the Tor Browser. Privacy is one of the most discussed topics these days, from the NSA spying on citizens and governments alike to the Facebook data scandals. The](https://itsfoss.com/install-tar-browser-linux/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/wordpress/2014/07/install-tor-browser-on-linux.jpg) ![](https://itsfoss.com/content/images/wordpress/2014/07/install-tor-browser-on-linux.jpg) ### Improved Letterboxing ![a screenshot of tor browser 13.0 letterboxing a webpage](https://news.itsfoss.com/content/images/2023/10/Tor_Browser_13.0_2.png) The letterboxing feature has received an important update with the Tor Browser 13.0 release. The devs found **a problem with the default letterboxing dimensions** of 1000×1000 pixels where many modern websites would not behave correctly, resulting in those sites switching to layouts intended for tablets and smartphones. Some sites would even serve a desktop site, but with only a horizontal scroll bar. To tackle this issue, they **tweaked the size of the windows** to be a maximum of 1400×900 pixels. What this means for you, the end-user, is that you won't need to fiddle with the window sizes manually to get the right fit. They also added that: Tor Browser for desktop should no longer trigger responsive break points on larger screens, and the vast majority of our desktop users will see a familiar landscape aspect-ratio more in-keeping with modern browsers. This particular size was chosen by crunching the numbers to offer greater real estate for new windows without increasing the number of buckets past the point of their usefulness. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ### Updated Homepage ![a screenshot of tor browser 13.0 updated homepage with the onionize duckduckgo feature enabled](https://news.itsfoss.com/content/images/2023/10/Tor_Browser_13.0_3.png) An update to the homepage on the Tor Browser has been a long time coming. With this release, it now showcases a refreshed logo (more on that below) and **a new feature to “Onionize” DuckDuckGo** for accessing its '.onion site'. This also **goes hand-in-hand with the revamped accessibility engine** that I mentioned earlier, allowing better support for users of screen readers and other assistive technology. They also fixed the dreaded “**red screen of death**” error that would pop up once in a while when opening a new homepage tab. ### Refreshed Logos ![a screenshot of the updated logos that have arrived with tor browser 13.0](https://news.itsfoss.com/content/images/2023/10/Tor_Browser_13.0_4.png) Since the beginning of the article, you may have noticed something different about Tor Browser's logo. Well, the **logos for all the builds of Tor Browser have been refreshed** with a more clean and modern look. This familiar “onion logo” has been around for a while now, it was chosen by a community poll back in the day. It's nice to see that they are still putting in efforts to improve it. These were just the key highlights of the release, you can go through the [official release notes](https://blog.torproject.org/new-release-tor-browser-130/?ref=news.itsfoss.com) to explore all the technical fixes and other refinements. **Suggested Read **📖 [11 Ways to Improve Your Privacy in Online WorldBring your A game to improve your privacy online, whether you are a Linux user or not. Follow these tips for a secure experience!](https://itsfoss.com/improve-privacy/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/04/ways-to-enhance-your-privacy.png) ![](https://itsfoss.com/content/images/2023/04/ways-to-enhance-your-privacy.png) ## 📥 Download Tor Browser 13.0 This release of the Tor browser is available for **Linux**, **Windows**, **Android, **and **macOS**. You can head over to the [official website](https://www.torproject.org/download/?ref=news.itsfoss.com) to get the package of your choice. ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,304
终端基础:Linux 终端中的目录切换
https://itsfoss.com/change-directories/
2023-10-21T06:23:00
[ "终端" ]
https://linux.cn/article-16304-1.html
![](/data/attachment/album/202310/21/062234mz9zymqc6om5924m.jpg) > > 本篇文章作为终端基础教程系列的一部分,介绍如何在 Linux 命令行中,利用绝对路径和相对路径实现目录切换。 > > > Linux 的 `cd` 命令让你可以轻松切换文件夹(即目录)。只需提供你要切换到的文件夹路径即可。 ``` cd path_to_directory ``` 然而对于 Linux 新人来说,可能会在路径的指定上有所困扰。 首先,让我们解决这个问题。 ### 理解 Linux 中的路径 在 Linux 文件系统中,路径是用来追踪文件位置的信息。所有的路径都从根目录开始,然后向下延伸。 你可以通过下面的方式查看当前所在的位置: ``` pwd ``` 结果可能是类似于 `/home/username` 的输出。注意,这里的 `username` 将会是你自己的用户名。 你可以注意到,路径是由 `/` 符号和目录名组成的。比如路径 `/home/abhishek/scripts`, 表示 `scripts` 是在文件夹 `abhishek` 之内,而文件夹 `abhishek` 在 `home` 文件夹之内。要注意,第一个 '/' 是指根目录(即文件系统的开始处),后面的 '/' 则作为目录的分隔符。 ![Path in Linux](/data/attachment/album/202310/21/062343zsnpchp9xhvss1f1.jpg) > > ?️ 在终端中键入 `ls /`,然后按回车。你将会看到根目录下的所有内容,试试看! > > > 接下来,让我们学习两种常见的路径指定方式:绝对路径和相对路径。 **绝对路径**:这种路径从根开始,然后一直扩展到你需要的位置。如果一个路径是以 `/` 开头,那就说明它是一个绝对路径。 **相对路径**:这是相对于你文件系统中当前位置的路径。如果我当前位置在 `/home/abhishek`,并且我需要去 `/home/abhishek/Documents`, 我只需要简单地切换到 `Documents`,而不需要指定整个绝对路径 `/home/abhishek/Documents`。 在我演示这两种路径的区别之前,有必要先熟悉两个特殊的目录标识: * `.` (单点)表示当前目录。 * `..` (双点)表示上一级目录,也就是当前目录的母目录。 这里有一张图形化的表示。 ![Absolute path vs relative path](/data/attachment/album/202310/21/062310gindi5il5nai31wn.png) ### 利用 cd 命令变更目录 在你已对路径概念有所了解之后,我们来了解如何切换目录。 > > ?️ 如果你**仅键入 `cd` 并按回车键**,无论当前位置在哪,系统都会将你带回主目录。试一试吧。 > > > 敲入以下命令,你就能看到主目录里的所有文件夹: ``` ls ``` 这是我看到的情况: ``` abhishek@ituxedo:~$ ls Desktop Downloads Pictures Templates VirtualBoxVMs Documents Music Public Videos ``` 你的情况可能与此类似,但未必完全一样。 假如你希望跳转到 `Documents` 文件夹。由于它就在当前目录下,这里使用相对路径会比较方便: ``` cd Documents ``` > > ? 注意,大部分 Linux 发行版预设的终端模拟器会在提示符本身显示出当前所在的位置。因此你不必频繁使用 `pwd` 指令来确认自己的位置。 > > > ![Most Linux terminal prompts show the current location](/data/attachment/album/202310/21/062310mvnh4h8j4a0ke4t0.png) 假如你希望切换到位于主目录里的 `Templates` 文件夹。 你可以使用相对路径 `../Templates`(`..` 会让你返回到上层目录,即 `/home/username`,然后你就可以进入 `Templates` 文件夹了)。 但这次我们尝试使用绝对路径。请把下面的 `abhishek` 替换成你的用户名。 ``` cd /home/abhishek/Templates ``` 此刻你已经在 `Templates` 文件夹里了。如何前往 `Downloads` 文件夹呢?这次我们再使用相对路径: ``` cd ../Downloads ``` 下面的图片会回顾一下你刚才学到的所有或有关目录切换的范例。 ![cd command example](/data/attachment/album/202310/21/062310xubbv2xbjtuj2ndj.svg) > > ? 别忘了你还可以使用终端的 `tab` 键自动补全功能。只需要键入命令或者文件夹名称的前几个字母,然后敲击 `tab` 键,系统就会尝试自动地补全命令或文件夹名称,或者给你显示出所有可能的选项。 > > > ### 故障解决 在 Linux 终端操作切换目录的过程中,你可能会遇到一些常见的错误。 #### 文件或目录不存在 如果在你尝试切换目录时,出现类似下面的错误信息: > > bash: cd: directory\_name: No such file or directory > > > 那么你可能在路径或目录名称上犯了误解。这里有几点你需要注意的: * 请确定你输入的目录名中没有拼写错误。 * Linux 系统对大小写敏感,因此,`Downloads` 和 `downloads` 会被识别为不同的目录。 * 你可能未正确指定路径。可能你所在的位置与你预期的不同?或者你遗漏了绝对路径中的开头的 `/` 字符? ![Common examples of "no such file or directory" error](/data/attachment/album/202310/21/062311y022v9za82q2avdj.png) #### 非目录错误 如果你看到像下面这样的错误提示: > > bash: cd: filename: Not a directory > > > 这表示你尝试使用 `cd` 命令对一个文件进行操作,而不是一个目录(文件夹)。很明显,你不能像进入文件夹那样“进入”一个文件,因此会出现这样的错误。 ![Not a directory error with the cd command](/data/attachment/album/202310/21/062312ebxyo6he7de0eydx.png) #### 参数过多 这是 Linux 新手常犯的另一个错误: > > bash: cd: too many arguments > > > `cd` 命令只接受一个参数。也就是说,你只能对命令指定一个目录。 如果你指定了超过一个的参数,或者在路径中误加了空格,你就会看到这个错误。 ![Too many arguments error in Linux terminal](/data/attachment/album/202310/21/062312dl6g6xgxusl40ago.png) > > ?? 如果你输入 `cd -`,它将会把你带到前一个目录。当你在两个相隔较远的地方切换时非常方便,可以避免再次输入长路径。 > > > ### 特殊目录符号 在结束这个教程之前,我想快速告诉你关于特殊符号 `~`。在 Linux 中,`~` 是用户主目录的捷径。 如果用户 `abhi` 运行它,`~` 就会代表 `/home/abhi`,如果用户 `prakash` 运行,`~` 就意味着 `/home/prakash`。 总结一下你在这个基础教程系列中学到的所有特殊目录标识: | 符号 | 描述 | | --- | --- | | `.` | 当前目录 | | `..` | 上级目录 | | `~` | 主目录 | | `-` | 前一个目录 | ### 测试你的知识 下面是一些简单的练习,用来测试你刚刚学到的关于路径和 `cd` 命令的知识。 移动到你的主目录,并使用这个命令创建一个嵌套的目录结构: ``` mkdir -p sample/dir1/dir2/dir3 ``` 然后,一步步来试试这个: * 使用绝对路径或相对路径进入 `dir3` * 使用相对路径移动到 `dir1` * 使用你能想象到的最短路径进入 `dir2` * 使用绝对路径切换到 `sample` 目录 * 返回你的主目录 > > ? 想知道你是否全都做对了吗?欢迎分享你的答案。 > > > 现在你知道如何切换目录,是不是应该学习一下如何创建它们呢? 我强烈推荐你阅读这篇文章,了解一些关于终端和命令的小技巧。 如果你想了解 Linux 命令行的基础知识,记得关注我们的 Linux 终端基础系列教程的更多章节。 --- via: <https://itsfoss.com/change-directories/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lkxed](https://github.com/lkxed/) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
# Chapter 1: Changing Directories in Linux Terminal Learn how to change directories in the Linux command line using absolute and relative paths in this part of the Terminal Basics series. The [cd command in Linux](https://itsfoss.com/cd-command/) allows you to change directories. [Folders are called directories in Linux terms](https://itsfoss.com/folder-directory-linux/). You just have to give the path to the directory. `cd path_to_directory` And here comes the first challenge if you are new to Linux. You are probably not sure about the path. Let's tackle that first. ## Understanding paths in Linux The path traces the location in the Linux directory structure. Everything starts at the root and then goes from there. You can check your current location with the following: `pwd` It should show an output like /home/username. Of course, it will be your username. As you can see, paths are composed of / and directory names. Path `/home/abhishek/scripts` means the folder scripts is inside the folder `abhishek` , which is inside the folder `home` . The first `/` is for root (from where the filesystem starts), the trailing / are separators for the directories. ![Path in Linux](https://itsfoss.com/content/images/2023/02/path-linux.webp) `ls /` in the terminal and press enter. It will show you the content of the root directory. Try it.Now, there are two ways to specify a path: absolute and relative. **Absolute path**: It starts with the root and then traces the location from there. If a path starts with /, it is an absolute path. **Relative path**: This path originates from your current location in the filesystem. If I am in the location /home/abhishek and I have to go to /home/abhishek/Documents, I can simply go to Documents instead of specifying the absolute path /home/abhishek/Documents. Before I show you the difference between the two, you should get familiar with two special directory notations: - . (single dot) denotes the current directory. - .. (two dots) denote the parent directory taking you one directory above the current one. Here's a pictorial representation. ![Absolute path vs relative path](https://itsfoss.com/content/images/2023/11/relative-path-cd.png) Want more on paths in Linux? This article will help you. [Absolute vs Relative Path in Linux: What’s the Difference?In this essential Linux learning chapter, know about the relative and absolute paths in Linux. What’s the difference between them and which one should you use.](https://linuxhandbook.com/absolute-vs-relative-path/)![](https://linuxhandbook.com/content/images/2021/04/absolute-relative-path-linux.png) ![](https://linuxhandbook.com/content/images/2021/04/absolute-relative-path-linux.png) ## Changing directory with cd command Now that you are familiar with the concept of path, let's see how you can change the directory. **, it will take you to your home directory from any location. Go on, try it.** **just type cd and press enter**Enter the following command to see the directories inside your home directories: `ls` This is what it shows to me: ``` abhishek@ituxedo:~$ ls Desktop Downloads Pictures Templates VirtualBoxVMs Documents Music Public Videos ``` Yours may be similar but not exactly the same. Let's say you want to go to the Documents directory. Since it is available under the current directory, it will be easier to use the relative path here: `cd Documents` ![Most Linux terminal prompts show the current location](https://itsfoss.com/content/images/2023/02/linux-terminal-prompt.png) Now, let's say you want to switch to the Templates directory that was located in your home directory. You can use the relative path `../Templates` (.. takes you to the one directory above Documents to /home/username and from there you go to Templates). But let's go for the absolute path instead. Please change 'abhishek' with your username. `cd /home/abhishek/Templates` Now you are in the Templates directory. How about going to the Downloads directory? Use the relative path this time: `cd ../Downloads` Here's a replay of all the above directory change examples you just read. ## Troubleshooting You may encounter a few common errors while changing the directories in Linux terminal. ### No such file or directory If you see an error like this while changing the directories: bash: cd: directory_name: No such file or directory Then you made mistake with the path or name of the directories. Here are a few things to note. - Make sure there is no typo in the directory name. - Linux is case sensitive. Downloads and downloads are not the same. - You are not specifying the correct path. Perhaps you are in some other location? Or did you miss the first / in the absolute path? ![Common examples of "no such file or directory" error](https://itsfoss.com/content/images/2023/02/common-errors-with-cd.png) ### Not a directory If you see an error like this: bash: cd: filename: Not a directory It means that you are trying to use the cd command with a file, not a directory (folder). Clearly, you cannot enter a file the same way you enter a folder and hence this error. ![Not a directory error with the cd command](https://itsfoss.com/content/images/2023/02/not-a-directory-error-linux.png) ### Too many arguments Another common rookie Linux mistake: bash: cd: too many arguments The cd commands take only one argument. That means that you can only specify one directory to the command. If you specify more than one or mistyped a path by adding a space to the path, you'll see this error. ![Too many arguments error in Linux terminal](https://itsfoss.com/content/images/2023/02/too-many-arguments.png) `cd -` , it will take you to your previous directory. It's quite handy when you are switching between two distant locations. You don't have to type the long paths again.## Special directory notations Before ending this tutorial, let me quickly tell you about the special notation `~` . In Linux, ~ is a shortcut for the user's home directory. If user `abhi` is running it, ~ would mean `/home/abhi` and if user `prakash` was running it, it would mean `/home/prakash` . To summarize all the special directory notations you learned in this chapter of the terminal basics series: Notation | Description | ---|---| . | Current directory | .. | Parent directory | ~ | Home directory | - | Previous directory | ## 📝 Test your knowledge Here are a few simple exercises to test your newly learned knowledge of the path and the cd command. Move to your home directory and create a nested directory structure with this command: `mkdir -p sample/dir1/dir2/dir3` Now, try this one by one: - Go to the dir3 using either absolute or relative path - Move to dir1 using relative path - Now go to dir2 using the shortest path you can imagine - Change to the sample directory using absolute path - Go back to your home directory [share your answers in the It's FOSS Community](https://itsfoss.community/t/exercise-in-changing-directories-in-linux-terminal/10177). Now that you know how to change directories, how about you [learn about creating directories](https://itsfoss.com/make-directories/) as well? The next chapter of this series discusses that. And, of course, your feedback on this new series is welcome. What can I do to improve it?
16,306
Bitwarden 与 Proton Pass:顶级开源密码管理器的比较
https://itsfoss.com/bitwarden-vs-proton-pass/
2023-10-22T07:58:00
[ "密码管理器", "Bitwarden", "Proton Pass" ]
https://linux.cn/article-16306-1.html
![](/data/attachment/album/202310/22/075735dk7c6b4raibhkutq.jpg) > > 你最钟爱哪一个开源密码管理器? > > > Bitwarden 和 Proton Pass 是两个杰出的开源密码管理器。 Bitwarden 已经成为一个可靠的选择,运行稳定已经超过六年了,而 Proton Pass 则是较新的参与者。 你应该选哪一个呢?是**选择已被大众信任的密码管理器还是选择由以隐私为导向的 Proton 新开发的产品**? 我一直使用 Bitwarden 和带高级特性的 Proton Pass。主要使用的是 Bitwarden,但自 Proton Pass 推出后我也在试用它。 在这里,我会分享我对两者的使用体验,以及在选择密码管理器时需要了解的一些注意事项。 ### 应用场景和应用程序的可用性 选用密码管理器时,应用程序的可用情况和你的使用场景起着重要角色。 你需要提些问题给自己: * 我在哪些地方(如桌面、移动设备或网页浏览器)需要密码管理器? * 它有提供哪些额外功能? * 是否坚持使用一个服务满足多种功能需求? 我会在文章的后半部分详细阐述这些功能特性。但首先,你需要确定你想在哪里使用密码管理器,以及是否希望单独保持密码管理器服务。 #### Proton Pass 在编写本文时,Proton Pass 仅以 **浏览器扩展** 形式存在,同时提供给 **移动平台** 使用。 ![](/data/attachment/album/202310/22/075804r7b9ovxs77w7zv6x.jpg) 你可以为 **Mozilla Firefox、Google Chrome、Brave、Edge** 及其它基于 Chrome 的浏览器获取扩展。你也可以选择在你的 **安卓或 iOS** 设备上安装它。 ![](/data/attachment/album/202310/22/075804t79l9s944i8viv41.jpg) ✅ *如果你不需要桌面应用的密码管理器,同时希望继续使用 Proton 提供的全部服务,那么 Proton Pass 是一个适合的选择。* #### Bitwarden 反之,Bitwarden 可以作为 **桌面应用**,支持在 **Windows、 macOS、Linux** 上运行。 此外,你可以为 **Google Chrome、Firefox、Vivaldi, Opera、Edge、Tor 和 DuckDuckGo for Mac** 获取相应的扩展。 ![](/data/attachment/album/202310/22/075804a24fikbc9kfx32cf.jpg) 对于移动平台来说,Bitwarden 支持 iPhone、Apple Watch 和安卓手机。你也可以从 F-Droid 安装到安卓设备上。 还不仅限于这些,你可以将 Bitwarden 作为一款 **网页应用**,或通过 **命令行接口** 来使用。 ✅ *如果你需要一个能够在多个平台上无缝使用的密码管理器,那么 Bitwarden 就是你完美的选择。* ### 用户体验 #### Bitwarden Bitwarden 的用户体验简洁且低调。 以下是浏览器插件的界面样式: ![](/data/attachment/album/202310/22/075804k5oqbt0zzm5tfzas.jpg) 虽然用户界面随着年份的推移有所改进建,但始终忠于其核心理念,也就是 **注重简洁而不是华丽的 UI**。 它不会打扰你的操作,始终提供熟悉的用户体验。 ![](/data/attachment/album/202310/22/075804q80o7xkrgkx2klom.jpg) 你可以在预设的 “dark”、“light”、“solarized dark” 和 “nord” 主题间自由切换。 ![](/data/attachment/album/202310/22/075804cldc6mcipzlzd4di.jpg) 无论你正在使用桌面应用、移动应用还是浏览器扩展,它都能给你带来同样的便利。 #### Proton Pass Proton Pass 在其布局方面 **颇具特色** ,每次你访问该扩展时,它都会给出一个详细的凭证概览。 ![](/data/attachment/album/202310/22/075804it3mt4x3xo3y6i4w.jpg) 有些用户可能更倾向于 **现代化的 UI 处理方式**,这完全看你的个人喜好。 我个人更倾向于 Bitwarden 的传统设计方式。 ### 价格 你可以免费开始使用这两种服务。 Bitwarden 和 Proton Pass 在其免费计划中都不限制存储的登录凭证数量和可使用设备的数量。 如果你需要包括紧急访问、家庭共享、安全存储、二次验证、电子邮箱别名隐藏等特性,你需要升级为高级版。 ![](/data/attachment/album/202310/22/075804vjwha5ywmphfj332.jpg) [Bitwarden](https://bitwarden.com/pricing/) 的年费仅为 **10 美元**,而其家庭计划(*包含六个账户*)的年费为 **40 美元**。这个价格对大多数人来说是**极其实惠**的。 相比之下,[Proton Pass](https://account.proton.me/pass/signup) 的价格较高,其 Plus 计划的年费为 **47.88 欧元**。 ![](/data/attachment/album/202310/22/075805z44uyyn6eene50ef.jpg) 不过,如果你使用了所有其他 Proton 的服务,并选择了 Proton 的无限制订阅,你就可以获得包括 **Proton Pass、Mail、VPN、Drive 和 Calendar** 在内的高级特性。 ### 功能 这两个密码管理器功能都十分完善,因此每一种都能提供人们所需要的核心特性。 它们共同拥有的特性包括: * 密码生成器 * 安全笔记 * 自动填充 * 卡片信息和登录凭证 * 便于随时获取凭证的手机应用 接下来,让我来突出一下根据我个人的使用经验,每一种服务各自独特的优点: #### Bitwarden Bitwarden 的一项关键功能是其 “<ruby> 发送 <rt> Send </rt></ruby>” 功能,它允许你发送一个文件(最大 500 MB)或一段文本/便笺给任何人,这都是通过一个安全连接实现的,并且在整个过程中都实现了端到端的加密。这项功能可以在 **桌面应用、扩展插件和网页保险库** 中使用。 ![](/data/attachment/album/202310/22/075805jgdqgagta0uu4s5r.jpg) 你可以通过添加一段只有接收者知道的密码短语来保护这个链接。还有更多的自定义选项,例如设定链接的过期时间,或在文件被下载后销毁链接。 我不认为这是一种安全发送文件的方法,更多的是适合发送私人文件(如电子邮件附件)和文本文件。 接下来,Bitwarden 提供了一个 **家庭计划**,允许你与 **其他五个账户** 共享一个订阅。Proton Pass 并没有此类服务。 我想着重强调的另一个功能是:**紧急访问**。 因为密码管理器储存了你所有的登录信息,它就是一个包含 **所有你的访问密钥** 的地方。你可以设置紧急访问功能,以方便你信任的朋友或者家庭成员在你不幸出现紧急状况后访问你的密码。 ![](/data/attachment/album/202310/22/075805q887777w8fz7fvc7.jpg) 当然,在授权用户访问你的账户之前,你可以设定一个期限以确认或拒绝这个访问请求。如果你没有采取任何行动,那么这个访问权限将会授予你的信任用户。 ![](/data/attachment/album/202310/22/075805gqlgmtuksu4aazqg.jpg) > > ? 紧急联系人选项只能在 [网络保险库](https://vault.bitwarden.com/) 中访问。 > > > **值得注意的是:** 这两种服务的密码生成器都包含历史记录,但 Bitwarden **保留历史时间更长**,而 Proton Pass 只保留一天的历史记录。 ![](/data/attachment/album/202310/22/075805npk67hktzzqpptqn.jpg) 其他功能差异包括: * 导出为 .CSV 文件 * 调整自动填充行为 * 访问网络保险库 * 桌面应用 * 记录身份信息 对于所有列出的功能,在我使用 Bitwarden 的过程中,我都没有遇到任何重大的问题。 **我唯一注意到的问题**:有时在我的安卓手机上,自动填充功能并没有在键盘应用中作为建议显示。当然,这取决于各个智能手机制造商提供的定制安卓体验,因此不一定是 Bitwarden 特有的问题。 #### Proton Pass 如果我们从“功能数量”上进行比较,Bitwarden 会占据优势。 但是,作为一个以隐私为重点的工具,Proton Pass 实现了密码管理器所有你需要的重要功能,甚至超越了这些。 ![](/data/attachment/album/202310/22/075805jd7g583dvgrg751y.jpg) 得益于对 [SimpleLogin](https://simplelogin.io/) 的专业研究,Proton Pass 支持生成电子邮件别名。 如果你不太了解:SimpleLogin 是最受欢迎的 [工具之一,用于保护你的电子邮件地址](https://itsfoss.com/protect-email-address/)。 所以,当 Proton Pass 集成了这个功能后,用户可以 **便捷地创建电子邮件别名**,并同时保存登录信息。你在 Proton Pass 上注册的电子邮件将会是实际的电子邮件地址。 我希望他们提供一个设定新的目标电子邮件地址的选项,这将使 Proton Pass 的额外费用更具价值。 此外,如果你是一位使用了部分或所有 Proton 服务的用户,使用 Proton Pass 将会是一种良好的用户体验。因为你无需为其他平台切换或注册。 使用 Proton Pass 还可以获得基本的 **导入/导出,控制某些安全措施,修改密码管理器行为** 的功能。 ![](/data/attachment/album/202310/22/075805ttw2tcauoca7vn0a.jpg) 因此,对于 Proton 用户而言,Proton Pass 可以是一种一站式的解决方案。 是的,我暂时没有注意到任何关于其移动应用的问题,Proton Pass 到目前为止很好。 ### 你应该选择哪个? 考虑到它们的共性,这主要取决于你个人的使用体验、预算(如果选择付费),以及功能集。 对于我个人的使用,我暂时没有看到 Proton Pass 替换 Bitwarden 的需要。 然而,如果我决定购买 Proton 的无限制订阅,或是更加投入到 Proton 的各项服务中去,我可能会放弃 Bitwarden。 ? 你怎么认为呢?你认为 Proton Pass 值得额外付费吗,或者对于 Proton 的捆绑订阅你有什么看法?Bitwarden 是你的最爱吗?欢迎在下方评论分享你的想法。 *(题图:MJ/a2f5d428-b853-4312-837c-9d66371dd5dc)* --- via: <https://itsfoss.com/bitwarden-vs-proton-pass/> 作者:[Ankush Das](https://itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Bitwarden and Proton Pass are two excellent open-source password managers. While Bitwarden has established itself as a solid option for more than six years now, Proton Pass entered as an option only recently. What should you pick? **An existing trustworthy password manager or a newer option built by Proton**, known for its privacy-focused products. I have been using Bitwarden, and Proton Pass with their premium features. Primarily I utilize Bitwarden, but I have been experimenting with Proton Pass since its launch. So, here, I shall share my user experience insights and other pointers that you need to know when selecting one as your password manager. ## Use-Case and App Availability When it comes to a password manager, the app availability and your use-case play an important role. You have to ask yourself questions like: **Where do I need the password manager? (Desktop/Mobile/Web Browser)****What are the extra features that it offers?****Do I stick to a single service for multiple utilities?** I shall highlight the features in the later part of this article. But before that, you need to decide where you want to use the password manager and if you would like to keep the password manager service separate. Proton Pass is available as a **browser extension (***Chrome/Safari/Firefox***), desktop app (***Linux/Windows/macOS***)** and for **mobile platforms** (*Android/iOS*). ![welcome proton pass screen](https://itsfoss.com/content/images/2023/10/proton-pass.jpg) So, Proton Pass is available for all kinds of platforms (including a web app). For Android, it is available on the Play Store and F-Droid as well. ![proton pass ui](https://itsfoss.com/content/images/2023/10/proton-pass-ui-1.jpg) ✅ *If you want seamless access to your passwords on every major platform and want to continue using all the services by Proton, Proton Pass is a suitable choice.* When it comes to **Bitwarden**, it is also available for **Windows, macOS, and Linux** as a **desktop app**. In addition, you can get the add-on for **Google Chrome, Firefox, Tor, Safari, DuckDuckGo for Mac, and other Chromium/Firefox-based browsers**. There are also plans to support DuckDuckGo Browser on Windows (but it was absent at the time of writing). ![bitwarden ui](https://itsfoss.com/content/images/2023/10/bitwarden-extension-ui.jpg) For mobile platforms, it is available for iPhone, **Apple Watch**, and Android phones. You can also install it from F-Droid or the Google Play Store for Android. Not just limited to all these, you can use it as a **web app **or** **through** a command-line interface**. ✅ *Bitwarden should be the perfect pick if you require the password manager available across multiple platforms with Apple Watch and a command-line interface as bonus support.* ## User Experience Bitwarden's user experience can be described as straightforward and non-intrusive. You can see how the browser add-on looks like: ![bitwarden login](https://itsfoss.com/content/images/2023/10/bitwarden-extension-firefox.jpg) Sure, the user interface has improved over the years, but it always sticks to its roots, i.e., **simplicity over a beautified UI**. And, it is also re-designing it further to step it up a notch with a modern touch. It was not present while updating the article, but this is what you can expect Bitwarden to feature in 2024: ![Bitwarden's 2024 redesign](https://itsfoss.com/content/images/2024/06/Bitwarden_BE_Redesign.png) Even with the re-design, it does not look entirely different but some good improvements. Overall, it does not get in your way and provides a familiar user experience at all times. ![bitwarden ui](https://itsfoss.com/content/images/2023/10/bitwarden-login.jpg) You can tweak the theme among dark, light, solarized and nord presets. ![bitwarden themes](https://itsfoss.com/content/images/2023/10/bitwarden-theme.jpg) Whether you are on the desktop app, mobile app or the browser extension, you get the same convenience. Proton Pass **stands out with its layout**, and provides an expanded overlook at your credentials every time you access the extension. ![proton pass UI](https://itsfoss.com/content/images/2023/10/proton-pass-ui-2.jpg) At times, it warns you of a weak password when you look at a password entry with a warning icon. And, that is a good design element, encouraging users to improve the strength of the password. ![proton pass warning a password strength](https://itsfoss.com/content/images/2024/06/protonpass-warn.png) Some users could prefer **the modern approach to the UI**. So, it is up to your personal preferences. I like Bitwarden's traditional approach. ## Pricing You can get started using both the services for free. **Bitwarden and Proton Pass** can be used to store unlimited logins with no restrictions to the number of devices on its free plan. If you need features like **emergency access**, **family access**, **secure storage**, **2FA authenticator**, and **hide-my-email aliases**, you need a premium subscription. [affiliate policy](https://itsfoss.com/affiliate-policy/). ![bitwarden pricing](https://itsfoss.com/content/images/2023/10/bitwarden-pricing.jpg) [Bitwarden](https://bitwarden.com/pricing/) starts just at **10 USD** per year, with its family plan (*six accounts*) at **40 USD** per year. **Incredibly affordable** for the masses 💵 [Proton Pass](https://go.getproton.me/aff_c?offer_id=38&aff_id=1173) is a bit expensive at **23.88 USD per year** for its plus plan. ![proton pass pricing](https://itsfoss.com/content/images/2024/06/proton-pass-pricing.png) However, if you utilize all other Proton services, and opt for a Proton Unlimited subscription, you can get premium perks for **Proton Pass, Mail, VPN, Drive, and Calendar**. [Proton Pass - Fast and secure login on any device | ProtonProton Pass is an open-source, end-to-end encrypted password manager app. Create and store passwords, email aliases, 2FA codes, and notes on all your devices](https://go.getproton.me/aff_c?offer_id=38&aff_id=1173&ref=news.itsfoss.com)![](https://proton.me/images/social/proton-og.png) ![](https://proton.me/images/social/proton-og.png) Partner Link ## Features Both the password managers are quite competent. So, you can expect the essentials with each of them. Here are the things that are common between them: **Password generator****Secure notes****Autofill****Card and login credentials****Email aliases****Mobile apps for convenient access to credentials** Now let me highlight the things that make each of the services stand out as per my experience: ### Bitwarden One of the key offerings of Bitwarden is its "**Send**" feature. You can send a file (up to 500 MB) or a piece of text/note to anyone via a secure link, which keeps things end-to-end encrypted. This option is accessible on **desktop app, extension, and the web vault**. ![bitwarden send screenshot](https://itsfoss.com/content/images/2023/10/bitwarden-send-web-vault.jpg) You can keep the link protected by adding a passphrase known only to the receiver. More customization options are also available, like setting an expiry timer to it or the ability to destroy the link once the file has been downloaded. I would not call it as a way to securely send files. But it is more suitable to send private documents (similar to email attachments) and text files. Next, Bitwarden offers a **family plan** where you can share a **single subscription with six accounts**. There's no such offering with Proton Pass. Another important feature that I'd like to emphasize: **emergency access** 🚨 With every credential going into the password manager, it is the one place where **all your access secrets lie**. To make it convenient for a trusted friend or family member to access your passwords when something happens to you, you can set up emergency access. ![bitwarden emergency access](https://itsfoss.com/content/images/2023/10/emergency-access-bitwarden.jpg) Of course, before giving the authorized user access to your account, you can choose to set a duration to be able to confirm or deny it. If you take no action, the access will be granted to your trusted user. ![bitwarden emergency contact](https://itsfoss.com/content/images/2023/10/bitwarden-emergency-invite.jpg) **web vault** **.****Not to forget:** the password generator includes history for both the services. Bitwarden **retains history for a longer time**, but Proton Pass keeps only **one day of history**. ![bitwarden password geenrator](https://itsfoss.com/content/images/2023/10/bitwarden-password-generator.jpg) There is also something interesting about **email aliases** on Bitwarden. While it supports them, it does not integrate them by default. You can integrate **DuckDuckGo Email Protection**, **SimpleLogin**, **Addy.io**, **Firefox Relay**, and a couple more services. ✅ I use [ DuckDuckGo's free email aliases](https://duckduckgo.com/email) following [Bitwarden's official documentation](https://bitwarden.com/blog/how-to-use-the-bitwarden-forwarded-email-alias-generator/), and it works great. Other feature differences include: **Ability to export in .CSV****Ability to tweak the autofill behavior****Access to web vault****Desktop apps****Password and Credentials Health / Expose Checkup****Ability to self-host on your server** I have never had any significant issues with Bitwarden for all the features listed. Of course, if you decide to **self-host it,** you need to ensure that you have the technical expertise and the time to maintain it. Refer to its [official documentation](https://bitwarden.com/help/self-host-an-organization/) to explore more about deploying Bitwarden yourself. To sum up, Bitwarden is all about: ✅ Passkey support ✅ Straightforward UI ✅ Apple Watch support ✅ Independent email alias ✅ Emergency Access feature ✅ Password generator history ✅ DuckDuckGo browser support ❌ Manual setup for email aliases ❌ No alerts for data breaches **Suggested Read **📖 [Top 5 Best Password Managers for Linux [2023]Linux Password Managers to the rescue!](https://itsfoss.com/password-managers-linux/)![](https://itsfoss.com/content/images/2023/08/best-password-managers-for-linux.png) ![](https://itsfoss.com/content/images/2023/08/best-password-managers-for-linux.png) ### Proton Pass If we compare both in terms of "*number of features*", Bitwarden gets the edge. However, Proton Pass ticks all the essentials you need in a password manager and goes beyond as a privacy-focused tool. ![proton pass password generator](https://itsfoss.com/content/images/2023/10/proton-pass-password-generator.jpg) Proton Pass supports generating email aliases, all thanks to having [SimpleLogin](https://simplelogin.io)'s expertise. If you are curious: SimpleLogin is one of the most popular [tools to protect your email address](https://itsfoss.com/protect-email-address/). ✅ So, with that being integrated with Proton Pass service, it gets **convenient to quickly create an email alias**, and save the login at the same time. The email you signed up with for Proton Pass will be the real email address. I wish if they provided an option to set new target email addresses, this would make the extra premium for Proton Pass worth it. Some standout features with Proton Pass include: **Proton Sentinel**(a group of dedicated security professionals with AI-powered monitoring keep an eye on the login activity of your Proton Pass account for extra security)**Dark Web Monitoring (**you can add emails to get notified if found in a data breach) Additionally, if you are someone who utilizes some or all Proton services, it should be a good user experience with Proton Pass. You do not have to switch or sign up for a different platform. With Proton Pass, you also get the essentials to **import/export, control certain security measures, and tweak the password manager's behavior**. ![proton pass settings](https://itsfoss.com/content/images/2023/10/proton-pass-settings.jpg) So, Proton Pass can be an all-in-one solution for Proton users: ✅ Passkey support ✅ Convenient email alias ✅ Dark web monitoring ✅ Proton Sentinel Program ✅ Seamless experience with Proton privacy tools (Drive, Proton Mail, VPN, etc) ❌ No self-host support ❌ No Emergency Access feature ❌ Lacks Family Plan ## What Should You Pick? Considering you know what's common between them, it comes down to your **personal user experience taste**, **budget** (if opting for premium), and the **feature-set**. For my use-case, I do not see Proton Pass replacing Bitwarden anytime soon 😃 However, if I decide to take a Proton Unlimited subscription or get involved with Proton's offerings more than ever, I might ditch Bitwarden. *💬 What do you think? Do you think Proton Pass is worth the extra premium, or better with Proton's bundled subscription? Is Bitwarden your favorite? Share your thoughts in the comments down below.*
16,307
在 Ubuntu 等非 Nix 操作系统上安装和使用 Nix 包管理器
https://itsfoss.com/ubuntu-install-nix-package-manager/
2023-10-22T08:21:43
[ "NixOS", "Nix" ]
https://linux.cn/article-16307-1.html
![](/data/attachment/album/202310/22/082116ket5ed87padptmbw.jpg) > > Nix 软件包管理器可以安装在任何 Linux 发行版上。具体方法如下。 > > > [人们喜欢使用不可变的 NixOS](/article-15606-1.html) 的原因之一是它的 Nix 包管理器。 它有超过 80,000 个软件包,这可能与 Debian 软件包的数量相差比较大,但仍然令人印象深刻。 好处是你不必仅仅为了包管理器而 [安装 NixOS](/article-15624-1.html)。与 [Homebrew](/article-14065-1.html) 和 Rust 的 [Cargo 包管理器](/article-13938-1.html) 一样,你可以在当前发行版中使用 Nix 包管理器。 为什么要这么做?因为有时,你可能会发现仅以 Nix 打包格式提供的新应用。这种情况很少见,但有可能。 在本教程中,我将引导你完成以下内容: * 安装 Nix 包管理器 * 搜索并安装包 * 尝试/测试软件包而不安装它们 * 更新包 * 删除包 ### 在其他 Linux 发行版上安装 Nix 包管理器 Nix 包管理器有两种安装方式:全局安装和本地安装。 > > ? 全局安装意味着系统上的每个可用用户都可以访问 nix 包管理器,而本地安装仅适用于当前用户。[Nix 官方文档](https://nixos.org/learn) 建议你使用全局安装。 > > > #### 全局安装 如果你想全局安装 Nix 包管理器,那么,你需要执行以下命令: ``` sh <(curl -L https://nixos.org/nix/install) --daemon ``` 执行上述命令后,需要输入 `y` 键并按回车键: ![](/data/attachment/album/202310/22/082143da0fndc0ego334d7.png) 完成后,关闭当前终端,因为它不会在当前终端会话上运行。 #### 本地安装 如果你更喜欢本地安装并且不想每次都使用 `sudo`,则执行以下命令: ``` sh <(curl -L https://nixos.org/nix/install) --no-daemon ``` 输入 `y` 并在要求确认时按回车键。 完成后,关闭当前终端会话并启动一个新终端会话以使用 Nix 包管理器。 ### 搜索并安装包 安装 Nix 包管理器后,下一步是搜索包。 首先,[访问 Nix 搜索的官方页面](https://search.nixos.org/packages) 并输入你要安装的软件包的名称。 从给定的描述中,你可以找到所需的软件包,然后选择 `nix-env` 进行永久安装。 在这里,你可以添加一些额外的关键字以获得更好的搜索结果。例如,在这里,我搜索 “Firefox browser”: ![](/data/attachment/album/202310/22/082144vouku3as3qdgyy5o.png) 我上面提到的最后一步(“复制命令”)什么也不做,只是为你提供了一个用于安装的命令。 现在,你所要做的就是在终端中执行该命令。 就我而言,它给了我以下命令来安装 Firefox: ``` nix-env -iA nixpkgs.firefox ``` 完成后,你可以使用以下命令列出已安装的软件包: ``` nix-env -q ``` ![](/data/attachment/album/202310/22/082144tcomo9e5bqa4rn6o.png) ### 使用包而不安装它们 到目前为止,这是 Nix 包管理器的最佳功能,因为你可以使用/测试包甚至不用安装它! 为此,你可以使用 Nix Shell,它允许你将交互式 Shell 与指定的包一起使用,关闭后,你将无法再访问该包。 很酷,对吧? 要使用 nix-shell 访问你喜欢的软件包,请使用以下命令语法: ``` nix-shell -p <package_name> ``` 例如,我想使用一次 `neofetch`,所以我使用了以下命令: ``` nix-shell -p neofetch ``` ![](/data/attachment/album/202310/22/082144ivyevv9unexcuxc1.png) 要退出 Shell,你所要做的就是执行 `exit` 命令: ``` exit ``` ### 使用 Nix 包管理器更新包 使用 Nix 包管理器更新包非常简单。 要更新软件包,首先,你需要使用以下命令更新频道: ``` nix-channel --update ``` 接下来,你可以通过试运行更新命令来列出过时的软件包: ``` nix-env --upgrade --dry-run ``` ![](/data/attachment/album/202310/22/082146xg5gllqoigbgtuqx.png) 就我而言,Firefox 浏览器已经过时,需要更新! 要更新单个包,请使用以下命令: ``` nix-env -u <Package_name> ``` 如果你想一次更新所有软件包,请使用以下命令: ``` nix-env -u ``` ### 使用 Nix 包管理器删除包 要删除软件包,你只需按以下方式执行 `nix-env` 命令即可: ``` nix-env --uninstall [package_name] ``` 例如,如果我想删除 Firefox 浏览器,那么,我将使用以下命令: ``` nix-env --uninstall firefox ``` ![](/data/attachment/album/202310/22/082146e5n7nkp1l5tnl55p.png) ### 通过 NixOS 释放其全部潜力 如果你喜欢 Nix 包管理器背后的想法,请相信我,你一定会喜欢 [NixOS](https://nixos.org/)。 仅使用一个配置文件来复制整个系统就足以说服我切换到 NixOS,但还有更多原因: 我喜欢 NixOS。以至于我写了整个系列,这样你就不必阅读文档(基础知识): > > **[NixOS 系列](/article-15606-1.html)** > > > 我希望你能像我一样喜欢使用它。 *(题图:MJ/da586165-eadb-4ed7-9a0b-9c92903344d5)* --- via: <https://itsfoss.com/ubuntu-install-nix-package-manager/> 作者:[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) One of the reasons [why people like using the immutable NixOS](https://itsfoss.com/why-use-nixos/) is its Nix package manager. It has over 80,000 packages, which might not be close to the number of Debian packages but pretty impressive nonetheless. The good thing is that you don't have to [install NixOS](https://itsfoss.com/install-nixos-vm/) just for the package manager. Like [Homebrew](https://itsfoss.com/homebrew-linux/) and Rust's [Cargo package manager](https://itsfoss.com/install-rust-cargo-ubuntu-linux/), you can use Nix package manager in your present distribution. Why would you do that? Because sometimes, you may find a new application that is only available in Nix packaging format. It's rare but possible. In this tutorial, I will walk you through the following: - Installing Nix package manager - Searching and installing packages - Try/test packages without installing them - Update packages - Removing packages ## Install Nix package manager on other Linux distros There are two ways to install the Nix package manager: global install and local install. [official Nix documentation](https://nixos.org/learn)recommends you use the global install. #### For global installation: If you want to install the Nix package manager globally, then, you need to execute the following command: `sh <(curl -L https://nixos.org/nix/install) --daemon` Once you execute the above command, you need to enter the `y` key and press the `Enter` key: ![](https://itsfoss.com/content/images/2023/10/Install-nix-package-manager-globally.png) Once done, close the current terminal as it won't work on the current terminal session. #### For local installation: If you prefer the local installation and don't want to use sudo every time, then execute the following command: `sh <(curl -L https://nixos.org/nix/install) --no-daemon` Enter `y` and press the `Enter` key when asked for the confirmation. Once done, close the current terminal session and start a new one to use the Nix package manager. ## Search and install packages Once you have installed the Nix package manager, the next step is to search for packages. First, [visit the official page of Nix search](https://search.nixos.org/packages) and type the name of the package that you want to install. From the given description, you can find the package which you were looking for and then, choose the `nix-env` to go with the permanent installation. Here, you can add some extra keywords to have better search results. For example, here, I searched for "Firefox browser": ![Search packages to install using the Nix package manager](https://itsfoss.com/content/images/2023/10/Search-packages-to-install-using-the-Nix-package-manager.png) The last step that I mentioned above (copy command) does nothing but gives you a command that you execute for the installation. Now, all you have to do is execute that command in your terminal. In my case, it gave me the following command to install Firefox: `nix-env -iA nixpkgs.firefox` Once done, you can list the installed packages using the following command: `nix-env -q` ![List installed packages using the nix package manager](https://itsfoss.com/content/images/2023/10/List-installed-packages-using-the-nix-package-manager.png) ## Use packages without installing them By far this is the best feature of the Nix package manager as you get to use/test packages that are not even installed! For this, you can use the nix shell which lets you use an interactive shell with the specified package, and once closed, you can no longer access that package. Cool, right? To use the nix-shell to access your favorite package, use the following command syntax: `nix-shell -p <package_name>` For example, I wanted to use neofetch once, so I used the following: `nix-shell -p neofetch` ![Use packages wihout installing them using the nix package manager](https://itsfoss.com/content/images/2023/10/Use-packages-wihout-installing-them-using-the-nix-package-manager.png) To exit from the shell, all you have to do is execute the `exit` command: `exit` ## Update packages using the Nix package manager Updating packages using the Nix package manager is pretty easy. To update packages, first, you need to update channels using the following command: `nix-channel --update` Next, you can list the outdated packages by dry-running the update command: `nix-env --upgrade --dry-run` ![List outdated packages using the nix package manager](https://itsfoss.com/content/images/2023/10/List-outdated-packages-using-the-nix-package-manager.png) In my case, the Firefox browser was outdated and needs to be updated! To update a single package, use the following command: `nix-env -u <Package_name>` And if you want to update all the packages at once, then use the following: `nix-env -u` ## Remove packages using the Nix package manager To remove packages, all you have to do is execute the `nix-env` command in the following manner: `nix-env --uninstall [package_name]` For example, if I want to remove the Firefox browser, then, I will use the following command: `nix-env --uninstall firefox` ![Remove packages using the nix package manager](https://itsfoss.com/content/images/2023/10/Remove-packages-using-the-nix-package-manager-1.png) ## Unlock its full potential with NixOS If you liked the idea behind the Nix package manager, trust me, you're going to love the [NixOS](https://nixos.org/). Reproducing the entire system just by using one config file was enough to convince me to make a switch to NixOS but there are more reasons: [6 Reasons Why You Should Consider Using NixOS LinuxNixOS is an exciting distribution. Let’s take a look why you might want to give it a try.](https://itsfoss.com/why-use-nixos/)![](https://itsfoss.com/content/images/2023/02/nix-series-1.png) ![](https://itsfoss.com/content/images/2023/02/nix-series-1.png) I love NixOS. So much so that I wrote a whole series so you don't have to go through documentation (for basics): [Getting Started With NixOS LinuxA tutorial series to help you get familiar with the immutable NixOS Linux distribution.](https://itsfoss.com/tag/nix-os/)![](https://itsfoss.com/content/images/2023/03/nix-os-tag.png) ![](https://itsfoss.com/content/images/2023/03/nix-os-tag.png) I hope you will enjoy using it as much as I do.
16,309
HashiCorp CEO 预测,除非开源模型发展,否则硅谷将没有开源公司
https://www.thestack.technology/hashicorp-ceo-predicts-oss-free-silicon-valley-unless-the-open-source-model-evolves/
2023-10-23T10:06:21
[ "HashiCorp", "开源", "Terraform" ]
https://linux.cn/article-16309-1.html
![](/data/attachment/album/202310/23/100619d754xnee4kksw7sr.jpg) > > 他还称,Linux 基金会接受 OpenTofu 的决策是一个 “悲剧”。 > > > (本文节略自 The Stack 的[文章](https://www.thestack.technology/hashicorp-ceo-predicts-oss-free-silicon-valley-unless-the-open-source-model-evolves/)) HashiCorp 的 CEO 在该公司本月的用户会议上为其改变许可证的做法辩护。他预测,除非社区重新思考如何保护创新,否则硅谷将 “不再有开源公司”。 作为 IaaC 的先驱者,他在 HashiConf 用户会议上介绍了一系列产品了更新和新特性,这是在该公司将其所有产品的版权协议从 <ruby> Mozilla 公共许可证 <rt> Mozilla Public License </rt></ruby>(MPL)更改为 <ruby> 商业源代码许可证 <rt> Business Source License </rt></ruby>(BSL)后不到两个月时间所做的举措。 HashiCorp 当时表明,“除了在与 HashiCorp 商业产品竞争的产品中托管或嵌入软件外,所有生产用途都不受限制,无论是自我管理的还是托管的。” 然而,此举引起了开源社区的强烈反响。在 Linux 基金会的支持下,一个名为 OpenTofu 的 Terraform 分支很快地被发布出来。 HashiCorp 的 CEO Dave McJannet 本周表示,改变许可证的决策是必要的,因为 HashiCorp 的技术对现代云服务起到了关键的作用,随着全球最大的公司将其业务从本地技术转移到云服务,这种关键性只会越来越强。 尽管开源社区猛烈批评了 HashiCorp 改变许可证的决定,但 McJannet 说其最大的客户对此的反应却是,“太好了,因为你是我们的关键伙伴,我们需要你发展成一个大公司。”实际上,他表示,在很多反馈中客户表示,“我们希望你早点这么做”,并补充说,这个决定在公告之前就已经与主要的云供应商进行了讨论。 McJannet 说,“过去三四年间,每个达到一定规模的供应商都已经得出了同样的结论。……这只是意识到,鉴于市场现在的激励机制,开源模型必须演进。” 他声称,过去成立开源基金会的模式现在已经不合时宜了,这些基金会都被传统供应商所主导。以 Hadoop 为例,他说,“基金会就是大公司免遭创新影响的一种机制,如果 Hadoop 流行起来,IBM 这样的公司可以把它拿来,因为他们是基金会的一部分,他们可以以更低的价钱卖出去。” 将开源产品放到 GitHub 上 “的确非常好”,但是,一旦某个项目变得流行,“克隆供应商就开始竞相复制”。 他声称,“我们发出公告后不久,我就开始接到来自硅谷每一个开源创业公司的电话,他们都告诉我,‘我认为这才是正确的模型’。” “确实是悲剧……”,他感叹道,Linux 基金会接受 OpenTofu 的行动,为我们揭示了一个严重的问题。“如果基金会只是简单地接收并给它找个归宿,那对开源的未来将带来怎样的影响呢?这对开源创新而言,无疑是一场悲剧。我可以坦诚告诉你,如果这样的事情真的发生,硅谷将再也看不到开源公司的身影。” 他更具体地指出,许可证的改变是他们为赢取企业信任而设计的策略的一部分。 “让其他供应商误解我们的产品是一个巨大的风险,对吗?这对我们的长期发展是不利的,对我们的客户而言也同样危险。” 他进一步解释说,赢得这些大型组织的信任是促使 HashiCorp 当时选择上市的一个驱动力。“我们并不全然需要钱,我们之所以这么做,是想要向公众表明,我们有充足的资金,可以成为他们长期信任的合作伙伴。” 他补充说,他们提议继续和受许可证更改影响的四个主要的公司合作,“只需要你们承担一部分研发成本。然而他们却拒绝,声称要另起炉灶,这对我们来说也没问题。” *(题图:MJ/5cdb5ba0-a7fa-4a29-b3dd-ef0d07bad575)* --- via: <https://www.thestack.technology/hashicorp-ceo-predicts-oss-free-silicon-valley-unless-the-open-source-model-evolves/> 作者:[JOE FAY](https://www.thestack.technology/author/joe/) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](/article-16307-1.html) 荣誉推出
200
OK
HashiCorp’s CEO predicted there would be “no more open source companies in Silicon Valley” unless the community rethinks how it protects innovation, as he defended the firm’s license switch at its user conference this month. The IaaC pioneer unwrapped a slew of product updates and features at HashiConf in San Francisco, barely two months after it [switched](https://www.thestack.technology/hashicorps-poison-pill-shift-away-from-open-source-triggers-call-for-terraform-to-be-run-by-a-foundation/) future versions of its entire product set from the Mozilla Public License to the Business Source License (BSL). At the time, HashiCorp said, “All production uses are allowed other than hosting or embedding the software in an offering competitive with HashiCorp commercial products, hosted or self-managed.” However, the move drew a furious reaction from the open source world. OpenTofu, a fork of Terraform, was [launched](https://www.thestack.technology/opentofu-terraform-fork/) in short order, under the aegis of the Linux Foundation. CEO Dave McJannet said this week that the license switch had been necessary as HashiCorp’s technology was critical to the modern cloud, and would only become more so the world’s biggest companies complete their shift from on-prem technologies. While open source advocates had slammed the license switch, McJannet described the reaction from its largest customers as “Great. Because you’re a critical partner to us and we need you to be a big, big company.” Indeed, he claimed that “A lot of the feedback was, ‘we wished you had done that sooner’” – adding that the move had been discussed with the major cloud vendors ahead of the announcement. “Every vendor over the last three or four years that has reached any modicum of scale has come to the same conclusion,” said McJannet. “It’s just the realisation that the open source model has to evolve, given the incentives that are now in the market” He claimed the historic model of foundations was broken, as they were dominated by legacy vendors. Citing the case of Hadoop, he said: “They’re a way for big companies to protect themselves from innovation, by making sure that if Hadoop becomes popular, IBM can take it and sell it for less because they are part of that foundation.” The evolution to putting open source products on GitHub had worked “really, really well” but once a project became popular, there was an incentive for “clone vendors to start taking that stuff.” He claimed that “My phone started ringing materially after we made our announcement from every open source startup in Silicon Valley going ‘I think this is the right model’.” ## "Tragic..." He said the Linux Foundation’s adoption of Open Tofu raised serious questions. “What does it say for the future of open source, if foundations will just take it and give it a home. That is tragic for open source innovation. I will tell you, if that were to happen, there'll be no more open source companies in Silicon Valley.” More specifically, McJannet said the licensing change was part of its strategy to earn the confidence of enterprises. “Having other vendors out there misrepresenting our stuff is dangerous, right? Not only is it not great for us long term is dangerous for our customers.” That same need to earn the trust of such of large entities was one of the drivers for HashiCorp going public when it did. “We didn't need the money. We did it because we wanted to send the signal that we were funded to be a long term trusted partner.” He added that it offered to carry on working with the four main companies affected by the switch, saying “You just have to bear some of the r&d costs. And they were like, ‘No, no, we're gonna do something else’. Which is fine.” ## New Hashicorp products unveiled McJannet’s comments came as HashiCorp unwrapped a slew of beta and GA products. For its core Terraform IaaC tool, it announced a beta of test-integrated module publishing, and generated module tests. The former aims to streamline the testing and publication of modules – the containers used to hold and reuse config files in the Terraform architecture - with a new branch-based publishing approach in the HashiCorp Cloud private registry. The firm said this means tests can be executed remotely in a secure environment, eliminating the need for developers to handle sensitive cloud credentials on their workstation. The latter uses generative AI to produce new module tests. The company worked with a third party to train the underlying model on HCL and Terraform. Senior director of product marketing Chris Van Wesep said the model had been trained on HashiCorp’s own internal data, not customer data: “It's more a sophisticated prompt engineering that we did.” It also unveiled a private preview of Stacks, which aims to simplify infrastructure provisioning and management at scale, reducing the complexity users face managing dependencies as they repeatedly deploy infrastructure. It allows users to group together different interdependent systems, which become “deployments in a stack” and can be repeatedly replicated even with differing input values. On security, it announced an alpha program for HCP Vault Radar, which scans code for secrets, as well as other potential nasties including personally identifiable information, non-inclusive language, dependency vulnerabilities, and IAC risks. It is the first deliverable from HashiCorp’s acquisition of BlueBracket in June. It also announced that Vault Enterprise Secrets sync is now in beta in Vault Enterprise 1.15. It was previously only available in HCP Vault Secrets. HashiCorp unveiled a “new vision” for its HCP’s Waypoint platform, subtly changing its goal from “helping to standardize application delivery across platforms” to “empower[ing] platform teams to define golden patterns and workflows for developers to management applications at scale”. The firm said the rework was the result of research with platform teams that showed it made sense to tackle challenges that arose before the deployment and management part of the lifecycle. HashiCorp’s ultimate focus in on its HashiCorp Cloud Platform (HCP) managed services offering, and new technologies and features will initially be deployed to HCP. However, McJannet said that features will continue to be rolled out to its self-managed product, typically within a month. The exception, he said, was with Waypoint, which he said would be offered solely as a managed service.
16,310
如何使用 VLC 录制屏幕
https://itsfoss.com/vlc-record-screen/
2023-10-23T15:32:00
[ "VLC", "录制屏幕" ]
https://linux.cn/article-16310-1.html
![](/data/attachment/album/202310/23/153033pej4f9egegjbtbbs.jpg) > > 用途广泛的 VLC 可以做很多事情。屏幕录制就是其中之一。 > > > VLC 不仅仅是一个视频播放器。它还是一款多功能视频工具,具有普通用户永远无法了解的众多功能。 你可以 [使用 VLC 下载 YouTube 视频](https://itsfoss.com/download-youtube-videos-vlc/),甚至可以用它修剪视频。 VLC 的另一个不寻常用途是屏幕录制。 **我仍然建议使用合适的屏幕录像机来完成此任务,欢迎你探索这个 VLC 功能以获取乐趣。** ### 使用 VLC 进行屏幕录制 > > ? 虽然我可以使用 VLC 录制桌面屏幕,但无法录制任何声音和鼠标光标。在我看来,它并不能替代合适的屏幕录制工具。 > > > 要使用 [VLC](https://www.videolan.org/vlc/) 录制屏幕,请打开它并单击 “<ruby> 媒体 <rt> Media </rt></ruby>”,然后选择 “<ruby> 转换/保存… <rt> Convert/Save... </rt></ruby>”。(或者直接点击 “<ruby> 媒体 <rt> Media </rt></ruby>”→“<ruby> 打开采集设备… <rt> Open Capture Device... </rt></ruby>”) ![Select Convert/ Save option](/data/attachment/album/202310/23/153200xuq9kygdkdudd18q.png) 转到 “<ruby> 捕获设备 <rt> Capture Device </rt></ruby>” 选项卡,然后从 “<ruby> 捕获模式 <rt> Capture Mode </rt></ruby>” 下拉列表中选择桌面。 ![Capture Mode: Desktop](/data/attachment/album/202310/23/153201y0sovgu20mm0mugc.png) 现在,这里为你的录制提供了一些帧率。10、24 fps 等都不错,如果你需要更高的质量,请选择更高的。请注意,这会增加文件大小和系统要求。然后,按 “<ruby> 转换/保存 <rt> Convert/Save </rt></ruby>” 按钮。 ![Set Frame Rate](/data/attachment/album/202310/23/153201ruezjjnj5jgto57t.png) 在下一页上,从下拉列表中选择一个配置文件,然后单击相邻的按钮来编辑该配置文件。 ![Set Output Profile](/data/attachment/album/202310/23/153202etqitx6t5xvi5zvn.png) 设置你需要的视频格式,然后按 “<ruby> 保存 <rt> Save </rt></ruby>”。 ![Edit the Output Profile](/data/attachment/album/202310/23/153203lf43m6zyww3h5f6y.png) 现在,你需要给出目标文件名。单击 “<ruby> 浏览 <rt> Browse </rt></ruby>”按钮,选择位置,然后输入输出文件的名称。单击 “<ruby> 保存 <rt> Save </rt></ruby>”。 ![Output file location and Name](/data/attachment/album/202310/23/153203m76q57u503xh7jg5.png) 按 “<ruby> 开始 <rt> Start </rt></ruby>” 按钮,开始录制屏幕。 ![Start Recording](/data/attachment/album/202310/23/153204yun45x18ufzxcfuc.png) 这将开始录制。完成录制后,使用面板按钮停止。 ![Stop Recording](/data/attachment/album/202310/23/153204wxwp9lcwtt5107p4.png) 或者单击 VLC 上的停止按钮。 ![Stop Button in VLC](/data/attachment/album/202310/23/153204uooau3wvtt1aaaa3.png) 就是这样。你可以在保存屏幕录像的位置查看屏幕录像。 ![Output File](/data/attachment/album/202310/23/153205scvykanka8phcnak.png) ### 总结 如你所见,虽然可以使用 VLC 录制桌面屏幕,但它并不能替代 [专用屏幕录制工具](https://itsfoss.com/best-linux-screen-recorders/)。缺乏录音是一个重大的遗憾。 仅当你没有任何其他选项时才使用 VLC 进行屏幕录制。你怎么认为? *(题图:MJ/f48c22e9-a2d1-4567-a265-6c3aaf147aff)* --- via: <https://itsfoss.com/vlc-record-screen/> 作者:[Sreenath](https://itsfoss.com/author/sreenath/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) VLC is more than just a video player. It's a versatile video tool with so many features that a normal user could never know them. You can [download YouTube videos with VLC](https://itsfoss.com/download-youtube-videos-vlc/) or even trim videos with it. Another such unusual use of VLC is for screen recording. **I still recommend using a proper screen recorder for this task, you are welcome to explore this VLC feature for fun.** ## Screen recording with VLC To record your screen using [VLC](https://www.videolan.org/vlc/), open it and click on Media and select Convert/Save. (Or directly click on Media → Open Capture Device) ![Select Convert/Save options from Media in VLC Main menu](https://itsfoss.com/content/images/2023/09/click-on-convert-save.png) Go to the "Capture Device" Tab and select Desktop from the Capture Mode dropdown list. ![Under Capture Device tab, select Desktop as the capture mode](https://itsfoss.com/content/images/2023/09/desktop-in-capture-device.png) Now, provide some frame rate for your recording. 10, 24 fps etc will be good, and if you need more quality, go for higher. Note that this will increase the file size and system requirements. Then, press the Convert/Save button. ![Set the frame rate for recording](https://itsfoss.com/content/images/2023/09/set-frame-rate-and-press-convert.png) On the next page, select a profile from the drop-down and click on the adjacent button to edit the profile. ![Set the output profile and edit it using the edit button](https://itsfoss.com/content/images/2023/09/Select-profile-and-edit.png) Set the Video format you need and press Save. ![Edit the output profile and save the modified version](https://itsfoss.com/content/images/2023/09/profile-settings.png) Now, you need to give a destination file name. Click on the Browse button, select a location, and enter the name of the output file. Click Save. ![Provide an Output file location and Name using the Browse button for Destination File](https://itsfoss.com/content/images/2023/09/give-name-to-output-file-and-save.png) Press the Start button, to start recording your screen. ![Start recording your screen by clicking on the start button](https://itsfoss.com/content/images/2023/09/press-start-button-to-start-recrding.png) This will start recording. Once you finished your recording, use the panel button to stop. ![Click on the Stop Button in Panel](https://itsfoss.com/content/images/2023/09/stop-button-in-panel-1.png) Or click on the stop button on VLC. ![Click on Stop Button in VLC to Stop Recording](https://itsfoss.com/content/images/2023/09/Stop-button-in-VLC.png) That's it. You can view the screen recording on the place where you saved it. ![The screen recrded file shown in file manager](https://itsfoss.com/content/images/2023/09/recorded-output.png) ## Conclusion As you can see, while it is possible to record the desktop screen with VLC, it is not a replacement of a [dedicated screen recording tool](https://itsfoss.com/best-linux-screen-recorders/). Lack of audio recording is a major letdown. [10 Best Screen Recorders for Linux in 2023Take a look at the best screen recorders available for Linux. Learn its key features, pros, and cons.](https://itsfoss.com/best-linux-screen-recorders/)![](https://itsfoss.com/content/images/2023/08/best-screen-recorders.png) ![](https://itsfoss.com/content/images/2023/08/best-screen-recorders.png) Use VLC for screen recording only if you don't have any other options. What do you think?
16,312
从零开始,运用 Ruby 语言创建一个 DNS 查询
https://jvns.ca/blog/2022/11/06/making-a-dns-query-in-ruby-from-scratch/
2023-10-24T15:50:37
[ "DNS" ]
https://linux.cn/article-16312-1.html
![](/data/attachment/album/202310/24/155014kli69j43i021iwwl.jpg) 大家好!前段时间我写了一篇关于“[如何用 Go 语言建立一个简易的 DNS 解析器](https://jvns.ca/blog/2022/02/01/a-dns-resolver-in-80-lines-of-go/)”的帖子。 那篇帖子里我没写有关“如何生成以及解析 DNS 查询请求”的内容,因为我觉得这很无聊,不过一些伙计指出他们不知道如何解析和生成 DNS 查询请求,并且对此很感兴趣。 我开始好奇了——解析 DNS *能* 花多大功夫?事实证明,编写一段 120 行精巧的 Ruby 语言代码组成的程序就可以做到,这并不是很困难。 所以,在这里有一个如何生成 DNS 查询请求,以及如何解析 DNS 响应报文的速成教学!我们会用 Ruby 语言完成这项任务,主要是因为不久以后我将在一场 Ruby 语言大会上发表观点,而这篇博客帖的部分内容是为了那场演讲做准备的。? (我尽量让不懂 Ruby 的人也能读懂,我只使用了非常基础的 Ruby 语言代码。) 最后,我们就能制作一个非常简易的 Ruby 版本的 `dig` 工具,能够查找域名,就像这样: ``` $ ruby dig.rb example.com example.com 20314 A 93.184.216.34 ``` 整个程序大概 120 行左右,所以 *并不* 算多。(如果你想略过讲解,单纯想去读代码的话,最终程序在这里:[dig.rb](https://gist.github.com/jvns/1e5838a53520e45969687e2f90199770)。) 我们不会去实现之前帖中所说的“一个 DNS 解析器是如何运作的?”,因为我们已经做过了。 那么我们开始吧! 如果你想从头开始弄明白 DNS 查询是如何格式化的,我将尝试解释如何自己弄明白其中的一些东西。大多数情况下的答案是“用 Wireshark 去解包”和“阅读 RFC 1035,即 DNS 的规范”。 生成 DNS 查询请求 ----------- ### 步骤一:打开一个 UDP 套接字 我们需要实际发送我们的 DNS 查询,因此我们就需要打开一个 UDP 套接字。我们会将我们的 DNS 查询发送至 `8.8.8.8`,即谷歌的服务器。 下面是用于建立与 `8.8.8.8` 的 UDP 连接,端口为 53(DNS 端口)的代码。 ``` require 'socket' sock = UDPSocket.new sock.bind('0.0.0.0', 12345) sock.connect('8.8.8.8', 53) ``` #### 关于 UDP 的说明 关于 UDP,我不想说太多,但是我要说的是,计算机网络的基础单位是“<ruby> 数据包 <rt> packet </rt></ruby>”(即一串字节),而在这个程序中,我们要做的是计算机网络中最简单的事情:发送 1 个数据包,并接收 1 个数据包作为响应。 所以 UDP 是一个传递数据包的最简单的方法。 它是发送 DNS 查询最常用的方法,不过你还可以用 TCP 或者 DNS-over-HTTPS。 ### 步骤二:从 Wireshark 复制一个 DNS 查询 下一步:假设我们都不知道 DNS 是如何运作的,但我们还是想尽快发送一个能运行的 DNS 查询。获取 DNS 查询并确保 UDP 连接正常工作的最简单方法就是复制一个已经正常工作的 DNS 查询! 所以这就是我们接下来要做的,使用 Wireshark (一个绝赞的数据包分析工具)。 我的操作大致如下: 1. 打开 Wireshark,点击 “<ruby> 捕获 <rt> capture </rt></ruby>” 按钮。 2. 在搜索栏输入 `udp.port == 53` 作为筛选条件,然后按下回车。 3. 在我的终端运行 `ping example.com`(用来生成一个 DNS 查询)。 4. 点击 DNS 查询(显示 “Standard query A [example.com](http://example.com)”)。 (“A”:查询类型;“[example.com](http://example.com)”:域名;“Standard query”:查询类型描述) 5. 右键点击位于左下角面板上的 “<ruby> 域名系统(查询) <rt> Domain Name System (query) </rt></ruby>”。 6. 点击 “<ruby> 复制 <rt> Copy </rt></ruby>” ——> “<ruby> 作为十六进制流 <rt> as a hex stream </rt></ruby>”。 7. 现在 `b96201000001000000000000076578616d706c6503636f6d0000010001` 就放到了我的剪贴板上,之后会用在我的 Ruby 程序里。好欸! ### 步骤三:解析 16 进制数据流并发送 DNS 查询 现在我们能够发送我们的 DNS 查询到 `8.8.8.8` 了!就像这样,我们只需要再加 5 行代码: ``` hex_string = "b96201000001000000000000076578616d706c6503636f6d0000010001" bytes = [hex_string].pack('H*') sock.send(bytes, 0) # get the reply reply, _ = sock.recvfrom(1024) puts reply.unpack('H*') ``` `[hex_string].pack('H*')` 意思就是将我们的 16 位字符串转译成一个字节串。此时我们不知道这组数据到底是什么意思,但是很快我们就会知道了。 我们还可以借此机会运用 `tcpdump` ,确认程序是否正常进行以及发送有效数据。我是这么做的: 1. 在一个终端选项卡下执行 `sudo tcpdump -ni any port 53 and host 8.8.8.8` 命令 2. 在另一个不同的终端指标卡下,运行 [这个程序](https://gist.github.com/jvns/aa202b1edd97ae261715c806b2ba7d39)(`ruby dns-1.rb`) 以下是输出结果: ``` $ sudo tcpdump -ni any port 53 and host 8.8.8.8 08:50:28.287440 IP 192.168.1.174.12345 > 8.8.8.8.53: 47458+ A? example.com. (29) 08:50:28.312043 IP 8.8.8.8.53 > 192.168.1.174.12345: 47458 1/0/0 A 93.184.216.34 (45) ``` 非常棒 —— 我们可以看到 DNS 请求(”这个 `example.com` 的 IP 地址在哪里?“)以及响应(“在93.184.216.34”)。所以一切运行正常。现在只需要(你懂的)—— 搞清我们是如何生成并解析这组数据的。 ### 步骤四:学一点点 DNS 查询的格式 现在我们有一个关于 `example.com` 的 DNS 查询,让我们了解它的含义。 下方是我们的查询(16 位进制格式): ``` b96201000001000000000000076578616d706c6503636f6d0000010001 ``` 如果你在 Wireshark 上搜索,你就能看见这个查询它由两部分组成: * **请求头**:`b96201000001000000000000` * **语句本身**:`076578616d706c6503636f6d0000010001` ### 步骤五:制作请求头 我们这一步的目标就是制作字节串 `b96201000001000000000000`(借助一个 Ruby 函数,而不是把它硬编码出来)。 (LCTT 译注:<ruby> 硬编码 <rt> hardcode </rt></ruby> 指在软件实现上,将输出或输入的相关参数(例如:路径、输出的形式或格式)直接以**常量**的方式撰写在源代码中,而非在运行期间由外界指定的设置、资源、数据或格式做出适当回应。) 那么:请求头是 12 个字节。那些个 12 字节到底意味着什么呢?如果你在 Wireshark 里看看(亦或者阅读 [RFC-1035](https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.1)),你就能理解:它是由 6 个 2 字节大小的数字串联在一起组成的。 这六个数字分别对应查询 ID、标志,以及数据包内的问题计数、回答资源记录数、权威名称服务器记录数、附加资源记录数。 我们还不需要在意这些都是些什么东西 —— 我们只需要把这六个数字输进去就行。 但所幸我们知道该输哪六位数,因为我们就是为了直观地生成字符串 `b96201000001000000000000`。 所以这里有一个制作请求头的函数(注意:这里没有 `return`,因为在 Ruby 语言里,如果处在函数最后一行是不需要写 `return` 语句的): ``` def make_question_header(query_id) # id, flags, num questions, num answers, num auth, num additional [query_id, 0x0100, 0x0001, 0x0000, 0x0000, 0x0000].pack('nnnnnn') end ``` 上面内容非常的短,主要因为除了查询 ID ,其余所有内容都由我们硬编码写了出来。 #### 什么是 `nnnnnn`? 可能能想知道 `.pack('nnnnnn')` 中的 `nnnnnn` 是个什么意思。那是一个向 `.pack()` 函数解释如何将那个 6 个数字组成的数据转换成一个字节串的一个格式字符串。 `.pack` 的文档在 [这里](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack),其中描述了 `n` 的含义其实是“将其表示为” 16 位无符号、网络(大端序)字节序’”。 (LCTT 译注:<ruby> 大端序 <rt> Big-endian </rt></ruby>:指将高位字节存储在低地址,低位字节存储在高地址的方式。) 16 个位等同于 2 字节,同时我们需要用网络字节序,因为这属于计算机网络范畴。我不会再去解释什么是字节序了(尽管我确实有 [一幅自制漫画尝试去描述它](https://wizardzines.com/comics/little-endian/))。 测试请求头代码 ------- 让我们快速检测一下我们的 `make_question_header` 函数运行情况。 ``` puts make_question_header(0xb962) == ["b96201000001000000000000"].pack("H*") ``` 这里运行后输出 `true` 的话,我们就成功了。 好了我们接着继续。 ### 步骤六:为域名进行编码 下一步我们需要生成 **问题本身**(“`example.com` 的 IP 是什么?”)。这里有三个部分: * **域名**(比如说 `example.com`) * **查询类型**(比如说 `A` 代表 “IPv4 **A**ddress”) * **查询类**(总是一样的,`1` 代表 **IN**ternet) 最麻烦的就是域名,让我们写个函数对付这个。 `example.com` 以 16 进制被编码进一个 DNS 查询中,如 `076578616d706c6503636f6d00`。这有什么含义吗? 如果我们把这些字节以 ASCII 值翻译出来,结果会是这样: ``` 076578616d706c6503636f6d00 7 e x a m p l e 3 c o m 0 ``` 因此,每个段(如 `example`)的前面都会显示它的长度(`7`)。 下面是有关将 `example.com` 翻译成 `7 e x a m p l e 3 c o m 0` 的 Ruby 代码: ``` def encode_domain_name(domain) domain .split(".") .map { |x| x.length.chr + x } .join + "\0" end ``` 除此之外,,要完成问题部分的生成,我们只需要在域名结尾追加上(查询)的类型和类。 ### 步骤七:编写 make\_dns\_query 下面是制作一个 DNS 查询的最终函数: ``` def make_dns_query(domain, type) query_id = rand(65535) header = make_question_header(query_id) question = encode_domain_name(domain) + [type, 1].pack('nn') header + question end ``` 这是目前我们写的所有代码 [dns-2.rb](https://gist.github.com/jvns/3587ea0b4a2a6c20dcfd8bf653fc11d9) —— 目前仅 29 行。 接下来是解析的阶段 --------- 现在我尝试去解析一个 DNS 查询,我们到了硬核的部分:解析。同样的,我们会将其分成不同部分: * 解析一个 DNS 的请求头 * 解析一个 DNS 的名称 * 解析一个 DNS 的记录 这几个部分中最难的(可能跟你想的不一样)就是:“解析一个 DNS 的名称”。 ### 步骤八:解析 DNS 的请求头 让我们先从最简单的部分开始:DNS 的请求头。我们之前已经讲过关于它那六个数字是如何串联在一起的了。 那么我们现在要做的就是: * 读其首部 12 个字节 * 将其转换成一个由 6 个数字组成的数组 * 为方便起见,将这些数字放入一个类中 以下是具体进行工作的 Ruby 代码: ``` class DNSHeader attr_reader :id, :flags, :num_questions, :num_answers, :num_auth, :num_additional def initialize(buf) hdr = buf.read(12) @id, @flags, @num_questions, @num_answers, @num_auth, @num_additional = hdr.unpack('nnnnnn') end end ``` 注: `attr_reader` 是 Ruby 的一种说法,意思是“使这些实例变量可以作为方法使用”。所以我们可以调用 `header.flags` 来查看`@flags`变量。 我们也可以借助 `DNSheader(buf)` 调用这个,也不差。 让我们往最难的那一步挪挪:解析一个域名。 ### 步骤九:解析一个域名 首先,让我们写其中的一部分: ``` def read_domain_name_wrong(buf) domain = [] loop do len = buf.read(1).unpack('C')[0] break if len == 0 domain << buf.read(len) end domain.join('.') end ``` 这里会反复读取一个字节的数据,然后将该长度读入字符串,直到读取的长度为 0。 这里运行正常的话,我们在我们的 DNS 响应头第一次看见了域名(`example.com`)。 关于域名方面的麻烦:压缩! ------------- 但当 `example.com` 第二次出现的时候,我们遇到了麻烦 —— 在 Wireshark 中,它报告上显示输出的域的值为含糊不清的 2 个字节的 `c00c`。 这种情况就是所谓的 **DNS 域名压缩**,如果我们想解析任何 DNS 响应我们就要先把这个实现完。 幸运的是,这没**那么**难。这里 `c00c` 的含义就是: * 前两个比特(`0b11.....`)意思是“前面有 DNS 域名压缩!” * 而余下的 14 比特是一个整数。这种情况下这个整数是 `12`(`0x0c`),意思是“返回至数据包中的第 12 个字节处,使用在那里找的域名” 如果你想阅读更多有关 DNS 域名压缩之类的内容。我找到了相关更容易让你理解这方面内容的文章: [关于 DNS RFC 的释义](https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.4)。 ### 步骤十:实现 DNS 域名压缩 因此,我们需要一个更复杂的 `read_domain_name` 函数。 如下所示: ``` domain = [] loop do len = buf.read(1).unpack('C')[0] break if len == 0 if len & 0b11000000 == 0b11000000 # weird case: DNS compression! second_byte = buf.read(1).unpack('C')[0] offset = ((len & 0x3f) << 8) + second_byte old_pos = buf.pos buf.pos = offset domain << read_domain_name(buf) buf.pos = old_pos break else # normal case domain << buf.read(len) end end domain.join('.') ``` 这里具体是: * 如果前两个位为 `0b11`,那么我们就需要做 DNS 域名压缩。那么: + 读取第二个字节并用一点儿运算将其转化为偏移量。 + 在缓冲区保存当前位置。 + 在我们计算偏移量的位置上读取域名 + 在缓冲区存储我们的位置。 可能看起来很乱,但是这是解析 DNS 响应的部分中最难的一处了,我们快搞定了! #### 一个关于 DNS 压缩的漏洞 有些人可能会说,有恶意行为者可以借助这个代码,通过一个带 DNS 压缩条目的 DNS 响应指向这个响应本身,这样 `read_domain_name` 就会陷入无限循环。我才不会改进它(这个代码已经够复杂了好吗!)但一个真正的 DNS 解析器确实会更巧妙地处理它。比如,这里有个 [能够避免在 miekg/dns 中陷入无限循环的代码](https://link.zhihu.com/?target=https%3A//github.com/miekg/dns/blob/b3dfea07155dbe4baafd90792c67b85a3bf5be23/msg.go%23L430-L435)。 如果这是一个真正的 DNS 解析器,可能还有其他一些边缘情况会造成问题。 ### 步骤十一:解析一个 DNS 查询 你可能在想:“为什么我们需要解析一个 DNS 查询?这是一个响应啊!” 但每一个 DNS 响应包含它自己的原始查询,所以我们有必要去解析它。 这是解析 DNS 查询的代码: ``` class DNSQuery attr_reader :domain, :type, :cls def initialize(buf) @domain = read_domain_name(buf) @type, @cls = buf.read(4).unpack('nn') end end ``` 内容不是太多:类型和类各占 2 个字节。 ### 步骤十二:解析一个 DNS 记录 最让人兴奋的部分 —— DNS 记录是我们的查询数据存放的地方!即这个 “rdata 区域”(“记录数据字段”)就是我们会在 DNS 查询对应的响应中获得的 IP 地址所驻留的地方。 代码如下: ``` class DNSRecord attr_reader :name, :type, :class, :ttl, :rdlength, :rdata def initialize(buf) @name = read_domain_name(buf) @type, @class, @ttl, @rdlength = buf.read(10).unpack('nnNn') @rdata = buf.read(@rdlength) end ``` 我们还需要让这个 `rdata` 区域更加可读。记录数据字段的实际用途取决于记录类型 —— 比如一个“A” 记录就是一个四个字节的 IP 地址,而一个 “CNAME” 记录则是一个域名。 所以下面的代码可以让请求数据更可读: ``` def read_rdata(buf, length) @type_name = TYPES[@type] || @type if @type_name == "CNAME" or @type_name == "NS" read_domain_name(buf) elsif @type_name == "A" buf.read(length).unpack('C*').join('.') else buf.read(length) end end ``` 这个函数使用了 `TYPES` 这个哈希表将一个记录类型映射为一个更可读的名称: ``` TYPES = { 1 => "A", 2 => "NS", 5 => "CNAME", # there are a lot more but we don't need them for this example } ``` `read.rdata` 中最有趣的一部分可能就是这一行 `buf.read(length).unpack('C*').join('.')` —— 像是在说:“嘿!一个 IP 地址有 4 个字节,就将它转换成一组四个数字组成的数组,然后数字互相之间用 ‘.’ 联个谊吧。” ### 步骤十三:解析 DNS 响应的收尾工作 现在我们正式准备好解析 DNS 响应了! 工作代码如下所示: ``` class DNSResponse attr_reader :header, :queries, :answers, :authorities, :additionals def initialize(bytes) buf = StringIO.new(bytes) @header = DNSHeader.new(buf) @queries = ([email protected]_questions).map { DNSQuery.new(buf) } @answers = ([email protected]_answers).map { DNSRecord.new(buf) } @authorities = ([email protected]_auth).map { DNSRecord.new(buf) } @additionals = ([email protected]_additional).map { DNSRecord.new(buf) } end end ``` 这里大部分内容就是在调用之前我们写过的其他函数来协助解析 DNS 响应。 如果 `@header.num_answers` 的值为 2,代码会使用了 `([email protected]_answers).map` 这个巧妙的结构创建一个包含两个 DNS 记录的数组。(这可能有点像 Ruby 魔法,但我就是觉得有趣,但愿不会影响可读性。) 我们可以把这段代码整合进我们的主函数中,就像这样: ``` sock.send(make_dns_query("example.com", 1), 0) # 1 is "A", for IP address reply, _ = sock.recvfrom(1024) response = DNSResponse.new(reply) # parse the response!!! puts response.answers[0] ``` 尽管输出结果看起来有点辣眼睛(类似于 `#<DNSRecord:0x00000001368e3118>`),所以我们需要编写一些好看的输出代码,提升它的可读性。 ### 步骤十四:对于我们输出的 DNS 记录进行美化 我们需要向 DNS 记录增加一个 `.to_s` 字段,从而让它有一个更良好的字符串展示方式。而者只是做为一行方法的代码在 `DNSRecord` 中存在。 ``` def to_s "#{@name}\t\t#{@ttl}\t#{@type_name}\t#{@parsed_rdata}" end ``` 你可能也注意到了我忽略了 DNS 记录中的 `class` 区域。那是因为它总是相同的(IN 表示 “internet”),所以我觉得它是个多余的。虽然很多 DNS 工具(像真正的 `dig`)会输出 `class`。 大功告成! ----- 这是我们最终的主函数: ``` def main # connect to google dns sock = UDPSocket.new sock.bind('0.0.0.0', 12345) sock.connect('8.8.8.8', 53) # send query domain = ARGV[0] sock.send(make_dns_query(domain, 1), 0) # receive & parse response reply, _ = sock.recvfrom(1024) response = DNSResponse.new(reply) response.answers.each do |record| puts record end ``` 我不觉得我们还能再补充什么 —— 我们建立连接、发送一个查询、输出每一个回答,然后退出。完事儿! ``` $ ruby dig.rb example.com example.com 18608 A 93.184.216.34 ``` 你可以在这里查看最终程序:[dig.rb](https://gist.github.com/jvns/1e5838a53520e45969687e2f90199770)。可以根据你的喜好给它增加更多特性,就比如说: * 为其他查询类型添加美化输出。 * 输出 DNS 响应时增加“授权”和“可追加”的选项 * 重试查询 * 确保我们看到的 DNS 响应匹配我们的查询(ID 信息必须是对的上的!) 另外如果我在这篇文章中出现了什么错误,就 [在推特和我聊聊吧](https://twitter.com/b0rk)。(我写的比较赶所以可能还是会有些错误) *(题图:MJ/449d049d-6bdd-448b-a61d-17138f8551bc)* --- via: <https://jvns.ca/blog/2022/11/06/making-a-dns-query-in-ruby-from-scratch/> 作者:[Julia Evans](https://jvns.ca/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[Drwhooooo](https://github.com/Drwhooooo) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Hello! A while back I wrote a post about [how to write a toy DNS resolver in Go](https://jvns.ca/blog/2022/02/01/a-dns-resolver-in-80-lines-of-go/). In that post I left out “how to generate and parse DNS queries” because I thought it was boring, but a few people pointed out that they did not know how to parse and generate DNS queries and they were interested in how to do it. This made me curious – how much work *is* it do the DNS parsing? It turns out we can do it in a pretty nice 120-line Ruby program, which is not that bad. So here’s a quick post on how to generate DNS queries and parse DNS responses! We’re going to do it in Ruby because I’m giving a talk at a Ruby conference soon, and this blog post is partly prep for that talk :). I’ve tried to keep it readable for folks who don’t know Ruby though, I’ve only used pretty basic Ruby code. At the end we’re going to have a very simple toy Ruby version of `dig` that can look up domain names like this: ``` $ ruby dig.rb example.com example.com 20314 A 93.184.216.34 ``` The whole thing is about 120 lines of code, so it’s not *that* much. (The final program is [dig.rb](https://gist.github.com/jvns/1e5838a53520e45969687e2f90199770) if you want to skip the explanations and just read some code.) We won’t implement the “how a DNS resolver works” from the previous post because, well, we already did that. Let’s get into it! Along the way I’m going to try to explain how you could figure out some of this stuff yourself if you were trying to figure out how DNS queries are formatted from scratch. Mostly that’s “poke around in Wireshark” and “read RFC 1035, the DNS RFC”. # step 1: open a UDP socket We need to actually *send* our queries, so to do that we need to open a UDP socket. We’ll send our queries to `8.8.8.8` , Google’s DNS server. Here’s the code to set up a UDP connection to `8.8.8.8` , port 53 (the DNS port). ``` require 'socket' sock = UDPSocket.new sock.bind('0.0.0.0', 12345) sock.connect('8.8.8.8', 53) ``` ### a quick note on UDP I’m not going to say too much about UDP here, but I will say that the basic unit of computer networking is the “packet” (a packet is a string of bytes), and in this program we’re going to do the simplest possible thing you can do with a computer network – send 1 packet and receive 1 packet in response. So UDP is a way to send packets in the simplest possible way. It’s the most common way to send DNS queries, though you can also use TCP or DNS-over-HTTPS instead. ### step 2: copy a DNS query from Wireshark Next: let’s say we have no idea how DNS works but we want to send a working query as fast as possible. The easiest way to get a DNS query to play with and make sure our UDP connection is working is to just copy one that already works! So that’s what we’re going to do, using Wireshark (an incredible packet analysis tool) The steps I used to this are roughly: - Open Wireshark and click ‘capture’ - Enter `udp.port == 53` as a filter (in the search bar) - Run `ping example.com` in my terminal (to generate a DNS query) - Click on the DNS query (“Standard query A example.com”) - Right click on “Domain Name System (query”) in the bottom left pane - Click ‘Copy’ -> ‘as a hex stream’ - Now I have “b96201000001000000000000076578616d706c6503636f6d0000010001” on my clipboard, to use in my Ruby program. Hooray! ### step 3: decode the hex stream and send the DNS query Now we can send our DNS query to `8.8.8.8` ! Here’s what that looks like: we just need to add 5 lines of code ``` hex_string = "b96201000001000000000000076578616d706c6503636f6d0000010001" bytes = [hex_string].pack('H*') sock.send(bytes, 0) # get the reply reply, _ = sock.recvfrom(1024) puts reply.unpack('H*') ``` `[hex_string].pack('H*')` is translating our hex string into a byte string. At this point we don’t really know what this data *means* but we’ll get there in a second. We can also take this opportunity to make sure our program is working and is sending valid data, using `tcpdump` . How I did that: - Run `sudo tcpdump -ni any port 53 and host 8.8.8.8` in a terminal tab - In a different terminal tab, run [this Ruby program](https://gist.github.com/jvns/aa202b1edd97ae261715c806b2ba7d39)(`ruby dns-1.rb` ) Here’s what the output looks like: ``` $ sudo tcpdump -ni any port 53 and host 8.8.8.8 08:50:28.287440 IP 192.168.1.174.12345 > 8.8.8.8.53: 47458+ A? example.com. (29) 08:50:28.312043 IP 8.8.8.8.53 > 192.168.1.174.12345: 47458 1/0/0 A 93.184.216.34 (45) ``` This is really good - we can see the DNS request (“what’s the IP for `example.com` ”) and the response (“it’s 93.184.216.34”). So everything is working. Now we just need to, you know, figure out how to generate and decode this data ourselves. ### step 4: learn a little about how DNS queries are formatted Now that we have a DNS query for `example.com` , let’s learn about what it means. Here’s our query, formatted as hex. ``` b96201000001000000000000076578616d706c6503636f6d0000010001 ``` If you poke around in Wireshark, you’ll see that this query has 2 parts: - The **header**(`b96201000001000000000000` ) - The **question**(`076578616d706c6503636f6d0000010001` ) ### step 5: make the header Our goal in this step is to generate the byte string `b96201000001000000000000` , but with a Ruby function instead of hardcoding it. So: the header is 12 bytes. What do those 12 bytes mean? If you look at Wireshark (or read [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.1)), you’ll see that it’s 6 2-byte numbers concatenated together. The 6 numbers correspond to the query ID, the flags, and then the number of questions, answer records, authoritative records, and additional records in the packet. We don’t need to worry about what all those things are yet though – we just need to put in 6 numbers. And luckily we know exactly which 6 numbers to put because our goal is to literally generate the string `b96201000001000000000000` . So here’s a function to make the header. (note: there’s no `return` because you don’t need to write `return` in Ruby if it’s the last line of the function) ``` def make_question_header(query_id) # id, flags, num questions, num answers, num auth, num additional [query_id, 0x0100, 0x0001, 0x0000, 0x0000, 0x0000].pack('nnnnnn') end ``` This is very short because we’ve hardcoded everything except the query ID. ### what’s `nnnnnn` ? You might be wondering what `nnnnnn` is in `.pack('nnnnnn')` . That’s a format string telling `.pack()` how to convert that array of 6 numbers into a byte string. [The documentation for .pack is here](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack), and it says that `n` means “represent it as “16-bit unsigned, network (big-endian) byte order”.16 bits is the same as 2 bytes, and we need to use network byte order because this is computer networking. I’m not going to explain byte order right now (though I do have a [comic attempting to explain it](https://wizardzines.com/comics/little-endian/)) ### test the header code Let’s quickly test that our `make_question_header` function works. ``` puts make_question_header(0xb962) == ["b96201000001000000000000"].pack("H*") ``` This prints out “true”, so we win and we can move on. ### step 5: encode the domain name Next we need to generate the **question** (“what’s the IP for `example.com` ?”). This has 3 parts: - the **domain name**(for example “example.com”) - the **query type**(for example “A” is for “IPv4**A**ddress” - the **query class**(which is always the same, 1 is for**IN**is for**IN**ternet) The hardest part of this is the domain name so let’s write a function to do that. `example.com` is encoded in a DNS query, in hex, as `076578616d706c6503636f6d00` . What does that mean? Well, if we translate the bytes into ASCII, it looks like this: ``` 076578616d706c6503636f6d00 7 e x a m p l e 3 c o m 0 ``` So each segment (like `example` ) has its length (like 7) in front of it. Here’s the Ruby code to translate `example.com` into `7 e x a m p l e 3 c o m 0` : ``` def encode_domain_name(domain) domain .split(".") .map { |x| x.length.chr + x } .join + "\0" end ``` Other than that, to finish generating the question section we just need to append the type and class onto the end of the domain name. ### step 6: write `make_dns_query` Here’s the final function to make a DNS query: ``` def make_dns_query(domain, type) query_id = rand(65535) header = make_question_header(query_id) question = encode_domain_name(domain) + [type, 1].pack('nn') header + question end ``` [Here’s all the code we’ve written before in dns-2.rb](https://gist.github.com/jvns/3587ea0b4a2a6c20dcfd8bf653fc11d9) – it’s still only 29 lines. ### now for the parsing Now that we’ve managed to *generate* a DNS query, we get into the hard part: the parsing. Again, we’ll split this into a bunch of different - parse a DNS header - parse a DNS name - parse a DNS record The hardest part of this (maybe surprisingly) is going to be “parse a DNS name”. ### step 7: parse the DNS header Let’s start with the easiest part: the DNS header. We already talked about how it’s 6 numbers concatenated together. So all we need to do is - read the first 12 bytes - convert that into an array of 6 numbers - put those numbers in a class for convenience Here’s the Ruby code to do that. ``` class DNSHeader attr_reader :id, :flags, :num_questions, :num_answers, :num_auth, :num_additional def initialize(buf) hdr = buf.read(12) @id, @flags, @num_questions, @num_answers, @num_auth, @num_additional = hdr.unpack('nnnnnn') end end ``` Quick Ruby note: `attr_reader` is a Ruby thing that means “make these instance variables accessible as methods”. So you can call `header.flags` to look at the `@flags` variable. We can call this with `DNSHeader(buf)` . Not so bad. Let’s move on to the hardest part: parsing a domain name. ### step 8: parse a domain name First, let’s write a partial version. ``` def read_domain_name_wrong(buf) domain = [] loop do len = buf.read(1).unpack('C')[0] break if len == 0 domain << buf.read(len) end domain.join('.') end ``` This repeatedly reads 1 byte and then reads that length into a string until the length is 0. This works great, for the first time we see a domain name (`example.com` ) in our DNS response. ### trouble with domain names: compression! But the second time `example.com` appears, we run into trouble – in Wireshark, it says that the domain is represented cryptically as just the 2 bytes `c00c` . This is something called **DNS compression** and if we want to parse any DNS responses we’re going to have to implement it. This is luckily not **that** hard. All `c00c` is saying is: - The first 2 bits ( `0b11.....` ) mean “DNS compression ahead!” - The remaining 14 bits are an integer. In this case that integer is `12` (`0x0c` ), so that means “go back to the 12th byte in the packet and use the domain name you find there” If you want to read more about DNS compression, I found the [explanation in the DNS RFC](https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.4) relatively readable. ### step 9: implement DNS compression So we need a more complicated version of our `read_domain_name` function Here it is. ``` domain = [] loop do len = buf.read(1).unpack('C')[0] break if len == 0 if len & 0b11000000 == 0b11000000 # weird case: DNS compression! second_byte = buf.read(1).unpack('C')[0] offset = ((len & 0x3f) << 8) + second_byte old_pos = buf.pos buf.pos = offset domain << read_domain_name(buf) buf.pos = old_pos break else # normal case domain << buf.read(len) end end domain.join('.') ``` Basically what’s happening is: - if the first 2 bits are `0b11` , we need to do DNS compression. Then:- read the second byte and do a little bit arithmetic to convert that into the offset - save the current position in the buffer - read the domain name at the offset we calculated - restore our position in the buffer This is kind of messy but it’s the most complicated part of parsing the DNS response, so we’re almost done! ### a DNS compression exploit Someone pointed out that a malicious actor could exploit this code by sending a DNS response with a DNS compression entry that points to itself, so that `read_domain_name` would end up in an infinite loop. I won’t update it (the code is already complicated enough!) but a real DNS parser would be smarter and deal with that. For example [here’s the code that avoids infinite loops in miekg/dns](https://github.com/miekg/dns/blob/b3dfea07155dbe4baafd90792c67b85a3bf5be23/msg.go#L430-L435) There are also probably other edge cases that would be problematic if this were a real DNS parser. ### step 10: parse a DNS query You might think “why do we need to parse a DNS query? This is the response!”. But every DNS response has the original query in it, so we need to parse it. Here’s the code for parsing the DNS query. ``` class DNSQuery attr_reader :domain, :type, :cls def initialize(buf) @domain = read_domain_name(buf) @type, @cls = buf.read(4).unpack('nn') end end ``` There’s not very much to it: the type and class are 2 bytes each. ### step 11: parse a DNS record This is the exciting part – the DNS record is where our query data lives! The “rdata field” (“record data”) is where the IP address we’re going to get in response to our DNS query lives. Here’s the code: ``` class DNSRecord attr_reader :name, :type, :class, :ttl, :rdlength, :rdata def initialize(buf) @name = read_domain_name(buf) @type, @class, @ttl, @rdlength = buf.read(10).unpack('nnNn') @rdata = buf.read(@rdlength) end ``` We also need to do a little work to make the `rdata` field human readable. The meaning of the record data depends on the record type – for example for an “A” record it’s a 4-byte IP address, for but a “CNAME” record it’s a domain name. So here’s some code to make the request data human readable: ``` def read_rdata(buf, length) @type_name = TYPES[@type] || @type if @type_name == "CNAME" or @type_name == "NS" read_domain_name(buf) elsif @type_name == "A" buf.read(length).unpack('C*').join('.') else buf.read(length) end end ``` This function uses this `TYPES` hash to map the record type to a human-readable name: ``` TYPES = { 1 => "A", 2 => "NS", 5 => "CNAME", # there are a lot more but we don't need them for this example } ``` The most interesting part of `read_rdata` is probably the line `buf.read(length).unpack('C*').join('.')` – it’s saying “hey, an IP address is 4 bytes, so convert it into an array of 4 numbers and then join those with “.“s”. ### step 12: finish parsing the DNS response Now we’re ready to parse the DNS response! Here’s some code to do that: ``` class DNSResponse attr_reader :header, :queries, :answers, :authorities, :additionals def initialize(bytes) buf = StringIO.new(bytes) @header = DNSHeader.new(buf) @queries = ([email protected]_questions).map { DNSQuery.new(buf) } @answers = ([email protected]_answers).map { DNSRecord.new(buf) } @authorities = ([email protected]_auth).map { DNSRecord.new(buf) } @additionals = ([email protected]_additional).map { DNSRecord.new(buf) } end end ``` This mostly just calls the other functions we’ve written to parse the DNS response. It uses this cute `([email protected]_answers).map` construction to create an array of 2 DNS records if `@header.num_answers` is 2. (which is maybe a *little* bit of Ruby magic but I think it’s kind of fun and hopefully isn’t too hard to read) We can integrate this code into our main function like this: ``` sock.send(make_dns_query("example.com", 1), 0) # 1 is "A", for IP address reply, _ = sock.recvfrom(1024) response = DNSResponse.new(reply) # parse the response!!! puts response.answers[0] ``` Printing out the records looks awful though (it says something like `#<DNSRecord:0x00000001368e3118>` ). So we need to write some pretty printing code to make it human readable. ### step 13: pretty print our DNS records We need to add a `.to_s` field to DNS records to make them have a nice string representation. This is just a 1-line method in `DNSRecord` : ``` def to_s "#{@name}\t\t#{@ttl}\t#{@type_name}\t#{@parsed_rdata}" end ``` You also might notice that I left out the `class` field of the DNS record. That’s because it’s always the same (IN for “internet”) so I felt it was redundant. Most DNS tools (like real `dig` ) will print out the class though. ### and we’re done! Here’s our final `main` function: ``` def main # connect to google dns sock = UDPSocket.new sock.bind('0.0.0.0', 0) sock.connect('8.8.8.8', 53) # send query domain = ARGV[0] sock.send(make_dns_query(domain, 1), 0) # receive & parse response reply, _ = sock.recvfrom(1024) response = DNSResponse.new(reply) response.answers.each do |record| puts record end ``` I don’t think there’s too much to say about this – we connect, send a query, print out each of the answers, and exit. Success! ``` $ ruby dig.rb example.com example.com 18608 A 93.184.216.34 ``` You can see the final program as a gist here: [dig.rb](https://gist.github.com/jvns/1e5838a53520e45969687e2f90199770). You could add more features to it if you want, like - pretty printing for other query types - options to print out the “authority” and “additional” sections of the DNS response - retries - making sure that the DNS response we see is *actually*a response to the query we sent (the query ID has to match! Also [you can let me know on Twitter](https://twitter.com/b0rk) if I’ve made a mistake in this post somewhere – I wrote this pretty quickly so I probably got something wrong.
16,313
Linux 爱好者线下沙龙:LLUG 2023·蓉城热辣相聚
https://jinshuju.net/f/oYUkwF
2023-10-24T17:44:00
[ "LLUG" ]
https://linux.cn/article-16313-1.html
![](/data/attachment/album/202310/24/174427zitzthovutszclut.jpg) 成都,别称“蓉城”,是我国西南的一颗璀璨的明珠,热辣的四川火锅,憨态可掬的大熊猫,都是人们对于成都的理解和认识。而我们的 Linux 爱好者线下沙龙,也在这个冬天,来到了美丽蓉城,与蓉城的开发者们线下相见。 **2023 年 10 月 29 日下午,我们将在成都市菁蓉汇举行 LLUG 2023 · 成都场,欢迎广大的 Linux 爱好者来到现场,与我们一同交流技术,分享自己工作过程中的所思所想。同期还在举行中国开源年会 COSCON,欢迎来参与活动的同时,参加 COSCON,了解中国开源项目,助力中国开源产业** 本次活动依然由 Linux 中国和 龙蜥社区(OpenAnolis)联合主办,异步图书、COSCON 中国开源年会提供了支持。 > 龙蜥社区(OpenAnolis)是国内的顶尖 Linux 发行版社区,我们希望在普及 Linux 知识的同时,也能让中国的 Linux 发行版,为更多人知晓,推动国产发行版的发展和进步。 > [异步社区(www.epubit.com)](https://www.epubit.com) 是由人民邮电出版社创办的IT专业图书社区。异步社区于2015年8月上线运营,依托于人民邮电出版社20余年的IT专业优质出版资源和编辑策划团队,致力于优质学习内容的出版和分享,为读者提供优质学习内容,为作译者提供优质出版服务,实现作者与读者在线交流互动,实现传统出版与数字出版的融合发展。 > [中国开源年会(COSCON)](https://kaiyuanshe.cn/activity/coscon-2023)是由开源社主办的,中国大陆开源界最高规格的年度盛会。大家可以访问 <https://kaiyuanshe.cn/activity/coscon-2023> 了解活动详情。 ### 活动议程 | 时间 | 议题 | 分享简介 | 分享者 | | --- | --- | --- | --- | | 14:00~14:20 | 签到 | | | 14:20~14:30 | LLUG 活动介绍 | 白宦成 | | 14:30~15:00 | 技术之旅:从结识Linux到创业——我的Linux历程 | 作为一个创业公司的 CEO,我是如何从 2010 年开始了解 Linux,又一步步从 嵌入式开发,走上创业的道路 | 孙康, 成都不周山文化发展有限公司 CEO。 | | 15:00~15:30 | 如何高效参与开源 | 作为新人,如何学习上手使用开源,参与开源贡献 | wxy Linux 中国创始人 | | 15:30~16:00 | 大模型开发经验分享 | 作为一个大模型开发者,分享一些自己在使用 LLMs 开发应用的经验,帮助大家上手使用 LLMs。开发者也要使用 LLMs 优化工作流! | 白宦成 Linux 中国技术组组长 | | 16:30~17:00 | 神秘议题 | | 17:00~17:30 | 闪电演讲(短分享) | #### 《技术之旅:从结识 Linux 到创业——我的 Linux 历程》 ![](/data/attachment/album/202310/24/173923b7aa7k46a5x7xezv.jpg) *孙康,成都不周山文化发展有限公司 CEO* 作为一个 Linuxer, 我是如何与 Linux 结缘,又是如何一步步从嵌入式开发,深入 Linux 生态,并最终走到创业路的故事。 #### 《如何高效参与开源》 ![老王(wxy),Linux 中国技术社区创始人](/data/attachment/album/202309/18/145415gaezeh3hoaezjsee.jpg "老王(wxy),Linux 中国技术社区创始人") *老王(wxy),Linux 中国技术社区创始人* 老王的经典分享,聊聊作为一个社区新人,应该如何参与到开源社区当中,并逐步成长为社区的中坚力量的。 #### 《大模型开发经验分享》 ![](/data/attachment/album/202310/24/173949dapkw6mx8ewr7qok.jpg) *白宦成,Linux 中国技术组组长* 作为一个大模型开发者,分享一些自己在使用 LLMs 开发应用的经验,帮助大家上手使用 LLMs。开发者也要使用 LLMs 优化工作流! #### ⚡️闪电演讲 本次线下活动依旧保留闪电演讲环节,作为最受欢迎的线下活动,本次活动依旧继续举办闪电演讲。每位演讲者有 5 分钟时间参与现场活动,可以提前报名,也可即兴上台演讲。时间一满,马上结束~强制大家控制自己的分享时间,用最短的时间,向大家发出你的声音~ 上海场闪电演讲照片: ![胡张治分享自己从 GNU/Linux 小白到 ArchLinuxCN 贡献者的旅程](/data/attachment/album/202307/31/143352a1xz1nmwywpwn0ma.jpg "胡张治分享自己从 GNU/Linux 小白到 ArchLinuxCN 贡献者的旅程") *胡张治分享自己从 GNU/Linux 小白到 ArchLinuxCN 贡献者的旅程* ![李伟光现场介绍 neovim 的使用](/data/attachment/album/202307/31/143411w0xj33s5fosxo4sf.jpg "李伟光现场介绍 neovim 的使用") *李伟光现场介绍 neovim 的使用* ### 活动地点及到达信息 四川省成都市武侯区天府五街200号 **菁蓉汇 7 栋 5 号会议室** ![](/data/attachment/album/202310/24/174022qvsawollab0va4l2.png) 如果你因为有事,没办法来到线下,那也没问题,我们的活动也会在 **Linux 中国视频号、Linux 中国 B 站、龙蜥 B 站、龙蜥钉钉群**等开启同步直播。 当然,我们更希望你能亲自来到线下,和我们一起聊聊开源,聊聊技术~ > > **[点此报名](https://jinshuju.net/f/oYUkwF)** > > > **并在活动前收到我们的提醒**~此外,也可以在问卷中反馈你想听的内容,我们将竭尽所能,邀请行业专家,针对大家感兴趣的话题进行分享。 ![](/data/attachment/album/202310/17/164149tn6kwvmkz16uokkn.png) > 本次活动免费参与,如果你希望参加同期举行的**中国开源年会 COSCON 2023**,欢迎大家入群后联系小助手,分享活动推文,即可领取赠票。 > > **[中国开源年会 COSCON 2023](https://mp.weixin.qq.com/s/o6n4eT7uHbZc4LYMKSJyPg)** > > > *(题图:MJ/ff7ab7b7-35ac-452b-901f-d8369f89b067)*
302
Found
null
16,315
Overskride:刚刚出现的一款有趣的 Linux 蓝牙应用!
https://news.itsfoss.com/bluetooth-app-linux-overskride/
2023-10-25T09:30:00
[ "蓝牙" ]
https://linux.cn/article-16315-1.html
![](/data/attachment/album/202310/25/092956c1jb1bqxx8qryrju.jpg) > > 通过这个全新的应用可以实现所有蓝牙功能! > > > 一款适用于 Linux 的新应用已经出现,它可能是满足你所有蓝牙需求的一站式应用。 这款名为 “**Overskride**” 的开源应用首次发布。尽管它还处于开发阶段,但已经提供了一些不错的功能。 请允许我带你看一下。 ### Overskride:可以期待什么? ![](/data/attachment/album/202310/25/093023teitihoe55etdeoh.png) Overskride 将会吸引 Rust 爱好者,因为它**主要是用 Rust 语言**编写的,带有 **GTK4/libadwaita 风格**。 根据开发人员的说法,它是一个**简单的蓝牙和 Obex 客户端** *(未来计划)*,无论使用什么桌面环境或窗口管理器都可以工作。 一些主要功能包括: * 信任/阻止设备。 * 能够发送/接收文件。 * 设置连接超时时间。 * 支持配置适配器。 查看上面的截图,你可以看到自定义蓝牙设备和连接的所有基本选项,包括适配器名称。 当然,考虑到这是该应用的第一次发布,人们不应该抱有太高的期望。因此,还有改进的空间。 以下是 **Overskride 的一些预览**,以查看它提供的功能。 我在 Ubuntu 22.04 LTS 和 GNOME 42.9 上使用提供的 Flatpak 包进行安装。在此安装上运行似乎没有任何问题。 Overskride 能够检测到我的智能手机,并提供多种配置选项。 ![](/data/attachment/album/202310/25/093024uwbnb47lenhxbw22.png) 你可以将设备添加到受信任列表或阻止列表、重命名并发送文件。 我尝试了**文件传输功能**,但在此之前,我必须使用 [Flatseal](https://itsfoss.com/flatseal/) 允许访问用户文件,以便它可以读取我系统上的文件。 ![](/data/attachment/album/202310/25/093026t9mtggzrjstxgti4.png) 我在手机上接受文件传输后,传输开始。速度还可以,文件确实完整地到达那里,没有任何问题。 ![](/data/attachment/album/202310/25/093027qvooddnjdxjnbo46.png) 我必须说,在其首次发布时,开发人员为我们提供了一个有用的实用程序。我很高兴看到其未来版本将提供什么样的改进。 一位 Reddit 用户 [询问](https://www.reddit.com/r/gnome/comments/17a5m99/full_release_of_my_bluetooth_app_d/k5b3ybg/) 是否有任何计划**支持显示无线耳机的电池百分比**。对此,开发人员提到这样做很棘手,因为 每个设备都遵循不同的规范,这使得这一目标更难实现。 ### ? 获得 Overskride 目前,Overskride 只能通过 [GitHub 仓库](https://github.com/kaii-lb/overskride) 以 Flatpak 软件包的形式提供。或者,你也可以从源代码开始编译。 > > **[Overskride (GitHub)](https://github.com/kaii-lb/overskride/releases/)** > > > 我希望开发者在发布稳定版本后将其发布在 [Flathub](https://flathub.org/en) 上,以便用户可以使用。 --- via: <https://news.itsfoss.com/bluetooth-app-linux-overskride/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) A new app for Linux has shown up that could be a one-stop app for all your Bluetooth needs. Called '**Overskride**', it is **an open-source app** making an appearance with its first release. Even though it is in a work-in-progress state, it offers some decent functionality. Allow me to take you through it. ## Overskride: What to Expect? ![a screenshot of oversrkide](https://news.itsfoss.com/content/images/2023/10/Overskride_1.png) Overskride will appeal to the Rust-heads out there, as it is **primarily written in the Rust programming language** with **a GTK4/libadwaita flavor** to it. According to the developer, it is meant to be **a straightforward Bluetooth and Obex client ***(planned for future)* that works irrespective of the desktop environment or window manager being used. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) Some key features include: **Trust/Block devices.****Ability to send/receive files.****Set connection timeout periods.****Support for configuring the adapter.** Looking at the screenshot above, you have got about every essential option to customize the Bluetooth device, and the connection, including the adapter name. Of course, considering this is the first release of the app ever, one should not set high expectations. So, there would be room for improvements. For now, here's **a little sneak peek of Overskride** to check what it offers. I set it up using the provided Flatpak package on Ubuntu 22.04 LTS with GNOME 42.9. It didn't seem to have any issues with running on this setup. Overskride was able to detect my smartphone, with various options to configure it. ![a screenshot of oversrkide showing info about a connected bluetooth device](https://news.itsfoss.com/content/images/2023/10/Overskride_2.png) You can add the device to the trusted list or block list, rename it, and send a file as well. I gave the **file transfer feature** a try, but before I could do that, I had to allow access to user files using [Flatseal](https://itsfoss.com/flatseal/?ref=news.itsfoss.com) so that it could read the files on my system. ![a screenshot of oversrkide file sending feature](https://news.itsfoss.com/content/images/2023/10/Overskride_3.png) The transfer began after I accepted the file transfer on my phone. The speeds were okay, and the file did get there in one piece, without any issues. ![a screenshot of oversrkide doing file transfer via bluetooth](https://news.itsfoss.com/content/images/2023/10/Overskride_4.png) I must say, for its first-ever release, the developer has presented us with a useful utility. I am excited to see what kind of improvements its future releases will offer. The developer [was asked](https://www.reddit.com/r/gnome/comments/17a5m99/full_release_of_my_bluetooth_app_d/k5b3ybg/?ref=news.itsfoss.com) by a Reddit user if there are any plans to** support for showing the battery percentage of wireless headphones.** In response to that, the dev mentioned that it is tricky to do so, as every device follows a different specification, which makes such a goal harder to achieve. **Suggested Read **📖 [Warehouse: A Powerhouse Tool to Manage Flatpak AppsDo you rely on Flatpak applications? Warehouse should help you make things easier.](https://news.itsfoss.com/warehouse/)![](https://news.itsfoss.com/content/images/2023/10/warehouse-first-look-ft.png) ![](https://news.itsfoss.com/content/images/2023/10/warehouse-first-look-ft.png) ## 📥 Get Overskride For now, Overskride is only available via its [GitHub repo](https://github.com/kaii-lb/overskride?ref=news.itsfoss.com) as a Flatpak package. Or, you can compile it from source. I hope the developer publishes it on [Flathub](https://flathub.org/en?ref=news.itsfoss.com) once it gets to a stable release to make it accessible for users. ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,316
一些被忽略的 Git 知识
https://jvns.ca/blog/2023/10/20/some-miscellaneous-git-facts/
2023-10-25T12:23:24
[ "Git" ]
https://linux.cn/article-16316-1.html
![](/data/attachment/album/202310/25/122259mfu0uowyppuyfdyo.jpg) 我一直在慢慢地撰写关于 Git 工作原理的文章。尽管我曾认为自己对 Git 非常了解,但像往常一样,当我尝试解释某事的时候,我又学到一些新东西。 现在回想起来,这些事情都不算太令人吃惊,但我以前并没有清楚地思考过它们。 事实是: * “索引”、“暂存区” 和 `-cached` 是一回事 * 隐匿文件就是一堆提交 * 并非所有引用都是分支或标签 * 合并提交不是空的 下面我们来详细了解这些内容。 ### “索引”、“暂存区” 和 `-cached` 是一回事 当你运行 `git add file.txt`,然后运行 `git status`,你会看到类似以下的输出: ``` $ git add content/post/2023-10-20-some-miscellaneous-git-facts.markdown $ git status Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: content/post/2023-10-20-some-miscellaneous-git-facts.markdown ``` 人们通常称这个过程为“暂存文件”或“将文件添加到暂存区”。 当你使用 `git add` 命令来暂存文件时,Git 在后台将文件添加到其对象数据库(在 `.git/objects` 目录下),并更新一个名为 `.git/index` 的文件以引用新添加的文件。 Git 中的这个“暂存区”事实上有 3 种不同的名称,但它们都指的是同一个东西(即 `.git/index` 文件): * `git diff --cached` * `git diff --staged` * `.git/index` 文件 我觉得我早该早点认识到这一点,但我之前并没有,所以在这里提醒一下。 ### 隐匿文件就是一堆提交 当我运行 `git stash` 命令来保存更改时,我一直对这些更改究竟去了哪里感到有些困惑。事实上,当你运行 `git stash` 命令时,Git 会根据你的更改创建一些提交,并用一个名为 `stash` 的引用来标记它们(在 `.git/refs/stash` 目录下)。 让我们将此博客文章隐匿起来,然后查看 `stash` 引用的日志: ``` $ git log stash --oneline 6cb983fe (refs/stash) WIP on main: c6ee55ed wip 2ff2c273 index on main: c6ee55ed wip ... some more stuff ``` 现在我们可以查看提交 `2ff2c273` 以查看其包含的内容: ``` $ git show 2ff2c273 --stat commit 2ff2c273357c94a0087104f776a8dd28ee467769 Author: Julia Evans <[email protected]> Date: Fri Oct 20 14:49:20 2023 -0400 index on main: c6ee55ed wip content/post/2023-10-20-some-miscellaneous-git-facts.markdown | 40 ++++++++++++++++++++++++++++++++++++++++ ``` 毫不意外,它包含了这篇博客文章。这很合理! 实际上,`git stash` 会创建两个独立的提交:一个是索引提交,另一个是你尚未暂存的改动提交。这让我感到很振奋,因为我一直在开发一款工具,用于快照和恢复 Git 仓库的状态(也许永远不会发布),而我提出的设计与 Git 的隐匿实现非常相似,所以我对自己的选择感到满意。 显然 `stash` 中的旧提交存储在 reflog 中。 ### 并非所有引用都是分支或标签 Git 文档中经常泛泛地提到 “引用”,这使得我有时觉得很困惑。就个人而言,我在 Git 中处理 “引用” 的 99% 时间是指分支或 HEAD,而剩下的 1% 时间是指标签。事实上,我以前完全不知道任何不是分支、标签或 `HEAD` 的引用示例。 但现在我知道了一个例子—— `stash` 是一种引用,而它既不是分支也不是标签!所以这太酷啦! 以下是我博客的 Git 仓库中的所有引用(除了 `HEAD`): ``` $ find .git/refs -type f .git/refs/heads/main .git/refs/remotes/origin/HEAD .git/refs/remotes/origin/main .git/refs/stash ``` 人们在本帖回复中提到的其他一些参考资料: * `refs/notes/*`,来自 [`git notes`](https://tylercipriani.com/blog/2022/11/19/git-notes-gits-coolest-most-unloved-feature/) * `refs/pull/123/head` 和 `refs/pull/123/head`` 用于 GitHub 拉取请求(可通过` git fetch origin refs/pull/123/merge` 获取) * `refs/bisect/*`,来自 `git bisect` ### 合并提交不是空的 这是一个示例 Git 仓库,其中我创建了两个分支 `x` 和 `y`,每个分支都有一个文件(`x.txt` 和 `y.txt`),然后将它们合并。让我们看看合并提交。 ``` $ git log --oneline 96a8afb (HEAD -> y) Merge branch 'x' into y 0931e45 y 1d8bd2d (x) x ``` 如果我运行 `git show 96a8afb`,合并提交看起来是“空的”:没有差异! ``` git show 96a8afb commit 96a8afbf776c2cebccf8ec0dba7c6c765ea5d987 (HEAD -> y) Merge: 0931e45 1d8bd2d Author: Julia Evans <[email protected]> Date: Fri Oct 20 14:07:00 2023 -0400 Merge branch 'x' into y ``` 但是,如果我单独比较合并提交与其两个父提交之间的差异,你会发现当然**有**差异: ``` $ git diff 0931e45 96a8afb --stat x.txt | 1 + 1 file changed, 1 insertion(+) $ git diff 1d8bd2d 96a8afb --stat y.txt | 1 + 1 file changed, 1 insertion(+) ``` 现在回想起来,合并提交并不是实际上“空的”(它们是仓库当前状态的快照,就像任何其他提交一样),这一点似乎很明显,只是我以前从未思考为什么它们看起来为空。 显然,这些合并差异为空的原因是合并差异只显示**冲突** —— 如果我创建一个带有合并冲突的仓库(一个分支在同一文件中添加了 `x`,而另一个分支添加了 `y`),然后查看我解决冲突的合并提交,它看起来会像这样: ``` $ git show HEAD commit 3bfe8311afa4da867426c0bf6343420217486594 Merge: 782b3d5 ac7046d Author: Julia Evans <[email protected]> Date: Fri Oct 20 15:29:06 2023 -0400 Merge branch 'x' into y diff --cc file.txt index 975fbec,587be6b..b680253 --- a/file.txt +++ b/file.txt @@@ -1,1 -1,1 +1,1 @@@ - y -x ++z ``` 这似乎是在告诉我,一个分支添加了 `x`,另一个分支添加了 `y`,合并提交通过将 `z` 替代冲突解决了它。但在前面的示例中,没有冲突,所以 Git 并未显示任何差异。 (感谢 Jordi 告诉我合并差异的工作原理) ### 先这样吧 些写到这里吧,也许我将在学到更多 Git 知识时撰写另一篇关于 Git 的知识的博客文章。 *(题图:MJ/03bfecc3-944e-47a0-a4fd-575293d2ba92)* --- via: <https://jvns.ca/blog/2023/10/20/some-miscellaneous-git-facts/> 作者:[Julia Evans](https://jvns.ca/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[KaguyaQiang](https://github.com/KaguyaQiang) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
I’ve been very slowly working on writing about how Git works. I thought I already knew Git pretty well, but as usual when I try to explain something I’ve been learning some new things. None of these things feel super surprising in retrospect, but I hadn’t thought about them clearly before. The facts are: [the “index”, “staging area” and “–cached” are all the same thing](#the-index-staging-area-and-cached-are-all-the-same-thing)[the stash is a bunch of commits](#the-stash-is-a-bunch-of-commits)[not all references are branches or tags](#not-all-references-are-branches-or-tags)[merge commits aren’t empty](#merge-commits-aren-t-empty) Let’s talk about them! ### the “index”, “staging area” and “–cached” are all the same thing When you run `git add file.txt` , and then `git status` , you’ll see something like this: ``` $ git add content/post/2023-10-20-some-miscellaneous-git-facts.markdown $ git status Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: content/post/2023-10-20-some-miscellaneous-git-facts.markdown ``` People usually call this “staging a file” or “adding a file to the staging area”. When you stage a file with `git add` , behind the scenes git adds the file to its object database (in `.git/objects` ) and updates a file called `.git/index` to refer to the newly added file. This “staging area” actually gets referred to by 3 different names in Git. All of these refer to the exact same thing (the file `.git/index` ): `git diff --cached` `git diff --staged` - the file `.git/index` I felt like I should have realized this earlier, but I didn’t, so there it is. ### the stash is a bunch of commits When I run `git stash` to stash my changes, I’ve always been a bit confused about where those changes actually went. It turns out that when you run `git stash` , git makes some commits with your changes and labels them with a reference called `stash` (in `.git/refs/stash` ). Let’s stash this blog post and look at the log of the `stash` reference: ``` $ git log stash --oneline 6cb983fe (refs/stash) WIP on main: c6ee55ed wip 2ff2c273 index on main: c6ee55ed wip ... some more stuff ``` Now we can look at the commit `2ff2c273` to see what it contains: ``` $ git show 2ff2c273 --stat commit 2ff2c273357c94a0087104f776a8dd28ee467769 Author: Julia Evans <[email protected]> Date: Fri Oct 20 14:49:20 2023 -0400 index on main: c6ee55ed wip content/post/2023-10-20-some-miscellaneous-git-facts.markdown | 40 ++++++++++++++++++++++++++++++++++++++++ ``` Unsurprisingly, it contains this blog post. Makes sense! `git stash` actually creates 2 separate commits: one for the index, and one for your changes that you haven’t staged yet. I found this kind of heartening because I’ve been working on a tool to snapshot and restore the state of a git repository (that I may or may not ever release) and I came up with a very similar design, so that made me feel better about my choices. Apparently older commits in the stash are stored in the reflog. ### not all references are branches or tags Git’s documentation often refers to “references” in a generic way that I find a little confusing sometimes. Personally 99% of the time when I deal with a “reference” in Git it’s a branch or `HEAD` and the other 1% of the time it’s a tag. I actually didn’t know ANY examples of references that weren’t branches or tags or `HEAD` . But now I know one example – the stash is a reference, and it’s not a branch or tag! So that’s cool. Here are all the references in my blog’s git repository (other than `HEAD` ): ``` $ find .git/refs -type f .git/refs/heads/main .git/refs/remotes/origin/HEAD .git/refs/remotes/origin/main .git/refs/stash ``` Some other references people mentioned in reponses to this post: `refs/notes/*` , from`git notes` `refs/pull/123/head` , and`refs/pull/123/head` for GitHub pull requests (which you can get with`git fetch origin refs/pull/123/merge` )`refs/bisect/*` , from`git bisect` ### merge commits aren’t empty Here’s a toy git repo where I created two branches `x` and `y` , each with 1 file (`x.txt` and `y.txt` ) and merged them. Let’s look at the merge commit. ``` $ git log --oneline 96a8afb (HEAD -> y) Merge branch 'x' into y 0931e45 y 1d8bd2d (x) x ``` If I run ` git show 96a8afb` , the commit looks “empty”: there’s no diff! ``` git show 96a8afb commit 96a8afbf776c2cebccf8ec0dba7c6c765ea5d987 (HEAD -> y) Merge: 0931e45 1d8bd2d Author: Julia Evans <[email protected]> Date: Fri Oct 20 14:07:00 2023 -0400 Merge branch 'x' into y ``` But if I diff the merge commit against each of its two parent commits separately, you can see that of course there **is** a diff: ``` $ git diff 0931e45 96a8afb --stat x.txt | 1 + 1 file changed, 1 insertion(+) $ git diff 1d8bd2d 96a8afb --stat y.txt | 1 + 1 file changed, 1 insertion(+) ``` It seems kind of obvious in retrospect that merge commits aren’t actually “empty” (they’re snapshots of the current state of the repo, just like any other commit), but I’d never thought about why they appear to be empty. Apparently the reason that these merge diffs are empty is that merge diffs only show **conflicts** – if I instead create a repo with a merge conflict (one branch added `x` and another branch added `y` to the same file), and show the merge commit where I resolved the conflict, it looks like this: ``` $ git show HEAD commit 3bfe8311afa4da867426c0bf6343420217486594 Merge: 782b3d5 ac7046d Author: Julia Evans <[email protected]> Date: Fri Oct 20 15:29:06 2023 -0400 Merge branch 'x' into y diff --cc file.txt index 975fbec,587be6b..b680253 --- a/file.txt +++ b/file.txt @@@ -1,1 -1,1 +1,1 @@@ - y -x ++z ``` It looks like this is trying to tell me that one branch added `x` , another branch added `y` , and the merge commit resolved it by putting `z` instead. But in the earlier example, there was no conflict, so Git didn’t display a diff at all. ### that’s all! I’ll keep this post short, maybe I’ll write another blog post with more git facts as I learn them.
16,318
Grayjay:可能是终极的视频流应用程序
https://news.itsfoss.com/video-streaming-app/
2023-10-26T11:53:00
[ "流媒体" ]
https://linux.cn/article-16318-1.html
![](/data/attachment/album/202310/26/115233ydzdt8kedtkkt7ti.jpg) > > 一款可提供源代码的应用,让视频流应用不再烦恼。你怎么看? > > > 视频流媒体服务大多包含 DRM,并限制下载离线媒体拷贝,即使你拥有这些媒体。 每个平台都有自己的一套规则,这些规则对创作者来说可能公平也可能不公平。那么,对于消费者来说呢?要关注多个网络,而且平台可用的订阅选项也很混乱。 如果我们有一个**单一应用让我们访问所有这些网络的视频怎么样?** **不仅如此:如果我们可以拥有离线下载**的福利以及更多功能,例如能够在同一应用中**将视频投射到电视**,而无需使用多个应用,那会怎么样? 而且,这些功能都以**应用的形式存在,其源码可以检查和修改**。听起来令人印象深刻,对吧? 嗯,这就是一个组织 [FUTO](https://futo.org/)([**Louis Rossmann**](https://www.youtube.com/@rossmanngroup) 是其成员之一)提出的。 来认识一下 “**Grayjay**”,你可以在该应用中**跨多个网络关注内容创作者,没有 DRM 和任何不必要的限制**。 ### Grayjay:专注于创作者 ![](/data/attachment/album/202310/26/115328hkl7xn7vy9nzyvgl.jpg) Grayjay 是一款媒体应用,旨在让创作者控制他们拥有的视频以及任何获利机会。 该应用处于初始阶段,因此其主要目标尚未反映在该应用中。 目前,该应用是一个**提供源码**的产品,你可以在其中观看来自你喜爱的网络的视频,同时摆脱跟踪器、广告和平台的其他烦恼。 **Louis Rossmann** 是这个项目的中心,我相信这让我们值得去看一下: > > ? Louis 是一位颇受欢迎的 YouTuber,他发布的视频涉及可维修性、反竞争行为等。他总是说出自己的想法,这使我们大多数人都喜欢他。 > > > 具体大家可以观看视频,我给大家总结一下,节省大家的时间: * Grayjay 的目标是成为 [Newpipe](https://newpipe.net/) 和 [YouTube ReVanced](https://revanced.app/) 等应用的**更好替代品**。 * 该应用**提供源码**,它允许你查看源代码,根据你的要求制作你自己的版本(但不能用于商业用途)。 * 该应用**不是免费的**,其商业模式将用户视为客户,而不是产品。然而,如果没有任何 DRM,该应用最终将为你提供无限的免费试用期。 * 虽然 Louis 将其称为“开源”以让大多数人理解,但它并不具有你通常期望的标准许可证。他们选择使用非标准许可证,以便能够阻止该应用的恶意重新分发。 你可以在其 [GitLab 页面](https://gitlab.futo.org/videostreaming/grayjay) 及其 [官方网站](https://grayjay.app/) 上仔细查看它。 > > **[Grayjay](https://grayjay.app/)** > > > 目前仅适用于安卓。考虑到它仍在开发中,你可以决定安装 APK 来尝试一下。 ? 该应用提供了源代码,Louis 提到它可以针对个人使用场景重新分发。你对 Grayjay 有何看法? 分享你的意见。 --- via: <https://news.itsfoss.com/video-streaming-app/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Video streaming services mostly include DRMs and restrictions to download offline copies of the media, even if you own them. Every platform has its set of rules that may or may not be fair to the creators. And, for consumers? Multiple networks to follow, and confusion regarding subscription options available for the platforms. What if we had a **single application that allowed us to access videos from all those networks?** **Not just that:** what if we could have the perks of **offline downloads** and more features like the ability to **cast videos to TV **within the same app, without needing to use multiple apps? And, all of that in the form of **an app whose source code is available to inspect and modify**. Sounds impressive, right? Well, that's what an organization, [FUTO](https://futo.org/?ref=news.itsfoss.com) (with [ Louis Rossmann](https://www.youtube.com/@rossmanngroup?ref=news.itsfoss.com) being one of its members) has come up with. Meet "**Grayjay**", an app where you can **follow content creators across multiple networks** **without DRMs and any unnecessary restrictions**. ## Grayjay: Focusing on Creators ![grayjay app screenshots](https://news.itsfoss.com/content/images/2023/10/gray-jay.jpg) Grayjay is a media app that aims to give creators control over the videos they own, along with any monetization opportunities. The app is in its initial phase, so its primary objective is not yet reflected with the app. At present, the app is a **source-available** offering where you can watch videos from your favorite networks while getting rid of trackers, ads, and other annoyances of the platforms. **Louis Rossmann** is at the center of this project, and I believe that makes it worthwhile for us to check it out. [Louis Rossmann](https://www.youtube.com/@rossmanngroup/videos?ref=news.itsfoss.com)channel to know more. The video included information such as: - Grayjay aims to be a **better replacement to apps**like[Newpipe](https://newpipe.net/?ref=news.itsfoss.com)and[YouTube ReVanced](https://revanced.app/?ref=news.itsfoss.com). - The app is **source-available**, which allows you to inspect the source code, make your own version of it as per your requirements (but not for commercial usage). - The app is **not free**to have a business model where users are treated as customers, not products. However, without any DRM, the app will end up offering you an infinite free trial period. - While Louis mentions it as **open-source**for most people to understand, it does not feature the standard license that you would normally expect. They chose to go with a non-standard license to be able to take down malicious redistribution of the app. You can take a closer look at it on its [GitLab page](https://gitlab.futo.org/videostreaming/grayjay?ref=news.itsfoss.com) and its [official website](https://grayjay.app/?ref=news.itsfoss.com). It is currently available for Android only. Considering it is still a work-in-progress, you can decide to install the APK to try it out. *💬 While the app is source-available, Louis mentions that it can be redistributed for personal use-cases. What do you think about Grayjay? Share your thoughts*. ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,319
Word 迎接它的 40 周年生日
https://www.theregister.com/2023/10/25/microsoft_word_40/?td=rt-3a
2023-10-26T15:27:00
[ "Word" ]
https://linux.cn/article-16319-1.html
![](/data/attachment/album/202310/26/152738tj0xaxjofnhttz8a.jpg) > > 1983 年,大卫·科波菲尔令人惊讶的使自由女神像消失的同时,Word for DOS 诞生了。 > > > 今天,Word 已经有 40 年历史了。撇开庆祝不谈,值得一提的是,时至 2023 年,这款生产力应用,并不一直是如今在许多工作站上看到的那个臃肿的样子。 首个版本的 Word (最初称为 “Multi-Tool Word”)于 1983 年 10 月 25 日在 Xenix 和 MS-DOS 平台上发布。这款产品支持 16 位图形和文本模式,同时也兼容当时刚出现的 “点击设备”——鼠标。 编写这个版本的团队包括 <ruby> 查尔斯·西蒙尼 <rt> Charles Simonyi </rt></ruby> 等人,他们过去曾在 <ruby> 施乐帕克 <rt> Xerox PARC </rt></ruby> 工作,后来在微软的应用部门获得了成功。可以公正的说,Word 的成功非一日之功。 当时,它面对 WordStar 等老牌产品的激烈竞争,当 Word 发布时,WordStar 已占据了约四分之一的文字处理市场。而在 DOS 上首度亮相的 WordPerfect,也是潜在的威胁。 Word 的首个版本并非完全的所见即所得应用,但微软坚持不懈,在接下来的数年里逐步增加其特性,直至 1993 年的最后一个 DOS 版本 —— Word 6.0 for DOS。然而,与此同时,一个新的竞争者即将全面掌控这个市场,那就是 Word for Windows。 Word for Windows 从默默无闻,到不到 10 年就占据了文字处理市场 90% 的份额。 第一版 Windows 版本的 Word 在 1989 年发布,但直到 1990 年 Windows 3.0 的发布,这款软件才奠定了它今天的巨大商业成功。Word for Windows 2.0 在 1991 年面世,对于笔者来讲,这是 Word for Windows 开始膨胀前的黄金时期,直到 Word 6.0 for Windows 的推出,软件的臃肿问题才开始一发不可收拾。 现阶段,它的名称变为 Office 365 的 Word,毫无疑问,微软的精英团队正竭尽全力想办法如何在其中融入 “AI” 这个词汇。 然而,我们回顾 1983 年,Word 在竞争对手主导的文字处理器市场中不过是众多选择之一。正如 Word 曾试图挑战竞争对手的主导地位,近年来,它的市场份额也在慢慢被如谷歌文档等竞争者侵蚀。 1984 年首次发布的 Word 1.1a 的源代码可以在 [计算机历史博物馆](https://computerhistory.org/blog/microsoft-word-for-windows-1-1a-source-code/) 找到。这个 ZIP 文件仅有不到 7MB,你可以想象一下。 *(题图:MJ/30bb1962-25de-4751-b828-566c4657d8c3)* --- via: <https://www.theregister.com/2023/10/25/microsoft_word_40/> 作者:[Richard Speed](https://www.theregister.com/Author/Richard-Speed "Read more by this author") 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](/article-16309-1.html) 荣誉推出
200
OK
# Word turns 40: From 'new kid on the block' to 'I can't believe it's not bloatware' ## In 1983, David Copperfield vanished the Statue of Liberty and Word for DOS turned up Microsoft's Word is 40 years old today. Celebrations aside, it's worth pointing out the productivity juggernaut of 2023 was not always the bloated behemoth that is found on so many workstations. The very first version of Word – or Multi-Tool Word as it was initially known – came out on October 25, 1983 for Xenix and MS-DOS. It featured 16-bit graphics and text mode support, as well as support for that newfangled clicky thing, the mouse. Coded by a team that included such luminaries-to-be as Charles Simonyi – who had previously worked at Xerox PARC and would later go on to success in Microsoft's application division – it is fair to say that Word was not quite an overnight success. It faced stiff competition from incumbents, such as WordStar, which, at the time of Word's release, accounted for nearly a quarter of the word processor market. WordPerfect also presented a threat, having debuted on DOS the previous year. The first version of Word was not exactly a WYSIWYG application, but Microsoft soldiered on and added features incrementally over the years until the final iteration – Word 6.0 for DOS in 1993. By then, there was a new Word in town that would lay waste to all before it – Word for Windows. Word for Windows would go from obscurity to accounting for 90 percent of the word processor market by revenue in under 10 years. [CEO Satya Nadella thinks Microsoft hung up on Windows Phone too soon](https://www.theregister.com/2023/10/25/nadella_windows_phone_regrets/)[Microsoft opens early access to AI assistant for infosec, Security Copilot](https://www.theregister.com/2023/10/23/microsoft_security_copilots_early_access/)[Microsoft admits 'power issue' downed Azure services in West Europe](https://www.theregister.com/2023/10/23/microsoft_azure_power_issue/)[Microsoft CEO Nadella's compensation drops... to $48M](https://www.theregister.com/2023/10/20/microsoft_ceo_nadellas_compensation_drops/) The first Windows version of Word appeared in 1989, but it took the release of Windows 3.0 in 1990 to give the software the enormous commercial success with which it is associated today. Word for Windows 2.0 emerged in 1991 and was, to the mind of this writer, peak Word for Windows before the bloat began to set in with Word 6.0 for Windows, and the kilos piled on. The current edition is dubbed Word for Office 365, and we have no doubt that Microsoft's brightest minds are currently focused on how to shoehorn the letters "AI" in there. However, back in 1983, Word was just one option in a word processor market dominated by the competition. Just as Word once challenged the dominance of its rivals, it has seen its market share eroded in recent years by competitors like Google Docs. The source code for Word 1.1a, first released in 1984, can be found at the [Computer History Museum](https://computerhistory.org/blog/microsoft-word-for-windows-1-1a-source-code/). The ZIP file comes in at just under seven megabytes. Imagine that. ® 112
16,321
Warehouse:管理 Flatpak 应用的强大工具
https://news.itsfoss.com/warehouse/
2023-10-26T22:41:59
[ "Flatpak" ]
https://linux.cn/article-16321-1.html
![](/data/attachment/album/202310/26/224157oonzwjd1vp0d2p85.jpg) > > 你是否使用 Flatpak 应用?Warehouse 可以让你更轻松。 > > > 有一个应用,可以为你提供有关 Flatpak 应用的所有重要信息,以及管理它的工具,这不是很好吗? 这一次你很幸运! 在这次的首次尝试中,我们有一个有趣的应用程序,名为 “**Warehouse**”,**它可以帮助你管理 Flatpak 应用**。 我们以前介绍过一个类似的应用,名为 “[Flatseal](https://itsfoss.com/flatseal/)”,但它更侧重于管理 Flatpak 的权限。 让我们看看 Warehouse 提供了哪些功能。 ### Warehouse:概述 ⭐ ![](/data/attachment/album/202310/26/224159hcigjec9jjjyyg1c.png) 开发人员将其称为“**多功能工具箱**”,Warehouse 可用于**管理 Flatpak 用户数据**、**查看 Flatpak 的信息**,甚至**批量管理系统上安装的 Flatpaks**。 它主要使用 **Python 语言**编写,具有以下主要特点: * 轻松管理用户数据 * 批量操作功能 * 清除残余数据 ### 初步印象 ?‍? 我一开始是在我的 Ubuntu 系统上测试 Warehouse。从 **Flathub** 上安装它很简单。 打开后,显示了所有**已安装的 Flatpak 应用**的列表。它们**都以有序的方式排列**。 在我看来,如果它们添加了切换到网格布局的选项,会看起来更好。 ![](/data/attachment/album/202310/26/224200u2cwyz0cwyc02xx9.png) > > ? 你是否对列在 Firefox 之上的应用感到好奇?我们最近介绍过它,它是一个名为 “[Mission Center](https://news.itsfoss.com/mission-center/)” 的系统监控应用。 > > > 接下来,我**查看了 Flatpak 应用的属性**,我点击应用旁边的“信息”标志,打开了应用属性窗口。 它提供了有关应用程序的各种信息,从**名称**、**描述**、**应用 ID**,一直到**活动提交**和**安装大小**。 ![](/data/attachment/album/202310/26/224200c5nrv3nfnrovtfo3.png) 类似地,我可以点击“垃圾桶”图标,要么**完全卸载 Flatpak 应用**,要么为将来重新安装**保留用户数据**,并恢复设置/内容。 ![](/data/attachment/album/202310/26/224201kyyynqvr9p38vrm8.png) Warehouse 还具有**搜索功能**,允许你搜索特定的应用。当你安装了很多 Flatpak 应用时,这可能会很有用。 只需点击应用程序左上角的**放大镜**图标即可开始搜索。 ![](/data/attachment/album/202310/26/224201cxg6p6frgdxdmrpl.png) 你还可以**设置过滤器**,以**应用甚至运行时(系统完成各种任务所需的)进行排序**。 点击应用程序左上角的“漏斗”图标以开始筛选。 ![](/data/attachment/album/202310/26/224202m7a8v7v45b4zba48.png) 然后,我查看了**批量操作功能**。我首先点击了应用右上方的“勾号”标志。 然后,我就可以选择多个应用,执行**复制信息**、**删除应用数据**和**卸载它们**等操作。 应用程序右下角的三个小按钮可以方便地执行上述操作。 ![](/data/attachment/album/202310/26/224203dqtn6h6ef777od25.png) 之后,我进入菜单,其中有一些重要选项。 ![](/data/attachment/album/202310/26/224203qe23qse5vffr3333.png) 第一个选项“<ruby> 从文件安装 <rt> Install from file </rt></ruby>”允许我使用 `.flatpakref` 文件安装 Flatpak 应用。 ![](/data/attachment/album/202310/26/224204ulcvltmp3exvnml5.png) 在安装过程中,它问我是要为特定用户安装,还是要为使用系统的所有人安装。我选择了后者。 ![](/data/attachment/album/202310/26/224204sirhvyo27ia2t4bi.png) 随后,我查看了“<ruby> 管理残余数据 <rt> Manage Leftover Data </rt></ruby>”选项。它向我显示了一个旧的 Flatpak 应用留下了多少数据。 我可以选择通过“<ruby> 安装 <rt> Install </rt></ruby>”选项重新安装应用并恢复数据,也可以使用“<ruby> 垃圾桶 <rt> Trash </rt></ruby>”选项彻底清除系统中的任何痕迹。有时,残留数据会占用大量空间。 ![](/data/attachment/album/202310/26/224205qxq7llhm89lshl97.png) 如果你经常安装/删除应用,那么你的系统中可能会有很多剩余数据。 如果你想管理 Flatpak 仓库,可以前往“<ruby> 管理远程仓库 <rt> Manage Remotes </rt></ruby>”选项,该选项允许你添加或删除它们。 ![](/data/attachment/album/202310/26/224205qm3i3esenh3mxsxx.png) 虽然你可以在 Fedora 和其他一些发行版的软件中心完成这项工作,但在一个应用中就能获得所有基本功能,这将是一种无缝体验。 最后,你还可以使用大量的“**键盘快捷键**”,通过键盘快速浏览应用的所有功能。 ![](/data/attachment/album/202310/26/224206yeaei8su8aphphfa.png) ### ? 下载 Warehouse 你可以前往 [Flathub 商店](https://flathub.org/apps/io.github.flattool.Warehouse)下载最新版本。 > > **[Warehouse(Flathub)](https://flathub.org/apps/io.github.flattool.Warehouse)** > > > 你还可以访问其 [GitHub 仓库](https://github.com/flattool/warehouse) 查看源代码。 你对 Warehouse 应用有何看法?请在下面的评论中分享你的想法。 --- via: <https://news.itsfoss.com/warehouse/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Wouldn't it be nice to have an app that could provide you with all the important information regarding a Flatpak app, as well as tools to manage it? Well, you're in luck this time! For this first look, we have an interesting app called '**Warehouse**' that **can help you manage Flatpak apps**. We have covered a similar app in the past, '[ Flatseal](https://itsfoss.com/flatseal/?ref=news.itsfoss.com)', but that is geared towards managing the permissions of a Flatpak. Let's see what kind of functionality Warehouse has to offer. ## Warehouse: Overview ⭐ ![a screenshot of warehouse about section](https://news.itsfoss.com/content/images/2023/10/Warehouse_1.png) Dubbed as “**a versatile toolbox**” by its developers, Warehouse can be used to** manage Flatpak user data**, **view a Flatpak's info**, and even **batch manage the installed Flatpaks on a system**. It has been written primarily in the **Python programming language**, and has the following key features: **Easily manage user data****Batch actions functionality****Leftover data clean up** ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ### Initial Impressions 👨💻 I began testing Warehouse on my Ubuntu setup. It was straightforward to get it installed **from Flathub**. After I opened it, a list was shown with all the **installed Flatpak apps**. These were all **arranged neatly in an ordered list**. In my opinion, it would look even better if they added an option for switching to a grid layout. ![a screenshot of warehouse home screen](https://news.itsfoss.com/content/images/2023/10/Warehouse_2a.png) [Mission Center](https://news.itsfoss.com/mission-center/)'. Next, I moved on to **check the properties of a Flatpak app**, I clicked on the 'Info' logo besides an app to open up the app properties window. It served up all kinds of information pertaining to the app, starting from the **Name**, **Description**, **App ID,** all the way to the **active commit** and the **installed size**. ![a screenshot of warehouse showing flatpak app properties](https://news.itsfoss.com/content/images/2023/10/Warehouse_2b.png) Similarly, I could click on the 'Trash' icon to either **completely uninstall the Flatpak app**, or **keep user data** for future reinstallation, and recover the settings/content. ![a screenshot of warehouse uninstalling a flatpak app](https://news.itsfoss.com/content/images/2023/10/Warehouse_2c.png) Warehouse also has a **search functionality** that allows you to search for specific apps. This can come in handy when you have loads of Flatpak apps installed. Simply click on the magnifying glass at the top-left of the app to get started. ![a screenshot of warehouse search functionality](https://news.itsfoss.com/content/images/2023/10/Warehouse_3.png) You can also **set filters** to **sort through apps or even the runtimes** that are required by your system to accomplish various tasks. Click on the 'funnel' logo at the top-left to start filtering. ![a screenshot of warehouse filter apps functionality](https://news.itsfoss.com/content/images/2023/10/Warehouse_4.png) I then took a look at the **batch actions feature**. I started by clicking on the 'tick-mark' logo at the top-right of the app. It then allowed me to select multiple apps, with the ability to perform actions such as **copying info**, **deleting app data**, and **uninstalling them**. The three little buttons at the bottom-right of the app facilitated the above-mentioned actions. ![a screenshot of warehouse batch selection of flatpak apps functionality](https://news.itsfoss.com/content/images/2023/10/Warehouse_5.png) Post that, I moved on to the hamburger menu that featured some important options. ![a screenshot of warehouse hamburger menu](https://news.itsfoss.com/content/images/2023/10/Warehouse_6.png) The first one '**Install from file'** which allowed me to **install a Flatpak app by using the '.flatpakref' file**. ![a screenshot of warehouse file picker for installing new flatpak app](https://news.itsfoss.com/content/images/2023/10/Warehouse_7a.png) During the installation, it asked me whether I wanted to install it for a specific user, or everyone who uses the system. I chose the latter. ![a screenshot of warehouse installing a flatpak app](https://news.itsfoss.com/content/images/2023/10/Warehouse_7b.png) Subsequently, I took a look at the '**Manage Leftover Data**' option. It showed me how much data an old Flatpak app had left behind. I had the option to reinstall the app and recover the data via the 'Install' option, or I could use the 'Trash' option to completely remove any trace of it from my system. Sometimes leftover data takes up a lot of space. ![a screenshot of warehouse cleaning leftover data from an old flatpak app](https://news.itsfoss.com/content/images/2023/10/Warehouse_8.png) If you are someone who keeps installing/removing apps regularly, you may end up with a lot of leftover data. If you want to manage Flatpak repos, you can head to the '**Manage Remotes**' option that allows you to add or remove them. ![a screenshot of warehouse manage flatpak remotes feature](https://news.itsfoss.com/content/images/2023/10/Warehouse_9.png) While you can do this from the software center on Fedora and some other distributions, it would feel like a seamless experience, getting all the essentials under a single app. And finally, you have plenty of '**Keyboard Shortcuts**' available to storm through all the functionalities of the app using the keyboard. ![a screenshot of warehouse keyboard shortcuts](https://news.itsfoss.com/content/images/2023/10/Warehouse_10.png) ## 📥 Download Warehouse You can head over to the [Flathub store](https://flathub.org/apps/io.github.flattool.Warehouse?ref=news.itsfoss.com) to grab the latest release. You can also visit its [GitHub repo](https://github.com/flattool/warehouse?ref=news.itsfoss.com) to take a look at its source code. *💬 What do you think about the Warehouse app? Share your thoughts in the comments below.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,323
Focusrite 帮助 Linux 开发人员提供驱动程序支持
https://news.itsfoss.com/focusrite-linux/
2023-10-27T23:11:15
[ "DAW" ]
https://linux.cn/article-16323-1.html
![](/data/attachment/album/202310/27/231035gjnehjvraytiwtbw.jpg) > > Focusrite 正在大力支持 Linux 。 > > > 尽管 Linux 作为桌面平台正在快速发展,但与 Windows 和 macOS 相比,它仍然是少数音乐制作人的选择。一个主要原因是缺乏一些 DAW 和硬件制造商的官方支持。 幸运的是,随着大牌企业涉足 Linux,这一切都在改变。好奇么? 嗯,最近,[PreSonus 宣布其 Studio One DAW 支持 Linux](/article-16254-1.html)。 现在,[PreSonus](https://www.presonus.com/) 的直接竞争对手之一 [Focusrite](https://focusrite.com/) 也加入了进来?,他们也生产音频接口和其他专业音频设备。 如果你是音乐制作人或音乐爱好者,你应该知道这些名字往往是彼此的代名词。虽然我目前使用 PreSonus 而不是 Focusrite,但这两家公司及其产品对于大众市场来说都很重要。 ### Focusrite 对 Linux 支持的承诺 **Geoffrey Bennett** 是 [LinuxMusicians](https://linuxmusicians.com/) 论坛的用户,他因致力于为流行的 Focusrite 音频接口(Scarlett 第二代和第三代)提供 Linux 支持而闻名。 当然,这是一项艰巨的非官方任务。 为了更进一步,他最近发起了一项筹款活动,以获得 Focusrite 的最新音频接口,即 [Scarlett 第四代](https://focusrite.com/scarlett/4th-generation)。 除此之外,他的目标是购买 Focusrite 的播客设备。 ![](/data/attachment/album/202310/27/231116h2tpl42tv7vtvrz7.jpg) 筹款活动取得成功的同时,**也得到了 Focusrite 的关注**,**他们提供了大量资金**来帮助他购买最新的音频接口。 **Focusrite 还表示愿意在产品发布前,向他寄送他没有的设备以及未来的产品。** 最重要的是,他们提到了他们的**工程团队如何帮助他改进开发工作**。 > > 虽然我之前一直很难与 Focusrite 的工程师或管理层取得联系,但这次筹款活动获得热烈反响的消息传到了 Focusrite 的高层。考虑到 Linux 音频的小众性质,我一直控制着自己的期望值,但这超出了我的想象。 > > > 我刚刚与他们通了电话,除了提供硬件之外,他们还询问支持开发的其他方式。 > > > Focusrite 不仅主动提出给我寄来我收藏中没有的设备,而且还提议,对于未来的产品发布,他们将尽最大努力提前向我发送设备。这意味着 Linux 支持可以从产品发布之日起就做好准备! > > > 此外,他们正在讨论他们的工程团队如何更好地帮助我简化开发流程,并消除大部分猜测。 > > > —— Geoffrey 来自 [LinuxMusicians](https://linuxmusicians.com/viewtopic.php?t=26173&start=15) > > > 因此,Focusrite 希望确保 Linux 社区能够以更好的体验使用他们的产品。也就是说,间接为 Linux 平台提供官方支持。 这是个大新闻! 这两家大型音频制造商**也应该会说服其他软件和硬件公司**。无论是对驱动程序的官方支持,还是对客户的故障排除支持,任何方式都是可行的。 对 Linux 平台的任何关注都将有助于改善 Linux 音频生态系统。 如果更多的音频公司添加了 Linux 支持,音频专业人士就不必被锁定在专有平台上,也不必支付许可证费用来获得操作系统。 ?我对未来充满希望!你怎么看呢? --- via: <https://news.itsfoss.com/focusrite-linux/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Even though Linux as a desktop platform is evolving fast, it is still a choice for few music producers compared to Windows and macOS. A major reason being the lack of official support from several DAWs and hardware manufacturers. Fortunately, all of that is changing, with big names getting involved with Linux. Curious? Well, recently, [PreSonus announced Linux support](https://news.itsfoss.com/studio-one-linux/) for its Studio One DAW. And, now, [Focusrite](https://focusrite.com/?ref=news.itsfoss.com), one of the direct competitors of [PreSonus](https://www.presonus.com/?ref=news.itsfoss.com) has joined in 🤩They also manufacture audio interfaces and other professional audio equipment. If you are a music producer or an enthusiast, you should know that these names often go as synonymous with each other. While I currently use PreSonus over Focusrite, both the companies and their products are a big deal for the mass market. **Suggested Read **📖 [Best DAW (Digital Audio Workstation) Available for LinuxYou may not get as many choices as Windows or macOS but there are a few Digital Audio Workstation software available for Linux.](https://itsfoss.com/best-daw-linux/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/wordpress/2021/10/DAW-for-LINUX.jpg) ![](https://itsfoss.com/content/images/wordpress/2021/10/DAW-for-LINUX.jpg) ## Focusrite's Pledge to Linux Support **Geoffrey Bennett** is a user on the [LinuxMusicians](https://linuxmusicians.com/?ref=news.itsfoss.com) forums, known for his work to bring Linux support to popular Focusrite audio interfaces (Scarlett 2nd and 3rd gen). Of course, it is a massive undertaking, unofficially. To take that up a notch, he recently launched a fundraiser to get the latest audio interface by Focusrite, i.e., [Scarlett 4th gen](https://focusrite.com/scarlett/4th-generation?ref=news.itsfoss.com). Along with that, he had goals to work on podcast equipment by Focusrite. ![gofundme fundraiser for focusrite driver development](https://news.itsfoss.com/content/images/2023/10/go-fund-me-focusrite.jpg) While the fundraiser was a success, **it also got attention from Focusrite**, and **they contributed a significant amount** to help him get the latest audio interface. **Focusrite also offered to send him any devices he does not have and future products before release. ** To add cherry on top, they mentioned how their **engineering team can help him improve the development work**. While I had previously struggled to connect with the engineers or management at Focusrite, news of the overwhelming response to this fundraiser reached the top tiers there. Given the niche nature of Linux audio, I had kept my expectations in check, but this was beyond what I had imagined. I just got off a call with them where, beyond providing the hardware, they were inquiring about other ways they could support the development. Focusrite not only offered to send me any devices I didn't have in my collection but also proposed that for any future product releases, they will do their utmost to send me devices in advance. This means that Linux support could be ready right from the product launch! Furthermore, they are discussing how their engineering team could better help me to streamline the development process, and eliminate much of the guesswork. - Geoffrey via[LinuxMusicians] So, Focusrite wants to ensure that the Linux community gets to use their products with an improved experience. In other words, indirectly providing official support to the Linux platform. And, this is big news! These two big audio manufacturers **should persuade other software and hardware companies as well**. Whether it is in the form of official support for drivers, troubleshooting support for their customers, anything works. Any kind of attention to the Linux platform will help improve the Linux audio ecosystem. Audio professionals do not have to get locked in the proprietary platforms or pay for a license to get an operating system if more audio companies add Linux support. *💬 I would be hopeful for that future! What do you think?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,325
“安全”这个热词:应避免使用还是该更直接了当?
https://opensource.com/article/22/9/security-buzzword-alternatives
2023-10-28T09:57:00
[ "安全" ]
https://linux.cn/article-16325-1.html
![](/data/attachment/album/202310/28/095718zso6aaitoyyv4ain.jpg) > > 思考一下,如何在你的开源项目中真正定义安全性吧。 > > > 科技行业以创造“热词”而小有名气,当然,其他行业也是如此。譬如,“故事驱动”和“轻规则”是当下流行的桌游概念,“解构”的汉堡和墨西哥卷饼在高级餐厅颇受欢迎。然而,技术热词的问题在于,它们可能直接影响你的生活。当某人标榜应用程序“安全”,以此来吸引你使用他们的产品,产品实际上是在暗示一种承诺:“安全”的含义就是它是安全的,它值得你的使用与信任。但问题是,“安全”这个词可能指的是许多事情,技术行业常将它用作一个过于泛化的术语,以至于它逐渐失去了实际含义。 由于“安全”一词可能含义丰富,也可能一无是处,使用它就需要慎之又慎。事实上,最好是尽量避免使用这个词,取而代之的是,诉诸你真正要表达的东西。 ### 当 “安全” 意味着加密 有时候,“安全” 会被作为 *加密* 的非常不明确的简短表述。在这种情况下,“安全” 指的是,对于外部观察者想要窃听你的数据,要经过一定的困难。 **避免这样表述:**“本网站稳如磐石且安全无忧。” 听起来很棒?你可能会想象一个拥有多重二次验证、零知识证明数据存储以及坚决的匿名策略的网站。 **你可以这么说:**“本网站承诺有 99% 的在线时间,并且其流量都通过 SSL 进行加密和验证。” 这样一来,承诺的含义变得清晰了,同时也明确了实现 “安全” 的方法(即使用 SSL)以及 “安全“ 的作用范围是什么。 注意,这里并未对隐私或匿名做出任何明确的承诺。 ### 当 “安全” 意味着访问限制 有时,“安全” 这个词是指应用程序或设备的访问权限。如果没有明确的解释,“安全” 可能涵盖从无效的“隐蔽即安全”模式,到简单的 htaccess 密码,直到生物识别扫描器等各种概念。 **避免这样表述:**“我们已经为你防护好了系统。” **你可以这么说:**“我们的系统采用了二步验证法。” ### 当 “安全” 意味着数据存储 “安全” 这个词也可以指你的数据在服务器或设备上的储存方法。 **避免这样表述:**“这个设备在数据存储上考虑了安全因素。” **你可以这么说:**“这个设备利用全盘加密技术来保护你的数据。” 当提到远程存储时,“安全” 可能更多指的是谁可以访问存储数据。 **避免这样表述:**“你的数据是安全的。” **你可以这么说:**“你的数据经过 PGP 加密,仅你持有私钥。” ### 当 “安全” 意味着隐私 今天,“隐私” 一词几乎和 “安全” 一样宽泛且模糊。一方面,“安全” 似乎必然就涉及 “隐私”,然而,这仅在 '安全' 有明确定义时才成立。是因为设有密码阻止外人进入所以称之为私有吗?还是因为数据已加密且仅你拥有密钥所以归为私有?又或者,由于存储你数据的厂商除了 IP 地址外对你一无所知,这才算是私有?光是口头声明 “隐私”,就像未经说明就声明 “安全” 一样,是不够的。 **避免这样表述:**“你的数据在我们这里是安全的。” **你可以这么说:**“你的数据经 PGP 加密,且只有你拥有私钥。我们不需要你的任何个人信息,唯一能识别你的只有你的 IP 地址。” 一些网站会声明 IP 地址在日志中保留期限,及非经法律授权绝不向执法部门交出用户数据等诸多承诺。虽然这些并不属于技术 “安全” 的范畴,但它们全都涉及的是信任度,你不能将这些看作是技术规格。 ### 明确所说 科技是个复杂的话题,极易引发混淆。沟通是至关重要的,虽然有时候简拼和专有名词在某些场合可能管用,但通常来说,讲明白总是比较好的。当你对你的项目的 “安全” 感到自豪,不要只用模糊的词语进行简述。向其他人明确你具体做了什么来保护你的用户,同时也要明确你认为哪些事物已超出你的考量范围,并要经常进行这样的沟通。“安全” 是个好特点,但它的涵盖面过广,所以请勿畏于夸赞自己在某个具体方向上的特别之处。 *(题图:MJ/b8cc54ee-5556-4106-b9fa-b08539452aa7)* --- via: <https://opensource.com/article/22/9/security-buzzword-alternatives> 作者:[Seth Kenlon](https://opensource.com/users/seth) 选题:[lkxed](https://github.com/lkxed) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Technology is a little famous for coming up with "buzzwords." Other industries do it, too, of course. "Story-driven" and "rules light" tabletop games are a big thing right now, "deconstructed" burgers and burritos are a big deal in fine dining. The problem with buzzwords in tech, though, is that they potentially actually affect your life. When somebody calls an application "secure," to influence you to use their product, there's an implicit promise being made. "Secure" must mean that something's secure. It's safe for you to use and trust. The problem is, the word "secure" can actually refer to any number of things, and the tech industry often uses it as such a general term that it becomes meaningless. Because "secure" can mean both so much and so little, it's important to use the word "secure" carefully. In fact, it's often best not to use the word at all, and instead, just say what you actually mean. ## When "secure" means encrypted Sometimes "secure" is imprecise shorthand for *encrypted*. In this context, "secure" refers to some degree of difficulty for outside observers to eavesdrop on your data. **Don't say this:** "This website is resilient and secure." That sounds pretty good! You're probably imagining a website that has several options for 2-factor authentication, zero-knowledge data storage, and steadfast anonymity policies. **Say this instead:** "This website has a 99% uptime guarantee, and its traffic is encrypted and verifiable with SSL." Not only is the intent of the promise clear now, it also explains how "secure" is achieved (it uses SSL) and what the scope of "secure" is. Note that there's explicitly no promise here about privacy or anonymity. ## When "secure" means restricted access Sometimes the term "secure" refers to application or device access. Without clarification, "secure" could mean anything from the useless *security by obscurity* model, to a simple htaccess password, to biometric scanners. **Don't say this:** "We've secured the system for your protection." **Say this instead:** "Our system uses 2-factor authentication." ## When "secure" means data storage The term "secure" can also refer to the way your data is stored on a server or a device. **Don't say this:** "This device stores your data with security in mind." **Say this instead:** "This device uses full disk encryption to protect your data." When remote storage is involved, "secure" may instead refer to who has access to stored data. **Don't say this:** "Your data is secure." **Say this instead:** "Your data is encrypted using PGP, and only you have the private key." ## When "secure" means privacy These days, the term "privacy" is almost as broad and imprecise as "security." On one hand, you might think that "secure" must mean "private," but that's true only when "secure" has been defined. Is something private because it has a password barrier to entry? Or is something private because it's been encrypted and only you have the keys? Or is it private because the vendor storing your data knows nothing about you (aside from an IP address?) It's not enough to declare "privacy" any more than it is to declare "security" without qualification. **Don't say this:** "Your data is secure with us." **Say this instead:** "Your data is encrypted with PGP, and only you have the private key. We require no personal data from you, and can only identify you by your IP address." Some sites make claims about how long IP addresses are retained in logs, and promises about never surrendering data to authorities without warrants, and so on. Those are beyond the scope of technological "security," and have everything to do with trust, so don't confuse them for technical specifications. ## Say what you mean Technology is a complex topic with a lot of potential for confusion. Communication is important, and while shorthand and jargon can be useful in some settings, generally it's better to be precise. When you're proud of the "security" of your project, don't generalize it with a broad term. Make it clear to others what you're doing to protect your users, and make it equally clear what you consider out of scope, and communicate these things often. "Security" is a great feature, but it's a broad one, so don't be afraid to brag about the specifics. ## Comments are closed.
16,326
人工智能教程(一):基础知识
https://www.opensourceforu.com/2022/08/artificial-intelligence-explaining-the-basics/
2023-10-29T15:57:22
[ "AI" ]
https://linux.cn/article-16326-1.html
![](/data/attachment/album/202310/29/155650e3vap2on6vwrrmpx.jpg) > > 如果你是关注计算机领域最新趋势的学生或从业者,你应该听说过人工智能、数据科学、机器学习、深度学习等术语。作为人工智能系列文章的第一篇,本文将解释这些术语,并搭建一个帮助初学者入门的简易教学平台。 > > > 如今,计算机科学领域的学生和从业者绝对有必要了解<ruby> 人工智能 <rt> artificial intelligence </rt></ruby>、<ruby> 数据科学 <rt> data science </rt></ruby>、<ruby> 机器学习 <rt> machine learning </rt></ruby>、<ruby> 深度学习 <rt> deep learning </rt></ruby>方面的基本知识。但是应该从哪里开始呢? 为了找到答案,我浏览了大量人工智能的教材和教程。它们有的从大量数学理论开始,有的用编程语言无关的方式(不要求你了解某一门特定的编程语言)讲解,有的假设你是线性代数、概率论和统计学专家。在很大程度上,它们都很有用。但它们都没有回答最重要的问题:真正的初学者应该从哪里开始学习人工智能? 开始学习人工智能的方式多种多样,但是我对它们各有担忧。涉及太多的数学会让人分心,但如果数学介绍得太少就好像驾驶员不知道汽车引擎在哪里一样。对于未来的人工智能工程师和数据科学家来说,从进阶概念开始讲解是最有效率的方式,因为他们精通线性代数、概率论和统计学。如果从基础知识开始,然后在中间某个地方结束也可以,只要学员想要在这里结束学习。考虑到所有这些事实,我认为初学者的人工智能教程应该从基础知识开始,并以一个实际的人工智能项目结束。这个项目可能很小,但是在相同任务上它将会超越任何传统项目。 本系列将从最基础的知识讲到中等水平内容。除了讨论人工智能,我还希望对相关的话题进行一些澄清,因为人们对人工智能、机器学习、数据科学等术语有很多困惑。人工智能程序是必要的,因为我们每天会产生海量的数据。根据互联网上查询到的结果,我们每天大约会产生 2.5x10<sup> 18</sup> 字节的数据。但是,这些数据中的大多数与我们完全无关,包括大量没有价值的 YouTube 视频,不经思考就发送的电子邮件,琐碎的新闻报道等等。然而,这片浩瀚的数据海洋中同样蕴含着无价的宝贵知识。传统软件无法完成处理这些数据的艰巨任务。人工智能是少数能够应对这种信息过载的技术之一。 当谈到到人工智能时,我们还需要区分事实和假象。我记得几年前听一位人工智能专家的演讲。他讲述了一个人工智能图像识别系统,它能近乎绝对准确地分辨西伯利亚雪橇犬和西伯利亚雪狼的图像。在互联网上搜索一下,你会看到这两种动物有多么相似。如果这个系统确实那么准确,它将是人工智能的奇迹。可惜的是,事实并非如此。该图像识别系统只是对图像的背景进行了分类。西伯利亚雪橇犬是家养动物,它的图像背景中几乎总会有一些矩形或圆形的物体。而西伯利亚雪狼是野生动物,它所在的背景中有雪。这些例子导致近年来人们对人工智能提出了准确性担保要求。 确实,最近几年人工智能展现了一些真正的力量。举个简单例子就是 YouTube、Amazon 等网站的推荐系统。很多时候我惊讶于它们的推荐结果,就好像它们会读心术一样。然而不论这些推荐的质量如何,“人工智能到底是好是坏?”都是一个很热门话题。我认为,一个像《终结者》中机器有意识地攻击人类的未来还遥遥无期。然而,前面那句话中的“有意识地”一词非常重要。目前的人工智能系统可能发生故障,并且意外地伤害到人类。但是,许多号称具有人工智能能力的系统实际上只是包含大量分支和循环的常规软件。因此目前可以安全地说,我们还没有在日常生活中看到人工智能的真正威力。不论是好的影响(如治愈癌症),还是坏的影响(合成的世界领导人视频导致的暴动和战争),我们都只能拭目以待了。就个人而言,我相信人工智能是一种福祉,并将大大提高未来几代人的生活质量。 ### 什么是人工智能? 在我们进一步探讨之前,让我们试着理解人工智能(AI)、机器学习(ML)、深度学习(DL)、数据科学(DS)等之间的联系和区别。这些术语经常被误用为同义词。图 1 表示了人工智能、机器学习、深度学习和数据科学之间的关系。当然这不是唯一的划分方式,你可能会看到其它的划分图。但在我看来,图 1 是最贴切的,它能够最大程度地概括这些领域之间关系。 ![图 1:人工智能体系结构和数据科学](/data/attachment/album/202310/29/155723qhw71hzewlh1l3kv.jpg) 在本系列的第一篇文章中,我不会对每个术语定义进行精确的定义。我认为在现阶段,精确地定义它们是适得其反的,是浪费时间。但在后续的文章中,我们将重新讨论这些术语并正式定义它们。目前我们可以暂时把人工智能看作是可以在某种程度上模仿人类智能的程序。那人类智能又是指什么呢? 想象一下你的人工智能程序是一个一岁大的婴儿。这个宝宝会通过听周围人说话来学习母语。他/她将很快学会识别形状,颜色,物体等,没有任何困难。此外,他/她将能够对周围人的情绪做出反应。例如,任何一个三岁的婴儿都知道如何用甜言蜜语让父母给他/她巧克力和棒棒糖。同样,人工智能程序也将能够感知并适应环境,就像婴儿一样。然而,这种真正的人工智能只能在遥远的未来实现。 图 1 显示机器学习是人工智能的真子集,它也是实现人工智能系统的技术之一。机器学习是使用大量数据来训练程序的技术,以便有效地执行必要的任务。它的准确性随着训练集的增大而增加。请注意,还有其它技术用于开发人工智能系统,如基于布尔逻辑的系统,基于模糊逻辑的系统,基于遗传编程的系统等。然而,如今机器学习是实现人工智能系统的最主流的技术。图 1 还显示深度学习是机器学习的真子集,它只是众多机器学习技术中的一种。但目前实际上大多数严肃的机器学习技术都用到了深度学习。在这一点上,我甚至避免尝试定义深度学习。请记住,深度学习涉及到使用大型人工神经网络。 那数据科学(图 1 中的红圈)是做什么的呢?数据科学是计算机科学/数学领域中的一门处理和解读大规模数据的学科。我说的“大”,有多大呢?早在 2010 年,Facebook 等一些企业巨头就声称它们的服务器可以处理几 Pb 的数据。当我们说大数据时,通常指的是 Tb 或 Pb 级的数据规模,而不是 Gb 级的。许多数据科学应用涉及人工智能、机器学习和深度学习技术的使用。因此,当我们讨论人工智能时,很难不提到数据科学。数据科学也使用很多传统的编程和数据库管理技术,比如使用 Apache Hadoop 进行大数据分析。 本系列的讨论将主要集中在人工智能和机器学习上,并涉及数据科学。 ### 教学环境搭建 在表明了本系列文章的主题后,现在说说本教程的前置条件。你需要一台 Linux 电脑(当然 Windows 或 macOS 机器也可以,只是在一些安装步骤上可能需要额外的协助),并了解基本的数学和计算机编程知识。我希望在细心地阅读本系列文章后,你会感受到人工智能的强大。 用编程语言无关的方式来学习人工智能是可能的,但本系列将基于一门编程语言并涉及大量的编程。在决定使用哪一门编程语言之前,我们先来回顾一下人工智能、机器学习、深度学习和数据科学领域流行的编程语言。Lisp 是一种函数式编程语言,它是最早用于开发人工智能程序的语言之一。Prolog 是一种逻辑编程语言,在 20 世纪 70 年代也被用于同样的目的。我们将在接下来的介绍人工智能历史的文章中更详细地介绍 Lisp 和 Prolog。 如今,Java、C、C++、Scala、Haskell、MATLAB、R、Julia 等编程语言也被用于开发人工智能程序。Python 在人工智能程序开发中被广泛使用,这使我们选择它作为本教程的编程语言。但我必须声明,从这里开始做的选择(更确切地说,是我替你做的选择),主要考虑的因素是易用性、受欢迎程度、(在少数情况下)我自己对该软件/技术的适应和熟悉程度、对本教程效率的提升。但同时,我也鼓励你尝试其它的编程语言、软件和工具。也许从长远来看,它们对你来说可能是更好的选择。 现在我们需要立即做出另一个选择:使用 Python 2 还是 Python 3?考虑到本系列有许多年轻的读者,他们还有漫长的职业生涯,我将选择使用 Python 3。在 Ubuntu 系统终端中执行命令 `sudo apt install python3` 安装最新版本的 Python 3(你的系统中可能已经安装了 Python 3)。在其它 Linux 发行版、Windows 和 macOS 机器上安装 Python 3 也非常容易。执行下面的命令查看安装的 Python 3 的版本: ``` python3 --version Python 3.8.10 ``` 在后续的教程中,我们需要安装许多 Python 包,所以需要一个包管理器。目前主流的包管理器有 pip、Conda 和 Mamba 等。我选择 pip 作为包在本教程的管理器。它相对简单,也是推荐的 Python 安装工具。我认为 Conda 和 Mamba 是比 pip 更强大的工具,你可以尝试一下它们。运行命令 `sudo apt install python3-pip` 将在 Ubuntu 系统中安装 pip。pip、Conda 和 Mamba 是跨平台软件,它们可以安装在 Linux、Windows 和 macOS 系统上。运行命令 `pip3 --version` 查看系统中安装的 pip 版本,如下所示: ``` pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8) ``` 现在我们需要一个 Python 集成开发环境(IDE)。IDE 能帮助程序员更容易地编写、编译、调试和执行代码。PyCharm、IDLE、Spyder 等都是流行的 Python IDE。然而,由于我们的主要目的是开发人工智能和数据科学程序,这里考虑另外两个强有力的竞争者 —— JupyterLab 和谷歌 Colab。严格地说,它们不仅仅是 IDE;它们是非常强大的基于网络的交互式开发环境。两者都可以在网络浏览器上工作,并提供强大的功能。JupyterLab 是由非营利组织 Project Jupyter 支持的免费开源软件。谷歌 Colab 遵循 <ruby> 免费增值 <rt> freemium </rt></ruby> 模式,即基本功能免费,附加功能收费。我认为谷歌 Colab 比 JupyterLab 功能更强大。但是由于谷歌 Colab 的免费增值模式,以及我相对缺乏谷歌 Colab 的使用经验,在本教程中我选择 JupyterLab。但我仍然强烈建议你去了解一下谷歌 Colab。 可以使用命令 `pip3 install JupyterLab` 在本地安装 JupyterLab。执行命令 `jupyter-lab` 将在系统的默认网络浏览器中运行 JupyterLab。Project Jupyter 还提供一个更老的类似系统,称为Jupyter Notebook。可以通过 `pip3 install Notebook` 命令在本地安装 Jupyter Notebook,用`Jupyter Notebook` 运行它。但 Jupyter Notebook 的功能不如 JupyterLab 强大,且官方宣布它最终会被 JupyterLab 取代。在本教程中,我们将在合适的阶段使用 JupyterLab。但在开始阶段,我们将使用 Linux 终端来运行 Python 程序,因此急需的是包管理器 pip。 Anaconda 是一个非常流行的 Python 和 R 编程语言发行版,它主要用于机器学习和数据科学领域。作为未来的人工智能工程师和数据科学家,熟悉使用 Anaconda 也是一个不错的选择。 现在我们需要确定最重要的一点 —— 本教程的风格。有大量人工智能开发相关的 Python 库,比如 NumPy、SciPy、Pandas、Matplotlib、Seaborn、TensorFlow、Keras、Scikit-learn 和 PyTorch。许多关于人工智能、机器学习和数据科学的教材和教程都是基于对其中一个或多个库的完整讲解。尽管对特定包的功能进行这样的覆盖讲解是一种高效的方式,但我的教程是更面向数学的。我们将首先讨论开发人工智能程序所需的数学概念,然后再介绍需要的 Python 基础知识和 Python 库。我们会为了探索实现这些数学概念所需的特性而不断回顾这些 Python 库。有时我也会要求你自己学习一些 Python 和数学的基本概念。 在完成这些准备工作之后,如果我们就在这里结束,任何代码或数学概念都不讲,那将是一种罪过。因此,我们将继续学习人工智能和机器学习中最重要的数学概念:向量和矩阵。 #### 向量和矩阵 矩阵是按行和列排列的数字、符号或数学表达式构成的矩形阵列。图 2 显示了一个 2 × 3 矩阵,它有 2 行和 3 列。如果你熟悉编程,在许多流行的编程语言中这个矩阵可以表示为一个二维数组。只有一行的矩阵称为行向量,只有一列的矩阵称为列向量。 ![](/data/attachment/album/202310/29/145931wm9voyym8t9h1tqo.svg) 就是一个行向量。 ![图 2:一个: A 2 × 3 的矩阵](/data/attachment/album/202310/29/155723eqy1zb6mqxllg66x.jpg) 为什么矩阵和向量在人工智能和机器学习中如此重要呢?人工智能和机器学习中广泛使用线性代数,而矩阵和向量是线性代数的核心。几个世纪以来,数学家们一直在研究矩阵和向量的性质和应用。高斯、欧拉、莱布尼茨、凯利、克莱姆和汉密尔顿等数学家在线性代数和矩阵论领域都有以他们的名字命名的定理。多年来,线性代数中发展出了许多分析矩阵和向量性质的技术。 复杂的数据通常可以很容易用向量或矩阵来表示。举一个简单的例子,从一个人的医疗记录中,可以得到详细的年龄、身高(厘米)、体重(公斤)、收缩压、舒张压和空腹血糖(毫克/分升)。这些信息可以很容易用行向量来表示, ![](/data/attachment/album/202310/29/155156vhtjgpgpmr2gp2bp.svg) 。人工智能和机器学习的第一个挑战来了:如果医疗记录有十亿条怎么办?即使动用成千上万的专业人员从中手动提取数据,这项任务也是无法完成的。因此,人工智能和机器学习利用程序来提取数据。 人工智能和机器学习的第二个挑战是数据解读。这是一个广阔的领域,有许多技术值得探索。我将在后续文章中介绍相关内容。人工智能和机器学习应用除了面临数学/计算方面的挑战外,还面临硬件方面的挑战。随着处理的数据量的增加,数据存储、处理器速度、功耗等也成为人工智能应用面临的重要挑战。但现在让我们先抛开这些挑战,动手编写第一行人工智能代码。 我们将编写一个简单的 Python 脚本,用来将两个向量相加。我们将用到名为 NumPy 的 Python 库,它支持多维矩阵(数组)的数学运算。用命令 `pip3 install numpy` 为 Python 3 安装 NumPy 包。如果你使用的是 JupyterLab、谷歌 Colab 或 Anaconda,那么 NumPy 应该已经被预安装了。但是为了演示,在本系列的前几篇文章中,我们都将在 Linux 终端上操作。在 Linux 终端上执行命令 `python3` 进入 Python 控制台。在这个控制台中可以逐行执行 Python 代码。图 3 展示了在控制台中逐行运行 Python 代码,将两个向量相加,并输出结果。 ![图 3:两个向量求和的 Python 代码](/data/attachment/album/202310/29/155723ol14fa11o0paf035.jpg) 首先,让我们试着逐行理解这些代码。由于本教程假定的编程经验很少,所以我将代码行标记为【基本】或【AI】。标记为【基本】的行是经典 Python 代码,标记为【AI】的行是用于开发人工智能程序的代码。通过区分基本和进阶的 Python 代码,我希望具有基本知识和中级编程技能的程序员都能够高效地使用本教程。 ``` import numpy as np #【基本】 a = np.array([11, 22, 33]) #【AI】 b = np.array([44, 55, 66]) #【AI】 c = np.add(a, b) #【AI】 print(c) #【基本】 ``` `import numpy as np` 导入 numpy 库并将其命名为 `np`。Python 中的 `import` 语句类似于在 C/C++ 用 `#include` 来包含头文件,或者在 Java 中用`import` 来使用包。 `a = np.array([11, 22, 33])` 和 `b = np.array([44, 55, 66])` 分别创建了名为 `a` 和 `b` 的一维数组(为了便于理解,目前假设向量等价于一维数组)。 `c = np.add(a, b)` 将向量 `a` 和`b` 相加,并将结果存储在名为 `c` 的向量中。当然,用 `a`,`b`,`c` 作为变量名是一种糟糕的编程实践,但数学家倾向于将向量命名为 ![](/data/attachment/album/202310/29/155226dmhqqoqh6vmwvtie.svg)、 ![](/data/attachment/album/202310/29/155233hgadvvi33dho3d3n.svg)、 ![](/data/attachment/album/202310/29/155239palkfhfz9f30x0uu.svg) 等。如果你完全没有 Python 编程经验,请自行了解 Python 变量的相关知识。 `print(c)` 在终端上打印对象的值,即向量 `[55 77 99]`。你可以暂时这样理解向量相加, `c = [55=11+44 77=22+55 99=33+66]`。如果你想正式地了解向量和矩阵是如何相加的,但手头又没有相关的教材,我建议阅读维基百科上关于矩阵加法的文章。在网上搜索一下就会发现,用经典的 C/C++ 或 Java 程序来实现向量相加需要更多的代码。这说明 Python 很适合处理向量和矩阵。当我们执行越来越复杂的向量运算时,Python 的强大将进一步显现。 在我们结束本文之前,我要做两个声明。第一,上面讨论的示例只处理了两个行向量(确切地说是 1 x 3 的矩阵)的相加,但真正的机器学习应用可能要处理 1000000 X 1000000 的矩阵。但不用担心,通过练习和耐心,我们将能够处理这些问题。第二,本文中给出许多定义包含了粗略的简化和不充分的描述。但如前面所说,在本系列结束之前,我将给这些模糊的术语下一个正式的定义。 现在我们该结束这篇文章了。我希望所有人都安装文中提到的必要软件,并运行本文中的代码。在下一篇文章中,我们将首先讨论人工智能的历史、范畴和未来,然后深入探讨线性代数的支柱——矩阵论。 *(题图:MJ/25071901-abc4-4144-bf27-4d98bb1d9301/)* --- via: <https://www.opensourceforu.com/2022/08/artificial-intelligence-explaining-the-basics/> 作者:[Deepu Benson](https://www.opensourceforu.com/author/deepu-benson/) 选题:[lkxed](https://github.com/lkxed) 译者:[toknow-gh](https://github.com/toknow-gh) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
*If you are a student or professional interested in the latest trends in the computing world, you would have heard of terms like artificial intelligence, data science, machine learning, deep learning, etc. The first article in this series on artificial intelligence explains these terms, and sets the platform for a simple tutorial that will help beginners get started with AI.* Today it is absolutely necessary for any student or professional in the field of computer science to learn at least the basics of AI, data science, machine learning and deep learning. However, where does one begin to do so? To answer this question, I have gone through a number of textbooks and tutorials that teach AI. Some start at a theoretical level (a lot of maths), some teach you AI in a language-agnostic way (they don’t care whether you know C, C++, Java, Python, or some other programming language), and yet others assume you are an expert in linear algebra, probability, statistics, etc. In my opinion, all of them are useful to a great extent. But the important question remains — where should an absolute beginner interested in AI begin his or her journey? Frankly, there are many fine ways to begin your AI journey. However, I have a few concerns regarding many of them. Too much maths is a distraction while too little is like a driver who doesn’t know where his/her car’s engine is placed. Starting with advanced concepts is really effective if the potential AI engineer or data scientist is good in linear algebra, probability, statistics, etc. Starting with the very basics and ending at the middle of nowhere is fine only if the potential AI learner wants to end the journey at that particular point. Considering all these facts, I believe an AI tutorial for beginners should start at the very basics and end with a real AI project (small, yet one that will outperform any conventional program capable of performing the same task). This series on AI will start from the very basics and will reach up to an intermediate level. But in addition to discussing topics in AI, I also want to ‘cut the clutter’ (the name of a popular Indian news show) about the topics involved since there is a lot of confusion among people where terms like AI, machine learning, data science, etc, are concerned. AI based applications are often necessary due to the huge volume of data being produced every single day. A cursory search on the Internet will tell you that about 2.5 quintillion bytes of data are produced a day (quintillion is the enormous number 1018). However, do remember that most of this data is absolutely irrelevant to us, including tons of YouTube videos with no merit, emails sent without a second thought, reports on trivial matters on newspapers, and so on and so forth. However, this vast ocean of data also contains invaluable knowledge which often is priceless. Conventional software programs cannot carry out the Herculean task of processing such data. AI is one of the few technologies that can handle this information overload. We also need to distinguish between fact and fiction as far as the power of AI is concerned. I remember a talk by an expert in the field of AI a few years back. He talked about an AI based image recognition system that was able to classify the images of Siberian Huskies (a breed of dogs) and Siberian snow wolves with absolute or near absolute accuracy. Search the Internet and you will see how similar the two animals look. Had the system been so accurate, it would have been considered a triumph of AI. Sadly, this was not the case. The image recognition system was only classifying the background images of the two animals. Images of Siberian Huskies (since they are domestic animals) almost always had some rectangular or round objects in the background, whereas the images of Siberian snow wolves (being wild animals located in Siberia) had snow in the background. Such examples have led to the need for AI with some guarantee for accuracy in recent years. Indeed, AI has shown some of its true power in recent years. A simple example is the suggestions we get from a lot of websites like YouTube, Amazon, etc. Many times, I have been astonished by the suggestions I have received as it almost felt as if AI was able to read my mind. Whether such suggestions are good or bad for us in the long run is a hot topic of debate. Then there is the critical question, “Is AI good or bad?” I believe that a ‘Terminator’ movie sort of future, where machines attack humans deliberately is far, far away in the future. However, the word ‘deliberately’ in the previous sentence is very important. AI based systems at present could malfunction and accidentally hurt humans. However, many systems that claim the powers of AI are conventional software programs with a large number of ‘if’ and ‘for’ statements with no magic of AI in it. Thus, it is safe to say that we are yet to see the real power of AI in our daily lives. But whether that impact will be good (like curing cancer) or bad (deepfake videos of world leaders leading to riots and war) is yet to be seen. On a personal level, I believe AI is a boon and will drastically improve the quality of life of the coming generations. ## What is AI? So, before we proceed any further, let us try to understand how AI, machine learning, deep learning, data science, etc, are related yet distinct from each other. Very often these terms are used (erroneously) as synonyms. First, let us consider a Venn diagram that represents the relationship between AI, machine learning, deep learning and data science (Figure 1). Please keep in mind that this is not the only such Venn diagram. Indeed, it is very plausible that you may find other Venn diagrams showing different relationships between the four different entities shown in Figure 1. However, in my opinion, Figure 1 is the most authentic diagram that captures the interrelationship between the different fields in question to the maximum extent. ![The AI hierarchy and data science](https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-The-AI-hierarchy-and-data-science-590x404.jpg) ![The AI hierarchy and data science](https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-1-The-AI-hierarchy-and-data-science-590x404.jpg) First of all, let me make a disclaimer. Many of the definitions of the terms involved in this first article in this series on AI may not be mathematically the most accurate. I believe that formally defining every term with utmost precision at this level of our discussion is counterproductive and a wastage of time. However, in the subsequent articles in this series we will revisit these terms and formally define them. At this point in time of our discussion, consider AI as a set of programs that can mimic human intelligence to some extent. But what do I mean by human intelligence? Imagine your AI program is a one-year old baby. As usual, this baby will learn his/her mother tongue simply by listening to the people speaking around him/her. He/she will soon learn to identify shapes, colours, objects, etc, without any difficulty at all. Further, he/she will be able to respond to the emotions of people around him. For example, any 3-year-old baby will know how to sweet talk his/her parents into giving him/her all the chocolates and lollipops he/she wants. Similarly, an AI program too will be able to sense and adapt to its surroundings, just like the baby. However, such true AI applications will be achieved only in the far future (if at all). Figure 1 shows that machine learning is a strict subset of AI and as such one of the many techniques used to implement artificially intelligent systems. Machine learning involves techniques in which large data sets are used to train programs so that the necessary task can be carried out effectively. Further, the accuracy of performing a particular task increases with larger and larger training data sets. Notice that there are other techniques used to develop artificially intelligent systems like Boolean logic based systems, fuzzy logic based systems, genetic programming based systems, etc. However, nowadays machine learning is the most vibrant technology used to implement AI based systems. Figure 1 also shows that deep learning is a strict subset of machine learning, making it just one of the many machine learning techniques. However, here again I need to inform you that, currently, in practice, most of the serious machine learning techniques involve deep learning. At this point, I refrain even from trying to define deep learning. Just keep in mind that deep learning involves the use of large artificial neural networks. Now, what is data science (the red circle) doing in Figure 1? Well, data science is a discipline of computer science/mathematics which deals with the processing and interpretation of large sets of data. By large, how large do I mean? Some of the corporate giants like Facebook claimed that their servers could handle a few petabytes of data as far back in 2010. So, when we say huge data, we mean terabytes and petabytes and not gigabytes of data. A lot of data science applications involve the use of AI, machine learning and deep learning techniques. Hence, it is a bit difficult to ignore data science when we discuss AI. However, data science involves a lot of conventional programming and database management techniques like the use of Apache Hadoop for Big Data analysis. Henceforth, I will be using the abbreviations AI, ML, DL and DS as shown in Figure 1. The discussions in this series will mainly focus on AI and ML with frequent additional references to data science. ## The beginning of our journey and a few difficult choices to make Now that we know the topics that will be covered in this series of articles, let us discuss the prerequisites for joining this tutorial. I plan to cover the content in such a way that any person who can operate a Linux machine (a person who can operate an MS Windows or a macOS machine is also fine, but some of the installation steps might require additional help) along with basic knowledge of mathematics and computer programming will definitely appreciate the power of AI, once he or she has meticulously gone through this series. It is possible to learn AI in a language-agnostic way without worrying much about programming languages. However, our discussion will involve a lot of programming and will be executed based on a single programming language. So, before we fix our (programming) language of communication, let us review the top programming languages used for AI, ML, DL and DS applications. One of the earliest languages used for developing AI based applications was Lisp, a functional programming language. Prolog, a logic programming language, was used in the 1970s for the same purpose. We will discuss more about Lisp and Prolog in the coming articles when we focus on the history of AI. Nowadays, programming languages like Java, C, C++, Scala, Haskell, MATLAB, R, Julia, etc, are also used for developing AI based applications. However, the huge popularity and widespread use of Python in developing AI based applications almost made the choice unanimous. Hence, from this point onwards we will proceed with our discussion on AI based on Python. However, let me caution you. From here onwards, we make a number of choices (or rather I am making the choices for you). The choices mostly depend on ease of use, popularity, and (on a few occasions) on my own comfort and familiarity with a software/technique as well as the best of my intentions to make this tutorial highly effective. However, I encourage you to explore any other potential programming language, software or tool we may not have chosen. Sometimes such an alternative choice may be the best for you in the long run. Now we need to make another immediate choice — whether to use Python 2 or Python 3? Considering the youth and the long career ahead of many of the potential readers of this series, I will stick with Python 3. First, let us install Python 3 in our systems. Execute the command ‘sudo apt install python3’ in the Linux terminal to install the latest version of Python 3 in your Ubuntu system (Python 3 is probably already installed in your system). The installation of Python 3 in other Linux distributions is also very easy. It can be easily installed in MS Windows and macOS operating systems too. The following command will show you the version of Python 3 installed in your system: python3 --version Python 3.8.10 We need to install a lot of Python packages as we proceed through the series. Hence, we need to install a package management system. Some of the choices include pip, Conda, Mamba, etc. I chose pip as our package management system for this tutorial because it is relatively simple as well as the recommended installation tool for Python. Personally, I am of the opinion that both Conda and Mamba are more powerful than pip and you are welcome to try them out. However, I will stick with pip. The command ‘sudo apt install python3-pip’ will install pip in an Ubuntu system. Notice that pip, Conda and Mamba are cross-platform software and can be installed in Linux, Windows and macOS systems. The command ‘pip3 –version’ shows the version of pip installed in your system, as shown below: pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8) Now we need to install an integrated development environment (IDE) for Python. IDEs help programmers write, compile, debug and execute code very easily. There are many contenders for this position also. PyCharm, IDLE, Spyder, etc, are popular Python IDEs. However, since our primary aim is to develop AI and data science based applications, we consider two other heavy contenders — JupyterLab and Google Colab. Strictly speaking, they are not just IDEs; rather, they are very powerful Web based interactive development environments. Both work on Web browsers and offer immense power. JupyterLab is free and open source software supported by Project Jupyter, a non-profit organisation. Google Colab follows the freemium model, where the basic model is free and for any additional features a payment is required. I am of the opinion that Google Colab is more powerful and has more features than JupyterLab. However, the freemium model of Google Colab and my relative inexperience with it made me choose JupyterLab over Google Colab for this tutorial. But I strongly encourage you to get familiar with Google Colab at some point in your AI journey. JupyterLab can be installed locally using the command ‘pip3 install jupyterlab’. The command ‘jupyter-lab’ will execute JupyterLab in the default Web browser of your system. An older and similar Web based system called Jupyter Notebook is also provided by Project Jupyter. Jupyter Notebook can be locally installed with the command ‘pip3 install notebook’ and can be executed using the command ‘jupyter notebook’. However, Jupyter Notebook is less powerful than JupyterLab, and it is now official that JupyterLab will eventually replace Jupyter Notebook. Hence, in this tutorial we will be using JupyterLab when the time comes. However, in the beginning stages of this tutorial we will be using the Linux terminal to run Python programs, and hence the immediate need for pip, the package management system. Anaconda is a very popular distribution of Python and R programming languages for machine learning and data science applications. As potential AI engineers and data scientists, it is a good idea to get familiar with Anaconda also. Now, we need to fix the most important aspect of this tutorial — the style in which we will cover the topics. There are a large number of Python libraries to support the development of AI based applications. Some of them are NumPy, SciPy, Pandas, Matplotlib, Seaborn, TensorFlow, Keras, Scikit-learn, PyTorch, etc. Many of the textbooks and tutorials on AI, machine learning and data science are based on complete coverage of one or more of these packages. Though such coverage of the features of a particular package is effective, I have planned a more maths-oriented tutorial. We will first discuss a maths concept required for developing AI applications, and then follow the discussion by introducing the necessary Python basics and the details of the Python libraries required. Thus, unlike most other tutorials, we will revisit Python libraries again and again to explore the features necessary for the implementation of certain maths concepts. However, at times, I will also request you to learn some basic concepts of Python and mathematics on your own. That settles the final question about the nature of this tutorial. After all this buildup, it would be a sin if we stop this article at this point without discussing even a single line of Python code or a mathematical object necessary for AI. Hence, we move on to learn one of the most important topics in mathematics required for conquering AI and machine learning. ### Vectors and matrices A matrix is a rectangular array of numbers, symbols or mathematical expressions arranged in rows and columns. Figure 2 shows a 2 x 3 (pronounced ‘2 by 3’) matrix having 2 rows and 3 columns. If you are familiar with programming, this matrix can be represented as a two-dimensional array in many popular programming languages. A matrix with only one row is called a row vector and a matrix with only one column is called a column vector. The vector [11, 22, 33] is an example of a row vector. ![A 2 x 3 matrix](https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-A-2-X-3-matrix-350x230.jpg) ![A 2 x 3 matrix](https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-2-A-2-X-3-matrix-350x230.jpg) But why are matrices and vectors so important in a discussion on AI and machine learning? Well, they are the core of linear algebra, a branch of mathematics. Linear algebraic techniques are heavily used in AI and machine learning. Mathematicians have studied the properties and applications of matrices and vectors for centuries. Mathematicians like Gauss, Euler, Leibniz, Cayley, Cramer, and Hamilton have a theorem named after them in the fields of linear algebra and matrix theory. Thus, over the years, a lot of techniques have been developed in linear algebra to analyse the properties of matrices and vectors. Complex data can often easily be represented in the form of a vector or a matrix. Let us see a simple example. Consider a person working in the field of medical transcription. From the medical records of a person named P, details of the age, height in centimetres, weight in kilograms, systolic blood pressure, diastolic blood pressure and fasting blood sugar level in milligrams/decilitres can be obtained. Further, such information can easily be represented as the row vector. As an example, P = [60, 160, 90, 130, 95, 160]. But here comes the first challenge in AI and machine learning. What if there are a billion health records. The task will be incomplete even if tens of thousands of professionals work to manually extract data from these billion health records. Hence, AI and machine learning applications try to extract data from these records using programs. The second challenge in AI and machine learning is data interpretation. This is a vast field and there are a number of techniques worth exploring. We will go through the most relevant of them in the coming articles in this series. AI and machine learning based applications also face hardware challenges, in addition to mathematical/computational challenges. With the huge amount of data being processed, data storage, processor speed, power consumption, etc, also become a major challenge for AI based applications. Challenges apart, I believe it is time for us to write the first line of AI code. We will write a simple Python script to add two vectors. For that, we use a Python library called NumPy. This is a Python library that supports multi-dimensional matrices (arrays) and a lot of mathematical functions to operate on them. The command ‘pip3 install numpy’ will install the package NumPy for Python 3. Notice that NumPy would have been preinstalled if you were using JupyterLab, Google Colab or Anaconda. However, we will operate from the Linux terminal for the first few articles in this series on AI for ease of use. Execute the command ‘python3’ on the Linux terminal to work from the Python console. This console is software that allows line-by-line execution of Python code. Figure 3 shows the line-by-line execution of the Python code to add two vectors and show the output on the terminal. ![Python code to find the sum of two row vectors](https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Python-code-to-find-the-sum-of-two-row-vectors-590x173.jpg) ![Python code to find the sum of two row vectors](https://www.opensourceforu.com/wp-content/uploads/2022/05/Figure-3-Python-code-to-find-the-sum-of-two-row-vectors-590x173.jpg) First, let us try to understand the code. An important note before we proceed any further. Since this tutorial assumes very little programming experience, I will label lines of code as either (basic) or (AI). Lines labelled (basic) are part of classical Python code, whereas lines labelled (AI) are part of the Python code for developing AI applications. I know such a classification is not necessary or very meaningful. However, I want to distinguish between basic Python and advanced Python so that programmers with both basic and intermediate skills in programming will find this tutorial useful. The line of code import numpy as np (basic) imports the library NumPy and names it as np. The import statement in Python is similar to the #include statement of C/C++ to use header files and the import statement of Java to use packages. The lines of code a = np.array([11, 22, 33]) and b = np.array([44, 55, 66]) (AI) create two one-dimensional arrays named ‘a’ and ‘b’. Let me do one more simplification for the sake of understanding. For the time being, assume a vector is equivalent to a one-dimensional array. The line of code c = np.add(a, b) (AI) adds the two vectors named ‘a’ and ‘b’ and stores the result in a vector named ‘c’. Of course, naming variables as ‘a’, ‘b’, ‘c’, etc, is a bad programming practice, but mathematicians tend to differ and name vectors as ‘u’, ‘v’, ‘w’, etc. If you are an absolute beginner in Python programming, please learn how variables in Python work. Finally, the line of code print(c) (basic) prints the value of the object, the vector [55 77 99], on the terminal. This is a line of basic Python code. The vector c = [55=11+44 77=22+55 99=33+66] gives you a hint about vector and matrix addition. However, if you want to formally learn how vectors and matrices are added, and if you don’t have any good mathematical textbooks on the topic available at your disposal, I suggest you go through the Wikipedia article on matrix addition. A quick search on the Internet will show you that a classic C, C++ or Java program to add two vectors takes a lot more of code. This itself shows how suitable Python is for handling vectors and matrices, the lifeline of linear algebra. The strength of Python will be further appreciated as we perform more and more complex vector operations. Before we conclude this article, I want to make two disclaimers. First, the programming example just discussed above deals with the addition of two row vectors (1 x 3 matrices to be precise). But a real machine learning application might be dealing with a 1000000 X 1000000 matrix. However, with practice and patience we will be able to handle these. The second disclaimer is that many of the definitions given in this article involve gross simplifications and some hand-waving. But, as mentioned earlier, I will give formal definitions for any term I have defined loosely before the conclusion of this series. Now it is time for us to wind up this article. I request all of you to install the necessary software mentioned in this article and run each and every line of code discussed here. We will begin the next article in this series by discussing the history, scope and future of AI, and then proceed deeper into matrix theory, the backbone of linear algebra.
16,327
Geany 2.0 发布使其成为更通用的文本编辑器和 IDE
https://news.itsfoss.com/geany-2-0/
2023-10-29T17:18:57
[ "Python", "IDE", "Geany" ]
https://linux.cn/article-16327-1.html
![](/data/attachment/album/202310/29/171811kqqcqggcg2h517go.jpg) > > Geany 2.0 带来了新的文件类型和其他改进。 > > > [Geany](https://www.geany.org/) 被认为是 [Linux 上最好的 Python IDE](https://itsfoss.com/best-python-ides-linux/) 之一,它是**一个基于 GTK3 工具包的开源、轻量级 IDE**。 考虑到 Geany 的功能集对各种用户的吸引力,它也可以算作 [Linux 上 Notepad++ 的替代品](https://itsfoss.com/notepad-alternatives-for-linux/)之一。 现在,新版本已以 “**Geany 2.0**” 的形式推出,提供了许多改进。 让我们看看有什么。 ### ? Geany 2.0:有什么新变化? ![](/data/attachment/album/202310/29/171857a9i64l282i9yq32g.png) Geany 版本的亮点可以分为两个不同的部分,主要涵盖界面和对文件类型的更好支持。 #### 文件类型升级 通过更新 [基本类型](https://kotlinlang.org/docs/basic-types.html),改进了 **Kotlin** 的文件类型配置。同样,对于 **Python** ,针对 Python 3 重写了标准库标签创建脚本,并改进了对 **ctags** 文件格式的支持。 最后,Geany 添加了对 [AutoIt](https://en.wikipedia.org/wiki/AutoIt) 和 [GDScript](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/index.html) 等新文件类型的\*\*支持,并更新了 **Nim** 和 **PHP** 的文件类型配置,以解决一些长期存在的问题。 #### 界面改进 ![](/data/attachment/album/202310/29/171858eruuw7w5ao1au5br.png) Geany 2.0 在文档列表的侧边栏中提供了**新的树视图**。它是默认启用的,因此你无需执行任何操作。 当你有大量单独的文件需要检查时,它非常实用。你还可以折叠特定文件夹以最大程度地减少混乱。 ![](/data/attachment/album/202310/29/171858l8lox1owuz1w8p8w.png) **编译器消息现在使用深色主题友好的颜色**,以便你可以轻松阅读消息。这在深夜编码时应该很有帮助。 此外,**一个新的确认对话框**添加到整个会话的“搜索和替换”功能中,并且**添加了一个选项以在符号树中显示符号**,而无需类别组。 #### ?️ 其他变化 除了上述内容之外,还有一些值得注意的变化: * Geany 现在需要 GTK 3.24。 * 你现在可以滚动文档选项卡。 * 更新了多种语言的翻译。 * 修复了文件类型更改时的关键词着色问题。 * 现在默认启用“更改历史记录”功能。 有关此版本的更多详细信息,你可以浏览[官方发行说明](https://www.geany.org/documentation/releasenotes/)。 ### ? 下载 Geany 2.0 由于它是 **跨平台 IDE**,Geany 2.0 可用于 **Linux**、**Windows** 和 **macOS**。你可以前往 [Flathub 商店](https://flathub.org/apps/org.geany.Geany)或其 [官方网站](https://www.geany.org/download/releases/)下载你选择的包。 > > **[Geany](https://www.geany.org/download/releases/)** > > > 如果你对源代码感兴趣,你还可以访问其 [GitHub 仓库](https://github.com/geany/geany)。 --- via: <https://news.itsfoss.com/geany-2-0/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) [Geany](https://www.geany.org/?ref=news.itsfoss.com) is regarded as one of the [best Python IDEs for Linux](https://itsfoss.com/best-python-ides-linux/?ref=news.itsfoss.com), it is **an open-source, lightweight IDE** based on the GTK3 toolkit. It can also be counted as one of the [alternatives to Notepad++ on Linux](https://itsfoss.com/notepad-alternatives-for-linux/?ref=news.itsfoss.com) considering Geany's feature-set appeals to variety of users. Now, a new release has been introduced in the form of '**Geany 2.0**' that offers many improvements. Let's see what is in store. ## 🆕 Geany 2.0: What's New? ![a screenshot of geany 2.0](https://news.itsfoss.com/content/images/2023/10/Geany_2.0_1.png) The highlights of this Geany release can be divided into two distinct sections, which cover mostly the interface and better support for filetypes. ### Filetype Upgrades The filetype configuration for **Kotlin** was improved with updates to the [basic types](https://kotlinlang.org/docs/basic-types.html?ref=news.itsfoss.com). Similarly, for **Python**, the standard library tags creation script was rewritten for Python 3 and support was improved for the **ctags** file format. And finally,** support for new filetypes **such as [ AutoIt](https://en.wikipedia.org/wiki/AutoIt?ref=news.itsfoss.com) and [were added to Geany, and the filetype configs for](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/index.html?ref=news.itsfoss.com) **GDScript****Nim**and **PHP**updated for addressing some long-standing issues. ### Interface Improvements ![a screenshot of geany 2.0 tree view under the documents tab of the sidebar](https://news.itsfoss.com/content/images/2023/10/Geany_2.0_2.png) Geany 2.0 features** a new tree view** in the sidebar for the documents list. It is enabled by default, so you don't have to do anything. It is practical when you have numerous individual files to go through. You can also collapse specific folders to minimize the clutter. ![a screenshot of geany 2.0 dark theme friendly colors for compiler messages](https://news.itsfoss.com/content/images/2023/10/Geany_2.0_3.png) The **compiler messages now use dark-theme friendly colors** so that you can easily read the messages. This should be helpful during those late-night coding runs. Furthermore, **a new confirmation dialog** was added to the “search & replace” feature for the whole session, and **an option was added to show symbols in the symbol tree** without the category group. ### 🛠️ Other Changes Other than the above-mentioned, here are some changes that are worth noting: - Geany now requires GTK 3.24. - You can now scroll over document tabs. - Updated translations for various languages. - The keyword colorization was fixed on filetype change. - The 'Change History' feature is now enabled by default. For more details on this release, you can go through the [official release notes](https://www.geany.org/documentation/releasenotes/?ref=news.itsfoss.com). ## 📥 Download Geany 2.0 As it is **a cross-platform IDE**, Geany 2.0 is available for **Linux**, **Windows**, and **macOS**. You can go to the [Flathub store](https://flathub.org/apps/org.geany.Geany?ref=news.itsfoss.com) or its [official website](https://www.geany.org/download/releases/?ref=news.itsfoss.com) to grab the package of your choice. You can also head over to its [GitHub repo](https://github.com/geany/geany?ref=news.itsfoss.com) if you are interested in the source code. ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,329
Moosync:一款充满特色的开源音乐播放器
https://news.itsfoss.com/moosync/
2023-10-30T06:24:34
[ "Moosync", "音乐播放器" ]
https://linux.cn/article-16329-1.html
![](/data/attachment/album/202310/30/062404f6xrcor9t6s1b9lc.jpg) > > Moosync 音乐播放器是一个适用于本地收藏与流媒体音乐的魅力十足的跨平台应用。 > > > 想听好音乐吗?? 首次亮相的**跨平台开源音乐播放器 Moosync** ,希望成为“欢迎全社区参与”的音乐播放器。 过去我们曾介绍过像 [Harmonoid](https://itsfoss.com/harmonoid/) 和 [MusicPod](https://news.itsfoss.com/musicpod/) 这样的应用,但是它们**主要是专注于离线使用**。 与之不同的是,Moosync 的独特之处。让我告诉你为什么。 ### Moosync:概况 ⭐ ![](/data/attachment/album/202310/30/062435lt0q9s3s49qhzksw.png) Moosync 是一个主要基于 **Vue** 和 **TypeScript** 编程语言开发的音乐播放器。 Moosync **高度可定制**且支持 [YouTube](https://www.youtube.com/)、[Spotify](https://open.spotify.com/) 以及 [LastFM](https://www.last.fm/) 等多种服务。其关键特性包含: * 支持显示歌词 * 无广告播放 * 支持本地音乐文件 #### 初次体验 ?‍? 在我在我的 Ubuntu 系统上安装它之后,我开始了**快速设置向导**。 首先设定我的音乐库的位置,它将会从此处获取本地音乐文件,过程包含了许多步骤。 ![](/data/attachment/album/202310/30/062435q78x7dh2vo2vu4ux.png) 然后,显示了**可以连接的服务选项**。 我**试图连接我的 Spotify 账户**,然而尽管我向 Moosync 提供了需要的信息,**操作无法成功**。不过幸运的是,**这一步并非必要**,所以我选择跳过。 ![](/data/attachment/album/202310/30/062436ar53idlb83d9tx8w.png) 随后,它显示了空白的 “<ruby> 所有歌曲 <rt> All Songs </rt></ruby>” 标签页,由于目前我未连接任何服务或者本地文件,所以这里是空的。 ![](/data/attachment/album/202310/30/062436kwyz4wy6cc2erzee.png) 考虑我没有本地音乐或 Spotify 音乐,我点击了 YouTube 过滤器并**搜寻我喜欢的曲目**以填充 Moosync。 搜索功能还包括歌曲、艺术家、播放列表和专辑的过滤器。 ![](/data/attachment/album/202310/30/062437utwevzlxf0wxxv6l.png) 我可以以右键点击单曲,并添加至播放队列或者立即播放。除此之外还有其他选项,会有所不同。 ![](/data/attachment/album/202310/30/062438x7zk7m3c6ik4mzk9.png) 我在 Spotify 数据库进行搜索时,尝试做相同操作,但不幸的是,我**必须要登录 Spotify 才能在 Moosync 使用它** 这一计划之前被搁置。 ![](/data/attachment/album/202310/30/062439nvapbobkz3niiurl.png) > > ? 如果你在寻找更好的 Spotify 支持,我建议你尝试一下 [BlackHole](https://news.itsfoss.com/blackhole-music-app/) 这个音乐应用。 > > > 而我选择继续,去**了解这个音乐播放器**。进入 “<ruby> 队列 <rt> Queue </rt></ruby>” 标签页或者点击应用程序右下角向上指向的箭头都可以访问它。 整齐的布局使人感到熟悉和舒适。 ![](/data/attachment/album/202310/30/062439st7e83rp3t0e9917.png) 在 “<ruby> 所有歌曲 <rt> All Songs </rt></ruby>” 标签页,我添加进 Moosync 的所有歌曲都在这,我可以**选择从列表开头播放**,或者**添加到当前队列**,甚至可以在其中**随机播放 100 首歌曲**。 ![](/data/attachment/album/202310/30/062440eezlrrtt1e979d7z.png) 在 “<ruby> 播放列表 <rt> Playlists </rt></ruby>” 标签页,我保存的所有来自 YouTube 的播放清单都在这。它还提供了本地文件和 YouTube 间的排序选项。 ![](/data/attachment/album/202310/30/062442e3l3rlojrfbql483.png) 在 “<ruby> 专辑 <rt> Albums </rt></ruby>” 标签页,我保存的所有专辑都以一个整齐的网格布局排列。 ![](/data/attachment/album/202310/30/062444mf5fk5pv75p67oja.png) 类似的,“<ruby> 艺术家 <rt> Artists </rt></ruby>” 标签页展示了我添加到 Moosync 库的艺术家。出于某种原因,它没有加载缩略图。 “<ruby> 类别 <rt> Genres </rt></ruby>” 标签页我也跳过了,因为它**似乎不能正常工作**。 ![](/data/attachment/album/202310/30/062444zzvy38zxy4wxw3yv.png) 最后是 “<ruby> 探索 <rt> Explore </rt></ruby>” 标签页,这里显示了我**听过多少分钟的音乐**。 ![](/data/attachment/album/202310/30/062446th8tuunq09zlurb4.png) 此外,**你可以在 Moosync 中找到许多有用的自定义设置**来优化你的使用体验。 首先在 “<ruby> 主题 <rt> Theme </rt></ruby>”设置中,你可以在**三个主题**和**两种布局视图**中选择,还有选项**上传或设计自定义主题**。 ![](/data/attachment/album/202310/30/062446skv5vu5xcvim5okk.png) 应用还有**许多扩展**,一种是**在 Discord 上开启丰富的存在支持**,另一种是**与 Soundcloud 集成**,此外还有很多。 ![](/data/attachment/album/202310/30/062447cozr3x2h72krmk87.png) 显然,**Moosync 支持键盘快捷方式**,你可以根据个人的喜好进行设置。 ![](/data/attachment/album/202310/30/062447lcxl5x078322t1yf.png) 在我写这篇文章的时候,Moosync 这里和那里都有一些小瑕疵,但我认为它作为 [最适合 Linux 的音乐播放器之一](https://itsfoss.com/best-music-players-linux/) 的竞争者非常有竞争力。 ### ? 下载 Moosync Moosync 适用于 **Linux**,**Windows** 以及 **macOS**。你可以在其[官方网站](https://moosync.app/)下载你需要的安装包。 > > **[Moosync](https://moosync.app/)** > > > **对于 Linux 用户**,你也可以在 [**Flathub 商店**](https://flathub.org/apps/app.moosync.moosync),[**Snap 商店**](https://snapcraft.io/moosync) 和 [**AUR**](https://aur.archlinux.org/packages/moosync) 下载 Moosync。 你还可以浏览他们的 [GitHub 仓库](https://github.com/Moosync/Moosync),获取源代码以及更多信息。 ? 对这款应用有何看法?欢迎在评论区告诉我。 --- via: <https://news.itsfoss.com/moosync/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) In the mood for listening to some good beats? 🎶 Well, with this first look, we have **a cross-platform, open-source music player** called '**Moosync**' that aims to be “a music player for the community”. Interestingly, we have covered apps like [Harmonoid](https://itsfoss.com/harmonoid/?ref=news.itsfoss.com) and [MusicPod](https://news.itsfoss.com/musicpod/) in the past, but **those focus mostly on offline use**. Moosync however, is slightly different. Allow me to show you why. ## Moosync: Overview ⭐ ![a screenshot of moosync](https://news.itsfoss.com/content/images/2023/10/Moosync_1.png) Moosync is a music player that has been written primarily in the **Vue** and **TypeScript** programming languages. It is **highly customizable** and has support for services such as [ YouTube](https://www.youtube.com/?ref=news.itsfoss.com), [and](https://open.spotify.com/?ref=news.itsfoss.com) **Spotify**[. Some of its key features include:](https://www.last.fm/?ref=news.itsfoss.com) **LastFM****Lyrics Support****Ad-Free Playback****Local File Support** ### Initial Impressions 👨💻 After I set it up on my Ubuntu system, I started **the quick-setup wizard**. It took me through many steps to set Moosync up. The first step was to set the location for my music library, from where it would source the local files. ![a screenshot of moosync quick setup feature](https://news.itsfoss.com/content/images/2023/10/Moosync_2.png) Thereafter, I was shown **options to connect to services**. I **tried connecting my Spotify account**, but **it refused to work** even after I provided Moosync with the required details. Luckily, **this step was optional**, so I skipped it. ![a screenshot of moosync connect to services feature](https://news.itsfoss.com/content/images/2023/10/Moosync_3.png) It then took me to the “**All Songs**” tab, which is empty for now as I do not have anything connected nor any local music files. ![a screenshot of moosync all songs tab](https://news.itsfoss.com/content/images/2023/10/Moosync_5.png) I started populating Moosync by **searching for some songs. **Considering I did not have local or Spotify music, I clicked on the YouTube filter to search for my favorite music. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) The search feature also includes filters such as Songs, Artists, Playlists, and Albums. ![a screenshot of moosync search feature](https://news.itsfoss.com/content/images/2023/10/Moosync_6.png) I was also able to right-click on individual songs and add them to the queue, or even play them right then. It had several other options too, see for yourself. 👇 ![a screenshot of moosync songs queue](https://news.itsfoss.com/content/images/2023/10/Moosync_7.png) I tried doing the same while searching the Spotify database, but sadly, I would **have to log in to Spotify for using it on Moosync**, and that, as you know, didn't pan out earlier. ![a screenshot of moosync spotify search error](https://news.itsfoss.com/content/images/2023/10/Moosync_8.png) [music app if you are looking for better Spotify support.](https://news.itsfoss.com/blackhole-music-app/) **BlackHole**Anyway, I moved on to **check out the music player**. It could be accessed either by going into the “Queue” tab, or from the small upwards pointing arrow in the bottom-right of the app. It had **a very neat layout **with a familiar feel to it. ![a screenshot of moosync music player screen](https://news.itsfoss.com/content/images/2023/10/Moosync_9.png) The “**All Songs**” tab housed all the songs that I added to Moosync, I had **options to either play from the beginning of the list**, or **add it to the current queue**, and even **play 100 random songs **from it. ![a screenshot of moosync all songs tab](https://news.itsfoss.com/content/images/2023/10/Moosync_11.png) The “**Playlists**” tab had all the playlists that I saved from YouTube. It also provided sorting options between local files and YouTube. ![a screenshot of moosync playlists tab](https://news.itsfoss.com/content/images/2023/10/Moosync_12-1.png) The “**Albums**” tab had my saved albums, arranged neatly in a grid layout. ![a screenshot of moosync albums tab](https://news.itsfoss.com/content/images/2023/10/Moosync_13.png) Similarly, the “**Artists**” tab featured the artists I added to my Moosync library. For some reason, it wouldn't load the thumbnails. I also skipped over the “**Genres**” tab as it **didn't seem to function properly**. ![a screenshot of moosync artists tab](https://news.itsfoss.com/content/images/2023/10/Moosync_13b.png) And finally, the “**Explore**” tab that showed me **how many** **minutes of music** I** **listened to. ![a screenshot of moosync explore tab](https://news.itsfoss.com/content/images/2023/10/Moosync_15.png) Furthermore, **you can find useful customization settings on Moosync** to tweak your experience. First up is the “**Theme**” settings that let you choose between **three themes** and **two layout views**, with the option to **upload or create a custom theme**. ![a screenshot of moosync themes settings](https://news.itsfoss.com/content/images/2023/10/Moosync_18.png) Then there were **numerous extensions** available, one was to **enable rich presence support on Discord**, another to **integrate with Soundcloud**, and more. ![a screenshot of moosync extensions settings](https://news.itsfoss.com/content/images/2023/10/Moosync_19.png) Not to forget, **Moosync also supports keyboard shortcuts** that could be configured according to personal preference. ![a screenshot of moosync keybinds settings](https://news.itsfoss.com/content/images/2023/10/Moosync_22.png) Moosync has its quirks here and there at the time of writing this, but I think it is a good contender as one of the [best music players for Linux](https://itsfoss.com/best-music-players-linux/?ref=news.itsfoss.com). **Suggested Read **📖 [Top 10 Best Music Players for Linux [2023]It isn’t rocket science to play music on Linux, but you should have a great experience with a good music player!](https://itsfoss.com/best-music-players-linux/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/wordpress/2022/07/best-music-players-for-linux.jpg) ![](https://itsfoss.com/content/images/wordpress/2022/07/best-music-players-for-linux.jpg) ## 📥 Download Moosync Moosync is available for **Linux**, **Windows**, and **macOS**. Head over to its [official site](https://moosync.app/?ref=news.itsfoss.com) to get the package of your choice. **For Linux**, you can also get Moosync from the [ Flathub store](https://flathub.org/apps/app.moosync.moosync?ref=news.itsfoss.com), [, and](https://snapcraft.io/moosync?ref=news.itsfoss.com) **Snap store**[.](https://aur.archlinux.org/packages/moosync?ref=news.itsfoss.com) **AUR****Y**ou can also explore its [GitHub repo](https://github.com/Moosync/Moosync?ref=news.itsfoss.com) for the source code and more information. *💬 What are your thoughts on this app? Let me know in the comments below.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,331
开源与 “半开源” 之间的战争和软件的历史一样久远
https://www.theregister.com/2023/10/27/open_source_vs_sort_of_open_source/
2023-10-30T10:21:00
[ "开源", "许可证", "HashiCorp" ]
https://linux.cn/article-16331-1.html
![](/data/attachment/album/202310/30/102124xk99zn7vaw997564.jpg) > > HashiCorp 放弃开源原则这件事并无新意。 > > > 在加利福尼亚蒙特利召开的 <ruby> Linux 基金会成员峰会 <rt> Linux Foundation Members Summit </rt></ruby> 上,最受关注的议题是人工智能和开源。而第二重要的话题涉及到 HashiCorp 放弃 Terraform 的 <ruby> Mozilla 公共许可证 <rt> Mozilla Public License </rt></ruby>(MPL),转而采用 <ruby> 商业源代码许可证 <rt> Business Source License </rt></ruby>(BSL)1.1,以及由此引发的 OpenTofu 项目复刻。因 Linux 基金会对 OpenTofu 项目的支持,HashiCorp 的 CEO David McJannet 表现出极度的不满。 关于许可证切换、源代码复刻以及由此产生的争议,火热的讨论并未减少。但在我看来,有一点被人们忽视:人们一直误认为这是新鲜事物,实则不然。 之前已经有过不止一次,甚至不止十次,公司将开源代码转变为专有程序,或者隐藏在一个专有的包装中。 首先,人们经常拿走开源代码,但却抹去其许可证信息,然后就此继续下去。虽然这并不一定构成窃取行为,实际上,有些许可证,比如 MIT 许可证和两句版 BSD 许可证,完全允许公司和开发者在他们的专有程序中使用这些代码。例如,我们都熟知以下基于 MIT 许可证的程序,比如 Angular、.NET、Node.js、Ruby on Rails 和 React。 其次,有一些程序最初以开源的形式开始,但随着时间的推移,原始所有者和许可证规则发生了变化,以至于许多人甚至都不知道它们曾经是开源的。举例来说,苹果公司的 macOS 就是其中的一个典型。 你是否知道 macOS 曾经是开源的?确实,它曾经是。 macOS 的核心基于 Darwin,这是一种 Unix 操作系统。<ruby> 史蒂夫·乔布斯 <rt> Steve Jobs </rt></ruby> 回归苹果公司时,引入了他的基于 Unix 的 NeXTStep 操作系统。到了 2000 年,苹果公司逐步放弃了他们的经典 Mac 操作系统,转而支持 macOS Darwin。除了来自 NeXTStep 的部分,Darwin 还大量借鉴了开源的 FreeBSD 和 Mach 操作系统的设计。 如今,如果你深入研究,仍然可以在 macOS 中找到 Darwin,它在 <ruby> 苹果公共源代码许可证 <rt> Apple Public Source License </rt></ruby> 2.0 下开源。虽然还有一项名为 PureDarwin 的工作正在努力制作一个独立的 Darwin 操作系统,但进展甚微。在这个过程中,苹果公司巧妙地减弱了一个重要的开源操作系统的影响力。更为常见的方式是开源软件以 “<ruby> 开放核心 <rt> open core </rt></ruby>” 的方式融入商业程序中。简而言之,开放核心,与开源不同的是,这是一种商业模式。在这种模式中,公司基于一个免费的、开源的核心程序,然后通过加入商业版本或者专有的附加组件来发展。 此术语由 Andrew Lampitt 在 2008 年提出,虽然代表的并不是一个新的概念。他提出这个术语是为了替代混乱的术语 “<ruby> 双重许可 <rt> dual licensing </rt></ruby>”。这个命名更改是为了 “消除误解,推广一个对于开源社区、付费客户和供应商都有利的商业模式”。同时,其目标也是为了消解我们现在在 HashiCorp 看到的 “<ruby> 诱捕并切换 <rt> bait and switch </rt></ruby>” 类似的争议。 尽管我们可以辩论这是否是一个 “出色的商业模式”,但无可争议的是它已经成为一个非常流行的模式。然而,近年来,我们看到的趋势是,许多企业从开放核心模式退回到 <ruby> 源码可得 <rt> source-available </rt></ruby> 模式。在源码可得模式下,你可以查看所有的代码,但在某些情况下你不能修改或使用它。 例如,MongoDB [创建](https://www.theregister.com/2018/10/16/mongodb_licensning_change/) 了一种非开源许可证,即 <ruby> 服务端公共许可证 <rt> Server Side Public License </rt></ruby>(SSPL),以应对那些通过提供自托管版本和服务从其代码中获利的超级云计算公司。 并非只有 MongoDB 做出了这样的决定。Elastic 在开源核心模型运作的很好,但当亚马逊 AWS 等公司通过提供 ElasticSearch 服务赚取巨额利润时,Elastic 在 2021 年做出了 [策略调整](https://www.theregister.com/2021/01/21/aws_not_ok_says_elastic/)。它放弃了开源的 Apache 2.0 许可,转而采用非开源的 SSPL 和 Elastic 许可证。 Elastic 和其他几家公司(如 Redis 等)的此类做法,主要目的是阻止云服务公司将他们的开源程序作为一种服务而提供。然而,这个做法反过来对 Elastic 产生了负面影响,因为 AWS 对这个项目进行了 [复刻](https://www.theregister.com/2021/04/13/aws_renames_elasticsearch_fork_opensearch/)。这一切是否让你想起了 HashiCorp?是吧。 尽管这些向非开源许可的转变惹怒了一些用户和很多开发者,但这些公司的业绩仍表现相对稳定。你可能对此感到不满,但事实是,对于这些公司来说,这种转变在一定程度上取得了成功。 接着,我们来看红帽公司的情况。红帽公司对其红帽企业 Linux(RHEL)代码的使用 [施加了限制](https://www.theregister.com/2023/06/23/red_hat_centos_move/),只允许其客户使用。几十年来,红帽公司一直在权衡作为开源领导者与处理 RHEL 克隆产品(例如 CentOS,以及最新的 AlmaLinux 和 Rocky Linux)的关系。 随着时间的推移,红帽公司对与他人共享其代码表现出越来越大的犹豫。现在,你可以(且很多人确实正在这么做)辩论红帽公司不再是一个真正的开源公司。批评者认为,红帽公司虽然仍然严格遵守 GNU 通用公共许可证(GPL)的条款,但已经失去了开源精神。 虽然 RHEL 和与其相关的一系列程序仍在产生可观的利润,但红帽公司希望能够从中获取更多的收益,因此,它也开始逐步偏离开源原则。 实际上,所有这些案例的共同之处在于:对更大财富的欲望。如圣经所言,“贪财是万恶之根”。我不确定这一句话的真假,但我确实知道,对金钱的热爱和开源原则很难两全。 对于从开源软件中赚钱并没有错误之处。<ruby> 理查德·斯托曼 <rt> Richard M Stallman </rt></ruby>(RMS)曾言:“工作寻求报酬,或者寻求尽可能增加收入,这并没有错,只要不采用破坏性的方式即可。” 然而,在 RMS 看来,“通过限制它们的使用来从程序的用户中挤取金钱,是一种破坏行为。” 尽管在现今开源软件与商业实践交汇的情况下,RMS 的观点可能并不如过去那样深受欢迎,但他仍然拥有众多的支持者。 *(题图:MJ/b06e9a62-5c0d-49c5-a7b3-fd5af60ac0b1)* --- via: <https://www.theregister.com/2023/10/27/open_source_vs_sort_of_open_source/> 作者:[Steven J. Vaughan-Nichols](https://www.theregister.com/Author/Steven-J-Vaughan-Nichols) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](/article-16309-1.html) 荣誉推出
200
OK
# The battle between open source and 'sort of' open source is as old as software ## There's nothing new about HashiCorp leaving the principle behind Opinion At the Linux Foundation Members Summit in Monterrey, California, topic number one was artificial intelligence and open source. Number two was about HashiCorp dumping Terraform's Mozilla Public License (MPL) for the Business Source License (BSL) 1.1, the resulting OpenTofu fork, and how ticked off HashiCorp CEO David McJannet was about the Linux Foundation's support of OpenTofu. The switch, the fork, and the arguments over it all continue to be hot and furious. But one thing stands out to me. People are treating it like there's something new here. There's not. This is far from the first or even the tenth time a company has taken open source code and either transformed it into a proprietary program or cloaked it in a proprietary wrapper. First, people have long taken open source code, erased the license, and continued on their merry way. That's not necessarily stealing. Indeed, some licenses, like the MIT License and the two-clause BSD License, enable companies and developers to use their code in proprietary programs. For example, we all know such MIT programs like Angular, .NET, Node.js, Ruby on Rails, and React. Then there are programs that started as open source, but their owners and licenses shifted the rules over time so that many people no longer even know that they were ever open source. Take, for example, Apple macOS. What's that? You didn't know macOS was open source? Well, it was. At its heart, macOS is based on Darwin, a Unix operating system. When Steve Jobs came back to Apple, he brought with him his NeXTStep Unix-based operating system. In 2000, Apple retired its Classic Mac operating system in favor of macOS Darwin. Besides NeXTStep, Darwin borrowed liberally from the open source FreeBSD and Mach operating system. Today, if you dig deep enough, you can still find Darwin, under the Apple Public Source License 2.0 in macOS. There's still an effort afoot, PureDarwin, to make a standalone Darwin operating system, but it's come to little. Here, by design, Apple withered an important open source operating system on the vine. A far more common way for open source software to end up in a commercial program is open core. Now, open core, unlike open source, is a business model. In open core, a company starts with a free, open source version of a core program and then surrounds it with commercial versions or add-ons that are proprietary software. Andrew Lampitt coined the term in 2008, but it wasn't new. He came up with it to replace the confusing phrase "dual licensing." The name change was "to remove confusion and promote a great business model for open source communities, paying customers, and vendors alike." It was also meant to remove the "bait and switch" controversies that we're now seeing with HashiCorp. While we can argue whether it was a "great business model," there is no argument that it's been a very popular model. However, in recent years, we've seen businesses retreating from open core to source-available models. In source available, you can see all the code, you just can't change it or use it in some circumstances. For example, [MongoDB created the non-open source license](https://www.theregister.com/2018/10/16/mongodb_licensning_change/), Server Side Public License (SSPL), to deal with hypercloud profiting from their code by offering self-hosted versions and services. [HashiCorp CEO talks license changes and the role of foundations](https://www.theregister.com/2023/10/19/hashicorp_ceo_license_changes/)[OpenTF forks Terraform, insists HashiCorp is the splinter group](https://www.theregister.com/2023/08/28/opentf_forks_terraform_code/)[A license to trust: Can you rely on 'open source' companies?](https://www.theregister.com/2023/08/18/opinion_column/)[HashiCorp's new license is still open source-ish, just with less free lunch](https://www.theregister.com/2023/08/11/hashicorp_bsl_licence/) MongoDB wasn't the only one. Elastic did very well with open core, but when companies such as Amazon Web Services (AWS) made big bucks by offering ElasticSearch as a service, [Elastic pivoted in 2021](https://www.theregister.com/2021/01/21/aws_not_ok_says_elastic/). It abandoned the open source Apache 2.0 license for the non-open source SSPL and Elastic license. The idea here, and with other businesses such as Redis, was to block cloud companies from offering open source programs as a service. This ended up backfiring on Elastic as [AWS forked the project](https://www.theregister.com/2021/04/13/aws_renames_elasticsearch_fork_opensearch/). Does all this remind you of HashiCorp? It should. While these moves to non-open licenses have ticked off some users and many developers, all of these companies continue to do relatively well. You may hate it, but the bottom line is it's been a somewhat successful move for these businesses. But then there's the case of [Red Hat restricting the use](https://www.theregister.com/2023/06/23/red_hat_centos_move/) of its Red Hat Enterprise Linux (RHEL) code to customers. For decades, Red Hat had to juggle being the open source champion while dealing with RHEL clones such as CentOS and, more recently, AlmaLinux and Rocky Linux. Over time, Red Hat has grown increasingly reluctant to share its code with others. You can now argue, and many do, that Red Hat is no longer truly an open source company. Its critics say Red Hat may still adhere to the letter of the GNU General Public License (GPL), but not the spirit. Be that as it may, while RHEL and its constellation of related programs continue to be very profitable, Red Hat wants to make even more money from it, so it, too, is shifting away from open source principles. Indeed, that's what all these cases have in common: A desire for more money. The Bible says "the love of money is the root of all evil." I don't know about that, but I do know that the love of money and open source principles don't get along easily. There's nothing wrong with making money from open source software. To quote Richard M Stallman: "There is nothing wrong with wanting pay for work, or seeking to maximize one's income, as long as one does not use means that are destructive." But, in RMS's view, "extracting money from users of a program by restricting their use of it is destructive." While RMS's opinions aren't as popular as they once were when it comes to the modern intersection of open source software and business practices, he still has lots of supporters. ® 34
16,332
我的一些 nix 学习经验:安装和打包
https://jvns.ca/blog/2023/02/28/some-notes-on-using-nix/
2023-10-30T21:54:00
[ "nix" ]
https://linux.cn/article-16332-1.html
![](/data/attachment/album/202310/30/221702nk4a42dglmcgc7lh.jpg) 最近,我首次尝试了 Mac。直至现在,我注意到的最大缺点是其软件包管理比 Linux 差很多。一段时间以来,我对于 homebrew 感到相当不满,因为每次我安装新的软件包时,它大部分时间都花在了升级上。于是,我萌生了试试 [nix](https://nixos.org/) 包管理器的想法! 公认的,nix 的使用存在一定困惑性(甚至它有自己单独的编程语言!),因此,我一直在努力以最简洁的方式掌握使用 nix,避开复杂的配置文件管理和新编程语言学习。以下是我至今为止学习到的内容, 敬请期待如何进行: * 使用 nix 安装软件包 * 为一个名为 [paperjam](https://mj.ucw.cz/sw/paperjam/) 的 C++ 程序构建一个自定义的 nix 包 * 用 nix 安装五年前的 [hugo](https://github.com/gohugoio/hugo/) 版本 如同以往,由于我对 nix 的了解还停留在入门阶段,本篇文章可能存在一些表述不准确的地方。甚至我自己也对于我是否真的喜欢上 nix 感到模棱两可 —— 它的使用真的让人相当困惑!但是,它帮我成功编译了一些以前总是难以编译的软件,并且通常来说,它比 homebrew 的安装速度要快。 ### nix 为何引人关注? 通常,人们把 nix 定义为一种“声明式的包管理”。尽管我对此并不太感兴趣,但以下是我对 nix 的两个主要欣赏之处: * 它提供了二进制包(托管在 <https://cache.nixos.org/> 上),你可以迅速下载并安装 * 对于那些没有二进制包的软件,nix 使编译它们变得更容易 我认为 nix 之所以擅长于编译软件,主要有以下两个原因: * 在你的系统中,可以安装同一库或程序的多个版本(例如,你可能有两个不同版本的 libc)。举个例子,我当前的计算机上就存在两个版本的 node,一个位于 `/nix/store/4ykq0lpvmskdlhrvz1j3kwslgc6c7pnv-nodejs-16.17.1`,另一个位于 `/nix/store/5y4bd2r99zhdbir95w5pf51bwfg37bwa-nodejs-18.9.1`。 * 除此之外,nix 在构建包时是在隔离的环境下进行的,只使用你明确声明的依赖项的特定版本。因此,你无需担心这个包可能依赖于你的系统里的其它你并不了解的包,再也不用与 `LD_LIBRARY_PATH` 战斗了!许多人投入了大量工作,来列出所有包的依赖项。 在本文后面,我将给出两个例子,展示 nix 如何使我在编译软件时遇到了更小的困难。 #### 我是如何开始使用 nix 的 下面是我开始使用 nix 的步骤: * 安装 nix。我忘记了我当时是如何做到这一点,但看起来有一个[官方安装程序](https://nixos.org/download) 和一个来自 [zero-to-nix.com](http://zero-to-nix.com) 的 [非官方安装程序](https://zero-to-nix.com/concepts/nix-installer)。在 MacOS 上使用标准的多用户安装卸载 nix 的 [教程](https://nixos.org/manual/nix/stable/installation/installing-binary.html#macos) 有点复杂,所以选择一个卸载教程更为简单的安装方法可能值得。 * 把 `~/.nix-profile/bin` 添加到我的 `PATH` * 用 `nix-env -iA nixpkgs.NAME` 命令安装包 * 就是这样。 基本上,是把 `nix-env -iA` 当作 `brew install` 或者 `apt-get install`。 例如,如果我想安装 `fish`,我可以这样做: ``` nix-env -iA nixpkgs.fish ``` 这看起来就像是从 <https://cache.nixos.org> 下载一些二进制文件 - 非常简单。 有些人使用 nix 来安装他们的 Node 和 Python 和 Ruby 包,但我并没有那样做 —— 我仍然像我以前一样使用 `npm install` 和 `pip install`。 #### 一些我没有使用的 nix 功能 有一些 nix 功能/工具我并没有使用,但我要提及一下。我最初认为你必须使用这些功能才能使用 nix,因为我读过的大部分 nix 教程都讨论了它们。但事实证明,你并不一定要使用它们。 * NixOS(一个 Linux 发行版) * [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html) * [nix flakes](https://nixos.wiki/wiki/Flakes) * [home-manager](https://github.com/nix-community/home-manager) * [devenv.sh](https://devenv.sh/) 我不去深入讨论它们,因为我并没真正使用过它们,而且网上已经有很多详解。 ### 安装软件包 #### nix 包在哪里定义的? 我认为 nix 包主仓库中的包是定义在 <https://github.com/NixOS/nixpkgs/>。 你可以在 <https://search.nixos.org/packages> 查找包。似乎有两种官方推荐的查找包的方式: * `nix-env -qaP NAME`,但这非常缓慢,并且我并没有得到期望的结果 * `nix --extra-experimental-features 'nix-command flakes' search nixpkgs NAME`,这倒是管用,但显得有点儿冗长。并且,无论何种原因,它输出的所有包都以 `legacyPackages` 开头 我找到了一种我更喜欢的从命令行搜索 nix 包的方式: * 运行 `nix-env -qa '*' > nix-packages.txt` 获取 Nix 仓库中所有包的列表 * 编写一个简洁的 `nix-search` 脚本,仅在 `packages.txt` 中进行 grep 操作(`cat ~/bin/nix-packages.txt | awk '{print $1}' | rg "$1"`) #### 所有的东西都是通过符号链接来安装的 nix 的一个主要设计是,没有一个单一的 `bin` 文件夹来存放所有的包,而是使用了符号链接。有许多层的符号链接。比如,以下就是一些符号链接的例子: * 我机器上的 `~/.nix-profile` 最终是一个到 `/nix/var/nix/profiles/per-user/bork/profile-111-link/` 的链接 * `~/.nix-profile/bin/fish` 是到 `/nix/store/afkwn6k8p8g97jiqgx9nd26503s35mgi-fish-3.5.1/bin/fish` 的链接 当我安装某样东西的时候,它会创建一个新的 `profile-112-link` 目录并建立新的链接,并且更新我的 `~/.nix-profile` 使其指向那个目录。 我认为,这意味着如果我安装了新版本的 `fish` 但我并不满意,我可以很容易地退回先前的版本,只需运行 `nix-env --rollback`,这样就可以让我回到之前的配置文件目录了。 #### 卸载包并不意味着删除它们 如果我像这样卸载 nix 包,实际上并不会释放任何硬盘空间,而仅仅是移除了符号链接: ``` $ nix-env --uninstall oil ``` 我尚不清楚如何彻底删除包 - 我试着运行了如下的垃圾收集命令,这似乎删除了一些项目: ``` $ nix-collect-garbage ... 85 store paths deleted, 74.90 MiB freed ``` 然而,我系统上仍然存在 `oil` 包,在 `/nix/store/8pjnk6jr54z77jiq5g2dbx8887dnxbda-oil-0.14.0`。 `nix-collect-garbage` 有一个更具攻击性的版本,它也会删除你配置文件的旧版本(这样你就不能回滚了)。 ``` $ nix-collect-garbage -d --delete-old ``` 尽管如此,上述命令仍无法删除 `/nix/store/8pjnk6jr54z77jiq5g2dbx8887dnxbda-oil-0.14.0`,我不明白原因。 #### 升级过程 你可以通过以下的方式升级 nix 包: ``` nix-channel --update nix-env --upgrade ``` (这与 `apt-get update && apt-get upgrade` 类似。) 我还没真正尝试升级任何东西。我推测,如果升级过程中出现任何问题,我可以通过以下方式轻松地回滚(因为在 nix 中,所有事物都是不可变的!): ``` nix-env --rollback ``` 有人向我推荐了 Ian Henry 的 [这篇文章](https://ianthehenry.com/posts/how-to-learn-nix/my-first-package-upgrade/),该文章讨论了 `nix-env --upgrade` 的一些令人困惑的问题 - 也许它并不总是如我们所料?因此,我会对升级保持警惕。 ### 下一个目标:创建名为 paperjam 的自定义包 经过几个月使用现有的 nix 包后,我开始考虑制作自定义包,对象是一个名为 [paperjam](https://mj.ucw.cz/sw/paperjam/) 的程序,它还没有被打包封装。 实际上,因为我系统上的 `libiconv` 版本不正确,我甚至在没有 nix 的情况下也遇到了编译 `paperjam` 的困难。我认为,尽管我还不懂如何制作 nix 包,但使用 nix 来编译它可能会更为简单。结果证明我的想法是对的! 然而,理清如何实现这个目标的过程相当复杂,因此我在这里写下了一些我实现它的方式和步骤。 #### 构建示例包的步骤 在我着手制作 `paperjam` 自定义包之前,我想先试手构建一个已存在的示例包,以便确保我已经理解了构建包的整个流程。这个任务曾令我头痛不已,但在我在 Discord 提问之后,有人向我阐述了如何从 <https://github.com/NixOS/nixpkgs/> 获取一个可执行的包并进行构建。以下是操作步骤: **步骤 1:** 从 GitHub 的 [nixpkgs](https://github.com/NixOS/nixpkgs/) 下载任意一个包,以 `dash` 包为例: ``` wget https://raw.githubusercontent.com/NixOS/nixpkgs/47993510dcb7713a29591517cb6ce682cc40f0ca/pkgs/shells/dash/default.nix -O dash.nix ``` **步骤 2:** 用 `with import <nixpkgs> {};` 替换开头的声明(`{ lib , stdenv , buildPackages , autoreconfHook , pkg-config , fetchurl , fetchpatch , libedit , runCommand , dash }:`)。我不清楚为何需要这样做,但事实证明这么做是有效的。 **步骤 3:** 运行 `nix-build dash.nix` 这将开始编译该包。 **步骤 4:** 运行 `nix-env -i -f dash.nix` 这会将该包安装到我的 `~/.nix-profile` 目录下。 就这么简单!一旦我完成了这些步骤,我便感觉自己能够逐步修改 `dash` 包,进一步创建属于我自己的包了。 #### 制作自定义包的过程 因为 `paperjam` 依赖于 `libpaper`,而 `libpaper` 还没有打包,所以我首先需要构建 `libpaper` 包。 以下是 `libpaper.nix`,我基本上是从 [nixpkgs](https://github.com/NixOS/nixpkgs/) 仓库中其他包的源码中复制粘贴得到的。我猜测这里的原理是,nix 对如何编译 C 包有一些默认规则,例如 “运行 `make install`”,所以 `make install` 实际上是默认执行的,并且我并不需要明确地去配置它。 ``` with import <nixpkgs> {}; stdenv.mkDerivation rec { pname = "libpaper"; version = "0.1"; src = fetchFromGitHub { owner = "naota"; repo = "libpaper"; rev = "51ca11ec543f2828672d15e4e77b92619b497ccd"; hash = "sha256-S1pzVQ/ceNsx0vGmzdDWw2TjPVLiRgzR4edFblWsekY="; }; buildInputs = [ ]; meta = with lib; { homepage = "https://github.com/naota/libpaper"; description = "libpaper"; platforms = platforms.unix; license = with licenses; [ bsd3 gpl2 ]; }; } ``` 这个脚本基本上告诉 nix 如何从 GitHub 下载源代码。 我通过运行 `nix-build libpaper.nix` 来构建它。 接下来,我需要编译 `paperjam`。我制作的 [nix 包](https://github.com/jvns/nixpkgs/blob/22b70a48a797538c76b04261b3043165896d8f69/paperjam.nix) 的链接在这里。除了告诉它从哪里下载源码外,我需要做的主要事情有: * 添加一些额外的构建依赖项(像 `asciidoc`) * 在安装过程中设置一些环境变量(`installFlags = [ "PREFIX=$(out)" ];`),这样它就会被安装在正确的目录,而不是 `/usr/local/bin`。 我首先从散列值为空开始,然后运行 `nix-build` 以获取一个关于散列值不匹配的错误信息。然后我从错误信息中复制出正确的散列值。 我只是在 nixpkgs 仓库中运行 `rg PREFIX` 来找出如何设置 `installFlags` 的 —— 我认为设置 `PREFIX` 应该是很常见的操作,可能之前已经有人做过了,事实证明我的想法是对的。所以我只是从其他包中复制粘贴了那部分代码。 然后我执行了: ``` nix-build paperjam.nix nix-env -i -f paperjam.nix ``` 然后所有的东西都开始工作了,我成功地安装了 `paperjam`!耶! ### 下一个目标:安装一个五年前的 Hugo 版本 当前,我使用的是 2018 年的 Hugo 0.40 版本来构建我的博客。由于我并不需要任何的新功能,因此我并没有感到有升级的必要。对于在 Linux 上操作,这个过程非常简单:Hugo 的发行版本是静态二进制文件,这意味着我可以直接从 [发布页面](https://github.com/gohugoio/hugo/releases/tag/v0.40) 下载五年前的二进制文件并运行。真的很方便! 但在我的 Mac 电脑上,我遇到了一些复杂的情况。过去五年中,Mac 的硬件已经发生了一些变化,因此我下载的 Mac 版 Hugo 二进制文件并不能运行。同时,我尝试使用 `go build` 从源代码编译,但由于在过去的五年内 Go 的构建规则也有所改变,因此没有成功。 我曾试图通过在 Linux docker 容器中运行 Hugo 来解决这个问题,但我并不太喜欢这个方法:尽管可以工作,但它运行得有些慢,而且我个人感觉这样做有些多余。毕竟,编译一个 Go 程序不应该那么麻烦! 幸好,Nix 来救援!接下来,我将介绍我是如何使用 nix 来安装旧版本的 Hugo。 #### 使用 nix 安装 Hugo 0.40 版本 我的目标是安装 Hugo 0.40,并将其添加到我的 PATH 中,以 `hugo-0.40` 作为命名。以下是我实现此目标的步骤。尽管我采取了一种相对特殊的方式进行操作,但是效果不错(可以参考 [搜索和安装旧版本的 Nix 包](https://lazamar.github.io/download-specific-package-version-with-nix/) 来找到可能更常规的方法)。 **步骤 1:** 在 nixpkgs 仓库中搜索找到 Hugo 0.40。 我在此链接中找到了相应的 `.nix` 文件 <https://github.com/NixOS/nixpkgs/blob/17b2ef2/pkgs/applications/misc/hugo/default.nix>。 **步骤 2:** 下载该文件并进行构建。 我下载了带有 `.nix` 扩展名的文件(以及同一目录下的另一个名为 `deps.nix` 的文件),将文件的首行替换为 `with import <nixpkgs> {};`,然后使用 `nix-build hugo.nix` 进行构建。 虽然这个过程几乎无需进行修改就能成功运行,但我仍然做了两处小调整: * 把 `with stdenv.lib` 替换为 `with lib`。 * 为避免与我已安装的其他版本的 `hugo` 冲突,我把包名改为了 `hugo040`。 **步骤 3:** 将 `hugo` 重命名为 `hugo-0.40`。 我编写了一个简短的后安装脚本,用以重命名 Hugo 二进制文件。 ``` postInstall = '' mv $out/bin/hugo $out/bin/hugo-0.40 ''; ``` 我是通过在 nixpkgs 仓库中运行 `rg 'mv '` 命令,然后复制和修改一条看似相关的代码片段来找到如何实施此步骤。 **步骤 4:** 安装。 我通过运行 `nix-env -i -f hugo.nix` 命令,将 Hugo 安装到了 `~/.nix-profile/bin` 目录中。 所有的步骤都顺利运行了!我把最终的 `.nix` 文件存放到了我自己的 [nixpkgs 仓库](https://github.com/jvns/nixpkgs/) 中,这样我以后如果需要,就能再次使用它了。 ### 可重复的构建过程并非神秘,其实它们极其复杂 我觉得值得一提的是,这个 `hugo.nix` 文件并不是什么魔法——我之所以能在今天轻易地编译 Hugo 0.40,完全归功于许多人长期以来的付出,他们让 Hugo 的这个版本得以以可重复的方式打包。 ### 总结 安装 `paperjam` 和这个五年前的 Hugo 版本过程惊人地顺利,实际上比没有 nix 来编译它们更简单。这是因为 nix 极大地方便了我使用正确的 `libiconv` 版本来编译 `paperjam` 包,而且五年前就已经有人辛苦地列出了 Hugo 的确切依赖关系。 我并无计划详细深入地使用 nix(真的,我很可能对它感到困扰,然后最后选择回归使用 homebrew!),但我们将拭目以待!我发现,简单入手然后按需逐步掌握更多功能,远比一开始就全面接触一堆复杂功能更容易掌握。 我可能不会在 Linux 上使用 nix —— 我一直都对 Debian 基础发行版的 `apt` 和 Arch 基础发行版的 `pacman` 感到满意,它们策略明晰且少有混淆。而在 Mac 上,使用 nix 似乎会有所得。不过,谁知道呢!也许三个月后,我可能会对 nix 感到不满然后再次选择回归使用 homebrew。 *(题图:MJ/f68aaf37-4a34-4643-b3a1-8728d49cf887)* --- via: <https://jvns.ca/blog/2023/02/28/some-notes-on-using-nix/> 作者:[Julia Evans](https://jvns.ca/) 选题:[lkxed](https://github.com/lkxed/) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
Recently I started using a Mac for the first time. The biggest downside I’ve noticed so far is that the package management is much worse than on Linux. At some point I got frustrated with homebrew because I felt like it was spending too much time upgrading when I installed new packages, and so I thought – maybe I’ll try the [nix](https://nixos.org/) package manager! nix has a reputation for being confusing (it has its whole own programming language!), so I’ve been trying to figure out how to use nix in a way that’s as simple as possible and does not involve managing any configuration files or learning a new programming language. Here’s what I’ve figured out so far! We’ll talk about how to: - install packages with nix - build a custom nix package for a C++ program called [paperjam](https://mj.ucw.cz/sw/paperjam/) - install a 5-year-old version of [hugo](https://github.com/gohugoio/hugo/)with nix As usual I’ve probably gotten some stuff wrong in this post since I’m still pretty new to nix. I’m also still not sure how much I like nix – it’s very confusing! But it’s helped me compile some software that I was struggling to compile otherwise, and in general it seems to install things faster than homebrew. (**note from 18 months later in August 2024**: I’ve mostly switched back to Homebrew, nix was interesting but overall I think it’s not worth the complexity for me) ### what’s interesting about nix? People often describe nix as “declarative package management”. I don’t care that much about declarative package management, so here are two things that I appreciate about nix: - It provides binary packages (hosted at [https://cache.nixos.org/](https://cache.nixos.org/)) that you can quickly download and install - For packages which don’t have binary packages, it makes it easier to compile them I think that the reason nix is good at compiling software is that: - you can have multiple versions of the same library or program installed at a time (you could have 2 different versions of libc for instance). For example I have two versions of node on my computer right now, one at `/nix/store/4ykq0lpvmskdlhrvz1j3kwslgc6c7pnv-nodejs-16.17.1` and one at`/nix/store/5y4bd2r99zhdbir95w5pf51bwfg37bwa-nodejs-18.9.1` . - when nix builds a package, it builds it in isolation, using only the specific versions of its dependencies that you explicitly declared. So there’s no risk that the package secretly depends on another package on your system that you don’t know about. No more fighting with `LD_LIBRARY_PATH` ! - a lot of people have put a lot of work into writing down all of the dependencies of packages I’ll give a couple of examples later in this post of two times nix made it easier for me to compile software. ### how I got started with nix here’s how I got started with nix: - Install nix. I forget exactly how I did this, but it looks like there’s an [official installer](https://nixos.org/download)and an[unofficial installer from zero-to-nix.com](https://zero-to-nix.com/concepts/nix-installer). The[instructions for uninstalling nix on MacOS with the standard multi-user install](https://nixos.org/manual/nix/stable/installation/installing-binary.html#macos)are a bit complicated, so it might be worth choosing an installation method with simpler uninstall instructions. - Put `~/.nix-profile/bin` on my PATH - Install packages with `nix-env -iA nixpkgs.NAME` - That’s it. Basically the idea is to treat `nix-env -iA` like `brew install` or `apt-get install` . For example, if I want to install `fish` , I can do that like this: ``` nix-env -iA nixpkgs.fish ``` This seems to just download some binaries from [https://cache.nixos.org](https://cache.nixos.org) – pretty simple. Some people use nix to install their Node and Python and Ruby packages, but I haven’t been doing that – I just use `npm install` and `pip install` the same way I always have. ### some nix features I’m not using There are a bunch of nix features/tools that I’m not using, but that I’ll mention. I originally thought that you *had* to use these features to use nix, because most of the nix tutorials I’ve read talk about them. But you don’t have to use them. - NixOS (a Linux distribution) [nix-shell](https://nixos.org/guides/nix-pills/developing-with-nix-shell.html)[nix flakes](https://nixos.wiki/wiki/Flakes)[home-manager](https://github.com/nix-community/home-manager)[devenv.sh](https://devenv.sh/) I won’t go into these because I haven’t really used them and there are lots of explanations out there. ### where are nix packages defined? I think packages in the main nix package repository are defined in [https://github.com/NixOS/nixpkgs/](https://github.com/NixOS/nixpkgs/) It looks like you can search for packages at [https://search.nixos.org/packages](https://search.nixos.org/packages). The two official ways to search packages seem to be: `nix-env -qaP NAME` , which is very extremely slow and which I haven’t been able to get to actually work`nix --extra-experimental-features 'nix-command flakes' search nixpkgs NAME` , which does seem to work but is kind of a mouthful. Also all of the packages it prints out start with`legacyPackages` for some reason I found a way to search nix packages from the command line that I liked better: - Run `nix-env -qa '*' > nix-packages.txt` to get a list of every package in the Nix repository - Write a short `nix-search` script that just greps`packages.txt` (`cat ~/bin/nix-packages.txt | awk '{print $1}' | rg "$1"` ) ### everything is installed with symlinks One of nix’s major design choices is that there isn’t one single `bin` with all your packages, instead you use symlinks. There are a lot of layers of symlinks. A few examples of symlinks: `~/.nix-profile` on my machine is (indirectly) a symlink to`/nix/var/nix/profiles/per-user/bork/profile-111-link/` `~/.nix-profile/bin/fish` is a symlink to`/nix/store/afkwn6k8p8g97jiqgx9nd26503s35mgi-fish-3.5.1/bin/fish` When I install something, it creates a new `profile-112-link` directory with new symlinks and updates my `~/.nix-profile` to point to that directory. I think this means that if I install a new version of `fish` and I don’t like it, I can easily go back just by running `nix-env --rollback` – it’ll move me to my previous profile directory. ### uninstalling packages doesn’t delete them If I uninstall a nix package like this, it doesn’t actually free any hard drive space, it just removes the symlinks. ``` $ nix-env --uninstall oil ``` I’m still not sure how to actually delete the package – I ran a garbage collection like this, which seemed to delete some things: ``` $ nix-collect-garbage ... 85 store paths deleted, 74.90 MiB freed ``` But I still have `oil` on my system at `/nix/store/8pjnk6jr54z77jiq5g2dbx8887dnxbda-oil-0.14.0` . There’s a more aggressive version of `nix-collect-garbage` that also deletes old versions of your profiles (so that you can’t rollback) ``` $ nix-collect-garbage -d --delete-old ``` That doesn’t delete `/nix/store/8pjnk6jr54z77jiq5g2dbx8887dnxbda-oil-0.14.0` either though and I’m not sure why. ### upgrading It looks like you can upgrade nix packages like this: ``` nix-channel --update nix-env --upgrade ``` (similar to `apt-get update && apt-get upgrade` ) I haven’t really upgraded anything yet. I think that if something goes wrong with an upgrade, you can roll back (because everything is immutable in nix!) with ``` nix-env --rollback ``` Someone linked me to [this post from Ian Henry](https://ianthehenry.com/posts/how-to-learn-nix/my-first-package-upgrade/) that talks about some confusing problems with `nix-env --upgrade` – maybe it doesn’t work the way you’d expect? I guess I’ll be wary around upgrades. ### next goal: make a custom package of `paperjam` After a few months of installing existing packages, I wanted to make a custom package with nix for a program called [paperjam](https://mj.ucw.cz/sw/paperjam/) that wasn’t already packaged. I was actually struggling to compile `paperjam` at all even without nix because the version I had of `libiconv` I has on my system was wrong. I thought it might be easier to compile it with nix even though I didn’t know how to make nix packages yet. And it actually was! But figuring out how to get there was VERY confusing, so here are some notes about how I did it. ### how to build an example package Before I started working on my `paperjam` package, I wanted to build an example existing package just to make sure I understood the process for building a package. I was really struggling to figure out how to do this, but I asked in Discord and someone explained to me how I could get a working package from [https://github.com/NixOS/nixpkgs/](https://github.com/NixOS/nixpkgs/) and build it. So here are those instructions: **step 1:** Download some arbitrary package from [nixpkgs](https://github.com/NixOS/nixpkgs/) on github, for example the `dash` package: ``` wget https://raw.githubusercontent.com/NixOS/nixpkgs/47993510dcb7713a29591517cb6ce682cc40f0ca/pkgs/shells/dash/default.nix -O dash.nix ``` **step 2**: Replace the first statement (`{ lib , stdenv , buildPackages , autoreconfHook , pkg-config , fetchurl , fetchpatch , libedit , runCommand , dash }:` with `with import <nixpkgs> {};` I don’t know why you have to do this, but it works. **step 3**: Run `nix-build dash.nix` This compiles the package **step 4**: Run `nix-env -i -f dash.nix` This installs the package into my `~/.nix-profile` That’s all! Once I’d done that, I felt like I could modify the `dash` package and make my own package. ### how I made my own package `paperjam` has one dependency (`libpaper` ) that also isn’t packaged yet, so I needed to build `libpaper` first. Here’s `libpaper.nix` . I basically just wrote this by copying and pasting from other packages in the [nixpkgs](https://github.com/NixOS/nixpkgs/) repository. My guess is what’s happening here is that nix has some default rules for compiling C packages (like “run `make install` ”), so the `make install` happens default and I don’t need to configure it explicitly. ``` with import <nixpkgs> {}; stdenv.mkDerivation rec { pname = "libpaper"; version = "0.1"; src = fetchFromGitHub { owner = "naota"; repo = "libpaper"; rev = "51ca11ec543f2828672d15e4e77b92619b497ccd"; hash = "sha256-S1pzVQ/ceNsx0vGmzdDWw2TjPVLiRgzR4edFblWsekY="; }; buildInputs = [ ]; meta = with lib; { homepage = "https://github.com/naota/libpaper"; description = "libpaper"; platforms = platforms.unix; license = with licenses; [ bsd3 gpl2 ]; }; } ``` Basically this just tells nix how to download the source from GitHub. I built this by running `nix-build libpaper.nix` Next, I needed to compile `paperjam` . Here’s a link to the [nix package I wrote](https://github.com/jvns/nixpkgs/blob/22b70a48a797538c76b04261b3043165896d8f69/paperjam.nix). The main things I needed to do other than telling it where to download the source were: - add some extra build dependencies (like `asciidoc` ) - set some environment variables for the install ( `installFlags = [ "PREFIX=$(out)" ];` ) so that it installed in the correct directory instead of`/usr/local/bin` . I set the hashes by first leaving the hash empty, then running `nix-build` to get an error message complaining about a mismatched hash. Then I copied the correct hash out of the error message. I figured out how to set `installFlags` just by running `rg PREFIX` in the nixpkgs repository – I figured that needing to set a `PREFIX` was pretty common and someone had probably done it before, and I was right. So I just copied and pasted that line from another package. Then I ran: ``` nix-build paperjam.nix nix-env -i -f paperjam.nix ``` and then everything worked and I had `paperjam` installed! Hooray! ### next goal: install a 5-year-old version of `hugo` Right now I build this blog using Hugo 0.40, from 2018. I don’t need any new features so I haven’t felt a need to upgrade. On Linux this is easy: Hugo’s releases are a static binary, so I can just download the 5-year-old binary from the [releases page](https://github.com/gohugoio/hugo/releases/tag/v0.40) and run it. Easy! But on this Mac I ran into some complications. Mac hardware has changed in the last 5 years, so the Mac Hugo binary I downloaded crashed. And when I tried to build it from source with `go build` , that didn’t work either because Go build norms have changed in the last 5 years as well. I was working around this by running Hugo in a Linux docker container, but I didn’t love that: it was kind of slow and it felt silly. It shouldn’t be that hard to compile one Go program! Nix to the rescue! Here’s what I did to install the old version of Hugo with nix. ### installing Hugo 0.40 with nix I wanted to install Hugo 0.40 and put it in my PATH as `hugo-0.40` . Here’s how I did it. I did this in a kind of weird way, but it worked ([Searching and installing old versions of Nix packages](https://lazamar.github.io/download-specific-package-version-with-nix/) describes a probably more normal method). **step 1**: Search through the nixpkgs repo to find Hugo 0.40 I found the `.nix` file here [https://github.com/NixOS/nixpkgs/blob/17b2ef2/pkgs/applications/misc/hugo/default.nix](https://github.com/NixOS/nixpkgs/blob/17b2ef2/pkgs/applications/misc/hugo/default.nix) **step 2**: Download that file and build it I downloaded that file (and another file called `deps.nix` in the same directory), replaced the first line with `with import <nixpkgs> {};` , and built it with `nix-build hugo.nix` . That almost worked without any changes, but I had to make two changes: - replace `with stdenv.lib` to`with lib` for some reason. - rename the package to `hugo040` so that it wouldn’t conflict with the other version of`hugo` that I had installed **step 3**: Rename `hugo` to `hugo-0.40` I write a little post install script to rename the Hugo binary. ``` postInstall = '' mv $out/bin/hugo $out/bin/hugo-0.40 ''; ``` I figured out how to run this by running `rg 'mv '` in the nixpkgs repository and just copying and modifying something that seemed related. **step 4**: Install it I installed into my `~/.nix-profile/bin` by running `nix-env -i -f hugo.nix` . And it all works! I put the final `.nix` file into my own personal [nixpkgs repo](https://github.com/jvns/nixpkgs/) so that I can use it again later if I want. ### reproducible builds aren’t magic, they’re really hard I think it’s worth noting here that this `hugo.nix` file isn’t magic – the reason I can easily compile Hugo 0.40 today is that many people worked for a long time to make it possible to package that version of Hugo in a reproducible way. ### that’s all! Installing `paperjam` and this 5-year-old version of Hugo were both surprisingly painless and actually much easier than compiling it without nix, because nix made it much easier for me to compile the `paperjam` package with the right version of `libiconv` , and because someone 5 years ago had already gone to the trouble of listing out the exact dependencies for Hugo. I don’t have any plans to get much more complicated with nix (and it’s still very possible I’ll get frustrated with it and go back to homebrew!), but we’ll see what happens! I’ve found it much easier to start in a simple way and then start using more features if I feel the need instead of adopting a whole bunch of complicated stuff all at once. I probably won’t use nix on Linux – I’ve always been happy enough with `apt` (on Debian-based distros) and `pacman` (on Arch-based distros), and they’re much less confusing. But on a Mac it seems like it might be worth it. We’ll see! It’s very possible in 3 months I’ll get frustrated with nix and just go back to homebrew. ### 5-month update: rebuilding my nix profile Update from 5 months in: nix is still going well, and I’ve only run into 1 problem, which is that every `nix-env -iA` package installation started failing with the error “bad meta.outputsToInstall”. [This script](https://github.com/zombiezen/dotfiles/blob/main/nix/nix-rebuild-profile/nix-rebuild-profile.sh) from Ross Light fixes that problem though. It lists every derivation installed in my current profile and creates a new profile with the exact same derivations. This feels like a nix bug (surely creating a new profile with the exact same derivations should be a no-op?) but I haven’t looked into it more yet.
16,333
KDE Plasma 6 将不支持较旧的桌面小部件
https://news.itsfoss.com/kde-plasma-6-widgets/
2023-10-30T22:52:07
[ "KDE", "小部件" ]
https://linux.cn/article-16333-1.html
![](/data/attachment/album/202310/30/225133j5bvbvb5bzdgg4gn.jpg) > > KDE Plasma 6 进行了一些修改,需要小部件作者进行调整。开发人员,移植时间到了! > > > KDE Plasma 6 是备受期待的桌面环境版本升级版本。 最近,其发布时间表公布,第一个 Alpha 版本将于 **2023 年 11 月 8 日**上线,最终 **Beta 版本于 2023 年 1 月 31 日**上线,稳定版计划于 **2024 年 2 月 28 日**上线。 考虑到 KDE Plasma 5.x 系列包含多项改进和功能添加,许多用户对 KDE Plasma 6 带来的功能感到期待。 如果你好奇,我们已经介绍了 [KDE Plasma 6 的主要变化](/article-15821-1.html)。因此,它会发生重大变化也就不足为奇了。 然而,在进行重大修改后,可能会出现一些破坏体验的改动,例如无法在 Plasma 6 上运行任何旧版小部件。 ### 给小部件开发者的移植通知 在 KDE 的 *Nate Graham* 最近发表的一篇 [博客文章](https://pointieststick.com/2023/10/24/its-time-to-port-your-widgets-to-plasma-6/) 中,向 Plasma 5 小部件作者发出了正式的警告。 其重点指出的信息是: > > **你需要将你的小部件移植到更新的 API,以使它们与 Plasma 6 兼容!** > > > Plasma 小部件 API 已随着即将发布的版本进行了修改。而且,为了适应这种变化并保持运行,小部件开发人员必须将他们的创作移植到更新的 API。 如果开发人员不移植小部件以使用更新的 API,它将无法在 KDE Plasma 6 中运行。 当然,流行的小部件开发人员很可能会进行移植。但是,如果你使用的小部件虽然还能使用,但没有积极维护,那么你将不得不在 KDE Plasma 6 中放弃它。 他们已提供了一份 [移植指南](https://develop.kde.org/docs/plasma/widget/porting_kf6/) 供开发人员遵循。 你可以在 “[Plasma 6 扩展](https://store.kde.org/browse?cat=705&ord=latest)” 下找到与 Plasma 6 兼容的小部件。在撰写本文时,只能看到列出了两个第三方小部件。 ![](/data/attachment/album/202310/30/225207ucy9rcrxr0wyryrr.jpg) 因此,当你喜欢的小部件被移植到 KDE Plasma 6 并由相关开发者上传后,你就会发现它们的踪迹。 ? 你期待移植哪些 KDE 小部件? 你认为你会错过某些不再维护的小部件吗?在下面的评论中分享你的想法。 --- via: <https://news.itsfoss.com/kde-plasma-6-widgets/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) KDE Plasma 6 is a highly anticipated upgrade among desktop environment releases. Recently, its release schedule was revealed with the first Alpha version going live on **8th November 2023**, final **Beta on 31st January 2024**, and the stable planned for **February 28, 2024**. Considering KDE Plasma 5.x series included several refinements and feature additions, many users are excited about what KDE Plasma 6 brings to the table. If you are curious, we already covered the [major changes coming to KDE Plasma 6](https://news.itsfoss.com/kde-plasma-6-dev/). Hence, it is not a surprise that it will come baked in big changes. However, with significant overhauls, there can be some experience breaking changes, such as not having any older widgets run on Plasma 6. ## Porting Notice to Widget Developers In a recent [blog post](https://pointieststick.com/2023/10/24/its-time-to-port-your-widgets-to-plasma-6/?ref=news.itsfoss.com) by *Nate Graham* from KDE, a formal heads-up was given to Plasma 5 widget authors. The highlighted information being: You will need to port your widgets to newer APIs to make them compatible with Plasma 6! The Plasma widget API has been modified with the upcoming release. And, to adapt to this change and keep things running, the widget developers have to port their creations to newer APIs. If a developer does not port the widget to use newer APIs, it will not run with KDE Plasma 6. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) Of course, popular widget developers would most likely do the port. But, if you were using a widget that does the job—but not actively maintained, you will have to let go of it with KDE Plasma 6. A [porting guide](https://develop.kde.org/docs/plasma/widget/porting_kf6/?ref=news.itsfoss.com) has been made available for the developers to follow. You can find the Plasma 6 compatible widgets under "[Plasma 6 Extensions](https://store.kde.org/browse?cat=705&ord=latest&ref=news.itsfoss.com)" category. At the time of writing this, only two third-party widgets can be seen listed. ![kde plasma 6 extensions](https://news.itsfoss.com/content/images/2023/10/kde-plasma-6-extension.jpg) So, you will find all your favorite widgets when they are ported and uploaded by the respective developers for KDE Plasma 6. *💬 What KDE widget do you look forward to being ported? Do you think you will be missing out on certain widgets that are no longer maintained? Share your thoughts in the comments below.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,336
Linux 内核 6.6 版本莅临,带来诸多变化
https://news.itsfoss.com/linux-kernel-6-6-release/
2023-10-31T20:46:32
[ "Linux", "内核" ]
https://linux.cn/article-16336-1.html
![](/data/attachment/album/202310/31/204603jy3e8ezhtyehn9po.jpg) > > 笔记本的支持得到了提升,服务器性能得到了改进,更多内容一一揭晓。 > > > 又到了迎接 Linux 内核新版本发布的时刻! Linux 内核 6.6 的发布,是一次大规模更新,针对各类笔记本、网络硬件、处理器等提供了**大量全方位的改良**。 Linus Torvalds [表示](https://lkml.iu.edu/hypermail/linux/kernel/2310.3/06370.html): > > 各种各样的修复散布各处,除了针对 r8152 驱动的一些重要修复外,其它的都相当小型。下面是上周的简短日志,供所有想要一探究竟、了解更多细节的读者。日志篇幅短小,可以快速翻阅。 > > > ### ? Linux 内核 6.6:都有哪些新元素? 在我们开始之前,需要提醒大家,这一次发布的是**非长期支持版本**,因此不是每个人都必须进行升级,除非你想要享受最新、最棒的版本。 总的来说,让我们来看看这次发布版本的亮点: * 针对英特尔芯片的优化 * 对笔记本的更佳支持 * 网络改进 * AMD 芯片性能提升 #### 针对英特尔芯片的优化 ![](/data/attachment/album/202310/31/204634alrzd80mebeztnnp.png) Linux 内核 6.6 版本新增了对英特尔的**神经处理单元(NPU)的支持**,这样的技术原先被称作通用处理器。 这项技术预计将于今年晚些时候,随着英特尔的“[Meteor Lake](https://www.intel.com/content/www/us/en/content-details/788851/meteor-lake-architecture-overview.html)”芯片亮相而首次公开登场。这些 **NPU 将被专门用于处理人工智能工作负载**。 英特尔甚至已经开始对即将发布的 “**Arrow Lake**”芯片进行**NPU 支持的初步工作**了! 此外,还新增了对英特尔的 [Shadow Stack](https://en.wikipedia.org/wiki/Shadow_stack) 的支持,因为他们的 [控制流执行技术](https://www.intel.com/content/www/us/en/developer/articles/technical/technical-look-control-flow-enforcement-technology.html)(CET)被引入到了内核中。其主要目的是防止现代英特尔 CPU(从 Tiger Lake 起)上的**返回导向编程(ROP)攻击**。 #### 对笔记本的更佳支持 ![](/data/attachment/album/202310/31/204635nb3btutx6bhmx03e.png) **对于惠普笔记本,现在你可以直接在 Linux 中对 BIOS 进行管理了**,这要归功于 “**HP-BIOSCFG**” 驱动的实现。 根据报道,**从 2018 年起出产的惠普笔记本应该都可以支持这个驱动程序**。 **对于联想笔记本,驱动程序已经更新,为更多的 IdeaPad 笔记本**添加了键盘背光控制\*\*。 同样,**对于华硕笔记本**,现在 [ROG Flow X16](https://rog.asus.com/laptops/rog-flow/rog-flow-x16-2023-series/spec/)(2023 年款)游戏笔记本,当屏幕翻转时可以**正确地启用平板模式**。 #### 网络改进 ![](/data/attachment/album/202310/31/204636x5yq5ndv5spg5gbv.png) 在网络方面,Linux 内核 6.6 版本带来了对如 [Atheros QCA8081](https://www.qualcomm.com/products/internet-of-things/networking/wi-fi-networks/qca8081)、**MediaTek MT7988**、**MediaTek MT7981**,[NXP TJA1120 PHY](https://www.nxp.com/products/interfaces/ethernet-/automotive-ethernet-phys/tja1120-automotive-ethernet-phy-1000base-t1-asil-b-and-tc-10:TJA1120) 等新型硬件的**支持**。 同时,各类驱动程序也进行了升级,例如 **高通 Wi-Fi 7 (ath12k)驱动程序**,它现在**支持 Extremely High Throughput(EHT)PHY**。 此外,针对各类 Realtek(rtl8xxxu)Wi-Fi 芯片**启用了 AP 模式**。 关于特定于网络的变动,你可以在这个 [拉取请求](https://lore.kernel.org/lkml/[email protected]/) 中查阅更多的详细信息。 #### AMD 芯片的性能提升 ![](/data/attachment/album/202310/31/204636mjfmj7zluojsbuob.png) 随着 Linux 内核 6.6 的发布,AMD 的开发人员推出了**两项尚未正式公开的新技术的支持**。 一项技术是对他们即将推出的 “**FreeSync Panel Replay**” 技术的支持,这一技术只用于游戏笔记本抖动屏,可以自动降低刷新率以节省电力和降低 GPU 工作负载。 另一项技术被称为 “**动态提速控制**”,这是一项能够**提高某些 Ryzen SoC 性能的功能**,但关于它的更多细节比较少。 关于它的实施,你可以在这个 [补丁序列](https://lore.kernel.org/lkml/[email protected]/T/#m38ab23d70d213ceb67440168b3f71ad2be3aa564) 中查阅更多的信息。 #### ?️ 其他的变化与改进 其他方面,还包括一些值得注意的变动: * 针对 **龙芯** 的大量新特性。 * **Rust 工具链** 升级至 v1.71.1 版本。 * 对 **RISC-V** 和 **Btrfs** 的多项改进。 * 完全移除了 [无线 USB](https://en.wikipedia.org/wiki/Wireless_USB) 和 [**Ultra-Wideband**](https://en.wikipedia.org/wiki/Ultra-wideband) 的代码。 * 对 **英伟达**、**英特尔** 和 **AMD** 的**开源图形驱动程序** 的众多优化。 你可以在 [更新日志](https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6) 中查阅更详细的信息。 ### 安装 Linux 内核 6.6 版本 如果你的体验是像 Arch 或 Fedora 那类的滚动发行版,升级过程非常简单。 你只需要稍等片刻,因为这些发行版在发布更新时需要一些时间。 对于其他的用户,你可以等待主要版本更新,或者**根据我们的指南在 Ubuntu 中升级至最新的主线 Linux 内核**: > > **[在 Ubuntu 上安装最新的主线 Linux 内核](https://itsfoss.com/upgrade-linux-kernel-ubuntu/)** > > > 你可以在 [官方网站](https://www.kernel.org/) 下载最新的 Linux 内核的 tarball (*发布后可能需要些时间才能得到*)。 ? 你对这次内核发布有何想法? --- via: <https://news.itsfoss.com/linux-kernel-6-6-release/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) It is time for another Linux kernel release! The Linux kernel 6.6 release is a big one with **plenty of improvements across the board** for various laptops, networking hardware, processors and what not. Linus Torvalds [mentions](https://lkml.iu.edu/hypermail/linux/kernel/2310.3/06370.html?ref=news.itsfoss.com): *There's a random smattering of fixes all over, and apart from somebigger fixes to the r8152 driver, it's all fairly small. Below is theshortlog for last week for anybody who really wants to get a flavor ofthe details. It's short enough to scroll through.* **Suggested Read **📖 [Linux Kernel 6.5 Released With Initial Support for Wi-Fi 7 and USB4The Linux Kernel 6.5 has dropped with nice improvements. Check it out here.](https://news.itsfoss.com/linux-kernel-6-5-release/)![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ![](https://news.itsfoss.com/content/images/2023/08/linux-6-5-release.png) ## 🆕 Linux Kernel 6.6: What's New? Before we begin, just keep in mind that this is **an LTS release**. Anyway, let's move on to the highlights of this release: **Intel Improvements****Better Support for Laptops****Networking Improvements****AMD Enhancements** ### Intel Improvements ![an image showing the intel logo](https://news.itsfoss.com/content/images/2023/10/Linux_Kernel_6.6_1.png) Linux kernel 6.6 features **support for Intel's Neural Processing Unit **(**NPU**) technology, which was formerly known as the Versatile Processing Unit. This tech is **set to debut with Intel's “****Meteor Lake****” chips** later this year that will see these **NPUs exclusively being used for handling AI workloads**. Intel has even begun the **initial work for NPU support** on the upcoming “**Arrow Lake**” chips with this kernel release! Then there's the **support for Intel's **[ Shadow Stack](https://en.wikipedia.org/wiki/Shadow_stack?ref=news.itsfoss.com) that came with the inclusion of their [(CET) into the kernel. Its main objective is to](https://www.intel.com/content/www/us/en/developer/articles/technical/technical-look-control-flow-enforcement-technology.html?ref=news.itsfoss.com) **Control-flow Enforcement Technology****defend against return-oriented programming (ROP) attacks**on modern Intel CPUs from Tiger Lake onwards. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ### Better Support for Laptops ![an image showing a laptop illustration](https://news.itsfoss.com/content/images/2023/10/Linux_Kernel_6.6_2-1.png) **For HP laptops**, it is now** possible to manage the BIOS from within Linux**, this is thanks to the implementation of the “**HP-BIOSCFG**” driver. According to reports, **HP laptops from 2018 and later should work** with this driver. **For Lenovo laptops**, the driver was updated to **add support for keyboard backlight control** for more IdeaPad laptops. Similarly,** for ASUS laptops**, the [ROG Flow X16](https://rog.asus.com/laptops/rog-flow/rog-flow-x16-2023-series/spec/?ref=news.itsfoss.com) (2023) gaming laptops can now **properly enable tablet mode** when the lid is flipped over. ### Networking Improvements ![an image showing a networking illustration](https://news.itsfoss.com/content/images/2023/10/Linux_Kernel_6.6_3.png) On the networking side of things, Linux kernel 6.6 features **support for new hardware** such as [ Atheros QCA8081](https://www.qualcomm.com/products/internet-of-things/networking/wi-fi-networks/qca8081?ref=news.itsfoss.com), **MediaTek MT7988**, **MediaTek MT7981**, [, and more.](https://www.nxp.com/products/interfaces/ethernet-/automotive-ethernet-phys/tja1120-automotive-ethernet-phy-1000base-t1-asil-b-and-tc-10:TJA1120?ref=news.itsfoss.com) **NXP TJA1120 PHY**Even the **drivers have seen upgrades**, take for instance the **Qualcomm Wi-Fi 7 (ath12k) driver**, which now **supports Extremely High Throughput (EHT) PHY**. Then there is the **enabling of AP mode for various Realtek (rtl8xxxu) Wi-Fi chips**. More details on networking-specific changes can be found in the [pull request](https://lore.kernel.org/lkml/[email protected]/?ref=news.itsfoss.com). ### AMD Enhancements ![an image showing the amd logo](https://news.itsfoss.com/content/images/2023/10/Linux_Kernel_6.6_4.png) With the Linux kernel 6.6 release, AMD developers have pushed **support for two new pieces of technology** that they have yet to officially announce. One is support for their upcoming “**FreeSync Panel Replay**” technology for gaming displays (laptops only) that would automatically decrease the refresh rate to save on power and reduce GPU workload. The other is called “**Dynamic boost control**” that is a **performance** **improving feature for some Ryzen SoCs**, details about it are quite slim. More on its implementation can be found in the [patch series](https://lore.kernel.org/lkml/[email protected]/T/?ref=news.itsfoss.com#m38ab23d70d213ceb67440168b3f71ad2be3aa564). ### 🛠️ Other Changes & Improvements As for the rest, here are some other notable changes: - Loads of new features for **LoongArch**. - The **Rust toolchain**was upgraded to v1.71.1. - Various improvements for **RISC-V**and**Btrfs**. - Complete removal of and**Wireless USB**code.**Ultra-Wideband** - Many improvements for **open-source graphics drivers**for**Nvidia**,**Intel**, and**AMD**. You can go through the [changelog](https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6?ref=news.itsfoss.com) for more details. ## Installing Linux Kernel 6.6 If you are running rolling-release distros such as Arch or Fedora, then it is quite straightforward to upgrade. You just have to wait a bit, as these distros take their time in releasing the update. As for the rest, you can either wait for a major release, or **upgrade to the latest mainline Linux kernel in Ubuntu** by following our guide: [Install the Latest Mainline Linux Kernel Version in UbuntuThis article shows you how to upgrade to the latest Linux kernel in Ubuntu. There are two methods discussed. One is manually installing a new kernel and the other uses a GUI tool providing even easier way.](https://itsfoss.com/upgrade-linux-kernel-ubuntu/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/04/install-mainline-kernel-in-ubuntu.png) ![](https://itsfoss.com/content/images/2023/04/install-mainline-kernel-in-ubuntu.png) You can download the tarball for the latest Linux kernel from its [official website](https://www.kernel.org/?ref=news.itsfoss.com) (*it takes time for it to be available after release*). *💬 What do you think of this kernel release?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,340
开放文档格式 ODT 文件格式解析
https://opensource.com/article/22/8/odt-files
2023-11-01T22:37:00
[ "ODF", "ODT" ]
/article-16340-1.html
![](/data/attachment/album/202311/01/223607j3nvjcuw5jcocbz3.jpg) > > 开放文档格式(ODF)基于开放标准,你可以使用其它工具检查它们,甚至从中提取数据。你只需要知道从哪里开始。 > > > 过去,文字处理文件是封闭的专有格式。在一些较旧的文字处理软件中,文档文件本质上是该软件的内存转储。虽然这样可以让加载文件更快,但也使文档文件格式变得不透明。 2005 年左右,<ruby> 结构化信息标准促进组织 <rt> Organization for the Advancement of Structured Information Standards </rt></ruby>(OASIS)为所有类型的办公文档定义了一种开放格式,即<ruby> 办公应用程序开放文档格式 <rt> Open Document Format for Office Applications </rt></ruby>(ODF)。由于 ODF 是基于 [OpenOffice.org](http://OpenOffice.org) 的 XML 文件规范的开放式标准,因此你也可以将其简称为 “开放文档格式”。ODF 包括几种文件类型,包括用于 <ruby> 开放文档文本OpenDocument Text</ruby> 文档的 ODT。ODT 文件中有很多值得探索的内容,它的本质是一个 Zip 文件。 ### ODT 文件结构 跟所有 ODF 文件一样,ODT 文件实际上是一个 XML 文档和其它文件的 Zip 压缩包。使用 Zip 可以占用更少的磁盘空间,同时也意味着可以用标准 Zip 工具来检查它。 我有一篇关于 IT 领导力的文章,名为“Nibbled to death by ducks”,我将其保存为 ODT 文件。由于 ODF 文件是一个 zip 容器,你可以用 `unzip` 命令来检查它: ``` $ unzip -l 'Nibbled to death by ducks.odt' Archive: Nibbled to death by ducks.odt Length Date Time Name 39 07-15-2022 22:18 mimetype 12713 07-15-2022 22:18 Thumbnails/thumbnail.png 915001 07-15-2022 22:18 Pictures/10000201000004500000026DBF6636B0B9352031.png 10879 07-15-2022 22:18 content.xml 20048 07-15-2022 22:18 styles.xml 9576 07-15-2022 22:18 settings.xml 757 07-15-2022 22:18 meta.xml 260 07-15-2022 22:18 manifest.rdf 0 07-15-2022 22:18 Configurations2/accelerator/ 0 07-15-2022 22:18 Configurations2/toolpanel/ 0 07-15-2022 22:18 Configurations2/statusbar/ 0 07-15-2022 22:18 Configurations2/progressbar/ 0 07-15-2022 22:18 Configurations2/toolbar/ 0 07-15-2022 22:18 Configurations2/popupmenu/ 0 07-15-2022 22:18 Configurations2/floater/ 0 07-15-2022 22:18 Configurations2/menubar/ 1192 07-15-2022 22:18 META-INF/manifest.xml 970465 17 files ``` 我想强调 Zip 文件结构的以下几个元素: 1. `mimetype` 文件用于定义 ODF 文档。处理 ODT 文件的程序,如文字处理程序,可以使用该文件来验证文档的 MIME 类型。对于 ODT 文件,它应该总是: ``` application/vnd.oasis.opendocument.text ``` 2. `META-INF` 目录中有一个 `manifest.xml` 文件。它包含查找 ODT 文件其它组件的所有信息。任何读取 ODT 文件的程序都从这个文件开始定位其它内容。例如,我的 ODT 文档的 `manifest.xml` 文件包含这一行,它定义了在哪里可以找到主要内容: ``` <manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/> ``` 3. `content.xml` 文件包含文档的实际内容。 4. 我的文档中只有一张截图,它位于 `Pictures` 目录中。 ### 从 ODT 中提取文件 由于 ODT 文档是一个具有特定结构的 Zip 文件,因此可以从中提取文件。你可以先解压缩整个 ODT 文件,例如使用 `unzip` 命令: ``` $ unzip -q 'Nibbled to death by ducks.odt' -d Nibbled ``` 一位同事最近向我要了一份我在文章中提到的图片。通过查看 `META-INF/manifest.xml` 文件,我找到了嵌入图像的确切位置。用 `grep` 命令可以找到描述图像的行: ``` $ cd Nibbled $ grep image META-INF/manifest.xml <manifest:file-entry manifest:full-path="Thumbnails/thumbnail.png" manifest:media-type="image/png"/> <manifest:file-entry manifest:full-path="Pictures/10000201000004500000026DBF6636B0B9352031.png" manifest:media-type=" image/png”/> ``` 我要找的图像保存在 `Pictures` 文件夹中。可以通过列出目录的内容来验证: ``` $ ls -F Configurations2/ manifest.rdf meta.xml Pictures/ styles.xml content.xml META-INF/ mimetype settings.xml Thumbnails/ ``` 就是这张图片: ![Image of rubber ducks in two bowls](/data/attachment/album/202311/01/223659zr9a9hzndzaqhdjx.jpg) ### 开放文档格式 ODF 是一种开放的文件格式,它可以描述文字处理文件(ODT)、电子表格文件(ODS)、演示文稿(ODP)和其它文件类型。由于 ODF 格式基于开放标准,因此可以使用其他工具检查它们,甚至从中提取数据。你只需要知道从哪里开始。所有 ODF 文件都以 `META-INF/manifest.xml` 为“引导”文件,通过它你能找到其余的所有内容。 *(题图:MJ/d245ab34-f0b0-452c-b29a-ece9aa78f11a)* --- via: <https://opensource.com/article/22/8/odt-files> 作者:[Jim Hall](https://opensource.com/users/jim-hall) 选题:[lkxed](https://github.com/lkxed) 译者:[toknow-gh](https://github.com/toknow-gh) 校对:[校对者ID](https://github.com/%E6%A0%A1%E5%AF%B9%E8%80%85ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='opensource.com', port=443): Read timed out. (read timeout=10)
null
16,341
为什么公司需要设立开源项目办公室(OSPO)
https://www.opensourceforu.com/2022/08/why-companies-need-to-set-up-an-open-source-program-office/
2023-11-01T23:29:04
[ "开源项目办公室", "OSPO" ]
https://linux.cn/article-16341-1.html
![](/data/attachment/album/202311/01/232800a8c8bk3b83rtbn6x.jpg) > > 要想软件产品能够成功,关键在于管理开源软件的使用并降低合规风险。开源项目办公室能帮助组织实现这一目标。让我们一起深入了解。 > > > <ruby> 开源软件 <rt> Open source software </rt></ruby>(OSS)是构建现代软件解决方案的重要组成部分。无论是服务于内部或是面向客户的解决方案,如今的组织都在很大程度上依赖于开源软件。开源软件组件受其独立的授权条款约束,对这些条款的不合规操作往往会使组织面临安全和知识产权(IP)风险,这进而可能会损害公司的品牌价值。 当开发团队正忙于发布软件版本时,他们的主要目标是满足项目的截止日期。因此,他们在跟踪组件版本、库或者引入项目的第三方代码时,往往疏于应有的严格性。这意味着带有许可限制或漏洞的开源软件组件可能会进入代码库,然后交付给客户,这对客户和提供软件解决方案的公司都将带来风险。 开发人员为开源项目做出贡献的领域也日益具有挑战性。如果公司能够参与,他们可以获得多种益处,包括保持技能的最新性,挽留员工,吸引开发者为组织工作,以及提升公司形象。很多开源项目要求开发者签署贡献者许可协议,该协议声明由开发者创建的知识产权属于该项目,而非开发者本人。在这种情况下,组织需要确保那些不公开源代码的知识产权和商业机密不会被转让给开源项目。 我们需要教育开发者去了解开源许可的相关问题,确定何时、如何以及在何种程度上向社区提供支持,以及哪些软件包可能会给组织的声誉带来风险。通过制定一套战略性的政策和操作流程,我们可以规范这一切。实现上述目标的一种方式就是设立一个专门处理所有开源相关事务的部门——即 <ruby> 开源项目办公室 <rt> open source program office </rt></ruby>(OSPO)。 OSPO 为员工使用开源软件创建了一个生态环境,使合规风险得到良好的控制。OSPO 的角色不仅在于监督开源软件的使用,它还负责回馈社区,并通过积极参与各种活动以及组织网络研讨会和促销活动,来推动公司在市场上的增长。 在这篇文章里,我们将深入探讨为何公司需要设立一个 OSPO,以及它是如何在开源政策和管理程序中崭露头角的。 ### 为何我们需要一个开源项目办公室(OSPO)? 由于开源软件正广泛地被运用,因此在产品开发周期中,为团队对其使用的监管和维持合规性策略往往会带来重大压力。 开发者往往会忽略许可证责任,有时甚至管理层或各利益相关方也并未完全意识到不遵守这些开源许可证的影响。不论是用于内部还是外部目的,OSPO 能处理从开始引入开源软件,直至交付给终端用户的过程中的所有环节。 通过在软件开发生命周期早期阶段开始进行合规性和规章制度的检查,OSPO 能构筑坚实的基础。这通常开始于引导和整合团队成员,共同迈向一个能惠及组织价值观的方向。OSPO 会设定关于开源使用的政策和流程,并在公司内部进行角色和职责的管理。 总结来说,OSPO 有助于整合所有参与产品构建的相关团队的努力,进而提升组织更好和更有效使用开源的能力。 #### 开源项目办公室(OSPO)的崛起 诸如微软、谷歌和 Netflix 等公司已经在自身组织内部设立了成熟的 OSPO。此外,像 Porsche 和 Spotify 这样的公司也在建立自己的 OSPO,以实现开源的高效利用。 以下是一些知名公司的领导者对 OSPO 实践的看法: * “对于公司来说,这是一种文化的变迁,”Jeff McAffer 解释了他的观点,他曾经多年负责微软的 OSPO,并现在是 GitHub 的产品主管,致力于在企业界推动开源的发展。“很多公司并不习惯与外部团队合作。” * “工程、业务、法律每一方的利益相关者都有他们各自的目标和角色,往往需要在速度、质量和风险之间做出权衡,” Spotify 的开源主管 Remy DeCausemaker 解释道。“ OSPO 的任务就是协调和连接这些单独的目标,融合成一个能够减少摩擦的全面策略。” * Verizon Media 的 OSPO 领导 Gil Yahuda 表达了他的观点,“我们正在寻找创造一个人才愿意融入其中的工作环境。我们的工程师都知道,他们处在一个欢迎开源的环境中,他们在这里被鼓励与他们工作相关的开源社区合作。” ![图 1:2018-2021年各行业开源项目办公室的普及情况 (来源:https://github.com/todogroup/osposurvey/tree/master/2021)](/data/attachment/album/202311/01/232905uv3vsx3ggubvqv0x.jpg) ### 开源项目办公室(OSPO)的职能 OSPO 的职能可能会根据组织的员工数量、OSPO 团队的人数以及开源的运用目的不同而有所差异。组织可能只想利用开源软件来开发产品,也可能同时计划向社区做出贡献。 OSPO 的角色可能会包括评估哪些开源许可证是适宜的,以及是否应让全职员工参与开源项目等任务。为愿意贡献的开发人员制定贡献者许可协议(CLA),并确定哪些开源组件有助于产品的快速成长和质量提升也是 OSPO 的重要职责。 OSPO 的主要职能包括但不限于: * 建立开源合规和治理政策来降低组织的知识产权风险 * 培育开发者做出更佳决策的能力 * 制定政策规范与公司全面采用开源的工作。 * 监控组织内外开源软件的使用情况 * 在每次软件版本发布后组织会议,讨论开源软件合规流程的优点及改进空间 * 加快软件开发生命周期(SDLC) * 提高不同部门之间的透明度和协调性 * 通过简化流程在早期阶段降低风险 * 鼓励团队成员向上游贡献,以享受开源项目的协作和创新优势 * 提供包含合适补救措施和产品团队建议的报告 * 准备合规文档,确保满足许可证的义务 ### 构建开源项目办公室(OSPO)的过程 OSPO 的组成通常包括公司内多个部门的人员。这个过程涉及了对相关部门进行开源合规基础和使用风险的培训与教育。OSPO 可能提供法律和技术支持,以确保达成开源的目标需求。 组织内的 OSPO 可能包括以下人员(这只是一个可能参与的人员名单,并不是详尽无遗的清单): * 主任/首席:主任或首席通常是 OSPO 的主要负责人。他能全方位掌控使用开源的各个方面,包括使用不同组件的影响,许可证的含义,以及开发和社区贡献等。这些要求完全取决于公司的需求。 * 项目经理:项目经理为目标解决方案设置需求和目标。他/她将与产品和工程团队共同工作,以协调工作流程。这包括以开发者友好的方式确保策略和工具的实施。 * 法律支持:法律支持可能来自公司外部或者内部,但他们在 OSPO 中扮演着重要角色。法律团队将与项目经理密切合作,定义管理开源软件使用的策略,包括每个产品允许使用的开源许可证,如何(或是否)向现有的开源项目贡献等。 * 产品和工程团队/开发者:工程团队需要熟悉开源许可及其相关风险。团队在使用任何开源组件之前,必须得到 OSPO 的批准。团队可能需要定期接受关于开源合规基础以及其使用的培训。 * 首席技术官/信息官/利益相关者:公司的领导对 OSPO 策略有着巨大影响。利益相关者在任何产品解决方案的决策过程中拥有很大的决定权。因此,工程副总裁,首席技术官/信息官,或者首席合规/风险官员需要参与 OSPO 的工作。 * IT 团队:来自 IT 部门的支持十分重要。OSPO 可能被分配实施内部工具的任务,如提高开发者效率,监控开源合规,或者设置开源安全措施等。IT 团队在协助连接工作流程和确保以开发者友好的方式实施策略方面起着关键作用。 在 TODO 组织于 2021 年执行的 OSPO 调查中,得出了以下的关键发现: * 教育企业理解 OSPO 如何为他们带来益处的机会仍然巨大。 * OSPO 对其赞助方的软件实践有显著的积极影响,但影响的具体效果并因组织规模的大小而异。 * 那些有意设立 OSPO 的公司,他们期望 OSPO 能提升创新,但策略设立及预算力度仍然是实现目标的主要挑战。 * 调查参与者中近半数尚未设立 OSPO 的人认为 OSPO 将有助于他们公司的发展,然而在那些认为 OSPO 无助于公司发展的人群中,有 35% 的人还未对此事有所考虑。 * 27% 的调查参与者表示,一家公司对开源参与的程度会深刻影响他们组织的购买决策。 如今,在构建任何软件解决方案时,对开源软件的依赖几乎是无法避免的。然而,开源许可证相关的潜在风险也不容忽视。因此,我们需要一套策略性的流程来有效解决使用开源组件带来的合规性问题。 通过建立一支集中的专业团队,OSPO 能帮助公司确立规范的开源文化,让员工了解并熟悉与组织内开源使用相关的所有事宜。此外,OSPO 还可以发挥引导作用,吸纳行业内的顶级人才,这无疑将对实现商业目标产生积极影响。 *(题图:MJ/9a3e106d-0710-4dd7-b278-ef1056c5c5ab)* --- via: <https://www.opensourceforu.com/2022/08/why-companies-need-to-set-up-an-open-source-program-office/> 作者:[Sakshi Sharma](https://www.opensourceforu.com/author/sakshi-sharma/) 选题:[lkxed](https://github.com/lkxed) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
*Managing the use of open source software and decreasing compliance risks is key to the success of any software product. An open source program office can help an organisation do just that. Find out how.* Open source software (OSS) is integral to building a modern software solution. Be it an internal or a customer facing solution, organisations rely significantly on open source software today. OSS components are governed by their unique licence terms, and non-compliance with these can often expose organisations to security and intellectual property (IP) risks which eventually may hamper a company’s brand value. When development teams are delivering a software release, they are primarily trying to meet project deadlines. Therefore, the tracking of versions of components and libraries, or the third party code pulled into the project, is not as rigorous as it should be. This means that licences and vulnerable OSS components can enter the code base and be delivered to customers. This can be risky for both the customer and the company delivering the software solution. Another increasingly challenging area is that of developers contributing to open source projects. Companies can reap numerous benefits if they do so. This includes keeping skills current, retention of staff, attracting developers to work for the organisation, and improving the image of the company. Many open source projects require developers to sign a contributor licence agreement. This states that any IP created by the developer belongs to the project and not to the contributing developer. In this scenario, organisations need to be careful that IP and trade secrets that are not open source are not being signed over to open source projects. Developers need to be educated about open source licensing issues, determining what to leverage, when or how much they can contribute to the community, and what packages might bring risk to the organisation’s reputation. All this can be streamlined by putting a strategic policy and operations in place. One way of doing this is by creating an entity that is dedicated to working around all things open source—an entity called the open source program office (OSPO). An OSPO creates an ecosystem for employees to use open source software in a way that compliance risks are kept at bay. The role of an OSPO is not limited to supervising open source usage; it is also responsible for contributing back to the community and managing the company’s growth in the market by actively engaging in events, as well as conducting webinars and campaigns. In this article we will see why there is a need for building an OSPO, and how it has emerged as a prominent entity for any open source policy and governance programme. ## Why should you have an OSPO? With the wide use of open source software, regulating its usage and keeping the compliance strategy in check can be often overwhelming for the teams involved in the product development cycle. Developers often overlook licence obligations, and sometimes the management or stakeholders are also not fully aware of the implications of non-compliance with these open source licences. OSPO handles open source software right from its on-boarding till the time it is delivered to the end user and everything inbetween, irrespective of whether it is being used for internal or external purposes. An OSPO builds a solid foundation by starting compliance and regulatory checks in the early software development life cycle. This usually begins by guiding and aligning the involved team members towards a common path that benefits the organisation’s values. The OSPO puts in place policies and processes around open source usage and governs the roles and responsibilities across the company. To conclude, it aligns the efforts of all relevant teams involved in building the product and helps increase the organisation’s capacity for better and effective use of open source. The rise of the OSPO | Companies like Microsoft, Google and Netflix have well established OSPOs within their organisations. Many others, like Porsche and Spotify, are building their own OSPOs to leverage the usage of open source in an efficient way. Here is what leaders from renowned companies have to say about OSPO practices. | ![Figure 1 OSPO prevalence by industry 2018 2021](https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-1-OSPO-prevalence-by-industry-2018-2021-2.jpg) ![Figure 1 OSPO prevalence by industry 2018 2021](https://www.opensourceforu.com/wp-content/uploads/2022/07/Figure-1-OSPO-prevalence-by-industry-2018-2021-2.jpg) ## The function of an OSPO The function of an OSPO may vary from organisation to organisation depending on the number of its employees and the number of people that are part of the OSPO team. Another factor is the purpose of using open source. An organisation may only want to use open source software for building the product or may also look at contributing back to the community. Evaluating factors such as which open source licences are appropriate or whether full-time employees should be contributing to an open source project may be part of the OSPO’s role. Putting a contributor licence agreement (CLA) in place for developers that are willing to contribute and determining what open source components will help in accelerating a product’s growth and quality are some other roles of an OSPO. Some of the key functions of an OSPO involve: - Putting an open source compliance and governance policy in place to mitigate intellectual property risks to the organisation - Educating developers towards better decision-making - Defining policies that lay out the requirements and rules for working with open source across the company - Monitoring the usage of open source software inside as well as outside the organisation - Conducting meetings after every software release to discuss what went well and what could be done better with the OSS compliance process - Accelerating the software development life cycle (SDLC) - Transparency and coordination amongst different departments - Streamlining processes to help mitigate risks at an early stage - Encouraging members to contribute upstream to gain the collaborative and innovative benefits of open source projects - Producing a report with suitable remediation and recommendations for the product team - Preparing compliance artifacts and ensuring licence obligations are fulfilled ## Building an OSPO The OSPO is typically staffed with personnel from multiple departments within the company. The process involves training and educating the relevant departments regarding open source compliance basics and the risks involved in its usage. It may provide legal and technical support services so that the open source requirement goals are met. An OSPO may be formed by the following people within the organisation (this is a non-exhaustive list of people who can be a part of it): **Principal/Chief:**This role can be taken by the flag bearer, the one who runs the OSPO. The chief knows the various aspects of using open source like the effect of using different components, licence implications, development and contributing to the community. These requirements are entirely dependent on an organisation’s needs.**Program manager:**The program manager sets the requirements and objectives for the target solution. He/she works alongside the product and engineering teams to connect workflows. This includes ensuring that policies and tools are implemented in a developer-friendly manner.**Legal support:**Legal support can come from outside the firm or in-house, but is an important part of an OSPO. The legal role works closely with the program manager to define policies that govern OSS use, including which open source licences are allowed for each product, how to (or whether to) contribute to existing open source projects, and so on.**Product and engineering teams/developers:**The engineering team should be well-versed with open source licence(s) and their associated risks. The team must seek approval from the OSPO before consuming any open source component. The team may have to be trained with respect to open source compliance basics and its usage at regular intervals**CTOs/CIOs/stakeholders:**A company’s leadership has a huge impact on the OSPO strategies. The stakeholders have a great say in the decision making process for any product/solution’s delivery. Due to the nature of the OSPO’s function within a company, the VP of engineering, CTO/CIO, or chief compliance/risk officer must get involved in the OSPO.**IT teams:**Having support from the IT department is very important. An OSPO may be tasked with implementing internal tools to improve developer efficiency, monitor open source compliance, or dictate open source security measures. IT teams are key in helping to connect workflows, and ensure policies are implemented in a developer-friendly manner. In the 2021 State of OSPO Survey conducted by the TODO Group, the key findings were: - There are many opportunities to educate companies about how OSPOs can benefit them. OSPOs had a positive impact on their sponsor’s software practices, but their benefits differed depending on the size of an organisation. - Companies that intended to start an OSPO hoped it would increase innovation, but setting a strategy and a budget remained top challenges to their goals. - Almost half of the survey participants without an OSPO believed it would help their company, but of those that didn’t think it would help, 35 per cent said they haven’t even considered it. - 27 per cent of survey participants said a company’s open source participation is very influential in their organisation’s buying decisions. The use of open source software when building any software solution is almost inevitable today. However, the open source licence risks cannot be overseen. What is needed is a strategic streamlining process that helps combat the compliance issues that come in the way of using open source components effectively. An OSPO helps set a regulatory culture by building a centralised dedicated team that educates employees and brings awareness regarding everything related to open source usage in an organisation. An OSPO can also work as a guide to fetch top talent from the industry, which will eventually be a boon for business goals.Sakshi Sharma
16,343
10 月份在 Fedora Linux 上值得尝试的酷炫 Flatpak应用
https://fedoramagazine.org/fedora-linux-flatpak-cool-apps-to-try-for-october/
2023-11-02T21:03:00
[ "Flatpak" ]
https://linux.cn/article-16343-1.html
![](/data/attachment/album/202311/02/210448a8vbipsdww8qk8bp.jpg) > > 本文介绍了 Flathub 中可用的项目以及安装说明。 > > > [Flathub](https://flathub.org) 是获取和分发适用于所有 Linux 的应用的地方。它由 Flatpak 提供支持,允许 Flathub 应用在几乎任何 Linux 发行版上运行。 请阅读 “[Flatpak 入门](https://fedoramagazine.org/getting-started-flatpak/)”。要启用 flathub 作为你的 flatpak 提供商,请使用 [flatpak 站点](https://flatpak.org/setup/Fedora) 上的说明。 ### Warehouse [Warehouse](https://flathub.org/apps/io.github.flattool.Warehouse) 是一个图形程序,用于管理已安装的 Flatpak 应用程序和 Flatpak 远程应用。一些最重要的功能是: * 查看 Flatpak 信息 * 管理用户数据 * 批量操作 * 剩余数据管理 * 管理远程应用 你可以通过单击网站上的安装按钮或手动使用以下命令来安装 “Warehouse”: ``` flatpak install flathub io.github.flattool.Warehouse ``` ### Jogger [Jogger](https://flathub.org/apps/xyz.slothlife.Jogger) 是一款适用于 Gnome Mobile 的应用,用于跟踪跑步和其他锻炼。它是用 GTK4、Libadwaita、Rust 和 Sqlite 构建的。尽管它的目标是 Gnome Mobile,但它在 Gnome Shell 下运行得很好,而且我发现它对于保存我的统计数据非常有用。其中一些功能是: * 使用 Geoclue 位置跟踪锻炼 * 从 Fitotrack 导出导入锻炼 * 手动输入锻炼 * 查看锻炼详情 * 编辑锻炼 * 删除锻炼 * 计算锻炼消耗的卡路里 你可以通过单击网站上的安装按钮或使用以下命令手动安装 “Jogger”: ``` flatpak install flathub xyz.slothlife.Jogger ``` ### Kooha [Kooha](https://flathub.org/apps/io.github.seadve.Kooha) 是一个简单的屏幕录像机,具有简约的界面。你只需单击录制按钮即可,无需配置一堆设置。 Kooha 的主要特点包括: * 录制麦克风、桌面音频或同时录制两者 * 支持 WebM、MP4、GIF 和 Matroska 格式 * 选择要录制的监视器、窗口或屏幕的一部分 * 多种来源选择 * 可配置的保存位置、指针可见性、帧速率和延迟 * 它在 Wayland 上运行得很好。 ``` flatpak install flathub io.github.seadve.Kooha ``` ### Warzone 2100 谁不喜欢经典的 Linux 游戏呢? [Warzone 2100](https://flathub.org/apps/net.wz2100.wz2100) 让你指挥“计划”部队,在人类几乎被核导弹摧毁后重建世界。 ![](/data/attachment/album/202311/02/210340vdh2a3aohtagxexx.jpg) Warzone 2100 于 1999 年发行,由 Pumpkin Studios 开发,是一款开创性的创新型 3D 即时战略游戏。 2004 年,Eidos 与 Pumpkin Studios 合作,以 GNU GPL 条款发布了游戏的源代码。此版本包含除音乐和游戏内视频序列之外的所有内容。当然,这些后来也被发布。 该游戏有一个问题:它使用旧的平台包(org.kde.Platform 6.4)。这意味着它需要更多的磁盘空间,但乐趣是值得的! 你可以通过单击网站上的安装按钮或使用以下命令手动安装 “Warzone 2100”: ``` flatpak install flathub net.wz2100.wz2100 ``` Warzone 2100 也可以在 Fedora 仓库中以 rpm 形式使用。 *(题图原始图片由 Daimar Stein 提供)* --- via: <https://fedoramagazine.org/fedora-linux-flatpak-cool-apps-to-try-for-october/> 作者:[Eduard Lucena](https://fedoramagazine.org/author/x3mboy/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出
200
OK
This article introduces projects available in Flathub with installation instructions. [Flathub](https://flathub.org) is the place to get and distribute apps for all of Linux. It is powered by Flatpak, allowing Flathub apps to run on almost any Linux distribution. Please read “[Getting started with Flatpak](https://fedoramagazine.org/getting-started-flatpak/)“. In order to enable flathub as your flatpak provider, use the instructions on the [flatpak site](https://flatpak.org/setup/Fedora). ## Warehouse [Warehouse](https://flathub.org/apps/io.github.flattool.Warehouse) is a graphical utility to manage your installed flatpak applications and your flatpak remotes. Some of the most important features are: - Viewing Flatpak Info - Managing User Data - Batch Actions - Leftover Data Management - Manage Remotes You can install “Warehouse” by clicking the install button on the web site or manually using this command: flatpak install flathub io.github.flattool.Warehouse ## Jogger [Jogger](https://flathub.org/apps/xyz.slothlife.Jogger) is an app for Gnome Mobile to track running and other workouts. It is built with GTK4, Libadwaita, Rust and Sqlite. Even though targeted for Gnome Mobile, it works pretty well under Gnome Shell and I find it very useful to keep my stats. Some of the features are: - Track a workout using Geoclue location - Import workouts from a Fitotrack export - Manually enter a workout - View workout details - Edit a workout - Delete a workout - Calculate calories burned for workouts You can install “Jogger” by clicking the install button on the web site or manually using this command: flatpak install flathub xyz.slothlife.Jogger ## Kooha [Kooha](https://flathub.org/apps/io.github.seadve.Kooha) is a simple screen recorder with a minimalist interface. You can just click the record button without having to configure a bunch of settings. The main features of Kooha include the following: - Record microphone, desktop audio, or both at the same time - Support for WebM, MP4, GIF, and Matroska formats - Select a monitor, a window, or a portion of the screen to record - Multiple sources selection - Configurable saving location, pointer visibility, frame rate, and delay - It works very well on wayland. flatpak install flathub io.github.seadve.Kooha ## Warzone 2100 And who doesn’t love a classic Linux game? [Warzone 2100](https://flathub.org/apps/net.wz2100.wz2100) lets you command the forces of The Project in a battle to rebuild the world after mankind was nearly destroyed by nuclear missiles. ![](https://fedoramagazine.org/wp-content/uploads/2023/10/image-1024x738.png) Warzone 2100, released in 1999 and developed by Pumpkin Studios, is a ground-breaking and innovative 3D real-time strategy game. In 2004 Eidos, in collaboration with Pumpkin Studios, released the source for the game under the terms of the GNU GPL. This release included everything but the music and in-game video sequences. These, however, were also later released. This game has one problem: It uses an old platform package (org.kde.Platform 6.4). This means that it takes more space on disk but the fun is worth it! You can install “Warzone 2100” by clicking the install button on the web site or manually using this command: flatpak install flathub net.wz2100.wz2100 *Warzone 2100**is also available as rpm on fedora’s repositories* ## hf147 I love it how 4 of those 5 projects are marked as “Potentially Unsafe”, with three of those requesting filesystem permissions (and therefor bypassing the flatpak sandbox) and the other one using outdated insecure old libraries. And the 1 safe project is one that manages flatpaks itself. ## Eduard Lucena There are 4 projects, not 5, and the 4 are marked as “Potentially Unsafe”, 2 are requesting access to files because you can’t safe to filesystem without giving them the permissions, you can’t record without saving (well, you can but it’s kind of pointless) and to save your preferences and modify your flatpak permissions it needs access to the filesystem. Jogger needs access to network if you use it on mobile, to track where you are and to use the map feature. In the case of warzone, it’s and old game, and it’s mentioned in the article. Hopefully devs of warzone can update this, but the warning was issued. I understand your concerns, but there are specific reasons and they are very well explained in each app flathub site what it needs (the file permissions are very very clear pointing that folders needs to be accessed). ## Nobody It is a matter of trust. We trust maintainers with traditional packages because basically they can access our system as “root”. Same goes with flatpaks. Do we trust people who publish flatpaks on Flathub the same as [your favorite distro] maintainers? Are flatpaks as safe as RPM or DEB packages from the distribution repositories? If the answer is “no” then installing flatpaks makes no sense. ## cornelius_corn Flatpaks cannot access your system as root, that’s just not true. Moreover, Flatpaks, while not a true sandbox, are still more secure than system packages, as their permissions will be restricted (when done properly), while system packages both can and will modify your system configuration. Plus, even crappily configured Flatpaks can have permissions configured using something like Flatseal. ## David Ok let’ s do something about it, what do you suggest to start with? ## Darvond So 3 tiny utilities, one of which is once again for managing flatpaks, and one massive game that has a build issue. Are we sureflatpak is supposed to be the future, and isn’t just an awkward fumbling of the paradigm?## null_pointer_00 The future of Flatpak applications is in our hands, we, users, by using (or not using) them. I relentlessly refuse them. I even prefer using a proprietary solution, usually a Windows application, with Wine. ## lemc I totally agree. Flatpak and other sandboxed package formats are a dirty and inefficient solution to the current state of fragmented Linux distributions. RPM and Deb distributions should at least standardize around these formats, so that we would have fewer, but native installation packages. ## Darvond I also refuse them, due to the data redundancy introduced (I don’t need, nor want an entire system of redundancies in my system libraries & runtimes; both on KISS and the Unix Philosophy.) and also a slight feeling of spite I feel towards them stealing attention and development from mainline programs. For example, the misguided thinking leading to a stall in this critical DNF5 issue: https://github.com/rpm-software-management/dnf5/issues/258 where the main talking point is Packagekit, instead of something like Zypper or Slackpkg. You know, established & mature methodologies that have been doing this thing for decades. Packagekit is not designed for the heavy rigors of a system upgrade; it was created so people can treat software like soup. Need a new soup? Just pop to the store and get a fresh one! ## Eduard Lucena There are plenty of apps, I review some of the one I like and find useful, but Firefox, Libreoffice, Openshot, VSCodium and a lot of apps are available as flatpak. ## YOUNGMANBLUES1969 Everyone is such a downer in this comment section. It’s just a showcase of a couple of applications, not a whole representation of every application that is packaged as a Flatpak. Why is everyone so insistent on using a package manager for GUI applications for the rest of their life for any of these programs? I mean yeah it’s personal preference, but if you really go, “I wish everyone used Linux on the desktop” then expect them to use applications that require dependencies on a system-level then what do you expect? It’s a lot easier in the long run to have that 1 universal package format, and this is the closest we’re going to get. ## therightorwronganswer I agree! People always want to find something to complain about. Most Linux users are purists and stubborn and can’t see past their preferences. I’ve been using Linux for almost as long as it’s been around and I have no issues with Flatpaks and run a handful of them for tools like Obsidian and Bitwarden. Open source is partly the freedom of choice and expression. How you use Linux is a reflection of you and because of that, I love it. I could care less about the “half glass empty” Linux users and comments you see in posts like these. It’s toxic! ## null_pointer_00 “Most Linux users are purists and stubborn” Yeah, it is what happens after years and years of experience in life, not only operative systems or software: DON’T TOUCH WHAT WORKS. ## cornelius_corn But it doesn’t work. Developers, game developers especially, have noted the incredible difficulty of creating Linux applications, with the wide plethora of distributions with different libraries and their versions it’s incredibly difficult. And what effectively ends up happening is you get crappy native software that either doesn’t work or doesn’t support your distribution. It sounds as though the software you use have native packages, which is lovely to hear, not everyone however, has your exact use case, with your exact set of software packages. Look at software like Davinci Resolve, Valve’s source games, Payday 2’s Linux port, etc. These are all examples of software that have major issues because current Linux packaging technologies suck. I sure do see a lot of people complain about Flatpak, but NONE of them are EVER software developers for Linux themselves. It’s really easy when you’re not the one writing the software to complain about containerized apps. ## Nobody Problem is you cannot trust software on Flathub, like you cannot trust any software on any “store” which is not inspected and authorized by anybody else but the guy who wants to publish it. The very idea of the “store” to help developers in meeting the public with their “app” without “system level complications” has proven suicidal again and again. I don’t understand if people who insist in re-inventing the squared wheel are bad guys or just have a 5 minutes memory . ## rugk @Nobody whether you want an auditor in the middle has nothing to do with Flatpak itself. E.g. you can use the great Fedora flatpaks. It’s the same software you get when you don’t use Fedora packages itself. And the sandboxing is just a security addition the old packaging systems did not have. See https://fedoramagazine.org/an-introduction-to-fedora-flatpaks/ Also BTW I guess Flathub would also ban malicious applications. It’s just that they are not built by someone else than. Basically the same model mobile app stores use, you cannot audit everything, so you use the builds by developers (or automatically build) from source – like F-Droid does it. ## Tom even the play store is problematic as google might be trying to get it right but they clearly drop the ball from time to time an open source mandate go along ways and still allow content providers to sell their content under a protected status as they are still copy righting the content now could they copy right the structure of a game where a quest opens a new quest and or new zone in the game no and should such concepts be open to copy right no then game design comes down to who has the fastest copy right attorney game mechanics no matter how unique should never be subject to copy right so what they are selling is an interactive story line and the interactive art work to go with it now game mods is another issue open to debate maybe a mod to work with a certain video card or to close certain security issue in a certain distro should be fine so if somebody wants a mod to run on a resultion of 800×600 could they do that I suspect they will suck at playing said game and pose no real balance threat to other players the open source concept would protect against both malware and cheating as the cheating mods could be analyzed to see how it interacts or changes the original game and the game devoloper might get install ready patches from the open source community anybody could be a game developer is they spend the time as the need of programing skills is greatly reduced take a basic frame work and add all new graphics ranging from GUI boarders and world landscape and boarders as well as skill art the result would look nothing like the original as the concepts of such are very common from one game to the next the concept of a skill tree is nothing new and no matter what game you play the function is not any different how its displayed can vary while for example WOW changed the nature of a skill tree to be more limited as a form of choices as the char levels up rather then a choice from an existing pool so at level 10 you get one of 3 choices and you can not decide to have the other options later on as its one of 3 you can reset and chose one of the other options I think the model we should work towards is what is known as zero trust which does not mean that we have a world of bad people but the zero trust concept will filter out most any malware and allow anybody to write a program ## Eduard Lucena Well, it’s just people being people. If you have been in FLOSS for a while, you know there have been, there are and always there will be haters on anything. If you don’t receive hate, you aren’t doing it well. ## Nobody Haters? Where is “hate” when somebody asks who checks on people who publish software on the “store” and who reviews the code of each “app” and authorize it for distribution? Where is “hate” when somebody says that when the answer is “nobody” then we already know there will be tens or hundreds of dangerous “apps”, because it already happened, it happens every time? Please don’t say “but apps are sandboxed” because it is a joke. All I can think of is Ballmer crying “developers, developers, developers”. The Parliament in my own country approving the “State trojan”. ## Gregory Bartholomew I let the above reply through because I prefer not to suppress speech. However, this isn’t the best place for that discussion. I’ll likely consider any more comments along those lines on this article as “off topic” and delete them. Thanks. ## Renich B Great article. Always good to hear about new or, rather, undiscovered apps in the flatpakiverse. Thank you. Also, I hear what others say, Flatpak has, still, a long way to go. Flatpakaging could be done better by upstream and collaborators. ## Matthew Phillips I like Flatpaks, and am appreciative of this article. I hope one day I have Jogger on my watch with Fedora on it =D I don’t think the data duplication problem is really so serious. I put this in another comment section where people were going on about Flatpaks, but I have a relatively small / moderate NVMe drive (256GB) and quite a few apps installed via Flatpak, plus several games installed in the Steam Flatpak (all work great)… I’m not even at 50% capacity. Even on the backend most standard Kubernets deployments are usually hypervisor -> VM -> Containers -> Applications. I’m sure LAMP stacks on bare metal are more prevalent, but that’s not how most people do their backend if starting anew these days. Similarly on the client we’ve moved on from putting files directly on the root operating system. This page is a good summation of what Flatpaks offer and why it is the way forward. JMO 🙂 https://docs.flatpak.org/en/latest/introduction.html ## Pisu S I just don’t get the hate Flatpak is getting. I mean its good for the third party apps that want to support Linux and may not be available or deprecated in the distributions repo. It makes even perfect sense in the future if companies want to sell paid software for the Linux platform who adhere to OSS licensing and standards. With NixOS and Flatpaks, its pretty much future ready going forwards as more and more Dapps and metaverse apps come out as it reduces dependency complexities. People just don’t get that, once upon a time we had apps and dependencies in KB, now in MB and in the future in GB. Sure Flatpaks are very heavy but they are for the future maybe not today. I wanted to install Mullvad, Floorp, signal and telegram on Fedora, SUSE and debian and on all three Flatpak did it. There would be no other way to do it in a unified way without pulling my hair out. ## newb bitwig flatpak made me go linux. currently enjoining fedora silverblue ## Geoffrey Gordon Ashbrook It is very helpful to learn about flatpack here. Finding ways to make things work for each case is an exciting challenge. I wonder if flatpacks may relate to some solutions for security issues with package verions, see security now 807 https://www.grc.com/sn/sn-807-notes.pdf (probably other episodes). And I’m not sure if the term ‘supply chain’ is sometimes used for these attacks (which might confuse various topics together). Some redundancy might be unavoidable for trusted applications to have their own versions and management for what they need and use (perhaps like browsers isolating processes likely requiring more resources). (Sorry if this is a tangent…) ## Ondrej Flatpak is a great tool which solves so many problems, desktop apps had. – Weird library version dependencies – Shorting the road from developer to the enduser – Allowing sandboxing the applications … Many problems we need to solve, but bashing Flatpak is from my point of view just a limited view on what the real world actually needs (not we system administrators, power users, etc.). Stop it. ## reyhan thanks a lot of information goodjobs ## Patrice Thanks for the article, which highlights some interesting new applications. It’s ineresting to have reviews of new apps, as it opens our horizons and encourages us to go and have a look in the app repository from time to time. However, I also refuse to install Flatpaks as I refuse to install a lot of mobile apps on my phone, even though they could be useful. The first reason is security and trust in the developer. The second reason is waste of resources. I only install apps on my systems from developers I trust, which means very few. But if you analyze your real needs and do a bit of search, you will find almost everything you need in your Linux distribution repository. Maintainer and app developer is not the same job. And security in the latter one is the latest of their worries most of the time. If you look at mobile app stores, they are heavily monitored and still security holes are found everyday. So can we talk about security in loosely monitored Flatpaks? We definitely need some new article dedicated to Flatpaks, explaining security, upsides and downsides of the tech. ## 2w3r23r every program with gtk or gnome is unsafe run valgrind -v –leak-check=full –show-leak-kinds=all –track-origins=yes \ –verbose –tool=memcheck example_program and check, amny memory leak ## Skryptar Good morning, I read the comments, I am 50% divided. I am for flatpak without being it! Excuse my frankness in advance, but I find it totally stupid to have created Flatpak after snapcraft! I’m a developer myself and I still don’t understand why we have fun making 36 wheels! For ego reasons? security? I like to switch between distributions at times, but I always come back to Fedora, I have always been addicted to the Redhat company since 1994… I will take a few examples that many people use. Discord: On Snapchat, very responsive, practically simultaneous, the application reacts like a local installation. On flat… The responsiveness is not the same and the icons in the notification do not work, finally, it sucks for access to local files. I haven’t retested this last point lately. There is a discord rpm, between the discord updates and the rpm there is easily a week. As I said, being a developer in different fields, I started on the web in php so… PhpStorm: Snap: Nickel installation, reacts like a local installation! Flat… Once you install the application and launch it…. Drum roll and we applaud loudly!! We have a post with unofficial Flatpack version! Not possible to access our local php configuration… on the other hand I now saw the local folders, I didn’t check if I really had access… Yes, because still in my configuration for phpstorm. I see the bin folder and it’s missing everything needed. So, to play pranks on us, look, you see your files… but you won’t have access to them 😛 Now that the venom is spat, why am I for one and not many, but a system like snapflat. This opens the Linux world to Windows applications. Today our society has changed a lot. I develop with passion like yesterday, today for many developers it has become a defect.. So what do we do? Lots of little application shortcuts, by telling the other devs you’re watching, you’ll save time and what’s more, it gives you the opportunity to be a little lazier than yesterday! I keep saying it, laziness doesn’t pay and one day we’re all going to lose our minds! It’s one thing to design tools to help, but tools to do that make us skip several steps that are, in my opinion, crucial and something else. Brief… Finally, I promise it’s the end… Finally, still in the demonstration of stupidity. A developer of a Windows application… Do you think he’s going to take 36 snapflats to release his program? The guy will say and you guys are very kind, he will do it once, twice, and the third time he will choose the hub that is the most attractive and where he encounters the least application concerns… If you have read everything I have written, you immediately know who will be the winner! FlatHub will have its copy, but not necessarily functional! For this, I don’t even bother to install a flat application, because every time there is something that goes wrong, whereas on snap, we install, it works by itself! ## YOUNGMANBLUES1969 Maybe Canonical shouldn’t have Snap applications locked to their proprietary backend. Flatpaks are much more ahead of Snap for GUI applications, but as for CLI/system-level packages, yeah Snap beats Flatpak. Best system combination: – System packages from package manager for anything at a system-level – Flatpak for most GUI applications – Distrobox containers for applications not available as a Flatpak or in the distro’s (in this case Fedora Linux) repos – Nix/Brew if you like those package managers – WINE for Windows applications
16,344
AI 模型的开源定义需要改变
https://news.itsfoss.com/open-source-definition-ai/
2023-11-02T22:00:13
[ "许可证", "开源", "AI" ]
https://linux.cn/article-16344-1.html
![](/data/attachment/album/202311/02/215953yyz45l5l3v4fzqyv.jpg) > > 你认为开源许可证应当进行演变吗? > > > 2023 年,我们以**人工智能(AI)崭露头角**开始了新的一年,同时也见证了众多公司全力以赴投身于 AI。 比如说 **Mozilla**,它在 2023 年初制定了 [开源 AI 计划](https://news.itsfoss.com/mozilla-open-source-ai/),以开发各种 AI 驱动的解决方案。而 **HuggingChat** 也成为了第一个推出 ChatGPT [开源替代品](https://news.itsfoss.com/huggingchat-chatgpt/) 的组织。 即便是 Meta,他们也不例外。他们自家的 <ruby> 大型语言模型 <rt> Large Language Model </rt></ruby>(LLM)[Llama 2](https://ai.meta.com/llama/) 项目在这一年都颇受关注,几个月前他们甚至推出了一款新的 [ChatGPT 竞争对手](https://news.itsfoss.com/meta-open-source-chatgpt/)。 然而,也有很多人开始 [提出质疑](https://www.wired.com/story/the-myth-of-open-source-ai/),主张 **Meta 的 Llama 2 模型并不像人们期望的那样开放**,查看它的开源许可证似乎更是印证了这个观点。 该许可证 **不允许拥有超过 7 亿日活跃用户的服务使用 Llama 2**,同样的,**它也不能被用于训练其他的语言模型**。 这也就意味着 Meta 对于 Llama 2 的许可证 **未能满足** <ruby> 开源倡议组织 <rt> Open Source Initiative </rt></ruby>(OSI)的 <ruby> <a href="https://opensource.org/osd/"> 开源定义 </a> <rt> Open Source Definition </rt></ruby>(OSD)所列出的 **全部要求**。 人们可以争辩,像 [EleutherAI](https://www.eleuther.ai/) 和 [Falcon 40B](https://www.tii.ae/news/uaes-technology-innovation-institute-launches-open-source-falcon-40b-large-language-model) 这样的机构就做出了很好的示范,展示了如何适当地处理 AI 的开源许可。 然而,Meta 对此的看法却截然不同。 ### 开源许可需要进化 在与 [The Verge](https://www.theverge.com/2023/10/30/23935587/meta-generative-ai-models-open-source) 的交谈中,Meta 人工智能研究副总裁 [Joëlle Pineau](https://en.wikipedia.org/wiki/Jo%C3%ABlle_Pineau) 为他们的立场进行了辩解。 她说,我们 **需要在信息共享的益处和可能对 Meta 商业造成的潜在成本之间寻找平衡**。 这种对开源的态度让他们的研究人员能够更加专注地处理 AI 项目。她还补充说: > > 开放的方式从内部改变了我们的科研方法,它促使我们不发布任何不安全的东西,并在一开始就负起责任。 > > > Joëlle 希望他们的生成型 AI 模型能够和他们过去的 [PyTorch](https://pytorch.org/) 项目一样受到热捧。 但是,**问题在于现有的许可证机制**。她又补充说,这些许可证并不是设计来处理那些需要利用大量多源数据的软件。 这反过来**为开发者和用户提供了有限责任**,以及,**对版权侵犯的有限赔偿**(解释为:保护)。 此外,她还指出: > > AI 模型与软件不同,涉及的风险更大,因此我认为我们应该对当前用户许可证进行改变,以更好地适应 AI 模型。 > > > 但我并不是一名律师,所以我在此问题上听从他们的意见。 > > > 我赞同她的观点,我们需要更新现有的许可方案,使之更好地适应 AI 模型,以及其他相关事务。 显而易见,**OSI 正在努力进行此事**。OSI 的执行董事 [Stefano Maffulli](https://twitter.com/smaffulli) 向 The Verge 透露,他们了解到 **当前的 OSI 批准的许可证无法满足人工智能模型的需求**。 他们正在商讨如何与 AI 开发者合作,以提供一个 “**透明、无许可但安全**” 的模型访问。 他还补充说: > > 我们肯定需要重新思考许可证的方式,以解决 AI 模型中版权和授权的真正限制,同时仍遵循开源社区的一些原则。 > > > 无论未来如何,显然,**开源标准必须推动其演化,以适应新的以及即将出现的技术** ,而此类问题不仅仅局限于 AI。 对于未来几年开源许可的变革,我充满期待。 ? 对于你来说呢?你认为对于陈旧的开源标准,我们需要进行什么样的改变? *(题图:MJ/e8bae5f6-606b-47db-aaea-c992c0bd143e)* --- via: <https://news.itsfoss.com/open-source-definition-ai/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) We started the year 2023 with **Artificial Intelligence (AI) being one of the biggest catches**, we also saw many companies going all in into this. Take for instance **Mozilla**, who entered 2023 with [plans to work on open-source AI](https://news.itsfoss.com/mozilla-open-source-ai/) to develop various types of AI-powered solutions, or even **HuggingChat**, the [first open source alternative to ChatGPT](https://news.itsfoss.com/huggingchat-chatgpt/). Even Meta is no stranger to that, they have their [ Llama 2](https://ai.meta.com/llama/?ref=news.itsfoss.com) large language model (LLM) that has been making waves all year round, they even announced a **a few months back.** **ChatGPT contender**However, many have [raised questions](https://www.wired.com/story/the-myth-of-open-source-ai/?ref=news.itsfoss.com) that **Meta's Llama 2 is not as open as one would expect**, and that does seem the case when one looks at its open-source license. The license **doesn't allow using Llama 2 for services that have over 700 million daily users**, and it also **cannot be used to train other language models**. This also means that Meta's license for **Llama 2 doesn't meet all the requirements of the Open Source Initiative's (OSI) Open Source Definition**. One can argue that open-source licenses implemented by the likes of [EleutherAI](https://www.eleuther.ai/?ref=news.itsfoss.com) and [Falcon 40B](https://www.tii.ae/news/uaes-technology-innovation-institute-launches-open-source-falcon-40b-large-language-model?ref=news.itsfoss.com) are a good example of how open source licensing should be handled for AI. But, Meta has a different take on it. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ## Open Source Licensing Needs to Evolve In conversation with [The Verge](https://www.theverge.com/2023/10/30/23935587/meta-generative-ai-models-open-source?ref=news.itsfoss.com), the VP for AI research over at Meta, [ Joëlle Pineau](https://en.wikipedia.org/wiki/Jo%C3%ABlle_Pineau?ref=news.itsfoss.com) defended their stand. She says that there is **a need to balance between the benefits of information sharing** and the **potential costs that could be incurred to Meta's business**. This approach to open source has allowed their researchers to take a more focused approach in handling their AI projects. She also adds: Being open has internally changed how we approach research, and it drives us not to release anything that isn’t very safe and be responsible at the onset. Joëlle also hopes that they can have the same level of enthusiasm with their generative AI models that they have seen in the past with their [ PyTorch](https://pytorch.org/?ref=news.itsfoss.com) initiative, But, the **problem lies with current licensing schemes**. She adds that, these licenses were not meant to work with software that leverage large amounts of data from a multitude of sources. This in turn gives **limited liability to both the users and the developers**, with **limited indemnity to copyright infringement** (read as: protection against). Furthermore, she added that: AI models are different from software because there are more risks involved, so I think we should evolve the current user licenses we have to fit AI models better. But I’m not a lawyer, so I defer to them on this point. I do agree with her on that, there is a need to update current licenses to better fit AI models, among other things. And it appears that **the OSI are already on the job**. [ Stefano Maffulli](https://twitter.com/smaffulli?ref=news.itsfoss.com), the executive director of OSI, has told The Verge that they understand that the **current OSI-approved licenses are not up to the job for AI models**. They are in the process of reviewing how to work with AI developers to provide a “**transparent, permissionless, yet safe**” access to models. He also added that: We definitely have to rethink licenses in a way that addresses the real limitations of copyright and permissions in AI models while keeping many of the tenets of the open source community. Regardless of what happens, it is clear that **open-source standards will have to evolve to accommodate new and emerging tech**, while not being just limited to AI. I am looking forward to how the open-source licensing changes in the coming years. *💬 What about you? Do you think that older open-source standards need to be updated?* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,346
Skiff Mail 添加了方便的“快速别名”功能
https://news.itsfoss.com/skiff-quick-aliases/
2023-11-03T22:30:33
[ "邮件别名" ]
https://linux.cn/article-16346-1.html
![](/data/attachment/album/202311/03/222957cr3rujs9rvxjm9x7.jpg) > > 一个用户邮件别名的省时功能。 > > > Skiff Mail 是一款开源的端到端加密电子邮件服务,非常注重隐私。在各方面,包括用户体验方面,它都是 Gmail 和 Proton mail 的不错替代品。 虽然与竞争对手相比,它相当新,但它的一些注重隐私的功能可能会给你留下深刻的印象。 此外,还推出了一项新的快速别名功能。我试用了一下,感觉非常方便。 ### 快速别名:一次性无忧设置 一般来说,你可以使用一些 [电子邮件保护工具](https://itsfoss.com/protect-email-address/)(例如 SimpleLogin)或从你的电子邮件提供商(无论是谁)创建电子邮件别名。 ![](/data/attachment/album/202311/03/223034ij8ezs0es8l190s1.jpg) 你可以选择记住电子邮件别名以供使用,或者在每次注册服务、新闻通讯或向你不认识的人提供联系信息时生成唯一的别名。 换句话说,大多数情况下,需要你进行多次交互才能使用多个电子邮件别名。 在这里,[Skiff Mail](https://skiff.com/mail) 允许你为自己声明一个完整的唯一子域,例如 **[gojo.maskmy.id](http://gojo.maskmy.id)** (正如我在测试用例中所做的那样): ![](/data/attachment/album/202311/03/223034o5tzhk07tby48y0q.jpg) 接下来,你所要做的就是 – 在激活它时将其视为你的网站地址,并在其之前添加任何内容作为电子邮件地址,例如 **[[email protected]](https://news.itsfoss.com/cdn-cgi/l/email-protection)** 或 **[[email protected]](https://news.itsfoss.com/cdn-cgi/l/email-protection)**。 如上面的截图所示,你也可以选择生成一个随机名称来声明。 你可以从“<ruby> 设置 <rt> Settings </rt></ruby>”菜单访问“<ruby> 快速别名 <rt> Quick Aliases </rt></ruby>”功能: ![](/data/attachment/album/202311/03/223035rkv7h5k5pw74cahq.png) 因此,你不再需要生成电子邮件别名,但仍然可以通过这种方式拥有无限的别名。使其成为一次性设置解决方案,可供在线和离线使用。 我认为这些类型的别名应该有几个好处: * 它使你无需访问该工具即可轻松创建新别名 * 使电子邮件别名看起来比垃圾邮件更真实 根据你的订阅,每人最多可以申请 3 个域名(Essential:1、Pro:2、Business:3)。并且,使用它们创建无限的电子邮件别名。 如果你使用免费套餐,你还可以申请 1 个域名,但最多只能使用 10 个别名。 > > **[Skiff Quick 别名](https://skiff.com/quick-alias)** > > > ? 你对此功能有何看法? 请在下面的评论中告诉我。 --- via: <https://news.itsfoss.com/skiff-quick-aliases/> 作者:[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Skiff Mail is a source-available end-to-end encrypted email service with a strong focus on privacy. It is a nice alternative to Gmail and Proton mail in various ways, including its user experience. While it is fairly new compared to its competitors, it might impress you with some of its privacy-focused features. To add to the list, a new quick alias feature has been introduced. I gave it a try, and it sounds like something incredibly handy. ### Quick Aliases: One-Time Hassle-Free Setup In general, you create email aliases using some [email protection tools](https://itsfoss.com/protect-email-address/?ref=news.itsfoss.com) like SimpleLogin, or from within your email provider (whoever it is). ![skiff quick email aliases option](https://news.itsfoss.com/content/images/2023/10/email-alias-skiff.jpg) You have the option to remember the email alias to use it or generate unique aliases every time you sign up for a service, newsletter or provide your contact info to someone you do not know. In other words, it requires multiple interactions from your end to use multiple email aliases for most part. Here, [Skiff Mail](https://skiff.com/mail?ref=news.itsfoss.com) lets you claim an entire unique subdomain for yourself like **gojo.maskmy.id **(as I did for my test use-case): ![skiff quick email alias domain](https://news.itsfoss.com/content/images/2023/10/email-alias-skiff-set.jpg) Next, all you have to do is – treat it as your website address upon activating it, and add anything before that as an email address, such as ** [email protected] **or [[email protected]](/cdn-cgi/l/email-protection)As illustrated by the screenshot above, you can choose to generate a randomized name to claim as well. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) You can access the “Quick Aliases” feature from the Settings menu: ![skiff quick email aliases option](https://news.itsfoss.com/content/images/2023/10/skiff-email-alias-option.png) So, you no longer have to generate email aliases, but still be able to have unlimited aliases this way. Making it a one-time setup solution, for both online and offline use. I think these types of aliases should have a couple of benefits: - It makes it easy for you to create new aliases without needing to access the tool - Makes the email aliases look more genuine than spammy **Suggested Read **📖 [12 Simple Tools to Protect Your PrivacyQuick ways to enhance online privacy? Use these simple tools to take control of your data easily.](https://itsfoss.com/privacy-tools/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/wordpress/2022/02/privacy-tools-ft.jpg) ![](https://itsfoss.com/content/images/wordpress/2022/02/privacy-tools-ft.jpg) You can claim up to 3 domains per person depending on your subscription (Essential:1, Pro: 2, and Business: 3). And, create unlimited email aliases with them. If you are on the free plan, you can also claim one domain, but you will be limited to 10 aliases. *💬 What are your thoughts on this feature? Let me know in the comments below.* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,347
Garuda Linux “Spizaetus” 发布,可以体验 KDE Plasma 6 了!
https://news.itsfoss.com/garuda-linux-spizaetus-release/
2023-11-03T22:52:27
[ "Garuda" ]
https://linux.cn/article-16347-1.html
![](/data/attachment/album/202311/03/225157jllf15lmeqehhhip.jpg) > > Garuda Linux 的最新升级带来了一些引人入胜的变化,以及一个全新的 ISO 版本。 > > > Garuda Linux,作为一款 [用户友好且基于 Arch Linux 的发行版](https://itsfoss.com/arch-based-linux-distros/),由于其可高度定制和可扩展性,近期已经吸引了大批用户。 Garuda Linux 提供了众多选项以满足不同的使用场景,无论是编程还是游戏。 目前,Garuda Linux 的最新发布版,**Garuda Linux “Spizaetus”** 现已可用。 下面,让我来引导你了解一下这个版本。 ### ? Garuda Linux “Spizaetus”:有哪些新变化? ![](/data/attachment/album/202311/03/225227sxdwrp5rrdzale00.png) 这个版本的代号“[Spizaetus](https://en.wikipedia.org/wiki/Spizaetus)” 是来源于一种通常在美洲热带地区发现的鹰鹞。此次发布的**主要亮点**包括: * 提供 Hyprland ISO * Ugrep 取代了 Grep * 提供了实验性的 KDE Plasma 6 仓库 #### 提供 Hyprland ISO ![](/data/attachment/album/202311/03/225228yljls041s4ss1smm.png) 在这个 Garuda Linux 的版本中,推出了带有 [Hyprland](https://hyprland.org/) 动态平铺 Wayland 组合器的新 ISO,这让**流畅的动画**和**轻松的窗口平铺**成为可能。 在此,开发者之一的 **dr460nf1r3** 表示: > > 关注精美的界面和模糊的窗口,Hyprland 无疑是 Garuda 的完美搭配。 > > > > > ? 然而,不幸的是,他们**不得不停止一些其它变体的更新**,因为这些变体并未得到妥善维护。受影响的变体包括:**MATE**、**LXQt-Kwin**、**KDE-git** 和 **Wayfire**。 > > > #### Ugrep 取代了 Grep [grep](https://en.wikipedia.org/wiki/Grep) 命令行工具已被性能更强的 [ugrep](https://ugrep.com/) 文件模式搜索器所取代,后者声称自己是“**超快速且用户友好的 Grep 替代品**”。 这是一个令人感兴趣的改变,我们期待看到用户的反馈。 #### 实验性的 KDE Plasma 6 仓库(请谨慎!) 开发者们还引入了一个名为 [chaotic-aur-kde](https://forum.garudalinux.org/t/kde-6-repository-testing/31442) 的实验性仓库,以提供**早期版本的 Plasma 6**。 请注意,这是为那些想提前体验 Plasma 6 设计的用户而设,并**不建议将其用于生产环境**。 一位开发者补充道: > > 我们一直在努力通过特定的 chaotic-aur-kde 仓库,提供 Plasma 6 的早期构建。 > > > 这可以让我们初步探索未来的 Plasma 6 将会是什么样子 - 它的首个版本计划在 2024 年 2 月发布。无需多说,这些都是来自主分支的实验性构建版,因此只适合喜欢接受挑战认的人去体验。 > > > #### ?️ 其它的变化和改进 除了上述的亮点之外,还有些其他值得一提的细化调整: * **garuda-update 工具已更新** 用于处理近期由于包名称变更引发的冲突。 * [Plymouth](https://wiki.archlinux.org/title/plymouth) **已被移除** ,现在在启动时,会显示终端的输出内容。 * 对他们的**基础设施进行了各种更新**,以服务用户。 * 为 Garuda Linux 安装了一个专用的 [Lemmy 实例](https://lemmy.garudalinux.org/)。 你可以查阅 [官方公告](https://forum.garudalinux.org/t/garuda-linux-spizaetus-231029/31843) 来获取更多详细信息。 ### ? 下载 Garuda Linux “Spizaetus” Garuda Linux 提供了 **9 个不同的变体**,包括有 **KDE Plasma**、**GNOME**、**Xfce**、**Cinnamon**、**Sway** 等等选择。 你只需前往 [官方网站](https://garudalinux.org/downloads) ,就可以找到自己所需的镜像下载。 > > **[Garuda Linux](https://garudalinux.org/downloads)** > > > ? 你会尝试这个新发布的版本吗?欢迎在评论中告知我们! --- via: <https://news.itsfoss.com/garuda-linux-spizaetus-release/> 作者:[Sourav Rudra](https://news.itsfoss.com/author/sourav/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![](/assets/images/pikapods-banner-v3.webp) ![](/assets/images/pikapods-banner-v3.webp) Garuda Linux is a popular, [user-friendly Arch Linux-based distro](https://itsfoss.com/arch-based-linux-distros/?ref=news.itsfoss.com)** **that has gained a sizeable following lately thanks to its customizable and extensible nature. It is known to provide various options to suit different use cases, from programming to gaming. Now, its latest release, **Garuda Linux “Spizaetus”** is here. Allow me to take you through the release. ## 🆕 Garuda Linux “Spizaetus”: What's New? ![garuda linux spizaetus neofetch output](https://news.itsfoss.com/content/images/2023/11/Garuda_Linux_Spizaetus.png) The release takes its code-name “[Spizaetus](https://en.wikipedia.org/wiki/Spizaetus?ref=news.itsfoss.com)” from a hawk-eagle bird typically found in the tropics of the Americas. Some **key highlights** of this release include: **Hyprland ISO Offering****Ugrep Replaces Grep****Experimental KDE Plasma 6 Repo** **Suggested Read **📖 [Top 10 User-friendly Arch-Based Linux Distributions [2023]Want to experience Arch Linux without the hassle of the complicated installation and setup? Here are a few user-friendly Arch-based Linux distributions.](https://itsfoss.com/arch-based-linux-distros/?ref=news.itsfoss.com)![](https://itsfoss.com/content/images/2023/03/arch-distros.png) ![](https://itsfoss.com/content/images/2023/03/arch-distros.png) ### Hyprland ISO Offering ![a screenshot showing the garuda linux hyprland banner on the official website](https://news.itsfoss.com/content/images/2023/11/Garuda_Linux_Spizaetus_Hyprland.png) A new ISO has debuted with this release of Garuda Linux that features the '[Hyprland](https://hyprland.org/?ref=news.itsfoss.com)**'** dynamic tiling Wayland compositor, which makes way for **smooth animations** and **effortless window tiling**. On this, one of the developers, **dr460nf1r3**, added: Being focused on fancy looks and blurry windows, it is certainly a good fit for Garuda. **, citing concerns that they were not being maintained properly. The affected ones include:** **had to drop a few editions****,** **MATE****,** **LXQt-Kwin****, and** **KDE-git****.** **Wayfire**### Ugrep Replaces Grep The '[grep](https://en.wikipedia.org/wiki/Grep?ref=news.itsfoss.com)' command line utility has been replaced with the better performing '[ugrep](https://ugrep.com/?ref=news.itsfoss.com)' file pattern searcher that claims to be an “**ultra-fast, user-friendly grep replacement**”. This is an interesting change, and we'll see how users like it. ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ![Follow It's FOSS on Google News](https://news.itsfoss.com/content/images/2023/04/Follow-us-on-Google-News.png) ### Experimental KDE Plasma 6 Repo (Be Cautious!) The developers have also introduced an experimental repo in the form of the '[chaotic-aur-kde](https://forum.garudalinux.org/t/kde-6-repository-testing/31442?ref=news.itsfoss.com)' repo for providing access to **early builds of Plasma 6**. Do keep in mind this is for users who want to test out the Plasma 6 experience, and is **not recommended for production use**. One of the developers added: There have been ongoing efforts to provide early builds of Plasma 6 via a dedicated chaotic-aur-kde repo. This basically allows testing out how Plasma 6 is going to be - the initial release of it is scheduled for February 2024. Needless to say, these are experimental master branch builds, so only adventurous people should embark the journey. ### 🛠️ Other Changes and Improvements Those were just the highlights, here are some other refinements worth noting: - The **'garuda-update' utility has been updated**to handle conflicts that cropped up due to recent package name changes. [Plymouth](https://wiki.archlinux.org/title/plymouth?ref=news.itsfoss.com)**has been removed**, the terminal output will now show up instead during boot.- Various **updates to their infrastructure**to better serve users. - A dedicated [Lemmy instance](https://lemmy.garudalinux.org/?ref=news.itsfoss.com)for Garuda Linux. You can go through the [official announcement](https://forum.garudalinux.org/t/garuda-linux-spizaetus-231029/31843?ref=news.itsfoss.com) to dive deeper. **Suggested Read **📖 [Lemmy: A Decentralized Open-Source Reddit Alternative To ExploreAre you looking for an open-source Reddit alternative? Well, this is something!](https://news.itsfoss.com/lemmy/)![](https://news.itsfoss.com/content/images/2023/06/lemmy-reddit-alternative.jpg) ![](https://news.itsfoss.com/content/images/2023/06/lemmy-reddit-alternative.jpg) ## 📥 Download Garuda Linux “Spizaetus” Garuda Linux is available in **9 distinct flavors** that include options with **KDE Plasma**, **GNOME**, **Xfce**, **Cinnamon**, **Sway** and more. Head on over to the [official site](https://garudalinux.org/downloads?ref=news.itsfoss.com) to get the image of your choice. *💬 Are you going to try this release out? Let us know below!* ## More from It's FOSS... - Support us by opting for [It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our [community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our [weekly Newsletter](https://itsfoss.com/newsletter/).
16,349
如何在 Ubuntu 上安装最新的 LibreOffice
https://itsfoss.com/install-libreoffice-ubuntu/
2023-11-04T17:06:33
[ "LibreOffice" ]
https://linux.cn/article-16349-1.html
![](/data/attachment/album/202311/04/170549qzsfnygzhtzsn0uo.jpg) > > 想在 Ubuntu 上使用最新、最好的 LibreOffice?这里有一个简单的方法。 > > > LibreOffice 已预装在 Ubuntu 中。 不过,如果你选择了最小化的 Ubuntu 安装,或者卸载它并安装了其他办公套件,你可以使用此命令轻松安装: ``` sudo apt install libreoffice ``` 这没问题。但 Ubuntu 仓库提供的 LibreOffice 版本可能不是最新的。 如果你听说有新的 LibreOffice 版本发布,很可能你不会获得该新版本。这是因为 Ubuntu 将其保持在稳定版本上。 这对大多数用户来说都很好。但是,如果你不是“大多数用户”,并且你想在 Ubuntu 中获取最新的 LibreOffice,那么你完全可以这样做。 有两种方法可以做到这一点: * 使用官方 PPA(推荐) * 从 LibreOffice 下载 deb 文件 让我们来看看。 ### 方法 1:通过官方 PPA 安装最新的 LibreOffice(推荐) 你可以使用官方 “LibreOffice Fresh” PPA 在基于 Ubuntu 的发行版上安装 LibreOffice 的最新稳定版本。 PPA 提供了 LibreOffice 的最新稳定版本,而不是开发版本。因此,这使其成为在 Ubuntu 上获取较新 LibreOffice 版本的理想选择。 你甚至不需要使用此方法卸载以前的版本。它将把现有的 LibreOffice 更新到新版本。 ``` sudo add-apt-repository ppa:libreoffice/ppa sudo apt update sudo apt install libreoffice ``` 由于你要添加 PPA,因此你还将获得以这种方式安装的新版本的更新。 ### 方法 2:从网站获取二进制文件(如果需要) 你可以随时前往 [LibreOfiice 网站的下载页面](https://www.libreoffice.org/download/download-libreoffice) 下载最新版本的 deb 文件。你还会看到下载较旧但 LTS 稳定版本的选项。 ![](/data/attachment/album/202311/04/170633n7pqyq5k5v6p8ebl.png) 我相信你已经 [知道如何从 deb 文件安装应用](https://itsfoss.com/install-deb-files-ubuntu/)。右键单击 deb 文件,选择使用软件中心打开它。进入软件中心后,你可以单击安装按钮进行安装。 ### 结论 第二种方法的缺点是,如果有更新,你必须再次下载 deb 文件,删除以前的 LibreOffice 版本,然后使用新下载的 deb 文件安装新版本。 相比之下,PPA 会随着系统更新而自动更新。这就是我推荐 PPA 的原因,特别是当它由 LibreOffice 团队自己维护时。 顺便说一句,这里有一些 [充分利用 LibreOffice 的技巧](/article-15530-1.html): > > **[提高 LibreOffice 生产力的技巧](/article-15530-1.html)** > > > 我希望这个快速技巧可以帮助你在基于 Ubuntu 的发行版上获取最新的 LibreOffice。如果你有疑问,请告诉我。 --- via: <https://itsfoss.com/install-libreoffice-ubuntu/> 作者:[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) LibreOffice comes preinstalled in Ubuntu. However, if you opted for the minimal Ubuntu install, removed it for some other office suite, you can easily install it using this command: `sudo apt install libreoffice` That's fine. But the LibreOffice version provided by the Ubuntu repository may not be the latest one. If you are hearing about a new LibreOffice version release, most likely, you won't be getting the new release. That's because Ubuntu keeps it on a stable release. And that's fine for most users. However, if you are not 'among most users' and you like to get the latest LibreOffice in Ubuntu, you can totally do that. There are two ways to do that: - Use official PPA (recommended) - Download deb file from LibreOffice Let's see them one by one. ## Method 1: Install latest LibreOffice via official PPA (recommended) You can use the official “LibreOffice Fresh” PPA to install the latest stable release of LibreOffice on Ubuntu based distributions. The PPA provides the latest stable release of the LibreOffice, not a development release. So, this makes it the ideal choice to get the newer LibreOffice version on Ubuntu. You don’t even need to uninstall the previous version using this method. It will update the existing LibreOffice to the newer version. ``` sudo add-apt-repository ppa:libreoffice/ppa sudo apt update sudo apt install libreoffice ``` Since you are adding a PPA, you'll also get updates on the newer version installed this way. ## Method 2: Get the binaries from the website (if you want) You can always go to the [download section of the LibreOfiice website](https://www.libreoffice.org/download/download-libreoffice) and download the deb file of the latest version. You'll also see the option to download an older but LTS stable version. ![Download LibreOffice latest version](https://itsfoss.com/content/images/2023/10/download-libreoffice.png) I believe you already [know how to install applications from a deb file](https://itsfoss.com/install-deb-files-ubuntu/). Right click on the deb file, select to open it with Software Center. Once in software center, you can click the install button to install it. ## Conclusion The downside of the second method is that if there is an update, you'll have to download the deb file again, remove the previous LibreOffice version and install the new version with the newly downloaded deb file. In contrast, the PPA gives you update automatically with the system updates. That's the reason why I recommend the PPA, specially when it is maintained by the LibreOffice team itself. By the way, here are some [tips on getting more out of LibreOffice](https://itsfoss.com/libreoffice-tips/): [15 LibreOffice Tips to Get More Out of itLibreOffice is an excellent office suite. These LibreOffice tips will enable you to use it more effectively.](https://itsfoss.com/libreoffice-tips/)![](https://itsfoss.com/content/images/wordpress/2017/12/LibreOffice-logo.jpeg) ![](https://itsfoss.com/content/images/wordpress/2017/12/LibreOffice-logo.jpeg) I hope this quick tip helped you get the latest LibreOffice on Ubuntu-based distributions. Let me know if you have questions.
16,350
计算机科学学者认为技术支持没什么用处,直到他真正需要它
https://www.theregister.com/2023/11/03/on_call/
2023-11-04T17:53:00
[ "技术支持", "计算机科学", "电子邮件" ]
https://linux.cn/article-16350-1.html
![](/data/attachment/album/202311/04/175322tfex5vobpe1vkkfe.jpg) > > “他们基本上是用 Emacs 作为自己的操作系统,再配上一个自定义的 LISP 脚本来收取邮件” —— 那能有什么问题呢? > > > 本周的故事,故事的主角我们给他起名字 “Declan”,他在 1990 年和 2000 年期间,为一所大学的计算机科学系提供 IT 支持服务。 Declan 这样介绍他的工作:“我的职责多样,从基本的桌面支持,到维护院系网站,有时候还需要开发一些学者们想出来的某个什么系统。” Declan 还补充说道,“尽管这个院系名字中带有 ‘计算机’ 这个词,但你会惊讶地发现在这个团队中各个教职工对计算机的熟练程度差异如此之大。有些聪明人用非常 ‘有趣’ 的方式使用电脑,当你步入一个教授的办公室协助‘解决他的电子邮件问题’时,你绝对会对你发现的东西感到惊讶。” 一个典型的例子是某位教授,他基本上是以 Emacs 作为其操作系统,而他的邮件客户端则是他自己用 LISP 编写的一个脚本。至于他的邮件为何无法收发,这是另一个故事了。 今天我们要讲的故事,跟 Declan 的部分用户之间发生的冲突有关。他们作为计算机科学家,对 IT 团队的存在感到不满,他们认为用在 Declan 和他的同事身上的投资,可以用于更重要的地方。对于这种观点,其中一部分人并不甘于默默背锅。 “有一次,一位讲话特别直言不讳的学者在全系会议上站出来,当着 400 名员工的面严厉批评 IT 人员,声称他不仅不需要 IT 支持人员,而且每当他提交支持申请时,我们总是无视他,” Declan 回忆道。 IT 部门的负责人因此要求他的团队去调查是否存在他所说的问题。于是,Declan 和他的团队请求那位愤怒的学者再次提交问题申请以重现问题。 学者依照他们的请求提交了申请。然而,他们却并未收到任何申请单。 接下来的步骤,则是对服务器日志的检查。 经过搜索,结果显露出来。这位学者的确提交了一张申请单,甚至还提交过几张其他的。 然而,它们都被发送到了以 “heldesk@” 开头的邮件地址。 而并非正确的包含 “p” 字母的 “hel**p**desk@”。 这位学者的邮件客户端记住了这个错误的地址,并且在他每次向他觉得不应存在的团队寻求帮助时,都会自动填入这个地址。 这个结果无疑是对学术严谨性的一种讽刺。 Declan 说:“这位学者被告知了他的错误,但他还是一本正经地表示,既然他的胳膊受伤,不能期待他打字完全准确,所以整个问题都不是他的责任,而并没有因为指责我们浪费金钱而道歉。” 几年前,我们有位员工手受伤了,然而他却惊讶地发现就算仅用中指打字也比想象中容易。如果 Declan 希望让那位愤怒的学者看看,我们愿意提供一个示例。 然而我们有些离题了。Declan 提到,这件事也带来了一个积极的转机,因为在那次事件发生后,计算机科学系的系主任开始“更倾向于站在 IT 人员这边,于是这场风波并非全然就是一场失败”。 你有没有过这样的经历,即与一个号称专家的人一起工作,但结果却发现他远非其言?如果有,你可以发表评论讲一下你的经历。 *(题图:MJ/e3f2ea48-bd9b-4952-96c3-5963ba6378fc)* --- via: <https://www.theregister.com/2023/11/03/on_call/> 作者:[Simon Sharwood](https://www.theregister.com/Author/Simon-Sharwood) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
# CompSci academic thought tech support was useless – until he needed it ## 'They were basically using Emacs for their OS, and a custom LISP script to read email' – what could possibly go wrong? On Call Welcome once again to On Call, *The Register*'s chronicle of computing crises that your fellow readers corrected and recalled in sufficient detail to share with us all. This week meet a reader we'll Regomize as "Declan" who, in the 1990s and 2000s, provided IT support services to a university's Computer Science department. "My job ranged from doing desktop support, to maintaining the departmental website, and sometimes just getting to code up some random system that an academic had dreamt up," Declan told On Call. "Given the department had the word 'computer' in the title, it was surprising how varied the competence level was across the academic body when it came to computers," Declan added. "There were some really smart people who used computers in 'interesting' ways, and you never quite knew what you were going to find when you arrived at an academic's office to 'help with their email'." One such visit turned out to involve a chap who was "basically using Emacs for their operating system, and their mail client was a custom script they'd written in LISP." Figuring out why their email wasn't arriving is a story for another day. Our present tale concerns the segment of Declan's users who resented the very existence of the IT team. As computer scientists they felt the money spent on Declan and his colleagues could be spent on other matters. Some were not shy about sharing that opinion. [Ask a builder to fix a server and out come the vastly inappropriate power tools](https://www.theregister.com/2023/10/27/on_call/)[Making the problem go away is not the same thing as fixing it](https://www.theregister.com/2023/10/20/on_call/)[Workload written by student made millions, ran on unsupported hardware, with zero maintenance](https://www.theregister.com/2023/10/13/on_call/)[Police ignored the laws of datacenter climate control](https://www.theregister.com/2023/10/06/on_call/) "One rather vocal academic stood up in an all-department meeting one time and berated the IT staff in front of 400 staff members, claiming that not only did he not need IT support staff, but whenever he logged a support ticket, we were ignoring him," Declan recalled. The head of IT asked his team to investigate if that was indeed the case, so Declan and his colleagues asked the angry academic to reproduce the issue by logging another ticket. The academic complied. But no ticket arrived. A search of server logs was the next step. Which produced a result. The academic had lodged a ticket. And a few others. But they were all sent to an email address that started with "heldesk@". Not "hel*p*desk@" with a "p". The academic's email client remembered the incorrect address and automatically inserted it whenever he sought assistance from the team he didn't believe should exist. So much for academic rigor. "The academic was informed of his mistake, and true to form, rather than apologize for accusing us of being a waste of money, claimed the whole problem was not his fault, because he had injured his arm, so he couldn't be expected to type accurately," Declan told On Call. On Call broke a hand a few years ago and found it surprisingly easy to type with only a middle finger. If Declan wants to identify his angry academic, we'll offer a demo. But we digress. Declan said the incident produced an upside, because the head of the CompSci department "tended to side with the IT staff a bit more after that incident, so it wasn't a complete loss." Have you worked with a supposed expert who turned out to be anything but? If so, [send On Call an email](mailto:[email protected]) that describes your experience, and it may be your turn to have a story appear on a future Friday. And yes, we did check that the email address in that link is correct. ® 248
16,353
JVM 解释和编译指南
https://opensource.com/article/22/8/interpret-compile-java
2023-11-06T09:36:37
[ "JVM", "编译", "解释" ]
/article-16353-1.html
![](/data/attachment/album/202311/06/093552kheiob71meqierhd.png) > > 通过理解解释、即时编译和预先编译之间的区别,有效地使用它们。 > > > Java 是一种跨平台的编程语言。程序源代码会被编译为 <ruby> 字节码 <rt> bytecode </rt></ruby>,然后字节码在运行时被转换为 <ruby> 机器码 <rt> machine code </rt></ruby>。<ruby> 解释器 <rt> interpreter </rt></ruby> 在物理机器上模拟出的抽象计算机上执行字节码指令。<ruby> 即时 <rt> just-in-time </rt></ruby>(JIT)编译发生在运行期,而 <ruby> 预先 <rt> ahead-of-time </rt></ruby>(AOT)编译发生在构建期。 本文将说明解释器、JIT 和 AOT 分别何时起作用,以及如何在 JIT 和 AOT 之间权衡。 ### 源代码、字节码、机器码 应用程序通常是由 C、C++ 或 Java 等编程语言编写。用这些高级编程语言编写的指令集合称为源代码。源代码是人类可读的。要在目标机器上执行它,需要将源代码转换为机器可读的机器码。这个转换工作通常是由 <ruby> 编译器 <rt> compiler </rt></ruby> 来完成的。 然而,在 Java 中,源代码首先被转换为一种中间形式,称为字节码。字节码是平台无关的,所以 Java 被称为平台无关编程语言。Java 编译器 `javac` 将源代码转换为字节码。然后解释器解释执行字节码。 下面是一个简单的 Java 程序, `Hello.java`: ``` //Hello.java public class Hello { public static void main(String[] args) { System.out.println("Inside Hello World!"); } } ``` 使用 `javac` 编译它,生成包含字节码的 `Hello.class` 文件。 ``` $ javac Hello.java $ ls Hello.class Hello.java ``` 现在,使用 `javap` 来反汇编 `Hello.class` 文件的内容。使用 `javap` 时如果不指定任何选项,它将打印基本信息,包括编译这个 `.class` 文件的源文件、包名称、公共和受保护字段以及类的方法。 ``` $ javap Hello.class Compiled from "Hello.java" public class Hello { public Hello(); public static void main(java.lang.String[]); } ``` 要查看 `.class` 文件中的字节码内容,使用 `-c` 选项: ``` $ javap -c Hello.class Compiled from "Hello.java" public class Hello { public Hello(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return public static void main(java.lang.String[]); Code: 0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #3 // String Inside Hello World! 5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 8: return } ``` 要获取更详细的信息,使用 `-v` 选项: ``` $ javap -v Hello.class ``` ### 解释器,JIT 和 AOT 解释器负责在物理机器上模拟出的抽象计算机上执行字节码指令。当使用 `javac` 编译源代码,然后使用 `java` 执行时,解释器在程序运行时运行并完成它的目标。 ``` $ javac Hello.java $ java Hello Inside Hello World! ``` JIT 编译器也在运行期发挥作用。当解释器解释 Java 程序时,另一个称为运行时 <ruby> 分析器 <rt> profiler </rt></ruby> 的组件将静默地监视程序的执行,统计各部分代码被解释的次数。基于这些统计信息可以检测出程序的 <ruby> 热点 <rt> hotspot </rt></ruby>,即那些经常被解释的代码。一旦代码被解释次数超过设定的阈值,它们满足被 JIT 编译器直接转换为机器码的条件。所以 JIT 编译器也被称为分析优化的编译器。从字节码到机器码的转换是在程序运行过程中进行的,因此称为即时编译。JIT 减少了解释器将同一组指令模拟为机器码的负担。 AOT 编译器在构建期编译代码。在构建时将需要频繁解释和 JIT 编译的代码直接编译为机器码可以缩短 <ruby> Java 虚拟机 <rt> Java Virtual Machine </rt></ruby>(JVM) 的<ruby> 预热 <rt> warm-up </rt></ruby>时间。(LCTT 译注:Java 程序启动后首先字节码被解释执行,此时执行效率较低。等到程序运行了足够的时间后,代码热点被检测出来,JIT 开始发挥作用,程序运行效率提升。JIT 发挥作用之前的过程就是预热。)AOT 是在 Java 9 中引入的一个实验性特性。`jaotc` 使用 Graal 编译器(它本身也是用 Java 编写的)来实现 AOT 编译。 以 `Hello.java` 为例: ``` //Hello.java public class Hello { public static void main(String[] args) { System.out.println("Inside Hello World!"); } } $ javac Hello.java $ jaotc --output libHello.so Hello.class $ java -XX:+UnlockExperimentalVMOptions -XX:AOTLibrary=./libHello.so Hello Inside Hello World! ``` ### 解释和编译发生的时机 下面通过例子来展示 Java 在什么时候使用解释器,以及 JIT 和 AOT 何时参与进来。这里有一个简单的程序 `Demo.java` : ``` //Demo.java public class Demo { public int square(int i) throws Exception { return(i*i); } public static void main(String[] args) throws Exception { for (int i = 1; i <= 10; i++) { System.out.println("call " + Integer.valueOf(i)); long a = System.nanoTime(); Int r = new Demo().square(i); System.out.println("Square(i) = " + r); long b = System.nanoTime(); System.out.println("elapsed= " + (b-a)); System.out.println("--------------------------------"); } } } ``` 在这个程序的 `main()` 方法中创建了一个 `Demo` 对象的实例,并调用该实例的 `square()`方法,然后显示 `for` 循环迭代变量的平方值。编译并运行它: ``` $ javac Demo.java $ java Demo 1 iteration Square(i) = 1 Time taken= 8432439 -------------------------------- 2 iteration Square(i) = 4 Time taken= 54631 -------------------------------- . . . -------------------------------- 10 iteration Square(i) = 100 Time taken= 66498 -------------------------------- ``` 上面的结果是由谁产生的呢?是解释器,JIT 还是 AOT?在目前的情况下,它完全是通过解释产生的。我是怎么得出这个结论的呢?只有代码被解释的次数必须超过某个阈值时,这些热点代码片段才会被加入 JIT 编译队列。只有这时,JIT 编译才会发挥作用。使用以下命令查看 JDK 11 中的该阈值: ``` $ java -XX:+PrintFlagsFinal -version | grep CompileThreshold intx CompileThreshold = 10000 {pd product} {default} [...] openjdk version "11.0.13" 2021-10-19 OpenJDK Runtime Environment 18.9 (build 11.0.13+8) OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing) ``` 上面的输出表明,一段代码被解释 10,000 次才符合 JIT 编译的条件。这个阈值是否可以手动调整呢?是否有 JVM 标志可以指示出方法是否被 JIT 编译了呢?答案是肯定的,而且有多种方式可以达到这个目的。 使用 `-XX:+PrintCompilation` 选项可以查看一个方法是否被 JIT 编译。除此之外,使用 `-Xbatch` 标志可以提高输出的可读性。如果解释和 JIT 同时发生,`-Xbatch` 可以帮助区分两者的输出。使用这些标志如下: ``` $ java -Xbatch -XX:+PrintCompilation Demo 34 1 b 3 java.util.concurrent.ConcurrentHashMap::tabAt (22 bytes) 35 2 n 0 jdk.internal.misc.Unsafe::getObjectVolatile (native) 35 3 b 3 java.lang.Object::<init> (1 bytes) [...] 210 269 n 0 java.lang.reflect.Array::newArray (native) (static) 211 270 b 3 java.lang.String::substring (58 bytes) [...] -------------------------------- 10 iteration Square(i) = 100 Time taken= 50150 -------------------------------- ``` 注意,上面命令的实际输出太长了,这里我只是截取了一部分。输出很长的原因是除了 `Demo` 程序的代码外,JDK 内部类的函数也被编译了。由于我的重点是 `Demo.java` 代码,我希望排除内部包的函数来简化输出。通过选项 `-XX:CompileCommandFile` 可以禁用内部类的 JIT: ``` $ java -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler Demo ``` 在选项 `-XX:CompileCommandFile` 指定的文件 `hotspot_compiler` 中包含了要排除的包: ``` $ cat hotspot_compiler quiet exclude java/* * exclude jdk/* * exclude sun/* * ``` 第一行的 `quiet` 告诉 JVM 不要输出任何关于被排除类的内容。用 `-XX:CompileThreshold` 将 JIT 阈值设置为 5。这意味着在解释 5 次之后,就会进行 JIT 编译: ``` $ java -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler \ -XX:CompileThreshold=5 Demo 47 1 n 0 java.lang.invoke.MethodHandle::linkToStatic(LLLLLL)L (native) (static) 47 2 n 0 java.lang.invoke.MethodHandle::invokeBasic(LLLLL)L (native) 47 3 n 0 java.lang.invoke.MethodHandle::linkToSpecial(LLLLLLL)L (native) (static) 48 4 n 0 java.lang.invoke.MethodHandle::linkToStatic(L)I (native) (static) 48 5 n 0 java.lang.invoke.MethodHandle::invokeBasic()I (native) 48 6 n 0 java.lang.invoke.MethodHandle::linkToSpecial(LL)I (native) (static) [...] 1 iteration 69 40 n 0 java.lang.invoke.MethodHandle::linkToStatic(ILIIL)I (native) (static) [...] Square(i) = 1 78 48 n 0 java.lang.invoke.MethodHandle::linkToStatic(ILIJL)I (native) (static) 79 49 n 0 java.lang.invoke.MethodHandle::invokeBasic(ILIJ)I (native) [...] 86 54 n 0 java.lang.invoke.MethodHandle::invokeBasic(J)L (native) 87 55 n 0 java.lang.invoke.MethodHandle::linkToSpecial(LJL)L (native) (static) Time taken= 8962738 -------------------------------- 2 iteration Square(i) = 4 Time taken= 26759 -------------------------------- 10 iteration Square(i) = 100 Time taken= 26492 -------------------------------- ``` 好像输出结果跟只用解释时并没有什么区别。根据 Oracle 的文档,这是因为只有禁用 `TieredCompilation` 时 `-XX:CompileThreshold` 才会生效: ``` $ java -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler \ -XX:-TieredCompilation -XX:CompileThreshold=5 Demo 124 1 n java.lang.invoke.MethodHandle::linkToStatic(LLLLLL)L (native) (static) 127 2 n java.lang.invoke.MethodHandle::invokeBasic(LLLLL)L (native) [...] 1 iteration 187 40 n java.lang.invoke.MethodHandle::linkToStatic(ILIIL)I (native) (static) [...] (native) (static) 212 54 n java.lang.invoke.MethodHandle::invokeBasic(J)L (native) 212 55 n java.lang.invoke.MethodHandle::linkToSpecial(LJL)L (native) (static) Time taken= 12337415 [...] -------------------------------- 4 iteration Square(i) = 16 Time taken= 37183 -------------------------------- 5 iteration 214 56 b Demo::<init> (5 bytes) 215 57 b Demo::square (16 bytes) Square(i) = 25 Time taken= 983002 -------------------------------- 6 iteration Square(i) = 36 Time taken= 81589 [...] 10 iteration Square(i) = 100 Time taken= 52393 ``` 可以看到在第五次迭代之后,代码片段被 JIT 编译了: ``` -------------------------------- 5 iteration 214 56 b Demo::<init> (5 bytes) 215 57 b Demo::square (16 bytes) Square(i) = 25 Time taken= 983002 -------------------------------- ``` 可以看到,与 `square()` 方法一起,构造方法也被 JIT 编译了。在 `for` 循环中调用 `square()` 之前要先构造 `Demo` 实例,所以构造方法的解释次数同样达到 JIT 编译阈值。这个例子说明了在解释发生之后何时 JIT 会介入。 要查看编译后的代码,需要使用 `-XX:+PrintAssembly` 标志,该标志仅在库路径中有反汇编器时才起作用。对于 OpenJDK,使用 `hsdis` 作为反汇编器。下载合适版本的反汇编程序库,在本例中是 `hsdis-amd64.so`,并将其放在 `Java_HOME/lib/server` 目录下。使用时还需要在 `-XX:+PrintAssembly` 之前增加 `-XX:+UnlockDiagnosticVMOptions` 选项。否则,JVM 会给你一个警告。 完整命令如下: ``` $ java -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler \ -XX:-TieredCompilation -XX:CompileThreshold=5 -XX:+UnlockDiagnosticVMOptions \ -XX:+PrintAssembly Demo [...] 5 iteration 178 56 b Demo::<init> (5 bytes) Compiled method (c2) 178 56 Demo::<init> (5 bytes) total in heap [0x00007fd4d08dad10,0x00007fd4d08dafe0] = 720 relocation [0x00007fd4d08dae88,0x00007fd4d08daea0] = 24 [...] handler table [0x00007fd4d08dafc8,0x00007fd4d08dafe0] = 24 [...] dependencies [0x00007fd4d08db3c0,0x00007fd4d08db3c8] = 8 handler table [0x00007fd4d08db3c8,0x00007fd4d08db3f8] = 48 ---------------------------------------------------------------------- Demo.square(I)I [0x00007fd4d08db1c0, 0x00007fd4d08db2b8] 248 bytes [Entry Point] [Constants] # {method} {0x00007fd4b841f4b0} 'square' '(I)I' in 'Demo' # this: rsi:rsi = 'Demo' # parm0: rdx = int # [sp+0x20] (sp of caller) [...] [Stub Code] 0x00007fd4d08db280: movabs $0x0,%rbx ; {no_reloc} 0x00007fd4d08db28a: jmpq 0x00007fd4d08db28a ; {runtime_call} 0x00007fd4d08db28f: movabs $0x0,%rbx ; {static_stub} 0x00007fd4d08db299: jmpq 0x00007fd4d08db299 ; {runtime_call} [Exception Handler] 0x00007fd4d08db29e: jmpq 0x00007fd4d08bb880 ; {runtime_call ExceptionBlob} [Deopt Handler Code] 0x00007fd4d08db2a3: callq 0x00007fd4d08db2a8 0x00007fd4d08db2a8: subq $0x5,(%rsp) 0x00007fd4d08db2ad: jmpq 0x00007fd4d08a01a0 ; {runtime_call DeoptimizationBlob} 0x00007fd4d08db2b2: hlt 0x00007fd4d08db2b3: hlt 0x00007fd4d08db2b4: hlt 0x00007fd4d08db2b5: hlt 0x00007fd4d08db2b6: hlt 0x00007fd4d08db2b7: hlt ImmutableOopMap{rbp=NarrowOop }pc offsets: 96 ImmutableOopMap{}pc offsets: 112 ImmutableOopMap{rbp=Oop }pc offsets: 148 Square(i) = 25 Time taken= 2567698 -------------------------------- 6 iteration Square(i) = 36 Time taken= 76752 [...] -------------------------------- 10 iteration Square(i) = 100 Time taken= 52888 ``` 我只截取了输出中与 `Demo.java` 相关的部分。 现在再来看看 AOT 编译。它是在 JDK9 中引入的特性。AOT 是用于生成 `.so` 这样的库文件的静态编译器。用 AOT 可以将指定的类编译成 `.so` 库。这个库可以直接执行,而不用解释或 JIT 编译。如果 JVM 没有检测到 AOT 编译的代码,它会进行常规的解释和 JIT 编译。 使用 AOT 编译的命令如下: ``` $ jaotc --output=libDemo.so Demo.class ``` 用下面的命令来查看共享库的符号表: ``` $ nm libDemo.so ``` 要使用生成的 `.so` 库,使用 `-XX:+UnlockExperimentalVMOptions` 和 `-XX:AOTLibrary`: ``` $ java -XX:+UnlockExperimentalVMOptions -XX:AOTLibrary=./libDemo.so Demo 1 iteration Square(i) = 1 Time taken= 7831139 -------------------------------- 2 iteration Square(i) = 4 Time taken= 36619 [...] 10 iteration Square(i) = 100 Time taken= 42085 ``` 从输出上看,跟完全用解释的情况没有区别。为了确认 AOT 发挥了作用,使用 `-XX:+PrintAOT`: ``` $ java -XX:+UnlockExperimentalVMOptions -XX:AOTLibrary=./libDemo.so -XX:+PrintAOT Demo 28 1 loaded ./libDemo.so aot library 80 1 aot[ 1] Demo.main([Ljava/lang/String;)V 80 2 aot[ 1] Demo.square(I)I 80 3 aot[ 1] Demo.<init>()V 1 iteration Square(i) = 1 Time taken= 7252921 -------------------------------- 2 iteration Square(i) = 4 Time taken= 57443 [...] 10 iteration Square(i) = 100 Time taken= 53586 ``` 要确认没有发生 JIT 编译,用如下命令: ``` $ java -XX:+UnlockExperimentalVMOptions -Xbatch -XX:+PrintCompilation \ -XX:CompileCommandFile=hotspot_compiler -XX:-TieredCompilation \ -XX:CompileThreshold=3 -XX:AOTLibrary=./libDemo.so -XX:+PrintAOT Demo 19 1 loaded ./libDemo.so aot library 77 1 aot[ 1] Demo.square(I)I 77 2 aot[ 1] Demo.main([Ljava/lang/String;)V 77 3 aot[ 1] Demo.<init>()V 77 2 aot[ 1] Demo.main([Ljava/lang/String;)V made not entrant [...] 4 iteration Square(i) = 16 Time taken= 43366 [...] 10 iteration Square(i) = 100 Time taken= 59554 ``` 需要特别注意的是,修改被 AOT 编译了的源代码后,一定要重新生成 `.so` 库文件。否则,过时的的 AOT 编译库文件不会起作用。例如,修改 `square()` 方法,使其计算立方值: ``` //Demo.java public class Demo { public int square(int i) throws Exception { return(i*i*i); } public static void main(String[] args) throws Exception { for (int i = 1; i <= 10; i++) { System.out.println("" + Integer.valueOf(i)+" iteration"); long start = System.nanoTime(); int r= new Demo().square(i); System.out.println("Square(i) = " + r); long end = System.nanoTime(); System.out.println("Time taken= " + (end-start)); System.out.println("--------------------------------"); } } } ``` 重新编译 `Demo.java`: ``` $ java Demo.java ``` 但不重新生成 `libDemo.so`。使用下面命令运行 `Demo`: ``` $ java -XX:+UnlockExperimentalVMOptions -Xbatch -XX:+PrintCompilation -XX:CompileCommandFile=hotspot_compiler -XX:-TieredCompilation -XX:CompileThreshold=3 -XX:AOTLibrary=./libDemo.so -XX:+PrintAOT Demo 20 1 loaded ./libDemo.so aot library 74 1 n java.lang.invoke.MethodHandle::linkToStatic(LLLLLL)L (native) (static) 2 iteration sqrt(i) = 8 Time taken= 43838 -------------------------------- 3 iteration 137 56 b Demo::<init> (5 bytes) 138 57 b Demo::square (6 bytes) sqrt(i) = 27 Time taken= 534649 -------------------------------- 4 iteration sqrt(i) = 64 Time taken= 51916 [...] 10 iteration sqrt(i) = 1000 Time taken= 47132 ``` 可以看到,虽然旧版本的 `libDemo.so` 被加载了,但 JVM 检测出它已经过时了。每次生成 `.class` 文件时,都会在类文件中添加一个指纹,并在 AOT 库中保存该指纹。修改源代码后类指纹与旧的 AOT 库中的指纹不匹配了,所以没有执行 AOT 编译生成的原生机器码。从输出可以看出,现在实际上是 JIT 在起作用(注意 `-XX:CompileThreshold` 被设置为了 3)。 ### AOT 和 JIT 之间的权衡 如果你的目标是减少 JVM 的预热时间,请使用 AOT,这可以减少运行时负担。问题是 AOT 没有足够的数据来决定哪段代码需要预编译为原生代码。相比之下,JIT 在运行时起作用,却对预热时间有一定的影响。然而,它将有足够的分析数据来更高效地编译和反编译代码。 *(题图:MJ/ed3e6e15-56c7-4c1d-aff1-84a225faeeeb)* --- via: <https://opensource.com/article/22/8/interpret-compile-java> 作者:[Jayashree Huttanagoudar](https://opensource.com/users/jayashree-huttanagoudar) 选题:[lkxed](https://github.com/lkxed) 译者:[toknow-gh](https://github.com/toknow-gh) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='opensource.com', port=443): Read timed out. (read timeout=10)
null
16,354
在 Linux 终端利用 Asciiquarium 打造海底世界
https://itsfoss.com/asciiquarium/
2023-11-06T10:42:00
[ "水族箱" ]
https://linux.cn/article-16354-1.html
![](/data/attachment/album/202311/06/104101r2sfkrf27ozfqffq.png) > > 这是一个小小的 CLI 工具,可在 Linux 终端中添加水族箱。 > > > [Linux 的众多命令工具](https://itsfoss.com/funny-linux-commands/) 里,有一部分偏向于休闲娱乐而非工作。Asciiquarium 就是一个很好的例子。 Asciiquarium 为 Linux 终端提供了以 ASCII 格式构建的简单的水族馆动画效果。 ![](/data/attachment/album/202311/06/104209lct0ic84lfi7l7r4.png) 看起来有趣吗?我们一起进一步了解。 ### 如何在 Linux 中安装 Asciiquarium 如果你是 Arch Linux 或 Fedora 用户,你可以直接从官方仓库中安装。 Fedora 的用户请运行: ``` sudo dnf install asciiquarium ``` 而 Arch Linux 用户请运行: ``` sudo pacman -S asciiquarium ``` 对于 Ubuntu,Asciiquarium 没有包含在默认仓库里。因此,你需要选择使用预编译的二进制文件,或者一些外部的 PPA。 #### 使用 PPA 安装 Asciiquarium 首先,添加 Asciiquarium 的 PPA: ``` sudo add-apt-repository ppa:ytvwld/asciiquarium sudo apt update ``` 然后,安装相关的软件包和依赖: ``` sudo apt install asciiquarium ``` ##### 删除 PPA 在你删除 Asciiquarium 的 PPA 之前,首先要移除相关软件包。 ``` sudo apt purge asciiquarium sudo apt autoremove ``` 然后,从系统中移除 PPA: ``` sudo add-apt-repository --remove ppa:openshot.developers/ppa sudo apt update ``` #### 使用二进制文件安装 Asciiquarium > > ? 你需要为你的系统单独安装一些 Perl 模块。同时,它将在你的系统中安装几个与 Perl 相关的包,所以请注意。 > > > ![安装 Perl 依赖包](/data/attachment/album/202311/06/104210urm8m4r85mmz2pu8.png) 要运行二进制文件,你需要从 CPAN 中安装 Animation 和 Curses 模块。 在 Ubuntu 中安装 CPAN: ``` sudo apt install cpanminus libcurses-perl ``` 接着,运行: ``` cpan Term::Animation ``` ![Animation 模块安装](/data/attachment/album/202311/06/104210xms8zujqjsj21q19.png) 该操作会要求你做一些配置,只需选取默认值即可。全部设置好后,来下载 Asciiquarium 的发布版。 > > **[下载 Asciiquarium](https://robobunny.com/projects/asciiquarium/html/)** > > > 解压文件,你会得到一个名为 Asciiquarium 的文件,接下来,让它具有执行权限。 ![赋予 Asciiquarium 执行权限](/data/attachment/album/202311/06/104211d5tfhcuyc9x36lzc.png) 如果你需要通过命令行来完成,只需打开终端,并用 [chmod 命令](https://linuxhandbook.com/chmod-command/)赋予执行权限。 ``` chmod +x asciiquarium ``` 此时,你可以直接在当前目录下运行这个文件以获取动画效果: ``` ./asciiquarium ``` 或者,你也可以把这个文件放在一个 [包含在你的 PATH 中](https://itsfoss.com/add-directory-to-path-linux/)的位置上。 ### 如何使用 Asciiquarium Asciiquarium 使用起来非常简单,它不设任何命令行选项。只需运行 `asciiquarium`,你就能在终端中看到水族馆的动画效果。 ![Asciiquarium 动画效果](/data/attachment/album/202311/06/104209lct0ic84lfi7l7r4.png) 程序还提供了几个热键支持。 * `r`:重绘动画 * `p`:暂停/播放动画 * `q`:退出程序 > > ? > > > 此外,也可以使用箭头键提升动画的速度。 #### 用 lolcat 加强 Asciiquarium 的体验 如果你想让 Asciiquarium 的颜色更丰富,可以综合使用 `lolcat`。首先安装 `lolcat` : ``` sudo apt install lolcat ``` 然后,运行: ``` asciiquarium | lolcat ``` ![Asciiquarium Lolcat 效果](/data/attachment/album/202311/06/104211f4oyakg2ozpzy2lo.png) 如果你还需要更多的动画效果,可以适当调节 `lolcat` 的参数,例如: ``` asciiquarium | lolcat -p 200 ``` ![Asciiquarium 和 lolcat 的效果调整](/data/attachment/album/202311/06/104211cvwddww8810aatd0.gif) 这样操作会产生各种不同的颜色效果。 你还可以使用 `lolcat` 的 `-i` 选项,来反转颜色: ``` asciiquarium | lolcat -i -p 200 ``` ![颜色反转效果](/data/attachment/album/202311/06/104212ph7f0zdmdhdagamf.png) ### 赠品:XFishTank(让你的桌面诠释海底世界) 还有一个类似的有趣命令叫做 `xfishtank`。它在你的根窗口,即桌面,创建一片海洋世界。你可以从 Ubuntu 的官方仓库直接安装 `xfishtank`。 ``` sudo apt install xfishtank ``` 安装完成后,直接运行: ``` xfishtank ``` XFishTank 提供了很多选项供你调节,例如鱼儿的数量、气泡等等。你可以参考 [该命令的 man 页面](https://itsfoss.com/linux-man-page-guide/) 学习更多相关内容。 ``` xfishtank -b 100 -f 15 ``` ![Xfishtank 效果展示](/data/attachment/album/202311/06/104212p24iu99ygkzfkzy9.png) ### 结语 就像你所看到的,Linux 终端里的小鱼或许不能提供实质性的帮助,但它确实能带给我们愉快的心情。 如果你不是那么喜欢鱼,那么试试看牛吧。 > > **[哞~ 我的 Linux 终端里有头牛](/article-15952-1.html)** > > > 希望你在这些有趣的小工具的陪伴下,能够更加享受 Linux 的世界。? *(题图:MJ/83766cba-02e1-4d20-8797-a38e5c17a0c0)* --- via: <https://itsfoss.com/asciiquarium/> 作者:[Sreenath](https://itsfoss.com/author/sreenath/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) There are a bunch of [Linux command tools that are more for amusement](https://itsfoss.com/funny-linux-commands/) than serious work. Asciiquarium is one of them. It provides a simple aquarium like animation effects in ASCII format for the Linux terminal. ![Running default asciiquarium command](https://itsfoss.com/content/images/2023/10/asciiquarium.png) Looks interesting? Let's explore it. ## Install Asciiquarium in Linux If you are using Arch Linux or Fedora, you can install it from your official repositories. Fedora users: `sudo dnf install asciiquarium` Arch Linux users: `sudo pacman -S asciiquarium` Asciiquarium is not available in the default repos of Ubuntu. So, you either need to use a prebuilt binary or an external PPA. ### Install Asciiquarium using PPA First, add the PPA for Asciiquarium. ``` sudo add-apt-repository ppa:ytvwld/asciiquarium sudo apt update ``` Now, install the package and its dependencies using: `sudo apt install asciiquarium` #### Remove PPA To remove the Asciiquarium PPA, first remove the package. ``` sudo apt purge asciiquarium sudo apt autoremove ``` Now, remove the PPA from your system: ``` sudo add-apt-repository --remove ppa:ytvwld/asciiquarium sudo apt update ``` ### Install Asciiquarium using Binary ![Installing Perl Dependencies during the installation process](https://itsfoss.com/content/images/2023/10/Installing-perl-dependencies.png) To run the binary, you need the Animation and Curses module from CPAN (Comprehensive Perl Archive Network). Install CPAN in Ubuntu using: `sudo apt install cpanminus libcurses-perl` Now, run: `cpan Term::Animation` ![Automatic setting up of Animation Module](https://itsfoss.com/content/images/2023/10/animation-module-setup.png) This will ask for some configuration, just accept the defaults. Once both are set up, download the Asciiquarium release. Extract the file. You will get a file called Asciiquarium. Now, make it executable. ![Execution permission for Asciiquarium through Nautilus File Manager](https://itsfoss.com/content/images/2023/10/execution-permission-for-asciiquarium.png) To do it via command line, open a terminal there and give the file execution permission [using chmod command](https://linuxhandbook.com/chmod-command/). `chmod +x asciiquarium` Now, to get the animation, you can run inside that location: `./asciiquarium` Or you can place the file in a [location that is in your path](https://itsfoss.com/add-directory-to-path-linux/). ## Using Asciiquarium Asciiquarium is a simple program. It does not have any command line options. Once you run `asciiquarium` , you will get the aquarium animation effect on your terminal. ![Running default asciiquarium command](https://itsfoss.com/content/images/2023/10/asciiquarium.png) A couple of in-program keys are supported. `r` : Repaint the animation`p` : Pause or Play the animation`q` : Quit ### Using Asciiquarium with lolcat If you want to make Asciiquarium more colorful, you can use it with `lolcat` . Install lolcat first using: `sudo apt install lolcat` Now, run: `asciiquarium | lolcat` ![Ascciquarium displayed with rainbow colors using lolcat](https://itsfoss.com/content/images/2023/10/ascciiquarium-lolcat.png) If you need more animation effect, tweak lolcat accordingly. For example, `asciiquarium | lolcat -p 200` ![Asciiquarium displayed with some options applied to lolcat command](https://itsfoss.com/content/images/2023/10/lolcat-200.gif) This will give you various color effects. You can use the `-i` option of lolcat, to invert the colors: `asciiquarium | lolcat -i -p 200` ![Use lolcat to invert colors and display asciiquarium](https://itsfoss.com/content/images/2023/10/inverted.png) ## Bonus: XFishTank (your desktop becomes the tank) Another similar fun command is xfishtank. It creates an aquarium on your root window, that is the desktop. You can install it from the official repositories of Ubuntu. `sudo apt install xfishtank` Once installed, use: `xfishtank` There are several options which will help you to manage the number of fishes, bubbles etc. [Use the man page](https://itsfoss.com/linux-man-page-guide/) of the command to learn more about it. `xfishtank -b 100 -f 15` ![Running "xfishtank" command will give moving fish and bubbles on your screen](https://itsfoss.com/content/images/2023/10/xfishtank.png) ## Wrapping Up As you can see, having a fish in your Linux terminal may not get you food but it would lighten up your mood. No a fish lover? Get a cow. [Using Cowsay Linux Command Like a ProThe cowsay is a fun little Linux command line utility that can be enjoyed in so many ways. Here are several examples.](https://itsfoss.com/cowsay/)![](https://itsfoss.com/content/images/2023/06/cowsay-linux-1.png) ![](https://itsfoss.com/content/images/2023/06/cowsay-linux-1.png) Enjoy Linux with these fun stuff :)
16,356
红帽的付费墙让开源社区产生裂痕
https://www.newsobserver.com/news/business/article279099964.html
2023-11-07T16:58:00
[ "红帽", "RHEL" ]
/article-16356-1.html
![](/data/attachment/album/202311/07/165729zn0oholszjn0ld4n.png) > > “我从未想过会有一天看到红帽对我们封闭源代码。”一位技术评论家说。 > > > 2023 年 6 月 21 日,红帽公司的副总裁 Mike McGrath 宣布了一个引发开源软件社区分裂的声明。 在一篇题为《[推进 CentOS Stream 进化](https://mp.weixin.qq.com/s?__biz=MzA3NjAyNDMyMg==&mid=2649849069&idx=1&sn=b73b4d4bd9541591f59735ca808193af&chksm=87624380b015ca96e086fbd83cd4debf21af148d28f9930ccf58e7b842e2346c720fc72ab31c&scene=21#wechat_redirect)》的 318 个单词的博客文章中,McGrath 宣布,全球最大的开源软件供应商、总部位于美国罗利的红帽公司将开始只向付费用户提供其旗舰产品——红帽企业级 Linux(RHEL)的源代码。 在大多数行业中,这样的决定并不会引起争议。一般来说,只有付费的客户才有权使用一项产品或服务。但在开源的环境中,自由获取信息是至关重要的,因此,许多人认为,红帽公司对红帽企业 Linux(RHEL)实施付费墙的决定是对开源的亵渎。 新政策的发布在网络上引发了轩然大波。McGrath 后来对《<ruby> 新闻与观察家 <rt> The News &amp; Observer </rt></ruby>》栏目说:“发布这篇博客文章一两个小时之后,他们就都知道了。” 最初的反应是惊讶和愤怒混合在一起。“RHEL 的付费墙可能威胁到红帽公司的长期发展,”一条推特这样写到。 一个观看次数高达 10 万次的 YouTube 视频中,科技评论员 Chris Titus 疑惑,这是否预示着开源运动发生了巨变,在过去的 40 年中,开源已从由草根爱好者推动的亚文化转变为由企业大力支持的重要运动。 他说:“我从未想过会有一天看到红帽对我们封闭源代码。” 如今,基本上每个人都会以某种方式接触到开源软件。它为无数的日常工作提供了便利:预订机票、申请共享乘车服务、访问医疗保健门户网站、使用智能电视等等。而且,开源软件已经广泛渗透到大型企业中,红帽宣称,超过 90% 的财富 500 强企业都在使用他们的服务。 开源软件的关键在于信息的自由交流。由众多的付费和志愿程序员构成的社区持续强化着开源,他们反对把代码局限在专有权后面。他们坚信,只有更多的人关注代码,软件的性能和安全性才会得到提高。 因此,对于红帽公司的举动引发了人们强烈的反弹,这并不令人意外。 “我只知道红帽公司是唯一一家实行付费墙的(公司),”曾在 2017 年出版的书籍《<ruby> 为了乐趣和利润 <rt> For Fun and Profit </rt></ruby>》中详述开源软件兴起的 Chris Tozzi 说,“这对开源社区来说是一个分歧问题。对我来说,这正是整个故事的关键。社区已经不能就开源如何运作达成共识。” Tozzi 指出,开源许可证的变化有可能使公众使用软件的方式复杂化,人们也开始担忧会有更多的公司效仿红帽。如果此种状况成为趋势,参与贡献代码的开发者数量将会减少,而公司可能会开始感受到为其代码收费的压力。 McGrath 承认,红帽的员工也对新政策感到矛盾。“我想即使是我们公司内部的同事都未能完全理解我们到底宣布了什么和原因,”他说。 他回忆说,一些反感是针对个人的:有些人指控他是红帽母公司 IBM 派来的人,目的是摧毁这家位于三角洲地区,在当地有着 2000 多名员工、已有 30 年历史的软件公司。 “无论在决策之前、期间还是之后,IBM 的任何人都没跟我讨论过这个问题,”在红帽工作了 16 年的 McGrath 说,“我总是被那些认为 IBM 的高管会开会讨论 CentOS 和重新构建者的人们逗笑。我认为他们可能并不真正了解 CentOS。” 在发布博客文章的五天之后,McGrath 在该公司网站上发布了 [更长篇的信息](https://mp.weixin.qq.com/s/RELpVQ541cQgU7wkyhVjEQ)。他并没有退缩,反而重申了红帽停止向非付费客户提供自由获取 RHEL 代码的决定。 他写道,问题在于有一些新兴的竞争者会完全复制红帽企业版 Linux,甚至连代码中的错误都不放过,然后免费把这些红帽的复制品提供给客户。他认为,这并不是社区成员在增加价值,而是釜底抽薪的竞争对手。今年,红帽公司裁员了总工作人员的 4%,McGrath 表示,该公司没有理由允许这种情况继续下去。 “我认为,虽然在社区与商业之间做出这个决定是困难的,但我们始终坚持自己选择的道路是对的,”他告诉《新闻与观察家》。 然而,不是所有人都同意他的看法。 ### “自由”应理解为言论自由,而非免费啤酒的“免费” 红帽争议背后的关键,被认为是理解开源如何开始,以及具体含义。 “这要追溯到几十年前,”Tozzi 表示,“深植于人心的一种观念便是,掌握控制权是至关重要的。而红帽公司剥夺了一定程度的控制权。” 1984 年,研究员理查德·斯托尔曼发布了名为 GNU 的软件项目。他为 GNU 提供了自由的许可,唯一的条件就是用户需要签署被称为 “GNU 通用公共许可证” 的协议,这其中包含了四条基本原则。现在被称为 GPL 的这份协议重申了人们享有使用、更改、分享,甚至重新打包并销售软件的权利。 对斯托尔曼而言,自由意味着没有任何限制,但并不必然代表不收费。“自由,犹如言论的自由,而非免费的啤酒,”他曾经这样形象地描述过。 GNU 与那时世界上最大的软件操作系统 —— 微软的 Windows,在理念上形成鲜明对比。Windows 是封闭且专有的,1985 年,微软首个 Windows 操作系统以 99 美元的价格上市。 然而当时,GNU 存在一个明显的局限,它缺少了被称为“内核”的软件部分,这是操作系统的关键部件。直到 1991 年,芬兰学生林纳斯·托瓦兹创造了一个名为 Linux 的 PC 操作系统内核。受斯托尔曼的启发,托瓦兹授权任何人对 Linux 进行商业性重新打包,只要他们同意 GPL。 “Linux 是在最佳时机推出的最佳产品,”Michael Tiemann 说,他是 1989 年参与创立世界上第一家商业开源公司 —— Cygnus Solutions 的软件工程师,而该公司后来被红帽收购。 ### 红帽接管(开源)世界 Linux 的关键优势之一,如 Tiemann 所言,是它的代码是可见的。如果将 Linux 比作一辆汽车并存在故障,车主并不需要依赖特定的制造商来修复它。反之,一个由成千上万的“修理工”所组成的贡献者社区,就可以进行维修,所有人都可以进行检查。 红帽在这种免费的软件中看到了商业机会。该公司于 1993 年由联合创始人 <ruby> 马克·尤因 <rt> Marc Ewing </rt></ruby> 在位于达勒姆的公寓内创办。公司在最初几年推出了定制版本的 Linux 操作系统光盘,并在书店向计算机科学爱好者销售。 到了 90 年代末,红帽已在企业界取得一席之地。2001 年,红帽发布了第一个面向企业的红帽企业版 Linux(RHEL)。该公司开始销售 RHEL 订阅访问,而非 CD,用于提供咨询和安全服务。 红帽公司不断发展壮大——无论是在业界还是在这个三角洲地区。2013 年,公司将超过 700 名员工转移到了位于罗利市中心新的总部大楼。六年后,IBM 以 340 亿美金的价格收购了这家软件公司。 Tozzi 表示:“就大多数评价指标来看,红帽是历史上最成功的开源公司。在财务成功和在开源社区领导地位方面,我无法想出哪一个公司能与其相匹敌。” 红帽不再是一家弱小的公司,而是随着许多大企业的加入而持续发展。自从被 IBM 收购以来,除了一个财务季度外,公司的收入每个财务季度都实现了两位数的增长。在 2022 年对近 1300 名技术领导者进行的调查显示,有更多的受访者表示他们使用的是开源软件而非专有软件。 McGrath 说:“我认为,那种业余爱好者在业余时间开发开源软件的浪漫景象已经过去了。尽管这样的空间仍然存在——我们依然有这样的场景——但是大部分的开源软件现在都是由全职员工开发的。” ### 截流下游克隆 Linux 内核是由成千上万人共同打造的操作系统之一。其中一些人是业余时间贡献代码的无薪爱好者,其他人则直接受雇于谷歌、Meta、红帽乃至微软等大型科技公司,在工作中编写代码并将其“上游”至 Linux 内核。 红帽公司制作企业版 Linux(RHEL),主要是对来自上游源(包括 Linux 内核和红帽所拥有的 Fedora 项目)的这些免费代码进行重新打包。类似地,直到最近,下游发行版都能直接获取 RHEL 的代码,并通过被称为“复刻”的过程自行重新打包。同时,它们也能将代码贡献给上游的 RHEL。 然而今年,红帽认为下游发行版回馈上游的代码不多,使其无法忽视它们的抄袭行为。 Tiemann 表示:“在许多情况下,开源中的自由使用更多是特性而非缺点。”他在红帽公司待了二十多年后于去年离开。“在这特定例子中,红帽基本上是说,‘你知道吗?这已不再是特性了。’” 这并非红帽第一次朝这个方向发展,早在 2020 年底,公司就宣布将终止 CentOS Linux,它曾经一直是红帽企业版 Linux 认可的免费版本。为弥补这一空缺,下一年就涌现出两个知名的下游 RHEL 发行版,Rocky Linux 和 AlmaLinux,它们都宣称自己与 RHEL 是连错误都一样的复制品。AlmaLinux 的基础设施团队负责人 Jonathan Wright 说:“实际上,就各种方面而言它们几乎完全相同。” 他继续说:“我们把红帽的名字剔除,然后重新打包发布。基本上是,保证不会侵犯他们的商标。” 尽管他的非营利组织的目标是克隆,Wright 仍然认为红帽限制 RHEL 代码的行动违反了“GPL 精神”。 他认为,像 AlmaLinux 这样无费用的下游副本吸引了更大规模、更多元化的贡献者加入开源社区,而这个社区自称是靠 “人多力量大” 而发展壮大的。 Wright 说:“(开源的)的基础是让每个人都能消费和使用你的作品。无论他是在世界另一端几乎无法上网的人,还是身处美国的世界 500 强公司。我认为这就是理查德·斯托尔曼当年的初衷。” Wright 和其他批评红帽公司政策转变的人还指出,RHEL本身是基于他人可得的编码贡献,尽管他承认红帽公司的员工做了大量工作,使 RHEL 成为有用、稳定和广泛流行的消费产品。他还表示自成立以来,AlmaLinux 已经向更广泛的开源生态系统贡献了代码。 ### 开源社区向前发展 McGrath 并没有对那些依赖 RHEL 一比一复制版的用户带来多少安慰。他们可以继续使用下游版本,寻找其他的提供商,或者选择付钱给红帽。 “我认为(人们)过于习惯了原有的工作方式,”他表示,“一些大公司的人可能需要红帽的支持,但他们却不甘心为此支付。对此我无能为力……因为我们并没什么好说的。” 自从做了 RHEL 决定以来,红帽已经获得了几个重要的合作伙伴。九月份时,云计算软件公司 Salesforce 将其 20 万套系统从免费的 CentOS Linux 迁移到了红帽企业级 Linux。同月,红帽还宣布 RHEL 将开始支持甲骨文的云架构。今年夏季时,甲骨文是少数公开批评红帽将其最流行的代码设置了付费壁垒的大公司之一。 10 月 24 日,数据安全公司 Cohesity 表示它也会放弃 CentOS Linux 转而选择使用 RHEL,这又是红帽的另一场胜利。 McGrath 反驳了 RHEL 被设置付费壁垒的说法,他表示人们仍然可以通过一个名为 CentOS Stream 的发行版在上游免费获取代码,这是 RHEL 的测试版本。 批评人士注意到,CentOS Stream 与 RHEL 源代码不同,因为它处于开发过程的早期。Wright 使用了烹饪的比喻来形容它:CentOS Stream 提供的可能是配料,但不是确切的比例。 非客户仍然可以访问红帽其他程序的源代码,如自动化平台 Ansible。 10 月中旬,Wright 从阿拉巴马的伯明翰出发,参加了每年在罗利举办的开源活动《All Things Open 大会》,红帽是会议的主要赞助商之一。 他提到:“我被问的每一个问题都是这次变革对我们的影响。” 在 7 月份,AlmaLinux 正式改变了其目标,相反这个非营利组织声明它不再是 RHEL 的精确副本,而是一个兼容于 RHEL 的操作系统。三个月后,Wright 说道,红帽的决定实际上使 AlmaLinux 变得更好了。 “就像我们已经摘掉了拐杖一样,”他说,“我们现在开始走自己的路了。” 那么他现在是否同意红帽的决定了呢? 完全不同意。 Wright 坚信,这个位于罗利的软件巨头在今年夏天对 GPL 进行了快速和不严谨的摆弄。对许多开源信仰者来说,这样对待他们视为神圣的文本的威胁是不能宽恕的。 *(题图:MJ/ba400e7a-8692-4935-8270-dac2e8f45acc)* --- via: <https://www.newsobserver.com/news/business/article279099964.html> 作者:[Brian Gordon](https://www.newsobserver.com/profile/263041588) 译者:[ChatGPT](https://linux.cn/lctt/ChatGPT) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
null
HTTPSConnectionPool(host='www.newsobserver.com', port=443): Read timed out. (read timeout=10)
null
16,357
如何在 Vim 中剪切、复制和粘贴
https://itsfoss.com/vim-cut-copy-paste/
2023-11-07T17:24:31
[ "Vim", "编辑器" ]
https://linux.cn/article-16357-1.html
![](/data/attachment/album/202311/07/172330q49ttt4ee9r86u39.png) > > 在本篇 Vim 快速技巧中,你将学习到剪切和复制粘贴的相关知识。 > > > 剪切、复制和粘贴文本是文本编辑中最基本的任务之一,我们都知道 Vim 有不同的处理方式。 这意味着,在你掌握它之前,你会害怕它,一旦你掌握了它,它就只是一个兔子洞。 虽然我将详细介绍剪切、复制和粘贴,但这里是本教程的基本摘要,以帮助你开始使用: | **按键** | **描述** | | --- | --- | | `yiw` | 复制当前单词。 | | `yy` | 复制整行。 | | `diw` | 剪切当前单词。 | | `dd` | 剪掉整行。 | | `p` | 粘贴文本。 | 别担心,Vim 为你提供的选项比我上面提到的要多得多。 在本教程中,我将引导你完成以下内容: * 如何在 Vim 中复制文本 * 如何在 Vim 中剪切文本 * 如何在 Vim 中粘贴文本 * 如何使用可视模式在 Vim 中剪切和复制文本 那么让我们从第一个开始。 ### 如何在 Vim 编辑器中复制文本 虽然我们使用术语“复制”,但 Vim 有一个不同的术语,称为 “<ruby> 扽出 <rt> yank </rt></ruby>”,因此从现在开始,我将使用“扽出”而不是“复制”。 正如我之前提到的,你可以使用多种方法在 Vim 中扽出文本,以下是一些有用的方法: | 命令 | 描述 | | --- | --- | | `nyy` 或 `nY` | 扽出(复制)当前行和接下来的 `n-1` 行。例如,`3yy` 复制当前行及其下面的两行。 | | `yaw` | 扽出(复制)光标所在的当前单词。 | | `yy` 或 `Y` | 扽出(复制)整个当前行。 | | `y$` | 扽出(复制)从光标到行尾的文本。 | | `y^` 或 `y0` | 扽出(复制)从光标到行首的文本。 | 要在 Vim 中扽出,请执行以下 3 个简单步骤: 1. 按 `Esc` 键切换到正常模式 2. 移动到要复制的行或单词 3. 按上表中的相关命令,你的文本将被复制 想学习交互式复制行的方式吗? 跳到本教程的最后一部分。 ### 如何在 Vim 编辑器中剪切文本 在 Vim 中,你没有任何删除文本的选项。取而代之的是剪切文本,因此删除和剪切文本与 Vim 中的操作类似。 要在 Vim 中剪切文本,请按 `d` 命令。但你永远不会在没有任何选项的情况下使用 `d` 命令。你总是会添加一些东西来做更多操作。 因此,你可以使用以下一些实用方法使用 `d` 命令剪切文本: | 命令 | 描述 | | --- | --- | | `dd` | 剪切整个当前行。 | | `d$` | 将文本从光标剪切到行尾。 | | `d^` 或 `d0` | 将文本从光标剪切到行首。 | | `ndd` 或 `dN` | 剪切当前行和接下来的 `n-1` 行。例如,`3dd` 剪切当前行及其下面的两行。 | | `daw` | 剪切光标所在的当前单词。 | 假设我想从文件中剪切前 4 行,然后我需要使用 `4dd`,我是这样做的: ![](/data/attachment/album/202311/07/172432w9s9ve9u4v468csf.gif) ### 如何在 Vim 编辑器中粘贴文本 在 Vim 中复制或剪切文本后,只需按 `p` 键即可粘贴它。 你可以多次按 `p` 键多次粘贴文本,也可以使用 `np`,其中 `n` 是要粘贴文本的次数。 例如,在这里,我粘贴了之前复制了三遍的行: ![](/data/attachment/album/202311/07/172432c41w8aaq1lxjv1p1.gif) 就是这么简单! ### 如何通过选择文本来剪切和复制文本 如果你使用过 GUI 文本编辑器,那么你肯定习惯于通过选择文本来复制和剪切文本。 让我们从如何通过在 Vim 中选择文本来复制开始。 #### 通过选择文本复制 要在可视模式下复制文本,请执行以下 3 个简单步骤: 1. 移动到要开始选择的地方 2. 按 `Ctrl + v` 启用可视模式 3. 使用箭头键进行选择 4. 按 `y` 键复制所选文本 例如,在这里,我使用可视模式复制了 4 行: ![](/data/attachment/album/202311/07/172432coxvtncbjmnv0v97.gif) 如果你注意到,当我按下 `y` 键,它就会显示有多少行被扽出(复制)。就我而言,有 4 行被复制。 #### 在 Vim 中选择文本来剪切文本 要在 Vim 中以可视模式剪切文本,你所要做的就是遵循 4 个简单步骤: 1. 移动到要剪切的位置 2. 按 `Ctrl + v` 切换到可视模式 3. 使用箭头键选择要剪切的行 4. 按 `d` 键剪切选定的行 假设我想剪掉 4 行,那么我会这样做: ![](/data/attachment/album/202311/07/172432ocy7myhmsu5m5u45.gif) 挺容易。是吧? ### 更多关于 Vim 的内容 你知道 Vim 有多种模式吗? [了解有关 Vim 中不同模式的更多信息](https://linuxhandbook.com/vim-modes/)。 想提高你的 Vim 水平吗?请参阅 [成为 Vim 专业用户的提示和技巧](https://linuxhandbook.com/pro-vim-tips/)。 我希望本指南对你有所帮助。 *(题图:MJ/3555eed2-ab14-433d-920f-17b80b46ce74)* --- via: <https://itsfoss.com/vim-cut-copy-paste/> 作者:[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
200
OK
![Warp Terminal](/assets/images/warp-terminal.webp) ![Warp Terminal](/assets/images/warp-terminal.webp) Cutting, copying, and pasting text is one of the most basic tasks in text editing and we all know Vim has a different way of doing things. This means until you get a hang of it, you fear it and once you get a grip, it is nothing but a rabbit hole. While I'll address cut, copy, and paste in detail, here's a basic summary of this tutorial to get things started: Action | Description | ---|---| `yiw` | Copy the current word. | `yy` | Copy the whole line. | `diw` | Cut the current word. | `dd` | Cut the whole line. | `p` | Paste text. | Don't worry, Vim gives you much more options than what I've mentioned above. In this tutorial, I will walk you through the following: - How to copy text in Vim - How to cut text in Vim - How to paste text in Vim - How to cut and copy text in Vim using Visual mode So let's start with the first one. ## How to copy the text in the Vim editor While we use the term copy, Vim has a different term called `yank` so from now on, I will be using Yank instead of copy. As I mentioned earlier, you get multiple ways to yank text in Vim, and here are some useful ones: Command | Description | ---|---| `nyy` or `nY` | Yanks (copies) the current line and the next `n-1` lines. For example, `3yy` copies the current line and the two lines below it. | `yaw` | Yanks (copies) the current word the cursor is on. | `yy` or `Y` | Yanks (copies) the entire current line. | `y$` | Yanks (copies) text from the cursor to the end of the line. | `y^` or `y0` | Yanks (copies) text from the cursor to the beginning of the line. | To yank in Vim, follow 3 simple steps: - Press the `Esc` key to switch to the normal mode - Navigate to a line or a word that you want to copy - Press the relative command from the above table and your text will be copied Want to learn the interactive way to copy lines? Skip to the last section of this tutorial. ## How to cut text in the Vim editor In Vim, you don't have any option to delete the text. Instead, you cut the text so you the delete and cut the text are similar things in Vim. To cut text in Vim, you press the `d` command. But you never use the `d` command without any opinions. You always add something to it to get more out of it. So here are some practical ways you can cut the text using the `d` command: Command | Description | ---|---| `dd` | Cuts the entire current line. | `d$` | Cuts text from the cursor to the end of the line. | `d^` or `d0` | Cuts text from the cursor to the beginning of the line. | `ndd` or `dN` | Cuts the current line and the next `n-1` lines. For example, `3dd` cuts the current line and the two lines below it. | `daw` | Cuts the current word the cursor is on. | Let's say I want to cut the first 4 lines from my file, then I need to use `4dd` and here's how I did it: ![Cut multiple lines in the Vim editor](https://itsfoss.com/content/images/2023/10/Cut-multiple-lines-in-the-Vim-editor.gif) ## How to paste text in the Vim editor After copying or cutting text in Vim, you can simply paste it by pressing the `p` key. You can press the `p` key multiple times to paste text multiple times or use `np` where the `n` is the number of how many times you want to paste the text. For example, here, I pasted lines that I copied previously three times: ![paste lines in Vim](https://itsfoss.com/content/images/2023/10/paste-lines-in-Vim-editor.gif) It's that easy! ## How to cut and copy text by selecting it If you are coming from GUI text editors, you must be used to copying and cutting text by selecting it. So let's start with how you copy text by selecting it in Vim. ### Copy the text by selecting it To copy the text in visual mode, follow 3 simple steps: - Go to the point from where you want to start the selection - Press `Ctrl + v` to enable the visual mode - Use arrow keys to make a selection - Press the `y` key to copy the selected text For example, here, I copied 4 lines using the visual mode: ![Copy lines in vim by selecting them](https://itsfoss.com/content/images/2023/10/Copy-lines-in-vim-by-selecting-them.gif) If you notice, once I pressed the `y` key, it showed how many lines were yanked (copied). In my case, 4 lines were yanked. ### Cut the text by selecting it in Vim To cut the text in Vim in visual mode, all you have to do is follow 4 simple steps: - Navigate to a point from where you want to cut lines - Press `Ctrl + v` to switch to visual mode - Use arrow keys to select the lines you want to cut - Press the `d` key to cut the selected lines So let's say I want to cut 4 lines, then, this is how I'd do it: ![Cut lines in Vim by selecting them](https://itsfoss.com/content/images/2023/10/Cut-lines-in-Vim-by-selecting-them.gif) Pretty easy. Right? ## More on Vim Did you know that there are multiple modes in Vim? [Learn more about different modes in Vim:](https://linuxhandbook.com/vim-modes/) [What are Vim Modes? How to Change Them?Vim has three different modes for handling user input and processing them.](https://linuxhandbook.com/vim-modes/)![](https://linuxhandbook.com/content/images/2022/04/vim-modes.png) ![](https://linuxhandbook.com/content/images/2022/04/vim-modes.png) Want to step up your Vim game? Refer to [tips and tricks to become a pro-Vim user](https://linuxhandbook.com/pro-vim-tips/): [11 Pro Vim Tips to Get Better Editing ExperienceYou can learn plenty of Vim tips on your own, or you can learn it from others’ experiences.](https://linuxhandbook.com/pro-vim-tips/)![](https://linuxhandbook.com/content/images/2022/08/pro-vim-tips.png) ![](https://linuxhandbook.com/content/images/2022/08/pro-vim-tips.png) I hope you will find this guide helpful.