mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-03 23:40:14 +08:00
commit
eaa990d6e6
@ -3,48 +3,42 @@
|
||||
[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (cool-summer-021)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-15178-1.html)
|
||||
|
||||
优化 Kubernetes 中的 Java 无服务器函数
|
||||
======
|
||||
|
||||
在 Kubernetes 中以更快的启动速度和更小的内存占用运行无服务器函数
|
||||
![Ship captain sailing the Kubernetes seas][1]
|
||||
> 在 Kubernetes 中运行无服务器函数时,实现更快的启动速度和更小的内存占用。
|
||||
|
||||
由于运行上千个应用程序集群所耗费的资源多,令它实现较少工作节点和资源占用所需成本也较高,所以在使用 [Kubernetes][2] 时,快速启动和较少的内存占用是至关重要的。在 Kubernetes 平台运行容器化微服务时,内存占用是比吞吐量更重要的考量因素,这是因为:
|
||||
|
||||
* 由于需要持续运行,所以耗费资源更多(不同于 CPU 周期)
|
||||
* 微服务令管理成本成倍增加
|
||||
* 一个庞大的应用程序变为若干个微服务的情况(例如20个微服务占用的存储空间一共有20GB)
|
||||
![](https://img.linux.net.cn/data/attachment/album/202210/26/151603a4a44w1a71zk8b11.jpg)
|
||||
|
||||
由于运行上千个应用程序<ruby>容器荚<rt>Pod</rt></ruby>所耗费的资源多,令它实现较少工作节点和资源占用所需成本也较高,所以在使用 [Kubernetes][2] 时,快速启动和较少的内存占用是至关重要的。在 Kubernetes 平台运行容器化微服务时,内存占用是比吞吐量更重要的考量因素,这是因为:
|
||||
|
||||
* 由于需要持续运行,所以耗费资源更多(不同于 CPU 占用)
|
||||
* 微服务令开销成本成倍增加
|
||||
* 一个单体应用程序变为若干个微服务的情况(例如 20 个微服务占用的存储空间约有 20GB)
|
||||
|
||||
这些情况极大影响了无服务器函数的发展和 Java 部署模型。到目前为止,许多企业开发人员选择 Go、Python 或 Node.js 这些替代方案来解决性能瓶颈,直到出现了 [Quarkus][3] 这种基于 kubernetes 的原生 Java 堆栈,才有所改观。本文介绍如何在使用了 Quarkus 的 kubernetes 平台上进行性能优化,以便运行无服务器函数。
|
||||
|
||||
### 容器优先的设计理念
|
||||
|
||||
由于 Java 生态系统中传统的框架都要进行框架的初始化,包括配置文件的处理、classpath 的扫描、类加载、注解的处理以及构建元模型,这些过程都是必不可少的,所以它们都比较耗费资源。如果使用了几种不同的框架,所耗费的资源也是成倍增加。
|
||||
由于 Java 生态系统中传统的框架都要进行框架的初始化,包括配置文件的处理、`classpath` 的扫描、类加载、注解的处理以及构建元模型,这些过程都是必不可少的,所以它们都比较耗费资源。如果使用了几种不同的框架,所耗费的资源也是成倍增加。
|
||||
|
||||
Quarkus 通过“向左移动”,把所有的资源开销大的操作都转移到构建阶段,解决了这些 Java 性能问题。在构建阶段进行代码和框架分析、字节码转换和动态元模型生成,而且只有一次,结果是:运行时可执行文件经过高度优化,启动非常快,不需要经过那些传统的启动过程,全过程只在构建阶段执行一次。
|
||||
Quarkus 通过“<ruby>左移<rt>shifting left</rt></ruby>”,把所有的资源开销大的操作都转移到构建阶段,解决了这些 Java 性能问题。在构建阶段进行代码和框架分析、字节码转换和动态元模型生成,而且只有一次,结果是:运行时可执行文件经过高度优化,启动非常快,不需要经过那些传统的启动过程,全过程只在构建阶段执行一次。
|
||||
|
||||
![Quarkus Build phase][4]
|
||||
|
||||
(Daniel Oh, [CC BY-SA 4.0][5])
|
||||
|
||||
更重要的是:Quarkus 支持构建原生可执行文件,它具有良好性能,包括快速启动和极小的 RSS 内存占用,跟传统的云原生 Java 栈相比,具备即时扩展的能力和高密度的内存利用。
|
||||
更重要的是:Quarkus 支持构建原生可执行文件,它具有良好性能,包括快速启动和极小的<ruby>驻留集大小<rt>resident set size</rt></ruby>(RSS)内存占用,跟传统的云原生 Java 栈相比,具备即时扩展的能力和高密度的内存利用。
|
||||
|
||||
![Quarkus RSS and Boot Time Metrics][7]
|
||||
|
||||
(Daniel Oh, [CC BY-SA 4.0][5])
|
||||
这里有个例子,展示如何使用 Quarkus 将一个 [Java 无服务器][8] 项目构建为本地可执行文件。
|
||||
|
||||
这里有个例子,展示如何使用 Quarkus 将一个 [Java 无服务器][8]项目构建为本地可执行文件。
|
||||
|
||||
### 1\. 使用 Quarkus 创建无服务器 Maven 项目
|
||||
|
||||
以下命令生成一个 Quarkus 项目,(例如`quarkus-serverless-native`)以此创建一个简单的函数:
|
||||
### 1、使用 Quarkus 创建无服务器 Maven 项目
|
||||
|
||||
以下命令生成一个 Quarkus 项目,(例如 `quarkus-serverless-native`)以此创建一个简单的函数:
|
||||
|
||||
```
|
||||
$ mvn io.quarkus:quarkus-maven-plugin:1.13.4.Final:create \
|
||||
@ -53,13 +47,12 @@ $ mvn io.quarkus:quarkus-maven-plugin:1.13.4.Final:create \
|
||||
-DclassName="org.acme.getting.started.GreetingResource"
|
||||
```
|
||||
|
||||
### 2\. 构建一个本地可执行文件
|
||||
### 2、构建一个本地可执行文件
|
||||
|
||||
你需要使用 GraalVM 为 Java 程序构建一个本地可执行文件。你可以选择 GraalVM 的任何发行版,例如 [Oracle GraalVM Community Edition (CE)][9] 或 [Mandrel][10](Oracle GraalVM CE 的下游发行版)。Mandrel 是为支持 OpenJDK 11 上的 Quarkus-native 可执行文件的构建而设计的。
|
||||
|
||||
打开 `pom.xml`,你将发现其中的 `native` 设置。你将使用它来构建本地可执行文件。
|
||||
|
||||
|
||||
```
|
||||
<profiles>
|
||||
<profile>
|
||||
@ -71,51 +64,45 @@ $ mvn io.quarkus:quarkus-maven-plugin:1.13.4.Final:create \
|
||||
</profiles>
|
||||
```
|
||||
|
||||
> **注意:** 你可以在本地安装 GraalVM 或 Mandrel 发行版。你也可以下载 Mandrel 容器映像来构建它(像我那样),因此你还需要在本地运行一个容器引擎(例如 Docker)。
|
||||
> **注意:** 你可以在本地安装 GraalVM 或 Mandrel 发行版。你也可以下载 Mandrel 容器映像来构建它(像我那样),因此你还需要在本地运行一个容器引擎(例如 Docker)。
|
||||
|
||||
假设你已经打开了容器运行时,此时需要运行一下 Maven 命令:
|
||||
|
||||
使用 [Docker][11] 作为容器引擎
|
||||
|
||||
使用 [Docker][11] 作为容器引擎:
|
||||
|
||||
```
|
||||
$ ./mvnw package -Pnative \
|
||||
-Dquarkus.native.container-build=true \
|
||||
-Dquarkus.native.container-runtime=docker
|
||||
-Dquarkus.native.container-build=true \
|
||||
-Dquarkus.native.container-runtime=docker
|
||||
```
|
||||
|
||||
使用 [Podman][12] 作为容器引擎
|
||||
|
||||
使用 [Podman][12] 作为容器引擎:
|
||||
|
||||
```
|
||||
$ ./mvnw package -Pnative \
|
||||
-Dquarkus.native.container-build=true \
|
||||
-Dquarkus.native.container-runtime=podman
|
||||
-Dquarkus.native.container-build=true \
|
||||
-Dquarkus.native.container-runtime=podman
|
||||
```
|
||||
|
||||
输出信息结尾应当是 `BUILD SUCCESS`。
|
||||
|
||||
![Native Build Logs][13]
|
||||
|
||||
(Daniel Oh, [CC BY-SA 4.0][5])
|
||||
|
||||
不借助 JVM 直接运行本地可执行文件:
|
||||
|
||||
|
||||
```
|
||||
`$ target/quarkus-serverless-native-1.0.0-SNAPSHOT-runner`
|
||||
$ target/quarkus-serverless-native-1.0.0-SNAPSHOT-runner
|
||||
```
|
||||
|
||||
输出信息类似于:
|
||||
|
||||
|
||||
```
|
||||
__ ____ __ _____ ___ __ ____ ______
|
||||
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
|
||||
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
|
||||
\--\\___\\_\\____/_/ |_/_/|_/_/|_|\\____/___/
|
||||
INFO [io.quarkus] (main) quarkus-serverless-native 1.0.0-SNAPSHOT native
|
||||
(powered by Quarkus xx.xx.xx.) Started in 0.019s. Listening on: <http://0.0.0.0:8080>
|
||||
__ ____ __ _____ ___ __ ____ ______
|
||||
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
|
||||
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
|
||||
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
|
||||
INFO [io.quarkus] (main) quarkus-serverless-native 1.0.0-SNAPSHOT native
|
||||
(powered by Quarkus xx.xx.xx.) Started in 0.019s. Listening on: http://0.0.0.0:8080
|
||||
INFO [io.quarkus] (main) Profile prod activated.
|
||||
INFO [io.quarkus] (main) Installed features: [cdi, kubernetes, resteasy]
|
||||
```
|
||||
@ -124,14 +111,12 @@ INFO [io.quarkus] (main) Installed features: [cdi, kubernetes, resteasy]
|
||||
|
||||
使用 Linux 的 `ps` 工具检测一下,结果内存占用还是很低。检测的方法是:在应用程序运行期间,另外打开一个终端,运行如下命令:
|
||||
|
||||
|
||||
```
|
||||
`$ ps -o pid,rss,command -p $(pgrep -f runner)`
|
||||
$ ps -o pid,rss,command -p $(pgrep -f runner)
|
||||
```
|
||||
|
||||
输出结果类似于:
|
||||
|
||||
|
||||
```
|
||||
PID RSS COMMAND
|
||||
10246 11360 target/quarkus-serverless-native-1.0.0-SNAPSHOT-runner
|
||||
@ -141,7 +126,6 @@ INFO [io.quarkus] (main) Installed features: [cdi, kubernetes, resteasy]
|
||||
|
||||
> **注意:** 各种应用程序(包括 Quarkus)的驻留集大小和内存占用,都因运行环境而异,并随着应用程序载入而上升。
|
||||
|
||||
|
||||
你也可以使用 REST API 访问这个函数。输出结果应该是 `Hello RESTEasy`:
|
||||
|
||||
```
|
||||
@ -149,18 +133,16 @@ $ curl localhost:8080/hello
|
||||
Hello RESTEasy
|
||||
```
|
||||
|
||||
### 3\. 把函数部署到 Knative 服务
|
||||
|
||||
如果你还没有创建命名空间,现在就在 [OKD][15] (OpenShift Kubernetes 发行版)[创建一个命名空间][14](例如 `quarkus-serverless-native`),进而把这个本地可执行文件部署为无服务器函数。然后添加 `quarkus-openshift` 扩展:
|
||||
### 3、把函数部署到 Knative 服务
|
||||
|
||||
如果你还没有创建命名空间,现在就在 [OKD][15](OpenShift Kubernetes 发行版)[创建一个命名空间][14](例如 `quarkus-serverless-native`),进而把这个本地可执行文件部署为无服务器函数。然后添加 `quarkus-openshift` 扩展:
|
||||
|
||||
```
|
||||
`$ ./mvnw -q quarkus:add-extension -Dextensions="openshift"`
|
||||
$ ./mvnw -q quarkus:add-extension -Dextensions="openshift"
|
||||
```
|
||||
|
||||
向 `src/main/resources/application.properties` 文件中添加以下内容,配置 Knative 和 Kubernetes 的相关资源:
|
||||
|
||||
|
||||
```
|
||||
quarkus.container-image.group=quarkus-serverless-native
|
||||
quarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000
|
||||
@ -173,77 +155,71 @@ quarkus.openshift.build-strategy=docker
|
||||
|
||||
构建本地可执行文件,并把它直接部署到 OKD 集群:
|
||||
|
||||
|
||||
```
|
||||
`$ ./mvnw clean package -Pnative`
|
||||
$ ./mvnw clean package -Pnative
|
||||
```
|
||||
|
||||
> **Note:** 提前使用 `oc login` 命令,确保登录的是正确的项目(例如 `quarkus-serverless-native`)。
|
||||
> **注意:** 提前使用 `oc login` 命令,确保登录的是正确的项目(例如 `quarkus-serverless-native`)。
|
||||
|
||||
输出信息结尾应当是 `BUILD SUCCESS`。完成一个本地二进制文件的构建并部署为 Knative 服务需要花费几分钟。成功创建服务后,使用 `kubectl` 或 `oc` 命令工具,可以查看 Knative 服务和版本信息:
|
||||
|
||||
|
||||
```
|
||||
$ kubectl get ksvc
|
||||
NAME URL [...]
|
||||
quarkus-serverless-native <http://quarkus-serverless-native-\[...\].SUBDOMAIN> True
|
||||
NAME URL [...]
|
||||
quarkus-serverless-native http://quarkus-serverless-native-[...].SUBDOMAIN True
|
||||
|
||||
$ kubectl get rev
|
||||
NAME CONFIG NAME K8S SERVICE NAME GENERATION READY REASON
|
||||
quarkus-serverless-native-00001 quarkus-serverless-native quarkus-serverless-native-00001 1 True
|
||||
NAME CONFIG NAME K8S SERVICE NAME GENERATION READY REASON
|
||||
quarkus-serverless-native-00001 quarkus-serverless-native quarkus-serverless-native-00001 1 True
|
||||
```
|
||||
|
||||
### 4\. 访问本地可执行函数
|
||||
### 4、访问本地可执行函数
|
||||
|
||||
运行 `kubectl` 命令,搜索无服务器函数的节点:
|
||||
|
||||
|
||||
```
|
||||
`$ kubectl get rt/quarkus-serverless-native`
|
||||
$ kubectl get rt/quarkus-serverless-native
|
||||
```
|
||||
|
||||
输出信息类似于:
|
||||
|
||||
|
||||
```
|
||||
NAME URL READY REASON
|
||||
quarkus-serverless-native <http://quarkus-serverless-restapi-quarkus-serverless-native.SUBDOMAIN> True
|
||||
NAME URL READY REASON
|
||||
quarkus-serverless-native http://quarkus-serverless-restapi-quarkus-serverless-native.SUBDOMAIN True
|
||||
```
|
||||
|
||||
用 `curl` 命令访问上述信息中的 `URL` 字段:
|
||||
|
||||
|
||||
```
|
||||
`$ curl http://quarkus-serverless-restapi-quarkus-serverless-native.SUBDOMAIN/hello`
|
||||
$ curl http://quarkus-serverless-restapi-quarkus-serverless-native.SUBDOMAIN/hello
|
||||
```
|
||||
|
||||
过了不超过一秒钟,你也会得到跟本地操作一样的结果:
|
||||
|
||||
|
||||
```
|
||||
`Hello RESTEasy`
|
||||
Hello RESTEasy
|
||||
```
|
||||
|
||||
当你在 OKD 群集中访问 Quarkus 运行中的节点的日志,你会发现本地可执行文件正在以 Knative 服务的形式运行。
|
||||
|
||||
![Native Quarkus Log][16]
|
||||
|
||||
(Daniel Oh, [CC BY-SA 4.0][5])
|
||||
|
||||
### 下一步呢?
|
||||
|
||||
你可以借助 GraalVM 发行版优化 Java 无服务器函数,从而在 Knative 中使用 Kubernetes 将它们部署为无服务器函数。Quarkus 支持在普通的微服务中使用简易配置进行性能优化。
|
||||
|
||||
本系列的下一篇文章将指导你在不更改代码的情况下跨多个无服务器平台实现可移植函数。
|
||||
|
||||
*(Daniel Oh, [CC BY-SA 4.0][5])*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/6/java-serverless-functions-kubernetes
|
||||
|
||||
作者:[Daniel Oh][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[cool-summer-021](https://github.com/cool-summer-021)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -3,15 +3,16 @@
|
||||
[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chai001125)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-15183-1.html)
|
||||
|
||||
使用 VirtualBox 安装 Linux 虚拟机
|
||||
======
|
||||
VirtualBox 能帮助任何人(即使是命令行新手)安装一个新的虚拟机。
|
||||
|
||||
![Person programming on a laptop on a building][1]
|
||||
> VirtualBox 能帮助任何人(即使是命令行新手)安装一个新的虚拟机。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202210/27/104215te6xpq2e2vvxprjs.jpg)
|
||||
|
||||
VirtualBox 能让任何人都可以轻松安装 Linux 虚拟机。你不需要有使用命令行的经验,就可以自己安装一个简单的 Linux 虚拟机。在虚拟机方面,我精通很多东西,但这篇文章将向新手展示如何安装一个 Linux 虚拟机。此外,这篇文章还概述了如何使用开源虚拟机管理程序 [VirtualBox][2] ,来运行以及安装一个测试目的的 Linux 系统。
|
||||
|
||||
@ -19,12 +20,12 @@ VirtualBox 能让任何人都可以轻松安装 Linux 虚拟机。你不需要
|
||||
|
||||
在开始之前,你需要了解在本安装教程中的两个操作系统(OS)之间的区别:
|
||||
|
||||
* **主机系统(host system):** 这指的是你安装 VirtualBox 的操作系统(即本机的操作系统)。
|
||||
* **访客系统(guest system):** 这指的是你想要在主机系统之上运行的虚拟化系统。
|
||||
* <ruby>主机系统<rt>host system</rt></ruby>:这指的是你安装 VirtualBox 的操作系统(即本机的操作系统)。
|
||||
* <ruby>客体系统<rt>guest system</rt></ruby>:这指的是你想要在主机系统之上运行的虚拟化系统。
|
||||
|
||||
在输入/输出、网络、文件访问、剪贴板、音频和视频方面,主机系统和访客系统都必须能够交互。
|
||||
在输入/输出、网络、文件访问、剪贴板、音频和视频方面,主机系统和客体系统都必须能够交互。
|
||||
|
||||
在本教程中,我将使用 Windows 10 作为 _主机系统_,[Fedora 33][3] 作为 _访客系统_。
|
||||
在本教程中,我将使用 Windows 10 作为 _主机系统_,[Fedora 33][3] 作为 _客体系统_。
|
||||
|
||||
### 安装前的准备
|
||||
|
||||
@ -37,40 +38,39 @@ VirtualBox 能让任何人都可以轻松安装 Linux 虚拟机。你不需要
|
||||
|
||||
### 准备虚拟机
|
||||
|
||||
下载你要用的 Linux 发行版的镜像文件。下载 32 位还是 64 位的操作系统映像都没有关系,因为在 32 位的主机系统上也可以启动 64 位的操作系统映像(当然内存的使用会受限),反之亦然。
|
||||
下载你要用的 Linux 发行版的镜像文件。下载 32 位还是 64 位的操作系统镜像都没有关系,因为在 32 位的主机系统上也可以启动 64 位的操作系统镜像(当然内存的使用会受限),反之亦然。
|
||||
|
||||
> **注意事项:** 如果可以的话,请下载附带有 [逻辑卷管理器][6](LVM)的 Linux 发行版。LVM 会将文件系统与物理硬盘驱动器解耦。如果你的空间不足时,这能够让你增加访客系统的硬盘驱动器的大小。
|
||||
> **注意事项:** 如果可以的话,请下载附带有 [逻辑卷管理器][6](LVM)的 Linux 发行版。LVM 会将文件系统与物理硬盘驱动器解耦。如果你的空间不足时,这能够让你增加客体系统的硬盘驱动器的大小。
|
||||
|
||||
现在,打开 VirtualBox,然后单击黄色的**新建**按钮:
|
||||
现在,打开 VirtualBox,然后单击黄色的“<ruby>新建<rt>New</rt></ruby>”按钮:
|
||||
|
||||
![VirtualBox New VM][7]
|
||||
|
||||
接下来,配置访客操作系统允许使用多少内存:
|
||||
接下来,配置客体操作系统允许使用多少内存:
|
||||
|
||||
![Set VM memory size][9]
|
||||
|
||||
我的建议是:**不要吝啬访客操作系统的内存!**
|
||||
当访客操作系统的内存不足时,访客系统将开始从随机存取存储器(RAM)转换到硬盘驱动器(hard drive),进行内存的分页,这样会极大地恶化系统的性能和响应能力。如果底层的主机系统开始分页,你很可能不会注意到。对于具有图形化桌面环境的 Linux 工作站系统,我建议至少分配 4GB 内存。
|
||||
我的建议是:**不要吝啬分配给客体操作系统使用的内存!** 当客体操作系统的内存不足时,客体系统将开始从随机存取存储器(RAM)向硬盘驱动器进行内存分页,这样会极大地恶化系统的性能和响应能力。如果底层的主机系统开始分页,你很可能不会注意到。对于具有图形化桌面环境的 Linux 工作站系统,我建议至少分配 4GB 内存。
|
||||
|
||||
接下来,创建虚拟磁盘:
|
||||
|
||||
![Create virtual hard disk][10]
|
||||
|
||||
虚拟磁盘的格式选择默认的选项 **VDI(VirtualBox 磁盘映像)** 就可以了:
|
||||
虚拟磁盘的格式选择默认的选项 “VDI(VirtualBox 磁盘镜像)” 就可以了:
|
||||
|
||||
![Selecting hard disk file type][11]
|
||||
|
||||
在以下的窗口中,我建议选择**动态分配**,因为这允许你在之后增加虚拟磁盘的大小。如果你选择了**固定大小**,磁盘的速度可能会更快,但你将无法修改虚拟磁盘的大小了:
|
||||
在以下的窗口中,我建议选择“<ruby>动态分配<rt>dynamically allocated</rt></ruby>”,因为这允许你在之后增加虚拟磁盘的大小。如果你选择了“<ruby>固定大小<rt>fixed size</rt></ruby>”,磁盘的速度可能会更快,但你将无法修改虚拟磁盘的大小了:
|
||||
|
||||
![Dynamically allocating hard disk][12]
|
||||
|
||||
建议你使用附带有逻辑卷管理器(LVM)的 Linux 发行版,这样你就可以先创建一个较小的硬盘。如果之后你的访客系统的空间快用完了,你可以按需增加磁盘的大小。
|
||||
建议你使用附带有逻辑卷管理器(LVM)的 Linux 发行版,这样你就可以先创建一个较小的硬盘。如果之后你的客体系统的空间快用完了,你可以按需增加磁盘的大小。
|
||||
|
||||
> **注意**:我选择的访客系统为 Fedora,在 Fedora 的官网说明:[Fedora 至少需要分配 20GB 的空闲磁盘空间][13]。我强烈建议你遵守该规范。在这里,我选择了 8GB,以便稍后演示如何用命令行增加磁盘空间。如果你是 Linux 新手,或者对命令行没有经验,请依旧选择 20GB。
|
||||
> **注意**:我选择的客体系统为 Fedora,在 Fedora 的官网说明:[Fedora 至少需要分配 20GB 的空闲磁盘空间][13]。我强烈建议你遵守该规范。在这里,我选择了 8GB,以便稍后演示如何用命令行增加磁盘空间。如果你是 Linux 新手,或者对命令行没有经验,请依旧选择 20GB。
|
||||
|
||||
![Setting hard disk size][14]
|
||||
|
||||
创建好硬盘驱动器后,从 VirtualBox 主窗口的列表中选择新创建的虚拟机,然后单击**设置**。在设置菜单中,点击**系统**,然后选择**处理器**标签。默认情况下,VirtualBox 只向访客系统分配一个 CPU 内核。在现代多核 CPU 计算机上,分配至少两个内核是没有任何问题的,这能显著地加快访客系统的速度:
|
||||
创建好硬盘驱动器后,从 VirtualBox 主窗口的列表中选择新创建的虚拟机,然后单击“<ruby>设置<rt>Settings</rt></ruby>”。在设置菜单中,点击“<ruby>系统<rt>System</rt></ruby>”,然后选择“<ruby>处理器<rt>Processor</rt></ruby>”标签。默认情况下,VirtualBox 只向客体系统分配一个 CPU 内核。在现代多核 CPU 计算机上,分配至少两个内核是没有任何问题的,这能显著地加快客体系统的速度:
|
||||
|
||||
![Assigning cores to guest system][15]
|
||||
|
||||
@ -81,55 +81,56 @@ VirtualBox 能让任何人都可以轻松安装 Linux 虚拟机。你不需要
|
||||
![Network settings][16]
|
||||
|
||||
你也可以创建多个网络适配器。以下是网络适配器最常见的类型:
|
||||
* **NAT:** NAT适配器能自动执行 [网络地址转换][17]。从外部看,主机和访客系统使用着相同的 IP 地址。你无法通过网络从主机系统内访问访客系统。(尽管,你也可以通过定义 [端口转发][18],来访问某些服务。)当你的主机系统可以访问互联网时,则你的访客系统也可以访问互联网。NAT 不再需要进一步的配置。
|
||||
* _如果你只需要让访客系统接入互联网就可以的话,请选择 **NAT**。_
|
||||
* **桥接适配器(Bridged adapter):** 在此配置中,访客系统和主机系统可以共享相同的物理以太网设备。这两个系统都将拥有独立的 IP 地址。从外部看,网络中会有两个独立的系统,它们共享相同的物理以太网适配器。这种设置更灵活,但需要更多的配置。
|
||||
* _如果你想要共享访客系统的网络服务的话,请选择 **桥接适配器**。_
|
||||
* **仅限主机的适配器(Host-only adapter):** 在此配置中,访客系统只能与主机,或在同一主机上运行的其他访客系统,相互通信。主机系统也可以连接到访客系统。但访客系统不能接入互联网或物理网络。
|
||||
* _如果你想要获得高安全性,请选择 **仅限主机的适配器**。_
|
||||
|
||||
#### 分配操作系统映像
|
||||
* NAT:NAT 适配器能自动执行 [网络地址转换][17]。从外部看,主机和客体系统使用着相同的 IP 地址。你无法通过网络从主机系统内访问客体系统。(尽管,你也可以通过定义 [端口转发][18],来访问某些服务。)当你的主机系统可以访问互联网时,则你的客体系统也可以访问互联网。NAT 不再需要进一步的配置。
|
||||
* _如果你只需要让客体系统接入互联网就可以的话,请选择 “NAT”。_
|
||||
* <ruby>桥接适配器<rt>Bridged adapter</rt></ruby>:在此配置中,客体系统和主机系统可以共享相同的物理以太网设备。这两个系统都将拥有独立的 IP 地址。从外部看,网络中会有两个独立的系统,它们共享相同的物理以太网适配器。这种设置更灵活,但需要更多的配置。
|
||||
* _如果你想要共享客体系统的网络服务的话,请选择 “桥接适配器”。_
|
||||
* <ruby>仅限主机的适配器<rt>Host-only adapter</rt></ruby>:在此配置中,客体系统只能与主机,或在同一主机上运行的其他客体系统相互通信。主机系统也可以连接到客体系统。但客体系统不能接入互联网或物理网络。
|
||||
* _如果你想要获得高安全性,请选择 “仅限主机的适配器”。_
|
||||
|
||||
在设置菜单中,点击**存储**,然后选择虚拟光盘驱动器。单击右侧的 **光盘图标**,然后点击**选择一个磁盘文件...**,然后分配你想要安装的、已下载的 Linux 发行版映像:
|
||||
#### 分配操作系统镜像
|
||||
|
||||
在设置菜单中,点击“<ruby>存储<rt>Storage</rt></ruby>”,然后选择虚拟光盘驱动器。单击右侧的 “光盘”图标,然后点击“<ruby>选择一个磁盘文件……<rt>Choose a disk file…</rt></ruby>”,然后分配你想要安装的、已下载的 Linux 发行版镜像:
|
||||
|
||||
![Assigning OS image][19]
|
||||
|
||||
### 安装 Linux
|
||||
|
||||
现在,就已经配置好了虚拟机。右上角关闭**设置**菜单,返回主窗口。点击**绿色箭头**(即“开始”按钮)。虚拟机将从虚拟光盘驱动器启动,你将发现你已经进入到 Linux 发行版的安装程序中:
|
||||
现在,就已经配置好了虚拟机。右上角关闭“<ruby>设置<rt>Settings</rt></ruby>”菜单,返回主窗口。点击“绿色箭头”(即“开始”按钮)。虚拟机将从虚拟光盘驱动器启动,你将发现你已经进入到 Linux 发行版的安装程序中:
|
||||
|
||||
![VirtualBox Fedora installer][20]
|
||||
|
||||
#### 设置分区
|
||||
|
||||
安装程序将在安装过程中要求你提供分区信息。选择**自定义(Custom)**:
|
||||
安装程序将在安装过程中要求你提供分区信息。选择“<ruby>自定义<rt>Custom</rt></ruby>”:
|
||||
|
||||
![Selecting Custom partition configuration][21]
|
||||
|
||||
> **注意:** 我假设,你创建这一虚拟机的目的是为了测试。此外,你也无需关心访客系统的休眠,因为此功能会由 VirtualBox 来隐式地提供。因此,你可以省略交换分区,以节省主机系统的磁盘空间。请记住,如果你需要的话,你可以稍后自己添加交换分区。在 [Linux 系统交换空间的介绍][22] 这篇文章中,作者 David Both 进一步解释了如何添加交换分区,并选择交换分区正确的大小。
|
||||
> **注意:** 我假设,你创建这一虚拟机的目的是为了测试。此外,你也无需关心客体系统的休眠,因为此功能会由 VirtualBox 来隐式地提供。因此,你可以省略交换分区,以节省主机系统的磁盘空间。请记住,如果你需要的话,你可以稍后自己添加交换分区。在 《[Linux 系统交换空间的介绍][22]》 这篇文章中,作者 David Both 进一步解释了如何添加交换分区,并选择交换分区正确的大小。
|
||||
|
||||
Fedora 33 及之后更高的版本提供了一个 [zram 分区][23],zram 分区可以用于存放分页和交换、并经过压缩过后的硬盘数据。zram 分区可以按需地调整大小,并且它比硬盘交换分区快得多。
|
||||
|
||||
为了简单,我们只添加以下两个挂载点(mount point):
|
||||
为了简单,我们只添加以下两个<ruby>挂载点<rt>Mount Point</rt></ruby>:
|
||||
|
||||
![Adding mount points][24]
|
||||
|
||||
保存更改,接下来我们继续安装。
|
||||
|
||||
### 安装 VirtualBox 增强功能 Guest Additions
|
||||
### 安装 VirtualBox 增强功能
|
||||
|
||||
完成安装后,从硬盘驱动器启动,并登录到虚拟机。现在,你可以安装 VirtualBox 增强功能,其中包括特殊的设备驱动程序和系统应用程序,他们能提供以下内容:
|
||||
完成安装后,从硬盘驱动器启动,并登录到虚拟机。现在,你可以安装 <ruby>VirtualBox 增强功能<rt>VirtualBox Guest Additions</rt></ruby>,其中包括特殊的设备驱动程序和系统应用程序,它们能提供以下功能:
|
||||
|
||||
* 共享剪贴板
|
||||
* 共享文件夹
|
||||
* 更好的性能
|
||||
* 可自由扩展的窗口大小
|
||||
|
||||
点击顶部菜单栏的**设备**,然后选择**插入增强功能的CD映像...**,来安装 VirtualBox 增强功能:
|
||||
点击顶部菜单栏的“<ruby>设备<rt>Devices</rt></ruby>”,然后选择“<ruby>插入增强功能的 CD 镜像……<rt>Insert Guest Additions CD image...</rt></ruby>”,来安装 VirtualBox 增强功能:
|
||||
|
||||
![Selecting Guest Additions CD image][25]
|
||||
|
||||
在大多数 Linux 发行版上,带有增强功能的CD映像会自动挂载,并且能够在 File Browser 文件管理器中找到。Fedora 会问你是否要运行安装脚本。单击**运行**,并授予该安装进程 root 权限:
|
||||
在大多数 Linux 发行版上,带有增强功能的 CD 镜像会自动挂载,并且能够在文件管理器中找到。Fedora 会问你是否要运行安装脚本。单击“<ruby>运行<rt>Run</rt></ruby>”,并授予该安装进程 root 权限:
|
||||
|
||||
![Enabling Guest Additions autorun][26]
|
||||
|
||||
@ -141,7 +142,7 @@ Fedora 33 及之后更高的版本提供了一个 [zram 分区][23],zram 分
|
||||
|
||||
![Fedora hard disk running out of space][27]
|
||||
|
||||
正如我提到的,Fedora 官网建议安装时分配 20GB 的磁盘空间。因为 8GB 是 Fedora 33 安装启动就需要的最少空间。没有新安装其他软件(除了 VirtualBox Guest Additions),启动项就几乎占用了整个 8GB 的可用空间。这时候,不要打开 GNOME 软件中心或任何其他可能从互联网下载文件的东西。
|
||||
正如我提到的,Fedora 官网建议安装时分配 20GB 的磁盘空间。因为 8GB 是 Fedora 33 安装启动就需要的最少空间。没有安装其他软件(除了 VirtualBox 增强功能)的一个新安装的系统就几乎占用了整个 8GB 的可用空间。这时候,不要打开 GNOME 软件中心或任何其他可能从互联网下载文件的东西。
|
||||
|
||||
幸运的是,我选择了附带有 LVM 的 Fedora,这样我就可以用命令行轻松地修复这个问题。
|
||||
|
||||
@ -150,10 +151,10 @@ Fedora 33 及之后更高的版本提供了一个 [zram 分区][23],zram 分
|
||||
关闭虚拟机。如果你的主机系统运行的是 Windows,请打开终端,并进入到 `C:\Program Files\Oracle\VirtualBox` 目录下。使用以下命令,将磁盘大小扩大到 12,000MB:
|
||||
|
||||
```
|
||||
`VBoxManage.exe modifyhd "C:\Users\StephanA\VirtualBox VMs\Fedora_33\Fedora_33.vdi" --resize 12000`
|
||||
VBoxManage.exe modifyhd "C:\Users\StephanA\VirtualBox VMs\Fedora_33\Fedora_33.vdi" --resize 12000
|
||||
```
|
||||
|
||||
然后启动虚拟机,并打开**磁盘**的利用。你可以看到你刚刚新创建且未分配的可用空间。选择**可用空间**,然后单击 **+** 按钮:
|
||||
然后启动虚拟机,并打开“<ruby>磁盘<rt>Disks</rt></ruby>”工具。你可以看到你刚刚新创建且未分配的可用空间。选择“<ruby>可用空间<rt>Free Space</rt></ruby>”,然后单击 “+” 按钮:
|
||||
|
||||
![Free space before adding][28]
|
||||
|
||||
@ -161,12 +162,11 @@ Fedora 33 及之后更高的版本提供了一个 [zram 分区][23],zram 分
|
||||
|
||||
![Creating a new partition and setting size][29]
|
||||
|
||||
You don't want to create a filesystem or anything else on your new partition, so select **Other**:
|
||||
如果你不想在新分区上创建文件系统或任何其他内容,请选择**其他**:
|
||||
如果你不想在新分区上创建文件系统或任何其他内容,请选择“<ruby>其他<rt>Other</rt></ruby>”:
|
||||
|
||||
![Selecting "other" for partition volume type][30]
|
||||
|
||||
选择**无文件系统**:
|
||||
选择“<ruby>无文件系统<rt>No Filesystem</rt></ruby>”:
|
||||
|
||||
![Setting "No filesystem" on new partition][31]
|
||||
|
||||
@ -174,26 +174,26 @@ You don't want to create a filesystem or anything else on your new partition, so
|
||||
|
||||
![VirtualBox after adding new partition][32]
|
||||
|
||||
虚拟机有了一个新的分区设备:**/dev/sda3**。通过输入 `vgscan` ,来检查你的 LVM 卷组,找到 **fedora_localhost_live** 这一LVM 卷组 :
|
||||
虚拟机有了一个新的分区设备:`/dev/sda3`。通过输入 `vgscan` ,来检查你的 LVM 卷组,找到 `fedora_localhost_live` 这一 LVM 卷组 :
|
||||
|
||||
![Checking LVM volume group by typing vgscan:][33]
|
||||
|
||||
现在,已经万事俱备了。在新分区 **/dev/sda3** 中扩展卷组 **fedora_localhost_live**:
|
||||
现在,已经万事俱备了。在新分区 `/dev/sda3` 中扩展卷组 `fedora_localhost_live`:
|
||||
|
||||
```
|
||||
`vgextend fedora_localhost-live /dev/sda3`
|
||||
vgextend fedora_localhost-live /dev/sda3
|
||||
```
|
||||
|
||||
![vgextend command output][34]
|
||||
|
||||
由于卷组较大,你可以增加逻辑卷的大小。命令 `vgdisplay` 显示了共有 951 个可用的空闲扩展:
|
||||
由于卷组比逻辑卷大,你可以增加逻辑卷的大小。命令 `vgdisplay` 显示了共有 951 个可用的物理扩展(PE):
|
||||
|
||||
![vgdisplay command output][35]
|
||||
|
||||
将逻辑卷增加 951 个扩展:
|
||||
将逻辑卷增加 951 个物理扩展:
|
||||
|
||||
```
|
||||
`lvextend -l+951 /dev/mapper/fedora_localhost--live-root`
|
||||
lvextend -l+951 /dev/mapper/fedora_localhost--live-root
|
||||
```
|
||||
|
||||
![lvextend command output][36]
|
||||
@ -201,16 +201,16 @@ You don't want to create a filesystem or anything else on your new partition, so
|
||||
在增加了逻辑卷后,最后一件事就是调整文件系统的大小:
|
||||
|
||||
```
|
||||
`resize2fs /dev/mapper/fedora_localhost--live-root`
|
||||
resize2fs /dev/mapper/fedora_localhost--live-root
|
||||
```
|
||||
|
||||
![resize2fs command output][37]
|
||||
|
||||
这样磁盘空间就增加完成了!检查**磁盘使用分析器**,你就可以看到扩展空间已经可用于文件系统了。
|
||||
这样磁盘空间就增加完成了!检查“<ruby>磁盘使用分析器<rt>Disk Usage Analyzer</rt></ruby>”,你就可以看到扩展空间已经可用于文件系统了。
|
||||
|
||||
### 总结
|
||||
|
||||
使用虚拟机,你可以检查在一个特定的操作系统或一个特定版本的操作系统,软件是如何操作的。除此之外,你还可以尝试任何想测试的 Linux 发行版,而不必担心系统损坏。对于高级用户来说,VirtualBox 在测试、网络和模拟方面提供了广泛的可能性。
|
||||
使用虚拟机,你可以检查在一个特定的操作系统或一个特定版本的操作系统、软件是如何操作的。除此之外,你还可以尝试任何想测试的 Linux 发行版,而不必担心系统损坏。对于资深用户来说,VirtualBox 在测试、网络和模拟方面提供了广泛的可能性。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -219,7 +219,7 @@ via: https://opensource.com/article/21/6/try-linux-virtualbox
|
||||
作者:[Stephan Avenwedde][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[chai001125](https://github.com/chai001125)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -3,13 +3,14 @@
|
||||
[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "Donkey-Hao"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15182-1.html"
|
||||
|
||||
利用习惯练习开放式组织原则
|
||||
======
|
||||
你可以按照以下步骤,来养成符合开放文化的习惯,并改掉那些不符合开放文化的习惯。
|
||||
|
||||
> 你可以按照以下步骤,来养成符合开放文化的习惯,并改掉那些不符合开放文化的习惯。
|
||||
|
||||
![Selfcare, drinking tea on the porch][1]
|
||||
|
||||
@ -44,9 +45,9 @@
|
||||
|
||||
### 养成习惯的 3 个步骤
|
||||
|
||||
1、提示(触发器):首先,提示或者触发器会告诉大脑,进入之前学习的习惯性行为的自动模式之中。这里的提示可以是某件事,比如每天在确定的时间点、在确定的地点,看到一包糖果或者看到电视购物节目,亦或者看到某个特定的人。时间压力会触发你去做例行事项(routine)。在令人崩溃的环境下也会触发例行事项。简而言之,某件事提醒你开始做一些固定的事情。
|
||||
2、例行事项(routine):例行事项会被触发。一个例行事项是一系列的身体、心理或者情绪上的表现,可以是非常复杂的,也可以十分简单。诸如与心情相关的一些习惯可以在很短时间内被触发。
|
||||
3、奖励:最后一步是奖励,奖励会帮助你的大脑计算一个特定的行为是否值得记住。奖励的范围很广泛,可以是食物或者其他令你感到快乐的东西。
|
||||
1. 提示(触发器):首先,提示或者触发器会告诉大脑,进入之前学习的习惯性行为的自动模式之中。这里的提示可以是某件事,比如每天在确定的时间点、在确定的地点,看到一包糖果或者看到电视购物节目,亦或者看到某个特定的人。时间压力会触发你去做例行事项(routine)。在令人崩溃的环境下也会触发例行事项。简而言之,某件事提醒你开始做一些固定的事情。
|
||||
2. <ruby>例行事项<rt>routine</rt></ruby>:例行事项会被触发。一个例行事项是一系列的身体、心理或者情绪上的表现,可以是非常复杂的,也可以十分简单。诸如与心情相关的一些习惯可以在很短时间内被触发。
|
||||
3. 奖励:最后一步是奖励,奖励会帮助你的大脑计算一个特定的行为是否值得记住。奖励的范围很广泛,可以是食物或者其他令你感到快乐的东西。
|
||||
|
||||
### 商业环境中的坏习惯
|
||||
|
||||
@ -65,11 +66,11 @@
|
||||
|
||||
以下是你可以用来改变任何习惯的四步框架,其中还包括与开放式组织原则相关的习惯。
|
||||
|
||||
##### 第一步:调整例行事项
|
||||
#### 第一步:调整例行事项
|
||||
|
||||
确定你的习惯循环和例行事项,例如,当面临一件你无法独自解决的重大挑战之时。例行事项(你表现出的行为)最容易确定,所以先从它下手:例如,“在我的组织中,没人愿意和别人讨论问题。大家都会早早地放弃”。决定好你想要调整、改变或者学习的事情:例如:“每次重大挑战到来的时候,我应该和他人讨论一下,并且尝试建立一个志同道合、有能力解决问题的社区。”
|
||||
|
||||
##### 第二步:有奖励的实验
|
||||
#### 第二步:有奖励的实验
|
||||
|
||||
奖励是很重要的,因为它会满足你强烈的渴望。但是,我们通常没有意识到强烈的渴望会驱动我们的行为。只有在事后,才会被我们察觉。比方说,开会时很多次你都想尽快离开会议室,避免讨论话题,即使内心清楚你应该弄明白如何解决问题。
|
||||
|
||||
@ -77,15 +78,12 @@
|
||||
|
||||
把你自己当作科学家,进行实验并收集数据。这是你调查研究的步骤:
|
||||
|
||||
1、第一个行为结束后,开始调整后面的行为,看看有没有奖励变化。例如,如果你每次碰到自己无法解决的挑战时都放弃,那么奖励就是不承担责任的解脱。更好的解决方法是与至少一个同样关心该问题的人讨论该问题。关键是要测试不同的假设,以确定哪种渴望驱使你的日常生活。你真的想逃避责任吗?
|
||||
1. 第一个行为结束后,开始调整后面的行为,看看有没有奖励变化。例如,如果你每次碰到自己无法解决的挑战时都放弃,那么奖励就是不承担责任的解脱。更好的解决方法是与至少一个同样关心该问题的人讨论该问题。关键是要测试不同的假设,以确定哪种渴望驱使你的日常生活。你真的想逃避责任吗?
|
||||
2. 在经历四至五个不同的例行事项和奖励之后,写下在收到每个奖励后立即想到的前三、四件事。例如,你不会在面对挑战时放弃,而是与其他人讨论这个问题。然后,你决定可以做什么。
|
||||
3. 写下你的感受或渴望后,设置一个 15 分钟的计时器。当计时器结束时,问问自己是否依旧渴望。在屈服于渴望之前,请休息一会儿并再考虑一两次这个问题。这会迫使你意识到这一刻,并帮助你稍后回忆起你当时的想法。
|
||||
4. 试着记住你在那一刻的想法和感受,然后在例行事项后 15 分钟。如果渴望消失了,你就已经确定了回报是什么。
|
||||
|
||||
2、在经历四至五个不同的例行事项和奖励之后,写下在收到每个奖励后立即想到的前三、四件事。例如,你不会在面对挑战时放弃,而是与其他人讨论这个问题。然后,你决定可以做什么。
|
||||
|
||||
3、写下你的感受或渴望后,设置一个 15 分钟的计时器。当计时器结束时,问问自己是否依旧渴望。在屈服于渴望之前,请休息一会儿并再考虑一两次这个问题。这会迫使你意识到这一刻,并帮助你稍后回忆起你当时的想法。
|
||||
|
||||
4、试着记住你在那一刻的想法和感受,然后在例行事项后 15 分钟。如果渴望消失了,你就已经确定了回报是什么。
|
||||
|
||||
##### 第三步:分析出坏习惯的提示或触发器
|
||||
#### 第三步:分析出坏习惯的提示或触发器
|
||||
|
||||
坏习惯的提示信息很难鉴定,因为通常有太多信息干扰你未定型的行为。要在干扰中鉴别提示,你可以在你的坏习惯出现的时候,观察以下四个因素:
|
||||
|
||||
@ -97,24 +95,24 @@
|
||||
|
||||
人们:当时有谁或者哪一类人在你周围,还是你是独自一人?例如:“在会议上,大多数人似乎对这个问题也不感兴趣。剩下的人主导会议讨论。”
|
||||
|
||||
##### 第四步:制定养成好习惯的计划
|
||||
#### 第四步:制定养成好习惯的计划
|
||||
|
||||
一旦你确定奖励可以驱动你的行为,某些提示会触发你的坏习惯,那你就可以开始改变你的行动。请跟随以下三个简单的步骤:
|
||||
|
||||
1、首先,规划好习惯的提示。例如:“在会议上,我将发现并将我的注意力集中在重要的问题上。”
|
||||
2、其次,选择一种能带来相同回报的好行为,但不会遭受你现在坏习惯的惩罚。例如:“我将找到解决这个问题的方法,并考虑我需要哪些资源和技能才能成功。当我创建一个能够成功解决问题的社区时,我会感觉很棒。”
|
||||
3、最后,让你选择的行为成为深思熟虑的选择,直到你不再需要考虑它,就能下意识地做它了。例如:“我将有意识地关注重要问题,直到我可以不假思索地做到这一点。我会查看近期会议的安排表,这样我就可以提前知道会发生什么。在每次会议开始前和会议期间,我会问自己‘为什么我会来开会’,来确保我集中注意于重要的事情。”
|
||||
1. 首先,规划好习惯的提示。例如:“在会议上,我将发现并将我的注意力集中在重要的问题上。”
|
||||
2. 其次,选择一种能带来相同回报的好行为,但不会遭受你现在坏习惯的惩罚。例如:“我将找到解决这个问题的方法,并考虑我需要哪些资源和技能才能成功。当我创建一个能够成功解决问题的社区时,我会感觉很棒。”
|
||||
3. 最后,让你选择的行为成为深思熟虑的选择,直到你不再需要考虑它,就能下意识地做它了。例如:“我将有意识地关注重要问题,直到我可以不假思索地做到这一点。我会查看近期会议的安排表,这样我就可以提前知道会发生什么。在每次会议开始前和会议期间,我会问自己‘为什么我会来开会’,来确保我集中注意于重要的事情。”
|
||||
|
||||
##### 指定计划来避免忘记必做事项
|
||||
#### 制定计划来避免忘记必做事项
|
||||
|
||||
为了成功地开始做你经常忘记的事情,请按照以下步骤:
|
||||
|
||||
1、 计划你想要做什么
|
||||
2、 决定何时完成
|
||||
3、 将计划分为必要的小任务
|
||||
4、 用计时器或者日常计划进行提示,并开始每项任务
|
||||
5、 按计划完成每个任务
|
||||
6、 按时完成后就奖励自己
|
||||
1. 计划你想要做什么
|
||||
2. 决定何时完成
|
||||
3. 将计划分为必要的小任务
|
||||
4. 用计时器或者日常计划进行提示,并开始每项任务
|
||||
5. 按计划完成每个任务
|
||||
6. 按时完成后就奖励自己
|
||||
|
||||
### 习惯的改变
|
||||
|
||||
@ -133,7 +131,7 @@ via: https://opensource.com/open-organization/22/6/using-habits-practice-open-or
|
||||
作者:[Ron McFarland][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[Donkey-Hao](https://github.com/Donkey-Hao)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -3,28 +3,31 @@
|
||||
[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15181-1.html"
|
||||
|
||||
如何在 Ubuntu Server 22.04 上设置静态 IP 地址
|
||||
如何在 Ubuntu 服务器 22.04 上设置静态 IP 地址
|
||||
======
|
||||
在这篇文章中,我们将介绍如何在 Ubuntu Server 22.04 上设置静态 IP 地址。
|
||||
|
||||
强烈建议在 linux 服务器上使用静态 ip,因为它会在重启后保持不变。静态 IP 对邮件服务器、Web 服务器和文件服务器等服务器起着重要作用。
|
||||
![](https://img.linux.net.cn/data/attachment/album/202210/27/091312aohaix6g6kay68xa.jpg)
|
||||
|
||||
##### 先决条件
|
||||
> 在这篇文章中,我们将介绍如何在 Ubuntu 服务器 22.04 上设置静态 IP 地址。
|
||||
|
||||
* 最小安装的 Ubuntu Server 22.04
|
||||
* 具有 sudo 管理员权限的普通用户
|
||||
强烈建议在 Linux 服务器上使用静态 IP,因为它会在重启后保持不变。静态 IP 对邮件服务器、Web 服务器和文件服务器等服务器起着重要作用。
|
||||
|
||||
在 Ubuntu Server 22.04 中,网络由 netplan 程序控制,因此我们将使用 netplan 在 Ubuntu Server 上配置静态 IP 地址。
|
||||
**准备条件**
|
||||
|
||||
注意:我们不能使用 [nmcli 程序][1],因为它不是 Ubuntu Server 上默认安装的一部分。
|
||||
* 最小安装的 Ubuntu 服务器 22.04
|
||||
* 具有 `sudo` 管理员权限的普通用户
|
||||
|
||||
### 在 Ubuntu Server 22.04 上设置静态 IP 地址
|
||||
在 Ubuntu 服务器 22.04 中,网络由 netplan 程序控制,因此我们将使用 netplan 在 Ubuntu 服务器上配置静态 IP 地址。
|
||||
|
||||
登录到你的 Ubuntu Server 22.04,查找 netplan 配置文件。它位于 /etc/netplan 目录下。
|
||||
注意:我们不能使用 [nmcli 程序][1],因为它不是 Ubuntu 服务器上默认安装的一部分。
|
||||
|
||||
### 在 Ubuntu 服务器 22.04 上设置静态 IP 地址
|
||||
|
||||
登录到你的 Ubuntu 服务器 22.04,查找 netplan 配置文件。它位于 `/etc/netplan` 目录下。
|
||||
|
||||
```
|
||||
$ cd /etc/netplan/
|
||||
@ -34,7 +37,7 @@ total 4
|
||||
$
|
||||
```
|
||||
|
||||
运行以下 cat 命令以查看 “00-installer-config.yaml” 的内容
|
||||
运行以下 `cat` 命令以查看 `00-installer-config.yaml` 的内容。
|
||||
|
||||
注意:配置文件的名称可能因你的设置而异。由于它是一个 yaml 文件,因此请确保在编辑时保持缩进和语法。
|
||||
|
||||
@ -42,13 +45,13 @@ $
|
||||
$ cat 00-installer-config.yaml
|
||||
```
|
||||
|
||||
输出:
|
||||
输出:
|
||||
|
||||
![Default-Content-netplan-ubuntu-server][2]
|
||||
|
||||
根据上面的输出,它说我们有 ens33 接口,它正在从 dhcp 服务器获取 ip。查看接口名称的另一种方法是通过 ip 命令。
|
||||
根据上面的输出,它说我们有 `ens33` 接口,它正在从 DHCP 服务器获取 IP。查看接口名称的另一种方法是通过 `ip` 命令。
|
||||
|
||||
现在,要配置静态 ip 代替 dhcp,使用 vi 或 nano 编辑器编辑 netplan 配置文件并添加以下内容。
|
||||
现在,要配置静态 IP 代替 DHCP,使用 `vi` 或 `nano` 编辑器编辑 netplan 配置文件并添加以下内容。
|
||||
|
||||
```
|
||||
$ sudo vi 00-installer-config.yaml
|
||||
@ -73,20 +76,20 @@ network:
|
||||
|
||||
在上面的文件中,我们使用了以下内容,
|
||||
|
||||
* ens33 为接口名称
|
||||
* 用于设置静态 ip 的地址
|
||||
* nameservers 用于指定 DNS 服务器的 ip
|
||||
* `ens33` 为接口名称
|
||||
* 用于设置静态 IP 的地址
|
||||
* `nameservers` 用于指定 DNS 服务器的 IP
|
||||
* 用于指定默认网关的路由
|
||||
|
||||
注意:根据你的环境更改 IP 详细信息和接口名称。
|
||||
|
||||
要是上述修改生效,请使用以下 netplan 命令应用这些更改:
|
||||
要是上述修改生效,请使用以下 `netplan` 命令应用这些更改:
|
||||
|
||||
```
|
||||
$ sudo netplan apply
|
||||
```
|
||||
|
||||
运行以下 ip 命令查看接口上的 ip 地址:
|
||||
运行以下 IP 命令查看接口上的 IP 地址:
|
||||
|
||||
```
|
||||
$ ip addr show ens33
|
||||
@ -102,7 +105,7 @@ $ ip route show
|
||||
|
||||
![ip-addr-route-command-output-ubuntu-server][4]
|
||||
|
||||
完美,以上命令的输出确认静态ip和路由配置成功。
|
||||
完美,以上命令的输出确认静态 IP 和路由配置成功。
|
||||
|
||||
这就是这篇文章的全部内容。请在下面的评论部分发表你的问题和反馈。
|
||||
|
||||
@ -113,7 +116,7 @@ via: https://www.linuxtechi.com/static-ip-address-on-ubuntu-server/
|
||||
作者:[Pradeep Kumar][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,121 @@
|
||||
[#]: subject: "Ubuntu Budgie 22.10 Release Improves Control Center and Removes Some GNOME Apps"
|
||||
[#]: via: "https://news.itsfoss.com/ubuntu-budgie-22-10-release/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "littlebirdnest"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-15179-1.html"
|
||||
|
||||
Ubuntu Budgie 22.10 的新变化
|
||||
======
|
||||
|
||||
> Ubuntu Budgie 22.10 是一个有趣的版本,它删除了几个 GNOME 应用程序,以及一些其他改进。
|
||||
|
||||
![Ubuntu Budgie 22.10 Release Improves Control Center and Removes Some GNOME Apps][1]
|
||||
|
||||
[Ubuntu Budgie][2] 是 Ubuntu 的官方版本,因其传统的桌面界面和最小的软件膨胀而广受欢迎。
|
||||
|
||||
Ubuntu Budgie 22.10 的发布带来了一些关键的调整和补充。
|
||||
|
||||
### 🆕 Ubuntu Budgie 22.10 有什么新变化
|
||||
|
||||
![ubuntu budgie 22.10][3]
|
||||
|
||||
基于 Ubuntu 22.10 “<ruby>充满活力的捻角羚<rt>Kinetic Kudu</rt></ruby>”,Ubuntu Budgie 22.10 带来了 Budgie 桌面 10.6.4 和许多其他改进。
|
||||
|
||||
一些值得注意的亮点包括:
|
||||
|
||||
- 增强型 Budgie <ruby>控制中心<rt>Control Center</rt></ruby>
|
||||
- 更新了 Budgie 的“<ruby>欢迎<rt>Welcome</rt></ruby>”应用
|
||||
- 替换各种基于 GNOME 的应用程序
|
||||
- 对翻译进行了更新
|
||||
|
||||
#### Budgie 桌面和控制中心
|
||||
|
||||
![ubuntu budgie 22.10 desktop settings][4]
|
||||
|
||||
Budgie 桌面以及更新到 V10.6.4, 它添加了一个新的全局选项来控制小程序之间的间距,并对工作区和时钟小程序进行了各种改进。
|
||||
|
||||
![ubuntu budgie 22.10 display color profiles][5]
|
||||
|
||||
Budgie <ruby>控制中心<rt>Control Center</rt></ruby>也得到了一堆调整,例如重新设计的显示颜色配置文件支持,修改了对屏幕分享的支持,如 [RDP][6] 和 [VNC][7],用于显示缩放的选项,等等。
|
||||
|
||||
#### 升级了欢迎应用
|
||||
|
||||
![ubuntu budgie 22.10 welcome app][8]
|
||||
|
||||
Ubuntu Budgie 22.10 特别升级了 [Budgie 的欢迎应用][9],改善了翻译以及一些其他改进。
|
||||
|
||||
#### 默认的应用的变化
|
||||
|
||||
Ubuntu Budgie 的开发人员已经开始替换和删除基于 GNOME 的应用程序,转而使用基于 MATE 的应用程序和其他替代品。
|
||||
|
||||
他们决定这样做是因为基于 GNOME 的应用程序在 Budgie 中的外观与其他具有圆角边缘的应用程序的外观不一致。
|
||||
|
||||
这些不一致是由于 GNOME 根据其样式和主题需求而转到 Libadwaita 库造成的。
|
||||
|
||||
Libadwaita 库是 GNOME 的一个有争议的补充,没有多少用户喜欢,你可以通过我们的报道来了解更多信息。
|
||||
|
||||
> **[你对在 Linux 世界中 GNOME 的 Libadwaita 库怎么看?][15]**
|
||||
|
||||
以下是一些已删除或替换的应用程序:
|
||||
|
||||
- GNOME 计算器被 MATE 计算器取代。
|
||||
- 删除了 GNOME 日历。
|
||||
- GNOME 系统监视器已由 MATE 系统监视器取代。
|
||||
- 删除了 GNOME 截图。
|
||||
- [字体管理器][10] 替代了 GNOME 字体查看器。
|
||||
|
||||
#### 🛠️ 其他改变
|
||||
|
||||
其他改变包括以下:
|
||||
|
||||
- 重新开发的内置主题
|
||||
- 移除 PulseAudio,并支持 PipeWire
|
||||
- 原生的截图功能
|
||||
- 支持 WebP 图像
|
||||
- 能够查看显示器的刷新率
|
||||
|
||||
你可以通过 [发行说明][11] 了解更多。
|
||||
|
||||
### 📥 下载 Ubuntu Budgie 22.10
|
||||
|
||||
你可以在 [Ubuntu 中央镜像仓库][12] 或者它的 [官方网站][13] 下载最新的 ISO。
|
||||
|
||||
*其官方网站可能需要一段时间才能提供 ISO。*
|
||||
|
||||
> **[下载 Ubuntu Budgie 22.10][13]**
|
||||
|
||||
> 💡 Ubuntu Budgie 22.10 将支持 9 个月直到 **2023 年 6 月**。如果你想使用稳定的功能,更应该选择 [LTS 版本][14]。
|
||||
|
||||
💬 你如何看待这个非 LTS 版本?愿意尝试一下吗?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/ubuntu-budgie-22-10-release/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[littlebirdnest](https://github.com/littlebirdnest)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/ubuntu-budgie-22-10-release.png
|
||||
[2]: https://ubuntubudgie.org/
|
||||
[3]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10.png
|
||||
[4]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10_Desktop_Settings.png
|
||||
[5]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10_Color_Profiles.png
|
||||
[6]: https://en.wikipedia.org/wiki/Remote_Desktop_Protocol
|
||||
[7]: https://en.wikipedia.org/wiki/Virtual_Network_Computing
|
||||
[8]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10_Welcome.png
|
||||
[9]: https://ubuntubudgie.org/2022/02/quick-overview-of-budgie-welcome-application/
|
||||
[10]: https://itsfoss.com/font-manager/
|
||||
[11]: https://ubuntubudgie.org/2022/09/ubuntu-budgie-22-10-release-notes/
|
||||
[12]: https://cdimage.ubuntu.com/ubuntu-budgie/releases/22.10/
|
||||
[13]: https://ubuntubudgie.org/downloads/
|
||||
[14]: https://itsfoss.com/long-term-support-lts/
|
||||
[15]: https://news.itsfoss.com/gnome-libadwaita-library/
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://www.debugpoint.com/check-wayland-or-xorg/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
@ -88,4 +88,4 @@ via: https://www.debugpoint.com/check-wayland-or-xorg/
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/This-command-can-give-you-details-about-Xorg-or-Wayland-1024x612.jpg
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2022/10/In-GNOME-Settings-you-can-find-it.jpg
|
||||
[3]: https://www.debugpoint.com/tag/systemd/
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2022/10/Using-loginctl-to-find-out.jpg
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2022/10/Using-loginctl-to-find-out.jpg
|
@ -1,197 +0,0 @@
|
||||
[#]: subject: "10 Things to Do After Installing Ubuntu 22.10 [With Bonus Tip]"
|
||||
[#]: via: "https://www.debugpoint.com/things-to-do-ubuntu-22-10/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "chai001125"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
10 Things to Do After Installing Ubuntu 22.10 [With Bonus Tip]
|
||||
======
|
||||
|
||||
**Here’s our recommended list of 10 things after installing Ubuntu 22.10 “Kinetic Kudu” (GNOME Edition).**
|
||||
|
||||
![][1]
|
||||
|
||||
Ubuntu 22.10 brings exciting new features such as GNOME 43, the latest Kernel, a newly re-designed tray menu, Files features, Pipewire and [many more][2].
|
||||
|
||||
I am sure you are excited to try them.
|
||||
|
||||
But wait.
|
||||
|
||||
Before you head over to enjoy a new installation of Ubuntu, here’s an assorted list of customization tips which you can’t miss.
|
||||
|
||||
### 10 Things to Do After Installing Ubuntu 22.10
|
||||
|
||||
#### 1. Update your system
|
||||
|
||||
The first thing you need to do after installing Ubuntu 22.10 is to update your system. Often, the latest ISO may not contain all the updates due to time differences. So, to update your system, oprn a terminal window and run the following commands.
|
||||
|
||||
```
|
||||
sudo apt update && sudo apt upgrade
|
||||
```
|
||||
|
||||
Once the commands are complete, you can proceed to the next steps.
|
||||
|
||||
#### 2. Remove Firefox Snap and install Flatpak or deb
|
||||
|
||||
Since Ubuntu 21.10 last year, the default web browser Firefox comes as a Snap package. Now, if you are an average user, this may not be a problem or a thing to worry about. But many users may not like the Snap package of Firefox for several reasons. For example, the startup time is slow. Unnecessary Snap update notifications when there is a backend update and so on.
|
||||
|
||||
So, to completely remove Firefox as Snap, you can follow the guide [on this page][3] that I have written. It’s a little complex and may take time. And install a deb version of Firefox from PPA or use the [Flatpak version][4].
|
||||
|
||||
As I said, this is an optional tip; you may skip it if you want.
|
||||
|
||||
#### 3. Install and Enable Flatpak
|
||||
|
||||
While every distribution today ships Flatpak by default, Ubuntu does not. Because it promotes its own sandboxing technology Snap.
|
||||
|
||||
But Flatpak applications are the best for everyone. It helps you to quickly install and use several applications without worrying about dependency and other things.
|
||||
|
||||
Most of the Flatpak applications are present in a centralised repo @ Flathub.
|
||||
|
||||
To enable Flatpak applications in Ubuntu 22.10, follow the below commands.
|
||||
|
||||
```
|
||||
sudo apt install flatpakflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakreporeboot
|
||||
```
|
||||
|
||||
Also, if you want to learn more about this process, [read this nice guide][5], we published a while ago.
|
||||
|
||||
#### 4. Review privacy settings
|
||||
|
||||
I recommend you opt out of any data collection after installing Ubuntu. Everyone knows that it’s difficult to protect your privacy over the internet, no matter how hard you try. These little steps matter.
|
||||
|
||||
To configure the privacy, open Settings and select Privacy. Then review the settings listed under privacy.
|
||||
|
||||
Also, ensure to disable backend reporting to Ubuntu servers with your usage. Run the following command to do that. Unfortunately, there is no option in the settings to disable it.
|
||||
|
||||
```
|
||||
sudo ubuntu-report -f send no
|
||||
```
|
||||
|
||||
![Turn off location services in Ubuntu 22.10][6]
|
||||
|
||||
#### 5. Explore GNOME 43 Features
|
||||
|
||||
The most visual and functional change coming in this release is GNOME 43. This is going to impact everyone and your workflow. Because there are some fundamental and core changes. GNOME 43 brings a new pill-shaped tray menu and updated native applications with new features such as Files and GNOME Web.
|
||||
|
||||
Do go over the detailed [GNOME 43 features][7] here to learn more. Or explore them yourself.
|
||||
|
||||
![Quick Settings Demo in GNOME 43][8]
|
||||
|
||||
#### 6. Ensure the audio works with Pipewire
|
||||
|
||||
If you work with Audio primarily or your workflow deals with sound capture, playback and other stuff, then make sure your Audio works properly in Ubuntu 22.10, wired or via Bluetooth.
|
||||
|
||||
Because there is a change in the audio server in this release for the first time in many years. The legacy PulseAudio is now replaced by the modern Pipewire. So it’s important for you to verify.
|
||||
|
||||
#### 7. Install additional packages
|
||||
|
||||
It’s important to ensure you can play all video and audio formats on your Ubuntu desktop. If you skipped the extra package installation during the setup, you could install them via the below commands.
|
||||
|
||||
```
|
||||
sudo apt install ubuntu-restricted-extras
|
||||
```
|
||||
|
||||
This should settle any video or audio playback problem in Ubuntu. Especially with GNOME Videos which can’t play anything by default.
|
||||
|
||||
#### 8. Setup basic apps
|
||||
|
||||
The base Ubuntu with GNOME comes with a very basic set of applications. Hence, it’s almost necessary for everyone to install applications before you use Ubuntu.
|
||||
|
||||
Now, necessary apps are different for everyone due to diverse workflow. Hence, here’s a quick list of generic apps which I think you can go ahead and install since they are preety much common for all.
|
||||
|
||||
- GIMP – Advanced photo editor
|
||||
- VLC – Media play that plays anything without the need for additional codecs
|
||||
- Leafpad – A lightweight text editor (even lightweight from default gedit)
|
||||
- Synaptic – A far better package manager
|
||||
|
||||
Command to install them:
|
||||
|
||||
```
|
||||
sudo apt install -y gimp vlc leafpad synaptic
|
||||
```
|
||||
|
||||
#### 9. Get some GNOME Extensions
|
||||
|
||||
You can extend your GNOME 43’s functionality using several cool extensions. That includes customizing the top bar, tray, changing the adwaita accent colour further and more. So, to do that, make sure you install the GNOME Extension manager first via Flatpak using the command below.
|
||||
|
||||
```
|
||||
flatpak install flathub com.mattjakeman.ExtensionManager
|
||||
```
|
||||
|
||||
And once you do, you can go ahead with any extensions you want by searching for them in the above app. However, here’s a quick set of necessary extensions which I feel are perfect for your brand-new Ubuntu desktop. You can simply search with these names in the Extension manager apps.
|
||||
|
||||
- Caffeine
|
||||
- Custom Hot Corners
|
||||
- Dash to Dock
|
||||
- Blur my shell
|
||||
- Gradients
|
||||
- Hide Activities Button
|
||||
- Net speed simplified
|
||||
|
||||
#### 10. Prepare backup
|
||||
|
||||
Last but not least, make sure you prepare for backup from the beginning. We always feel the necessity for backup when we run into difficult situations. To do that, the ideal app is Timeshift – which is easy to install and use.
|
||||
|
||||
Here’s the set of commands you can run from the terminal to install. And after installation, you can open and follow the on-screen instructions to set up a backup.
|
||||
|
||||
```
|
||||
sudo add-apt-repository -y ppa:teejee2008/ppasudo apt-get updatesudo apt-get install timeshift
|
||||
```
|
||||
|
||||
### Bonus Tips
|
||||
|
||||
If you want to customize your new Ubuntu installation further, here are some bonus tips for you.
|
||||
|
||||
#### Install nice fonts
|
||||
|
||||
Fonts impact everything. It’s one of the small yet impactful settings. However, Ubuntu comes with a default “Ubuntu regular” font, which is also good.
|
||||
|
||||
But you can also go ahead and install some nice fonts from Ubuntu’s official repo. Here is some command to install them.
|
||||
|
||||
```
|
||||
sudo apt install fonts-roboto fonts-cascadia-code fonts-firacode
|
||||
```
|
||||
|
||||
After installation, you can change the font using the [GNOME Tweak tool][9].
|
||||
|
||||
#### Install TLP
|
||||
|
||||
You must take care of your laptop battery if you are a heavy laptop user. While no battery is everlasting, you can still take some steps to ensure it lasts longer. The TLP is one of the best programs available in Linux, which helps to do that automatically. All you need to do is install it using the following command and run.
|
||||
|
||||
```
|
||||
sudo apt install tlp
|
||||
```
|
||||
|
||||
As per the recommendation, always keep the battery strength between 50% to 80%. Don’t overcharge or let it discharge below 50%. Don’t keep it plugged into power continuously.
|
||||
|
||||
### Wrapping Up
|
||||
|
||||
So, there you have it. Ten gettings started tips with some bonus for your Ubuntu desktop journey.
|
||||
|
||||
I hope this helps and that you get to install & tweak your desktop with further customization. That said, do let me know what is your best after-install tips in Ubuntu in the comment box.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/things-to-do-ubuntu-22-10/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/u2210-things-hd-1024x576.jpg
|
||||
[2]: https://www.debugpoint.com/ubuntu-22-10/
|
||||
[3]: https://www.debugpoint.com/remove-firefox-snap-ubuntu/
|
||||
[4]: https://flathub.org/apps/details/org.mozilla.firefox
|
||||
[5]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2022/10/Turn-off-location-services-in-Ubuntu-22.10.jpg
|
||||
[7]: https://www.debugpoint.com/gnome-43/
|
||||
[8]: https://www.debugpoint.com/wp-content/uploads/2022/08/Quick-Settings-Demo-in-GNOME-43.gif
|
||||
[9]: https://www.debugpoint.com/customize-your-ubuntu-desktop-using-gnome-tweak/
|
@ -1,144 +0,0 @@
|
||||
[#]: subject: "How to Install Python 3.10 in Ubuntu and Other Related Linux"
|
||||
[#]: via: "https://www.debugpoint.com/install-python-3-10-ubuntu/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
How to Install Python 3.10 in Ubuntu and Other Related Linux
|
||||
======
|
||||
|
||||
**Planning to get Python 3.10 installed for your work? Here’s how to install Python 3.10 in Ubuntu and related distributions.**
|
||||
|
||||
Python 3.10 was released on Oct 25, 2021 with additional features and updates. This release brings better handling of error messages, new pattern-matching features, TypeAlias, user-defined type guards and more. You can read the release highlights [here][1].
|
||||
|
||||
As of writing this guide, Python 3.10 is adopted by most of the current distros. For example, Ubuntu 22.04 LTS, and Fedora 36 all have Python 3.10 by default.
|
||||
|
||||
That said, if you need Python 3.10 in any non-supported releases right now, you can use the [below reliable PPA][2] to install the latest Python 3.10 in Ubuntu. Here’s how.
|
||||
|
||||
### How to Install Python 3.10 on Ubuntu
|
||||
|
||||
This PPA can be used for Ubuntu 21.10, Ubuntu 21.04, Ubuntu 20.04 LTS, Ubuntu 18.04 LTS, and Linux Mint 20.x, Elementary OS 6 and other related Ubuntu-based distributions. Mostly those don’t support 3.10 by default.
|
||||
|
||||
- Open a terminal prompt and add the following PPA.
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||
```
|
||||
|
||||
- Refresh the cache using the below command.
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
- And install Python 3.10 using the below command.
|
||||
|
||||
```
|
||||
sudo apt install python3.10
|
||||
```
|
||||
|
||||
### Set Python Versions
|
||||
|
||||
Setting up Python 3.10 as default require some additional steps. Follow along.
|
||||
|
||||
**Warning**: Many applications in your Ubuntu system depend on the stock version of Python 3.9. Hence, be very sure that your work applications (e.g. GIMP, GNOME Terminal etc.) are compatible with Python 3.10. So, be cautious.
|
||||
|
||||
**Quick Tip:** If you want to check which of your installed system packages depends on a specific version, use the following `rdepends` switch of `apt-cache` command. In the below example, I am checking which of the installed packages depends on Python 3.8.
|
||||
|
||||
```
|
||||
apt-cache rdepends python3.8
|
||||
```
|
||||
|
||||
```
|
||||
[~]$ apt-cache rdepends python3.8
|
||||
python3.8
|
||||
Reverse Depends:
|
||||
python3.8-dbg
|
||||
virtualbox
|
||||
python3.8-venv
|
||||
python3.8-full
|
||||
libpython3.8-testsuite
|
||||
libglib2.0-tests
|
||||
idle-python3.8
|
||||
idle-python3.8
|
||||
python3.8-minimal
|
||||
python3.8-doc
|
||||
python3.8-dev
|
||||
python3.8-dbg
|
||||
python3-uno
|
||||
gedit
|
||||
virtualbox
|
||||
stimfit
|
||||
python3.8-venv
|
||||
python3-stfio
|
||||
python3-escript-mpi
|
||||
python3-escript
|
||||
python3-csound
|
||||
pitivi
|
||||
obs-studio
|
||||
liferea
|
||||
libpython3.8-testsuite
|
||||
libglib2.0-tests
|
||||
kitty
|
||||
kdevelop-python
|
||||
idle-python3.8
|
||||
idle-python3.8
|
||||
rhythmbox-plugins
|
||||
python3.8-minimal
|
||||
python3.8-doc
|
||||
python3.8-dev
|
||||
python3
|
||||
python3-uno
|
||||
python3-all
|
||||
cluster-glue
|
||||
gedit
|
||||
[~]$
|
||||
```
|
||||
|
||||
#### Use Python 3.10 as the default Python3
|
||||
|
||||
- First, check the current default version using the below command from the terminal.
|
||||
|
||||
```
|
||||
python3 --version
|
||||
```
|
||||
|
||||
- Use `update-alternatives` to create symbolic links to python3
|
||||
|
||||
```
|
||||
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
|
||||
```
|
||||
|
||||
```
|
||||
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
|
||||
```
|
||||
|
||||
- And choose which one to use as Python3 via the command:
|
||||
|
||||
```
|
||||
sudo update-alternatives --config python3
|
||||
```
|
||||
|
||||
![Install Python 3.10 in Ubuntu][3]
|
||||
|
||||
That’s all for the steps. Now you can start using the latest Python in your current Ubuntu version for your work/study. You switch over to the stock version using the above commands and changing the version numbers at any given time.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/install-python-3-10-ubuntu/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://docs.python.org/3.10/whatsnew/3.10.html
|
||||
[2]: https://github.com/deadsnakes
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2021/10/Installed-Python-3.10-in-Ubuntu-1024x472.jpeg
|
@ -1,118 +0,0 @@
|
||||
[#]: subject: "Ubuntu Budgie 22.10 Release Improves Control Center and Removes Some GNOME Apps"
|
||||
[#]: via: "https://news.itsfoss.com/ubuntu-budgie-22-10-release/"
|
||||
[#]: author: "Sourav Rudra https://news.itsfoss.com/author/sourav/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "littlebirdnest"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Ubuntu Budgie 22.10 版本改进了控制中心并删除了一些 GNOME 应用程序
|
||||
======
|
||||
|
||||
Ubuntu Budgie 22.10是一个有趣的版本,它删除了几个GNOME应用程序,并添加了其他改进。
|
||||
|
||||
![Ubuntu Budgie 22.10 Release Improves Control Center and Removes Some GNOME Apps][1]
|
||||
|
||||
[Ubuntu Budgie][2] 是Ubuntu的官方风格,因其传统的桌面界面和最小的软件膨胀而广受欢迎。
|
||||
|
||||
Ubuntu Budgie 22.10的发布带来了一些关键的调整和补充。
|
||||
|
||||
### 🆕 Ubuntu Budgie 22.10: 有什么新内容?
|
||||
|
||||
![ubuntu budgie 22.10][3]
|
||||
|
||||
基于 Ubuntu 22.10 的“动态库杜”,Ubuntu Budgie 22.10 具有 Budgie 桌面 10.6.4 和许多其他改进。
|
||||
|
||||
一些值得注意的亮点包括:
|
||||
|
||||
- **增强型budgie控制中心**
|
||||
- **更新 Budgie 支持的应用**
|
||||
- **替换各种基于 GNOME 的应用程序**
|
||||
- **更新的翻译**
|
||||
|
||||
#### Budgie桌面和控制中心
|
||||
|
||||
![ubuntu budgie 22.10 desktop settings][4]
|
||||
|
||||
Budgie桌面以及更新到V10.6.4, 它添加了一个新的全局选项来控制小程序之间的间距,并对工作区和时钟小程序进行了各种改进。
|
||||
|
||||
![ubuntu budgie 22.10 display color profiles][5]
|
||||
|
||||
Budgie控制中心也收到了一堆调整, 例如重新设计的显示颜色配置文件支持, 修改了对屏幕分享的支持如 [RDP][6] 和 [VNC][7], 用于显示缩放的选项,等等.
|
||||
|
||||
#### 支持应用升级
|
||||
|
||||
![ubuntu budgie 22.10 welcome app][8]
|
||||
|
||||
Ubuntu Budgie 22.10的功能升级了 [Budgie支持的应用][9]改善了翻译以及一些其他改进.
|
||||
|
||||
#### 改成默认的应用
|
||||
|
||||
Ubuntu Budgie的开发人员已经开始替换和删除基于GNOME的应用程序,以支持基于MATE的应用程序和其他替代方案。
|
||||
|
||||
他们决定这样做,因为基于GNOME的应用程序在Budgie中的外观与其他具有圆角边缘的应用程序的外观不一致。
|
||||
|
||||
这些不一致是由于 GNOME 根据其样式和主题需求而转到Libadwaita库造成的。
|
||||
|
||||
Libadwaita 库是 GNOME 的一个有争议的补充,没有多少用户喜欢,你可以通过我们的报道来了解更多信息。
|
||||
|
||||
以下是一些已删除或替换的应用程序:
|
||||
|
||||
- GNOME 计算器被 MATE 计算器取代。
|
||||
- GNOM 删除了日历。
|
||||
- GNOME 系统显示器已由MATE系统显示器取代。
|
||||
- GNOME 移除截图.
|
||||
- GNOME [字体管理][10]替代了字体查看器。
|
||||
|
||||
#### 🛠️ 其他改变
|
||||
|
||||
其他改变包括以下:
|
||||
|
||||
- **内置主题返工**
|
||||
- **移除PulseAudio并支持PipeWire**
|
||||
- **原生截图功能**
|
||||
- **支持网络规划图像**
|
||||
- **能够查看显示器的刷新率**
|
||||
|
||||
你可以通过[发行说明][11]了解更多。
|
||||
|
||||
### 📥 下载 Ubuntu Budgie 22.10
|
||||
|
||||
你可以下载最新的ISO在[Ubuntu's 镜像中心仓库][12]或者它的[官方网站][13]。
|
||||
|
||||
其官方网站可能需要一段时间ISO才能够可用。
|
||||
|
||||
[下载 Ubuntu Budgie 22.10][13]
|
||||
|
||||
> 💡Ubuntu Budgie 22.10 将支持9个月直到 **2023 6月 **. 如果你想使用稳定的功能,更应该选择 [LTS 版本][14].
|
||||
|
||||
💬 您如何看待这个非LTS版本?愿意尝试一下吗?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://news.itsfoss.com/ubuntu-budgie-22-10-release/
|
||||
|
||||
作者:[Sourav Rudra][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[littlebirdnest](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://news.itsfoss.com/author/sourav/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://news.itsfoss.com/content/images/size/w1200/2022/10/ubuntu-budgie-22-10-release.png
|
||||
[2]: https://ubuntubudgie.org/
|
||||
[3]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10.png
|
||||
[4]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10_Desktop_Settings.png
|
||||
[5]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10_Color_Profiles.png
|
||||
[6]: https://en.wikipedia.org/wiki/Remote_Desktop_Protocol
|
||||
[7]: https://en.wikipedia.org/wiki/Virtual_Network_Computing
|
||||
[8]: https://news.itsfoss.com/content/images/2022/10/Ubuntu_Budgie_22.10_Welcome.png
|
||||
[9]: https://ubuntubudgie.org/2022/02/quick-overview-of-budgie-welcome-application/
|
||||
[10]: https://itsfoss.com/font-manager/
|
||||
[11]: https://ubuntubudgie.org/2022/09/ubuntu-budgie-22-10-release-notes/
|
||||
[12]: https://cdimage.ubuntu.com/ubuntu-budgie/releases/22.10/
|
||||
[13]: https://ubuntubudgie.org/downloads/
|
||||
[14]: https://itsfoss.com/long-term-support-lts/
|
@ -0,0 +1,197 @@
|
||||
[#]: subject: "10 Things to Do After Installing Ubuntu 22.10 [With Bonus Tip]"
|
||||
[#]: via: "https://www.debugpoint.com/things-to-do-ubuntu-22-10/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "chai001125"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
安装 Ubuntu 22.10 后要做的 10 件事
|
||||
======
|
||||
|
||||
**以下是我们安装 Ubuntu 22.10 “Kinetic Kudu”(GNOME 版)后,推荐做的 10 件事列表。**
|
||||
|
||||
![][1]
|
||||
|
||||
Ubuntu 22.10 带来了很多令人兴奋的新功能,例如 GNOME 43、最新的内核、重新设计的托盘菜单、文件功能和 Pipewire 等 [新功能][2]。
|
||||
|
||||
我相信你已经迫不及待地想尝试 Ubuntu 22.10 上的这些新功能了。
|
||||
|
||||
但是请先等一等。
|
||||
|
||||
在你前往享受你新安装的 Ubuntu 22.10 之前,我要向你推荐一个不容错过的 Ubuntu 定制技巧列表。
|
||||
|
||||
### 安装 Ubuntu 22.10 后要做的 10 件事
|
||||
|
||||
#### 1、更新你的系统
|
||||
|
||||
安装好 Ubuntu 22.10 后,第一件要做的事就是更新你的系统。因为时差的原因,最新的 ISO 镜像通常不会包括所有的系统更新。所以,你要打开一个终端窗口,并运行以下命令,来更新你的系统。
|
||||
|
||||
```
|
||||
sudo apt update && sudo apt upgrade
|
||||
```
|
||||
|
||||
上述命令执行完成后,你就可以进行下一步啦。
|
||||
|
||||
#### 2、删除 Firefox Snap,并安装 Flatpak 或者 deb 版本的 Firefox
|
||||
|
||||
自去年发布的 Ubuntu 21.10 版本以来,默认的网页浏览器 Firefox 开始以 Snap 软件包的形式出现。如果你是普通用户,这可能不是一个问题或者需要担心的事情。但是出于几个原因,例如 Snap 软件包的 Firefox 启动时间较长、且当 Firefox 有后端更新时,会有不必要的 Snap 更新通知等等原因,导致许多用户不太喜欢 Firefox 的 Snap 软件包。
|
||||
|
||||
因此,你可以按照 [我写的另一篇操作指南][3],来完全删除 Firefox 的 Snap 软件包。这一过程有点复杂,需要花费一点时间。删除完成后,再从个人软件包存档(PPA)安装 deb 版本的 Firefox,或者使用 [Flatpak 版本][4] 的 Firefox。
|
||||
|
||||
这是一个可选的动作,你也可以跳过这一步骤。
|
||||
|
||||
#### 3、安装并启用 Flatpak
|
||||
|
||||
虽然,几乎所有最近的 linux 发行版都会默认安装 Flatpak,但是 Ubuntu 并没有默认安装 Flatpak,这是因为 Ubuntu 使用了它自己的沙箱技术 Snap。
|
||||
|
||||
但 Flatpak 这一应用程序还是最适合于每个人。Flatpak 能够帮助你快速安装多个应用程序,并在使用过程中无需担心依赖性和其他事情。
|
||||
|
||||
大多数 Flatpak 应用程序都在集中的仓库 @ Flathub 中。
|
||||
|
||||
要在 Ubuntu 22.10 中启用 Flatpak 应用程序,请按照以下命令进行操作。
|
||||
|
||||
```
|
||||
sudo apt install flatpakflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakreporeboot
|
||||
```
|
||||
|
||||
如果你想进一步了解关于此安装过程的更多信息,请阅读我们不久前发布的 [指南][5]。
|
||||
|
||||
#### 4、查看隐私设置
|
||||
|
||||
我建议你在安装 Ubuntu 后,手动退出任何数据收集项。大家都知道,无论怎么努力尝试,在互联网上保护自己的隐私都很困难。因此,这些小步骤很重要。
|
||||
|
||||
要配置隐私项,请打开设置并选择**隐私**。然后查看隐私菜单下列出的项目。
|
||||
|
||||
此外,请确保禁用对 Ubuntu 服务器的后端报告。需要运行以下命令来手动禁用,因为在设置中没有禁用它的选项。
|
||||
|
||||
```
|
||||
sudo ubuntu-report -f send no
|
||||
```
|
||||
|
||||
![Turn off location services in Ubuntu 22.10][6]
|
||||
|
||||
#### 5、探索 GNOME 43 的功能
|
||||
|
||||
在 Ubuntu 22.10 版本中,最具视觉和功能性的变化是 GNOME 43。因为 GNOME 43 有一些根本性和核心变化,所以它会影响每个人和他们的工作。GNOME 43 带来了一个新的药丸形状的托盘菜单,并更新了具有文件和 GNOME Web 等新功能的原生应用程序。
|
||||
|
||||
请查看更为详细的 [GNOME 43 功能][7] 一文,以了解更多信息,或者你也可以自己探索 GNOME 43。
|
||||
|
||||
![Quick Settings Demo in GNOME 43][8]
|
||||
|
||||
#### 6、确保音频与 Pipewire 配合使用
|
||||
|
||||
如果你经常使用音频,或者你的工作范围涉及到声音捕获、播放等内容,请确保在 Ubuntu 22.10 中,你的音频在有线或蓝牙情况下都能正常工作。
|
||||
|
||||
因为 Ubuntu 22.10 这个版本中的音频服务器是多年来第一次发生了变化,传统的 PulseAudio 被现代的 Pipewire 所取代。因此,请务必进行验证音频是否能正常使用。
|
||||
|
||||
#### 7、安装其他软件包
|
||||
|
||||
确保你可以在 Ubuntu 桌面上,播放所有视频和音频格式是很重要的。如果你在设置期间跳过了额外的软件包安装,可以通过以下命令进行安装。
|
||||
|
||||
```
|
||||
sudo apt install ubuntu-restricted-extras
|
||||
```
|
||||
|
||||
这可以解决 Ubuntu 中的任何视频或音频的播放问题,特别是 GNOME 视频无法播放的情况(因为GNOME 视频在默认情况下将无法播放任何内容)。
|
||||
|
||||
#### 8、安装基本的应用程序
|
||||
|
||||
带有 GNOME 的基础 Ubuntu 版本只有非常基本的应用程序。因此,在你使用 Ubuntu 之前,你需要安装一些其他必要的应用程序。
|
||||
|
||||
由于每个人的工作范围不同,每个人所需的应用程序也都不同。因此,在这里我仅提供一个通用的应用程序的列表,我认为你可以把这些应用程序都安装上,因为这些应用程序对所有人来说都很常用。
|
||||
|
||||
- GIMP – 进阶的照片编辑器
|
||||
- VLC – 无需额外编解码器即可播放任何内容的媒体播放器
|
||||
- Leafpad – 轻量级文本编辑器(甚至比默认的文本编辑器 gedit 还要更轻量级)
|
||||
- Synaptic – 更好的软件包管理器
|
||||
|
||||
安装这些应用程序的命令:
|
||||
|
||||
```
|
||||
sudo apt install -y gimp vlc leafpad synaptic
|
||||
```
|
||||
|
||||
#### 9、获取一些 GNOME 扩展
|
||||
|
||||
你可以使用几个很酷的扩展程序,来扩展 GNOME 43 的功能,包括自定义顶部栏、托盘、更改 adwaita 外观等等。首先,使用下面的命令通过 Flatpak 来安装 GNOME 扩展管理器。
|
||||
|
||||
```
|
||||
flatpak install flathub com.mattjakeman.ExtensionManager
|
||||
```
|
||||
|
||||
安装完成后,你就可以在 GNOME 扩展管理器中搜索你想要的任何扩展了。以下是一些必要扩展,你可以用它们来快速扩展 GNOME 43 的功能,我认为它们非常适合你全新的 Ubuntu 桌面。你只需在扩展管理器应用程序中,搜索这些名称即可。
|
||||
|
||||
- Caffeine
|
||||
- Custom Hot Corners
|
||||
- Dash to Dock
|
||||
- Blur my shell
|
||||
- Gradients
|
||||
- Hide Activities Button
|
||||
- Net speed simplified
|
||||
|
||||
#### 10、准备备份
|
||||
|
||||
我们总是在我们遇到困难时,才觉得有必要备份。所以,请确保从一开始你就为备份做好了准备。理想的备份应用程序是 Timeshift,它很容易安装和使用。
|
||||
|
||||
以下是你可以从终端安装 Timeshift 的一组命令。安装完成后,你可以打开 Timeshift,并按照屏幕上的说明,设置备份了。
|
||||
|
||||
```
|
||||
sudo add-apt-repository -y ppa:teejee2008/ppasudo apt-get updatesudo apt-get install timeshift
|
||||
```
|
||||
|
||||
### 额外小贴士
|
||||
|
||||
如果你想进一步定制你新安装的 Ubuntu 系统,以下是一些额外的小贴士。
|
||||
|
||||
#### 安装漂亮的字体
|
||||
|
||||
字体是一个很小却影响很大的设置项。虽然,Ubuntu 自带有好用的“Ubuntu regular”字体。
|
||||
|
||||
但是,你也可以从 Ubuntu 的官方仓库中安装一些其他漂亮的字体。以下是安装字体的一些命令。
|
||||
|
||||
```
|
||||
sudo apt install fonts-roboto fonts-cascadia-code fonts-firacode
|
||||
```
|
||||
|
||||
安装完成后,你可以使用 [GNOME Tweak 工具][9],来更改字体。
|
||||
|
||||
#### 安装 TLP
|
||||
|
||||
如果你经常使用笔记本电脑,那么你要好好爱惜电脑的电池。虽然电池用久了总是会损坏的,但你可以采取一些步骤,来减缓电池的老化。TLP 是 Linux 中自动优化电池使用、减缓电池老化的最好的程序之一。你可以使用以下命令来安装 TLP。
|
||||
|
||||
```
|
||||
sudo apt install tlp
|
||||
```
|
||||
|
||||
我建议你将电池的电量始终保持在 50% 至 80% 之间。不要过度充电或让电池电量消耗到 50% 以下,也不要给电脑连续插电。
|
||||
|
||||
### 总结
|
||||
|
||||
以上就是安装桌面 Ubuntu 22.10 后要做的 10 件事啦。
|
||||
|
||||
我希望这篇文章会对你有帮助,你能够通过本文的方法来定制和调整你的 Ubuntu 桌面。那么你认为在安装好 Ubuntu 后,什么事是最推荐做的呢?请在评论区中告诉我吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/things-to-do-ubuntu-22-10/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[chai001125](https://github.com/chai001125)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/10/u2210-things-hd-1024x576.jpg
|
||||
[2]: https://www.debugpoint.com/ubuntu-22-10/
|
||||
[3]: https://www.debugpoint.com/remove-firefox-snap-ubuntu/
|
||||
[4]: https://flathub.org/apps/details/org.mozilla.firefox
|
||||
[5]: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/
|
||||
[6]: https://www.debugpoint.com/wp-content/uploads/2022/10/Turn-off-location-services-in-Ubuntu-22.10.jpg
|
||||
[7]: https://www.debugpoint.com/gnome-43/
|
||||
[8]: https://www.debugpoint.com/wp-content/uploads/2022/08/Quick-Settings-Demo-in-GNOME-43.gif
|
||||
[9]: https://www.debugpoint.com/customize-your-ubuntu-desktop-using-gnome-tweak/
|
@ -0,0 +1,144 @@
|
||||
[#]: subject: "How to Install Python 3.10 in Ubuntu and Other Related Linux"
|
||||
[#]: via: "https://www.debugpoint.com/install-python-3-10-ubuntu/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
如何在 Ubuntu 和其他相关 Linux 中安装 Python 3.10
|
||||
======
|
||||
|
||||
**计划为工作安装 Python 3.10?以下是在 Ubuntu 和相关发行版中安装 Python 3.10 的方法。**
|
||||
|
||||
Python 3.10 于 2021 年 10 月 25 日发布,具有附加功能和更新。此版本带来了更好的错误消息处理、新的模式匹配功能、TypeAlias、用户定义的类型保护等。你可以在[此处][1]阅读发布亮点。
|
||||
|
||||
在编写本指南时,大多数当前发行版都采用 Python 3.10。例如,Ubuntu 22.04 LTS 和 Fedora 36 默认都有 Python 3.10。
|
||||
|
||||
也就是说,如果你现在需要任何不支持的版本中的 Python 3.10,你可以使用[下面的可靠 PPA][2]在 Ubuntu 中安装最新的 Python 3.10。下面是方法。
|
||||
|
||||
### 如何在 Ubuntu 上安装 Python 3.10
|
||||
|
||||
此 PPA 可用于 Ubuntu 21.10、Ubuntu 21.04、Ubuntu 20.04 LTS、Ubuntu 18.04 LTS 和 Linux Mint 20.x、Elementary OS 6 和其他相关的基于 Ubuntu 的发行版。大多数默认情况下不支持 3.10。
|
||||
|
||||
- 打开终端并添加以下 PPA。
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||
```
|
||||
|
||||
- 使用以下命令刷新缓存。
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
- 并使用以下命令安装 Python 3.10。
|
||||
|
||||
```
|
||||
sudo apt install python3.10
|
||||
```
|
||||
|
||||
### 设置 Python 版本
|
||||
|
||||
将 Python 3.10 设置为默认值需要一些额外的步骤。请跟上。
|
||||
|
||||
**警告**:你的 Ubuntu 系统中的许多应用程序依赖于 Python 3.9 的库存版本。因此,请确保你的工作应用(例如 GIMP、GNOME 终端等)与 Python 3.10 兼容。所以,要小心。
|
||||
|
||||
**快速提示:** 如果要检查已安装的系统包中的哪些依赖于特定版本,请使用 `apt-cache` 命令的 `rdepends` 开关。在下面的示例中,我检查哪些已安装的包依赖于 Python 3.8。
|
||||
|
||||
```
|
||||
apt-cache rdepends python3.8
|
||||
```
|
||||
|
||||
```
|
||||
[~]$ apt-cache rdepends python3.8
|
||||
python3.8
|
||||
Reverse Depends:
|
||||
python3.8-dbg
|
||||
virtualbox
|
||||
python3.8-venv
|
||||
python3.8-full
|
||||
libpython3.8-testsuite
|
||||
libglib2.0-tests
|
||||
idle-python3.8
|
||||
idle-python3.8
|
||||
python3.8-minimal
|
||||
python3.8-doc
|
||||
python3.8-dev
|
||||
python3.8-dbg
|
||||
python3-uno
|
||||
gedit
|
||||
virtualbox
|
||||
stimfit
|
||||
python3.8-venv
|
||||
python3-stfio
|
||||
python3-escript-mpi
|
||||
python3-escript
|
||||
python3-csound
|
||||
pitivi
|
||||
obs-studio
|
||||
liferea
|
||||
libpython3.8-testsuite
|
||||
libglib2.0-tests
|
||||
kitty
|
||||
kdevelop-python
|
||||
idle-python3.8
|
||||
idle-python3.8
|
||||
rhythmbox-plugins
|
||||
python3.8-minimal
|
||||
python3.8-doc
|
||||
python3.8-dev
|
||||
python3
|
||||
python3-uno
|
||||
python3-all
|
||||
cluster-glue
|
||||
gedit
|
||||
[~]$
|
||||
```
|
||||
|
||||
#### 使用 Python 3.10 作为默认 Python3
|
||||
|
||||
- 首先,使用终端中的以下命令检查当前默认版本。
|
||||
|
||||
```
|
||||
python3 --version
|
||||
```
|
||||
|
||||
- 使用 `update-alternatives` 创建指向 python3 的符号链接。
|
||||
|
||||
```
|
||||
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
|
||||
```
|
||||
|
||||
```
|
||||
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
|
||||
```
|
||||
|
||||
- 并通过以下命令选择使用哪一个作为 Python3:
|
||||
|
||||
```
|
||||
sudo update-alternatives --config python3
|
||||
```
|
||||
|
||||
![在 Ubuntu 中安装 Python 3.10][3]
|
||||
|
||||
这就是所有步骤。现在,你可以开始在当前的 Ubuntu 版本中使用最新的 Python 进行工作/学习。你可以使用上述命令切换到库存版本并在任何时间更改版本号。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/install-python-3-10-ubuntu/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lkxed
|
||||
[1]: https://docs.python.org/3.10/whatsnew/3.10.html
|
||||
[2]: https://github.com/deadsnakes
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2021/10/Installed-Python-3.10-in-Ubuntu-1024x472.jpeg
|
Loading…
Reference in New Issue
Block a user