translated

This commit is contained in:
geekpi 2022-10-27 08:53:43 +08:00
parent 5759795967
commit b2a4de300e
3 changed files with 144 additions and 235 deletions

View File

@ -1,91 +0,0 @@
[#]: subject: "How to Check: Xorg or Wayland Display Server?"
[#]: via: "https://www.debugpoint.com/check-wayland-or-xorg/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Check: Xorg or Wayland Display Server?
======
**Heres how you can quickly check whether you are running Xorg or Wayland Display Server.**
With every passing day, the modern Wayland display server is making its way to all Linux distributions. Although the legacy Xorg is still relevant and will stay, Wayland is undoubtedly better in security and other performance aspects.
However, Xorg will not completely phase out anytime soon. Probably never.
If you are running any Linux distribution, how can you check whether you are running Xorg or Wayland? Heres how.
### Wayland or Xorg: Which one are you running?
- Open a terminal window (CTRL+ALT+T) in your Linux distributions (e.g. Ubuntu, Fedora, Arch…etc.).
- Then type the following command and hit enter.
```
echo $XDG_SESSION_TYPE
```
- The output of the command will tell you whether the current session is Wayland or Xorg (X11).
```
[debugpoint@fedora ~]$ echo $XDG_SESSION_TYPEwayland
```
![This command can give you details about Xorg or Wayland][1]
Thats simple. However, there are other ways as well.
### Other methods
#### Using Settings
If you want a graphical method, open your Linux distribution settings application. In the about section, you should see the Wayland/X11 mentioned under some label.
For example, in the GNOME Settings, you can find it under “Windowing system”, as shown below.
![In GNOME Settings you can find it][2]
#### Using session values
You can also find it out using `loginctl` which is the [systemd][3] login manager. Remember, it only works for systemd-based systems.
Open a terminal and run the below command. You can see the session id value. In this example `c2`.
```
loginctl
```
Now, pass the session id to the following command to get the display server type. Make sure to change c2 to your system spec.
```
loginctl show-session c2 -p Type
```
![Using loginctl to find out][4]
### Wrapping Up
So, these are some of the ways you can find out whether you are running Systemd or Xorg in your Linux system. You can also use the above commands in your shell scripts for further process automation.
Cheers.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/check-wayland-or-xorg/
作者:[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/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

View File

@ -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? Heres 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. Heres 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 dont 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]
Thats 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

View File

@ -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