mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-16 22:42:21 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
f3bb6188b1
@ -1,17 +1,18 @@
|
|||||||
使用 browser-mpris2(Chrome 扩展)将 YouTube 播放器控件添加到 Linux 桌面
|
使用 Chrome 扩展将 YouTube 播放器控件添加到 Linux 桌面
|
||||||
======
|
======
|
||||||
一个我怀念的 Unity 功能(虽然只使用了一小段时间)是在 Web 浏览器中访问 YouTube 等网站时自动获取 Ubuntu 声音指示器中的播放器控件,因此你可以直接从顶部栏暂停或停止视频,以及浏览视频/歌曲信息和预览。
|
|
||||||
|
|
||||||
这个 Unity 功能已经消失很久了,但我正在为 Gnome Shell 寻找类似的东西,然后我遇到了 **[browser-mpris2][1],这是一个为 Google Chrome/Chromium 实现 MPRIS v2 接口的扩展,目前只支持 YouTube**,我想可能会有一些 Linux Uprising 的读者会喜欢这个。
|
一个我怀念的 Unity 功能(虽然只使用了一小段时间)是在 Web 浏览器中访问 YouTube 等网站时在 Ubuntu 声音指示器中自动出现播放器控件,因此你可以直接从顶部栏暂停或停止视频,以及浏览视频/歌曲信息和预览。
|
||||||
|
|
||||||
**该扩展还适用于 Opera 和 Vivaldi 等基于 Chromium 的 Web 浏览器。**
|
这个 Unity 功能已经消失很久了,但我正在为 Gnome Shell 寻找类似的东西,然后我遇到了 [browser-mpris2][1],这是一个为 Google Chrome/Chromium 实现 MPRIS v2 接口的扩展,目前只支持 YouTube,我想可能会有一些读者会喜欢这个。
|
||||||
**
|
|
||||||
** **browser-mpris2 也支持 Firefox,但因为通过 about:debugging 加载扩展是临时的,而这是 browser-mpris2 所需要的,因此本文不包括 Firefox 的指导。开发人员[打算][2]将来将扩展提交到 Firefox 插件网站上。**
|
|
||||||
|
|
||||||
**使用此 Chrome 扩展,你可以在支持 MPRIS2 的 applets 中获得 YouTube 媒体播放器控件(播放、暂停、停止和查找
|
该扩展还适用于 Opera 和 Vivaldi 等基于 Chromium 的 Web 浏览器。
|
||||||
)**。例如,如果你使用 Gnome Shell,你可将 YouTube 媒体播放器控件作为永久通知,或者你可以使用 Media Player Indicator 之类的扩展来实现此目的。在 Cinnamon /Linux Mint with Cinnamon 中,它出现在声音 Applet 中。
|
|
||||||
|
|
||||||
**我无法在 Unity 上用它**,我不知道为什么。我没有在不同桌面环境(KDE、Xfce、MATE 等)中使用其他支持 MPRIS2 的 applet 尝试此扩展。如果你尝试过,请告诉我们它是否适用于你的桌面环境/支持 MPRIS2 的 applet。
|
browser-mpris2 也支持 Firefox,但因为通过 `about:debugging` 加载扩展是临时的,而这是 browser-mpris2 所需要的,因此本文不包括 Firefox 的指导。开发人员[打算][2]将来将扩展提交到 Firefox 插件网站上。
|
||||||
|
|
||||||
|
使用此 Chrome 扩展,你可以在支持 MPRIS2 的 applets 中获得 YouTube 媒体播放器控件(播放、暂停、停止和查找
|
||||||
|
)。例如,如果你使用 Gnome Shell,你可将 YouTube 媒体播放器控件作为永久显示的控件,或者你可以使用 Media Player Indicator 之类的扩展来实现此目的。在 Cinnamon /Linux Mint with Cinnamon 中,它出现在声音 Applet 中。
|
||||||
|
|
||||||
|
我无法在 Unity 上用它,我不知道为什么。我没有在不同桌面环境(KDE、Xfce、MATE 等)中使用其他支持 MPRIS2 的 applet 尝试此扩展。如果你尝试过,请告诉我们它是否适用于你的桌面环境/支持 MPRIS2 的 applet。
|
||||||
|
|
||||||
以下是在使用 Gnome Shell 的 Ubuntu 18.04 并装有 Chromium 浏览器的[媒体播放器指示器][3]的截图,其中显示了有关当前正在播放的 YouTube 视频的信息及其控件(播放/暂停,停止和查找):
|
以下是在使用 Gnome Shell 的 Ubuntu 18.04 并装有 Chromium 浏览器的[媒体播放器指示器][3]的截图,其中显示了有关当前正在播放的 YouTube 视频的信息及其控件(播放/暂停,停止和查找):
|
||||||
|
|
||||||
@ -19,42 +20,41 @@
|
|||||||
|
|
||||||
在 Linux Mint 19 Cinnamon 中使用其默认声音 applet 和 Chromium 浏览器的截图:
|
在 Linux Mint 19 Cinnamon 中使用其默认声音 applet 和 Chromium 浏览器的截图:
|
||||||
|
|
||||||
|
|
||||||
![](https://2.bp.blogspot.com/-I2DuYetv7eQ/W3VtUUcg26I/AAAAAAAABXc/Tv-RemkyO60k6CC_mYUxewG-KfVgpFefACLcBGAs/s1600/browser-mpris2-cinnamon-linux-mint.png)
|
![](https://2.bp.blogspot.com/-I2DuYetv7eQ/W3VtUUcg26I/AAAAAAAABXc/Tv-RemkyO60k6CC_mYUxewG-KfVgpFefACLcBGAs/s1600/browser-mpris2-cinnamon-linux-mint.png)
|
||||||
|
|
||||||
### 如何为 Google Chrom/Chromium安装 browser-mpris2
|
### 如何为 Google Chrom/Chromium安装 browser-mpris2
|
||||||
|
|
||||||
**1\. 如果你还没有安装 Git 就安装它**
|
1、 如果你还没有安装 Git 就安装它
|
||||||
|
|
||||||
在 Debian/Ubuntu/Linux Mint 中,使用此命令安装 git:
|
在 Debian/Ubuntu/Linux Mint 中,使用此命令安装 git:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt install git
|
sudo apt install git
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**2\. 下载并安装 [browser-mpris2][1] 所需文件。**
|
2、 下载并安装 [browser-mpris2][1] 所需文件。
|
||||||
|
|
||||||
|
下面的命令克隆了 browser-mpris2 的 Git 仓库并将 chrome-mpris2 安装到 `/usr/local/bin/`(在一个你可以保存 browser-mpris2 文件夹的地方运行 `git clone ...` 命令,由于它会被 Chrome/Chromium 使用,你不能删除它):
|
||||||
|
|
||||||
下面的命令克隆了 browser-mpris2 的 Git 仓库并将 chrome-mpris2 安装到 `/usr/local/bin/`(在一个你可以保存 browser-mpris2 文件夹的地方运行 “git clone ...” 命令,由于它会被 Chrome/Chromium 使用,你不能删除它):
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/otommod/browser-mpris2
|
git clone https://github.com/otommod/browser-mpris2
|
||||||
sudo install browser-mpris2/native/chrome-mpris2 /usr/local/bin/
|
sudo install browser-mpris2/native/chrome-mpris2 /usr/local/bin/
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**3\. 在基于 Chrome/Chromium 的 Web 浏览器中加载此扩展。**
|
3、 在基于 Chrome/Chromium 的 Web 浏览器中加载此扩展。
|
||||||
|
|
||||||
![](https://3.bp.blogspot.com/-yEoNFj2wAXM/W3Vvewa979I/AAAAAAAABXo/dmltlNZk3J4sVa5jQenFFrT28ecklY92QCLcBGAs/s640/browser-mpris2-chrome-developer-load-unpacked.png)
|
![](https://3.bp.blogspot.com/-yEoNFj2wAXM/W3Vvewa979I/AAAAAAAABXo/dmltlNZk3J4sVa5jQenFFrT28ecklY92QCLcBGAs/s640/browser-mpris2-chrome-developer-load-unpacked.png)
|
||||||
|
|
||||||
打开 Google Chrome、Chromium、Opera 或 Vivaldi 浏览器,进入 Extensions 页面(在 URL 栏中输入 `chrome://extensions`),在屏幕右上角切换到`开发者模式`。然后选择 `Load Unpacked` 并选择 chrome-mpris2 目录(确保没有选择子文件夹)。
|
打开 Google Chrome、Chromium、Opera 或 Vivaldi 浏览器,进入 Extensions 页面(在 URL 栏中输入 `chrome://extensions`),在屏幕右上角切换到“开发者模式”。然后选择 “Load Unpacked” 并选择 chrome-mpris2 目录(确保没有选择子文件夹)。
|
||||||
|
|
||||||
复制扩展 ID 并保存它,因为你以后需要它(它类似于这样:`emngjajgcmeiligomkgpngljimglhhii`,但它会与你的不一样,因此确保使用你计算机中的 ID!)。
|
复制扩展 ID 并保存它,因为你以后需要它(它类似于这样:`emngjajgcmeiligomkgpngljimglhhii`,但它会与你的不一样,因此确保使用你计算机中的 ID!)。
|
||||||
|
|
||||||
**4\. 运行 **`install-chrome.py`**(在 `browser-mpris2/native` 文件夹中),指定扩展 id 和 chrome-mpris2 路径。
|
4、 运行 `install-chrome.py`(在 `browser-mpris2/native` 文件夹中),指定扩展 id 和 chrome-mpris2 路径。
|
||||||
|
|
||||||
在终端中使用此命令(将 `REPLACE-THIS-WITH-EXTENSION-ID` 替换为上一步中 `chrome://extensions` 下显示的 browser-mpris2 扩展 ID)安装此扩展:
|
在终端中使用此命令(将 `REPLACE-THIS-WITH-EXTENSION-ID` 替换为上一步中 `chrome://extensions` 下显示的 browser-mpris2 扩展 ID)安装此扩展:
|
||||||
|
|
||||||
```
|
```
|
||||||
browser-mpris2/native/install-chrome.py REPLACE-THIS-WITH-EXTENSION-ID /usr/local/bin/chrome-mpris2
|
browser-mpris2/native/install-chrome.py REPLACE-THIS-WITH-EXTENSION-ID /usr/local/bin/chrome-mpris2
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
你只需要运行此命令一次,无需将其添加到启动或其他类似的地方。你在 Google Chrome 或 Chromium 浏览器中播放的任何 YouTube 视频都应显示在你正在使用的任何 MPRISv2 applet 中。你无需重启 Web 浏览器。
|
你只需要运行此命令一次,无需将其添加到启动或其他类似的地方。你在 Google Chrome 或 Chromium 浏览器中播放的任何 YouTube 视频都应显示在你正在使用的任何 MPRISv2 applet 中。你无需重启 Web 浏览器。
|
||||||
@ -66,7 +66,7 @@ via: https://www.linuxuprising.com/2018/08/add-youtube-player-controls-to-your.h
|
|||||||
作者:[Logix][a]
|
作者:[Logix][a]
|
||||||
选题:[lujun9972](https://github.com/lujun9972)
|
选题:[lujun9972](https://github.com/lujun9972)
|
||||||
译者:[geekpi](https://github.com/geekpi)
|
译者:[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/) 荣誉推出
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
@ -0,0 +1,153 @@
|
|||||||
|
如何提交你的第一个 Linux 内核补丁
|
||||||
|
======
|
||||||
|
> 学习如何做出你的首个 Linux 内核贡献,以及在开始之前你应该知道什么。
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22)
|
||||||
|
|
||||||
|
Linux 内核是最大且变动最快的开源项目之一,它由大约 53,600 个文件和近 2,000 万行代码组成。在全世界范围内超过 15,600 位程序员为它贡献代码,Linux 内核项目的维护者使用了如下的协作模型。
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/karnik_figure1.png)
|
||||||
|
|
||||||
|
本文中,为了便于在 Linux 内核中提交你的第一个贡献,我将为你提供一个必需的快速检查列表,以告诉你在提交补丁时,应该去查看和了解的内容。对于你贡献的第一个补丁的提交流程方面的更多内容,请阅读 [KernelNewbies 的第一个内核补丁教程][1]。
|
||||||
|
|
||||||
|
### 为内核作贡献
|
||||||
|
|
||||||
|
**第 1 步:准备你的系统。**
|
||||||
|
|
||||||
|
本文开始之前,假设你的系统已经具备了如下的工具:
|
||||||
|
|
||||||
|
+ 文本编辑器
|
||||||
|
+ Email 客户端
|
||||||
|
+ 版本控制系统(例如:git)
|
||||||
|
|
||||||
|
**第 2 步:下载 Linux 内核代码仓库。**
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone -b staging-testing
|
||||||
|
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
|
||||||
|
```
|
||||||
|
|
||||||
|
复制你的当前配置:
|
||||||
|
|
||||||
|
```
|
||||||
|
cp /boot/config-`uname -r`* .config
|
||||||
|
```
|
||||||
|
|
||||||
|
**第 3 步:构建/安装你的内核。**
|
||||||
|
|
||||||
|
```
|
||||||
|
make -jX
|
||||||
|
sudo make modules_install install
|
||||||
|
```
|
||||||
|
|
||||||
|
**第 4 步:创建一个分支并切换到该分支。**
|
||||||
|
|
||||||
|
```
|
||||||
|
git checkout -b first-patch
|
||||||
|
```
|
||||||
|
|
||||||
|
**第 5 步:更新你的内核并指向到最新的代码。**
|
||||||
|
|
||||||
|
```
|
||||||
|
git fetch origin
|
||||||
|
git rebase origin/staging-testing
|
||||||
|
```
|
||||||
|
|
||||||
|
**第 6 步:在最新的代码库上产生一个变更。**
|
||||||
|
|
||||||
|
使用 `make` 命令重新编译,确保你的变更没有错误。
|
||||||
|
|
||||||
|
**第 7 步:提交你的变更并创建一个补丁。**
|
||||||
|
|
||||||
|
```
|
||||||
|
git add <file>
|
||||||
|
git commit -s -v
|
||||||
|
git format-patch -o /tmp/ HEAD^
|
||||||
|
```
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/karnik_figure2.png)
|
||||||
|
|
||||||
|
主题是由冒号分隔的文件名组成,跟着是使用祈使语态来描述补丁做了什么。空行之后是强制的 `signed off` 标记,最后是你的补丁的 `diff` 信息。
|
||||||
|
|
||||||
|
下面是另外一个简单补丁的示例:
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/karnik_figure3.png)
|
||||||
|
|
||||||
|
接下来,[从命令行使用邮件][2](在本例子中使用的是 Mutt)发送这个补丁:
|
||||||
|
|
||||||
|
```
|
||||||
|
mutt -H /tmp/0001-<whatever your filename is>
|
||||||
|
```
|
||||||
|
|
||||||
|
使用 [get_maintainer.pl 脚本][11],去了解你的补丁应该发送给哪位维护者的列表。
|
||||||
|
|
||||||
|
### 提交你的第一个补丁之前,你应该知道的事情
|
||||||
|
|
||||||
|
* [Greg Kroah-Hartman](3) 的 [staging tree][4] 是提交你的 [第一个补丁][1] 的最好的地方,因为他更容易接受新贡献者的补丁。在你熟悉了补丁发送流程以后,你就可以去发送复杂度更高的子系统专用的补丁。
|
||||||
|
* 你也可以从纠正代码中的编码风格开始。想学习更多关于这方面的内容,请阅读 [Linux 内核编码风格文档][5]。
|
||||||
|
* [checkpatch.pl][6] 脚本可以帮你检测编码风格方面的错误。例如,运行如下的命令:`perl scripts/checkpatch.pl -f drivers/staging/android/* | less`
|
||||||
|
* 你可以去补全开发者留下的 TODO 注释中未完成的内容:`find drivers/staging -name TODO`
|
||||||
|
* [Coccinelle][7] 是一个模式匹配的有用工具。
|
||||||
|
* 阅读 [归档的内核邮件][8]。
|
||||||
|
* 为找到灵感,你可以去遍历 [linux.git 日志][9]去查看以前的作者的提交内容。
|
||||||
|
* 注意:不要与你的补丁的审核者在邮件顶部交流!下面就是一个这样的例子:
|
||||||
|
|
||||||
|
**错误的方式:**
|
||||||
|
|
||||||
|
```
|
||||||
|
Chris,
|
||||||
|
Yes let’s schedule the meeting tomorrow, on the second floor.
|
||||||
|
|
||||||
|
> On Fri, Apr 26, 2013 at 9:25 AM, Chris wrote:
|
||||||
|
> Hey John, I had some questions:
|
||||||
|
> 1. Do you want to schedule the meeting tomorrow?
|
||||||
|
> 2. On which floor in the office?
|
||||||
|
> 3. What time is suitable to you?
|
||||||
|
```
|
||||||
|
(注意那最后一个问题,在回复中无意中落下了。)
|
||||||
|
|
||||||
|
**正确的方式:**
|
||||||
|
|
||||||
|
```
|
||||||
|
Chris,
|
||||||
|
See my answers below...
|
||||||
|
|
||||||
|
> On Fri, Apr 26, 2013 at 9:25 AM, Chris wrote:
|
||||||
|
> Hey John, I had some questions:
|
||||||
|
> 1. Do you want to schedule the meeting tomorrow?
|
||||||
|
Yes tomorrow is fine.
|
||||||
|
> 2. On which floor in the office?
|
||||||
|
Let's keep it on the second floor.
|
||||||
|
> 3. What time is suitable to you?
|
||||||
|
09:00 am would be alright.
|
||||||
|
```
|
||||||
|
(所有问题全部回复,并且这种方式还保存了阅读的时间。)
|
||||||
|
* [Eudyptula challenge][10] 是学习内核基础知识的非常好的方式。
|
||||||
|
|
||||||
|
想学习更多内容,阅读 [KernelNewbies 的第一个内核补丁教程][1]。之后如果你还有任何问题,可以在 [kernelnewbies 邮件列表][12] 或者 [#kernelnewbies IRC channel][13] 中提问。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/18/8/first-linux-kernel-patch
|
||||||
|
|
||||||
|
作者:[Sayli Karnik][a]
|
||||||
|
选题:[lujun9972](https://github.com/lujun9972)
|
||||||
|
译者:[qhwdw](https://github.com/qhwdw)
|
||||||
|
校对:[wxy](https://github.com/wxy)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:https://opensource.com/users/sayli
|
||||||
|
[1]:https://kernelnewbies.org/FirstKernelPatch
|
||||||
|
[2]:https://opensource.com/life/15/8/top-4-open-source-command-line-email-clients
|
||||||
|
[3]:https://twitter.com/gregkh
|
||||||
|
[4]:https://www.kernel.org/doc/html/v4.15/process/2.Process.html
|
||||||
|
[5]:https://www.kernel.org/doc/html/v4.10/process/coding-style.html
|
||||||
|
[6]:https://github.com/torvalds/linux/blob/master/scripts/checkpatch.pl
|
||||||
|
[7]:http://coccinelle.lip6.fr/
|
||||||
|
[8]:linux-kernel@vger.kernel.org
|
||||||
|
[9]:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/
|
||||||
|
[10]:http://eudyptula-challenge.org/
|
||||||
|
[11]:https://github.com/torvalds/linux/blob/master/scripts/get_maintainer.pl
|
||||||
|
[12]:https://kernelnewbies.org/MailingList
|
||||||
|
[13]:https://kernelnewbies.org/IRC
|
@ -1,3 +1,5 @@
|
|||||||
|
translating by Flowsnow
|
||||||
|
|
||||||
Peeking into your Linux packages
|
Peeking into your Linux packages
|
||||||
======
|
======
|
||||||
Do you ever wonder how many _thousands_ of packages are installed on your Linux system? And, yes, I said "thousands." Even a fairly modest Linux system is likely to have well over a thousand packages installed. And there are many ways to get details on what they are.
|
Do you ever wonder how many _thousands_ of packages are installed on your Linux system? And, yes, I said "thousands." Even a fairly modest Linux system is likely to have well over a thousand packages installed. And there are many ways to get details on what they are.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
translating by Flowsnow
|
||||||
|
|
||||||
Build a bikesharing app with Redis and Python
|
Build a bikesharing app with Redis and Python
|
||||||
======
|
======
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
translating by Flowsnow
|
||||||
|
|
||||||
How To Rename Multiple Files At Once In Linux
|
How To Rename Multiple Files At Once In Linux
|
||||||
======
|
======
|
||||||
|
|
||||||
|
@ -1,179 +0,0 @@
|
|||||||
How to Install Pip on Ubuntu
|
|
||||||
======
|
|
||||||
**Pip is a command line tool that allows you to install software packages written in Python. Learn how to install Pip on Ubuntu and how to use it for installing Python applications.**
|
|
||||||
|
|
||||||
There are numerous ways to [install software on Ubuntu][1]. You can install applications from the software center, from downloaded DEB files, from PPA, from [Snap packages][2], [using Flatpak][3], using [AppImage][4] and even from the good old source code.
|
|
||||||
|
|
||||||
There is one more way to install packages in [Ubuntu][5]. It’s called Pip and you can use it to install Python-based applications.
|
|
||||||
|
|
||||||
### What is Pip
|
|
||||||
|
|
||||||
[Pip][6] stands for “Pip Installs Packages”. [Pip][7] is a command line based package management system. It is used to install and manage software written in [Python language][8].
|
|
||||||
|
|
||||||
You can use Pip to install packages listed in the Python Package Index ([PyPI][9]).
|
|
||||||
|
|
||||||
As a software developer, you can use pip to install various Python module and packages for your own Python projects.
|
|
||||||
|
|
||||||
As an end user, you may need pip in order to install some applications that are developed using Python and can be installed easily using pip. One such example is [Stress Terminal][10] application that you can easily install with pip.
|
|
||||||
|
|
||||||
Let’s see how you can install pip on Ubuntu and other Ubuntu-based distributions.
|
|
||||||
|
|
||||||
### How to install Pip on Ubuntu
|
|
||||||
|
|
||||||
![Install pip on Ubuntu Linux][11]
|
|
||||||
|
|
||||||
Pip is not installed on Ubuntu by default. You’ll have to install it. Installing pip on Ubuntu is really easy. I’ll show it to you in a moment.
|
|
||||||
|
|
||||||
Ubuntu 18.04 has both Python 2 and Python 3 installed by default. And hence, you should install pip for both Python versions.
|
|
||||||
|
|
||||||
Pip, by default, refers to the Python 2. Pip in Python 3 is referred by pip3.
|
|
||||||
|
|
||||||
Note: I am using Ubuntu 18.04 in this tutorial. But the instructions here should be valid for other versions like Ubuntu 16.04, 18.10 etc. You may also use the same commands on other Linux distributions based on Ubuntu such as Linux Mint, Linux Lite, Xubuntu, Kubuntu etc.
|
|
||||||
|
|
||||||
#### Install pip for Python 2
|
|
||||||
|
|
||||||
First, make sure that you have Python 2 installed. On Ubuntu, use the command below to verify.
|
|
||||||
|
|
||||||
```
|
|
||||||
python2 --version
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
If there is no error and a valid output that shows the Python version, you have Python 2 installed. So now you can install pip for Python 2 using this command:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo apt install python-pip
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
It will install pip and a number of other dependencies with it. Once installed, verify that you have pip installed correctly.
|
|
||||||
|
|
||||||
```
|
|
||||||
pip --version
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
It should show you a version number, something like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
This mans that you have successfully installed pip on Ubuntu.
|
|
||||||
|
|
||||||
#### Install pip for Python 3
|
|
||||||
|
|
||||||
You have to make sure that Python 3 is installed on Ubuntu. To check that, use this command:
|
|
||||||
|
|
||||||
```
|
|
||||||
python3 --version
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
If it shows you a number like Python 3.6.6, Python 3 is installed on your Linux system.
|
|
||||||
|
|
||||||
Now, you can install pip3 using the command below:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo apt install python3-pip
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
You should verify that pip3 has been installed correctly using this command:
|
|
||||||
|
|
||||||
```
|
|
||||||
pip3 --version
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
It should show you a number like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
It means that pip3 is successfully installed on your system.
|
|
||||||
|
|
||||||
### How to use Pip command
|
|
||||||
|
|
||||||
Now that you have installed pip, let’s quickly see some of the basic pip commands. These commands will help you use pip commands for searching, installing and removing Python packages.
|
|
||||||
|
|
||||||
To search packages from the Python Package Index, you can use the following pip command:
|
|
||||||
|
|
||||||
```
|
|
||||||
pip search <search_string>
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
For example, if you search or stress, it will show all the packages that have the string ‘stress’ in its name or description.
|
|
||||||
|
|
||||||
```
|
|
||||||
pip search stress
|
|
||||||
stress (1.0.0) - A trivial utility for consuming system resources.
|
|
||||||
s-tui (0.8.2) - Stress Terminal UI stress test and monitoring tool
|
|
||||||
stressypy (0.0.12) - A simple program for calling stress and/or stress-ng from python
|
|
||||||
fuzzing (0.3.2) - Tools for stress testing applications.
|
|
||||||
stressant (0.4.1) - Simple stress-test tool
|
|
||||||
stressberry (0.1.7) - Stress tests for the Raspberry Pi
|
|
||||||
mobbage (0.2) - A HTTP stress test and benchmark tool
|
|
||||||
stresser (0.2.1) - A large-scale stress testing framework.
|
|
||||||
cyanide (1.3.0) - Celery stress testing and integration test support.
|
|
||||||
pysle (1.5.7) - An interface to ISLEX, a pronunciation dictionary with stress markings.
|
|
||||||
ggf (0.3.2) - global geometric factors and corresponding stresses of the optical stretcher
|
|
||||||
pathod (0.17) - A pathological HTTP/S daemon for testing and stressing clients.
|
|
||||||
MatPy (1.0) - A toolbox for intelligent material design, and automatic yield stress determination
|
|
||||||
netblow (0.1.2) - Vendor agnostic network testing framework to stress network failures
|
|
||||||
russtress (0.1.3) - Package that helps you to put lexical stress in russian text
|
|
||||||
switchy (0.1.0a1) - A fast FreeSWITCH control library purpose-built on traffic theory and stress testing.
|
|
||||||
nx4_selenium_test (0.1) - Provides a Python class and apps which monitor and/or stress-test the NoMachine NX4 web interface
|
|
||||||
physical_dualism (1.0.0) - Python library that approximates the natural frequency from stress via physical dualism, and vice versa.
|
|
||||||
fsm_effective_stress (1.0.0) - Python library that uses the rheological-dynamical analogy (RDA) to compute damage and effective buckling stress in prismatic shell structures.
|
|
||||||
processpathway (0.3.11) - A nifty little toolkit to create stress-free, frustrationless image processing pathways from your webcam for computer vision experiments. Or observing your cat.
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to install an application using pip, you can use it in the following manner:
|
|
||||||
|
|
||||||
```
|
|
||||||
pip install <package_name>
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Pip doesn’t support tab completion so the package name should be exact. It will download all the necessary files and installed that package.
|
|
||||||
|
|
||||||
If you want to remove a Python package installed via pip, you can use the remove option in pip.
|
|
||||||
|
|
||||||
```
|
|
||||||
pip uninstall <installed_package_name>
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
You can use pip3 instead of pip in the above commands.
|
|
||||||
|
|
||||||
I hope this quick tip helped you to install pip on Ubuntu. If you have any questions or suggestions, please let me know in the comment section below.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://itsfoss.com/install-pip-ubuntu/
|
|
||||||
|
|
||||||
作者:[Abhishek Prakash][a]
|
|
||||||
选题:[lujun9972](https://github.com/lujun9972)
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]: https://itsfoss.com/author/abhishek/
|
|
||||||
[1]: https://itsfoss.com/how-to-add-remove-programs-in-ubuntu/
|
|
||||||
[2]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/
|
|
||||||
[3]: https://itsfoss.com/flatpak-guide/
|
|
||||||
[4]: https://itsfoss.com/use-appimage-linux/
|
|
||||||
[5]: https://www.ubuntu.com/
|
|
||||||
[6]: https://en.wikipedia.org/wiki/Pip_(package_manager)
|
|
||||||
[7]: https://pypi.org/project/pip/
|
|
||||||
[8]: https://www.python.org/
|
|
||||||
[9]: https://pypi.org/
|
|
||||||
[10]: https://itsfoss.com/stress-terminal-ui/
|
|
||||||
[11]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/10/install-pip-ubuntu.png
|
|
@ -1,186 +0,0 @@
|
|||||||
A Front-end For Popular Package Managers
|
|
||||||
======
|
|
||||||
|
|
||||||
![](https://www.ostechnix.com/wp-content/uploads/2018/10/sysget-720x340.png)
|
|
||||||
|
|
||||||
Are you a distro-hopper who likes to try new Linux OSs every few days? If so, I have something for you. Say hello to **Sysget** , a front-end for popular package managers in Unix-like operating systems. You don’t need to learn about every package managers to do basic stuffs like installing, updating, upgrading and removing packages. You just need to remember one syntax for every package manager on every Unix-like operating systems. Sysget is a wrapper script for package managers and it is written in C++. The source code is freely available on GitHub.
|
|
||||||
|
|
||||||
Using Sysget, you can do all sorts of basic package management operations including the following:
|
|
||||||
|
|
||||||
* Install packages,
|
|
||||||
* Update packages,
|
|
||||||
* Upgrade packages,
|
|
||||||
* Search for packages,
|
|
||||||
* Remove packages,
|
|
||||||
* Remove orphan packages,
|
|
||||||
* Update database,
|
|
||||||
* Upgrade system,
|
|
||||||
* Clear package manager cache.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**An Important note to Linux learners:**
|
|
||||||
|
|
||||||
Sysget is not going to replace the package managers and definitely not suitable for everyone. If you’re a newbie who frequently switch to new Linux OS, Sysget may help. It is just wrapper script that helps the distro hoppers (or the new Linux users) who become frustrated when they have to learn new commands to install, update, upgrade, search and remove packages when using different package managers in different Linux distributions.
|
|
||||||
|
|
||||||
If you’re a Linux administrator or enthusiast who want to learn the internals of Linux, you should stick with your distribution’s package manager and learn to use it well.
|
|
||||||
|
|
||||||
### Installing Sysget
|
|
||||||
|
|
||||||
Installing sysget is trivial. Go to the [**releases page**][1] and download latest Sysget binary and install it as shown below. As of writing this guide, the latest version was 1.2.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo wget -O /usr/local/bin/sysget https://github.com/emilengler/sysget/releases/download/v1.2/sysget
|
|
||||||
|
|
||||||
$ sudo mkdir -p /usr/local/share/sysget
|
|
||||||
|
|
||||||
$ sudo chmod a+x /usr/local/bin/sysget
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
|
|
||||||
Sysget commands are mostly same as APT package manager, so it should be easy to use for the newbies.
|
|
||||||
|
|
||||||
When you run Sysget for the first time, you will be asked to choose the package manager you want to use. Since I am on Ubuntu, I chose **apt-get**.
|
|
||||||
|
|
||||||
![](https://www.ostechnix.com/wp-content/uploads/2018/10/sysget-1.png)
|
|
||||||
|
|
||||||
You must choose the right package manager depending upon the distribution you’re running. For instance, if you’re on Arch Linux, choose **pacman**. For CentOS, choose **yum**. For FreeBSD, choose **pkg**. The list of currently supported package managers are:
|
|
||||||
|
|
||||||
1. apt-get (Debian)
|
|
||||||
2. xbps (Void)
|
|
||||||
3. dnf (Fedora)
|
|
||||||
4. yum (Enterprise Linux/Legacy Fedora)
|
|
||||||
5. zypper (OpenSUSE)
|
|
||||||
6. eopkg (Solus)
|
|
||||||
7. pacman (Arch)
|
|
||||||
8. emerge (Gentoo)
|
|
||||||
9. pkg (FreeBSD)
|
|
||||||
10. chromebrew (ChromeOS)
|
|
||||||
11. homebrew (Mac OS)
|
|
||||||
12. nix (Nix OS)
|
|
||||||
13. snap (Independent)
|
|
||||||
14. npm (Javascript, Global)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Just in case you assigned a wrong package manager, you can set a new package manager using the following command:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo sysget set yum
|
|
||||||
Package manager changed to yum
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Just make sure you have chosen your native package manager.
|
|
||||||
|
|
||||||
Now, you can perform the package management operations as the way you do using your native package manager.
|
|
||||||
|
|
||||||
To install a package, for example Emacs, simply run:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo sysget install emacs
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
The above command will invoke the native package manager (In my case it is “apt-get”) and install the given package.
|
|
||||||
|
|
||||||
![](https://www.ostechnix.com/wp-content/uploads/2018/10/Install-package-using-Sysget.png)
|
|
||||||
|
|
||||||
Similarly, to remove a package, simply run:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo sysget remove emacs
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
![](https://www.ostechnix.com/wp-content/uploads/2018/10/Remove-package-using-Sysget.png)
|
|
||||||
|
|
||||||
Update software repository (database):
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo sysget update
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
**Search for a specific package:**
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo sysget search emacs
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
**Upgrade a single package:**
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo sysget upgrade emacs
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
**Upgrade all packages:**
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo sysget upgrade
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
**Remove all orphaned packages:**
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo sysget autoremove
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
**Clear the package manager cache:**
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo sysget clean
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
For more details, refer the help section:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sysget help
|
|
||||||
Help of sysget
|
|
||||||
sysget [OPTION] [ARGUMENT]
|
|
||||||
|
|
||||||
search [query] search for a package in the resporitories
|
|
||||||
install [package] install a package from the repos
|
|
||||||
remove [package] removes a package
|
|
||||||
autoremove removes not needed packages (orphans)
|
|
||||||
update update the database
|
|
||||||
upgrade do a system upgrade
|
|
||||||
upgrade [package] upgrade a specific package
|
|
||||||
clean clean the download cache
|
|
||||||
set [NEW MANAGER] set a new package manager
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Please remember that the sysget syntax is same for all package managers in different Linux distributions. You don’t need to memorize the commands for each package manager.
|
|
||||||
|
|
||||||
Again, I must tell you Sysget isn’t a replacement for a package manager. It is just wrapper for popular package managers in Unix-like systems and it performs the basic package management operations only.
|
|
||||||
|
|
||||||
Sysget might be somewhat useful for newbies and distro-hoppers who are lazy to learn new commands for different package manager. Give it a try if you’re interested and see if it helps.
|
|
||||||
|
|
||||||
And, that’s all for now. More good stuffs to come. Stay tuned!
|
|
||||||
|
|
||||||
Cheers!
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://www.ostechnix.com/sysget-a-front-end-for-popular-package-managers/
|
|
||||||
|
|
||||||
作者:[SK][a]
|
|
||||||
选题:[lujun9972][b]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]: https://www.ostechnix.com/author/sk/
|
|
||||||
[b]: https://github.com/lujun9972
|
|
||||||
[1]: https://github.com/emilengler/sysget/releases
|
|
@ -1,160 +0,0 @@
|
|||||||
Getting started with Minikube: Kubernetes on your laptop
|
|
||||||
======
|
|
||||||
A step-by-step guide for running Minikube.
|
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ)
|
|
||||||
|
|
||||||
Minikube is advertised on the [Hello Minikube][1] tutorial page as a simple way to run Kubernetes for Docker. While that documentation is very informative, it is primarily written for MacOS. You can dig deeper for instructions for Windows or a Linux distribution, but they are not very clear. And much of the documentation—like one on [installing drivers for Minikube][2]—is targeted at Debian/Ubuntu users.
|
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
|
|
||||||
1. You have [installed Docker][3].
|
|
||||||
|
|
||||||
2. Your computer is an RHEL/CentOS/Fedora-based workstation.
|
|
||||||
|
|
||||||
3. You have [installed a working KVM2 hypervisor][4].
|
|
||||||
|
|
||||||
4. You have a working **docker-machine-driver-kvm2**. The following commands will install the driver:
|
|
||||||
|
|
||||||
```
|
|
||||||
curl -Lo docker-machine-driver-kvm2 https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \
|
|
||||||
chmod +x docker-machine-driver-kvm2 \
|
|
||||||
&& sudo cp docker-machine-driver-kvm2 /usr/local/bin/ \
|
|
||||||
&& rm docker-machine-driver-kvm2
|
|
||||||
```
|
|
||||||
|
|
||||||
### Download, install, and start Minikube
|
|
||||||
|
|
||||||
1. Create a directory for the two files you will download: [minikube][5] and [kubectl][6].
|
|
||||||
|
|
||||||
|
|
||||||
2. Open a terminal window and run the following command to install minikube.
|
|
||||||
|
|
||||||
```
|
|
||||||
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that the minikube version (e.g., minikube-linux-amd64) may differ based on your computer's specs.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
3. **chmod** to make it writable.
|
|
||||||
|
|
||||||
```
|
|
||||||
chmod +x minikube
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
4. Move the file to the **/usr/local/bin** path so you can run it as a command.
|
|
||||||
|
|
||||||
```
|
|
||||||
mv minikube /usr/local/bin
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
5. Install kubectl using the following command (similar to the minikube installation process).
|
|
||||||
|
|
||||||
```
|
|
||||||
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Use the **curl** command to determine the latest version of Kubernetes.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
6. **chmod** to make kubectl writable.
|
|
||||||
|
|
||||||
```
|
|
||||||
chmod +x kubectl
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
7. Move kubectl to the **/usr/local/bin** path to run it as a command.
|
|
||||||
|
|
||||||
```
|
|
||||||
mv kubectl /usr/local/bin
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
8. Run **minikube start**. To do so, you need to have a hypervisor available. I used KVM2, and you can also use Virtualbox. Make sure to run the following command as a user instead of root so the configuration will be stored for the user instead of root.
|
|
||||||
|
|
||||||
```
|
|
||||||
minikube start --vm-driver=kvm2
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
It can take quite a while, so wait for it.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
9. Minikube should download and start. Use the following command to make sure it was successful.
|
|
||||||
|
|
||||||
```
|
|
||||||
cat ~/.kube/config
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
10. Execute the following command to run Minikube as the context. The context is what determines which cluster kubectl is interacting with. You can see all your available contexts in the ~/.kube/config file.
|
|
||||||
|
|
||||||
```
|
|
||||||
kubectl config use-context minikube
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11. Run the **config** file command again to check that context Minikube is there.
|
|
||||||
|
|
||||||
```
|
|
||||||
cat ~/.kube/config
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
12. Finally, run the following command to open a browser with the Kubernetes dashboard.
|
|
||||||
|
|
||||||
```
|
|
||||||
minikube dashboard
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
This guide aims to make things easier for RHEL/Fedora/CentOS-based operating system users.
|
|
||||||
|
|
||||||
Now that Minikube is up and running, read [Running Kubernetes Locally via Minikube][7] to start using it.
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://opensource.com/article/18/10/getting-started-minikube
|
|
||||||
|
|
||||||
作者:[Bryant Son][a]
|
|
||||||
选题:[lujun9972][b]
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:
|
|
||||||
[b]: https://github.com/lujun9972
|
|
||||||
[1]: https://kubernetes.io/docs/tutorials/hello-minikube
|
|
||||||
[2]: https://github.com/kubernetes/minikube/blob/master/docs/drivers.md
|
|
||||||
[3]: https://docs.docker.com/install
|
|
||||||
[4]: https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver
|
|
||||||
[5]: https://github.com/kubernetes/minikube/releases
|
|
||||||
[6]: https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-curl
|
|
||||||
[7]: https://kubernetes.io/docs/setup/minikube
|
|
@ -1,173 +0,0 @@
|
|||||||
提交你的第一个 Linux 内核补丁时的一个检查列表
|
|
||||||
======
|
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22)
|
|
||||||
|
|
||||||
Linux 内核是最大的且变动最快的开源项目之一,它由大约 53,600 个文件和近 2,000 万行代码组成。在全世界范围内超过 15,600 位程序员为它贡献代码,Linux 内核项目的维护者使用了如下的协作模型。
|
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/karnik_figure1.png)
|
|
||||||
|
|
||||||
本文中,为了便于在 Linux 内核中提交你的第一个贡献,我将为你提供一个必需的快速检查列表,以告诉你在提交补丁时,应该去查看和了解的内容。对于你贡献的第一个补丁的提交流程方面的更多内容,请阅读 [KernelNewbies 第一个内核补丁教程][1]。
|
|
||||||
|
|
||||||
### 为内核作贡献
|
|
||||||
|
|
||||||
#### 第 1 步:准备你的系统
|
|
||||||
|
|
||||||
本文开始之前,假设你的系统已经具备了如下的工具:
|
|
||||||
|
|
||||||
+ 文本编辑器
|
|
||||||
+ Email 客户端
|
|
||||||
+ 版本控制系统(即:git)
|
|
||||||
|
|
||||||
#### 第 2 步:下载 Linux 内核代码仓库:
|
|
||||||
```
|
|
||||||
git clone -b staging-testing
|
|
||||||
|
|
||||||
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### 复制你的当前配置:
|
|
||||||
```
|
|
||||||
cp /boot/config-`uname -r`* .config
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### 第 3 步:构建/安装你的内核
|
|
||||||
```
|
|
||||||
make -jX
|
|
||||||
|
|
||||||
sudo make modules_install install
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### 第 4 步:创建一个分支并切换到它
|
|
||||||
```
|
|
||||||
git checkout -b first-patch
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### 第 5 步:更新你的内核并指向到最新的代码
|
|
||||||
```
|
|
||||||
git fetch origin
|
|
||||||
|
|
||||||
git rebase origin/staging-testing
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### 第 6 步:在最新的代码基础上产生一个变更
|
|
||||||
|
|
||||||
使用 `make` 命令重新编译,确保你的变更没有错误。
|
|
||||||
|
|
||||||
### 第 7 步:提交你的变更并创建一个补丁
|
|
||||||
```
|
|
||||||
git add <file>
|
|
||||||
|
|
||||||
git commit -s -v
|
|
||||||
|
|
||||||
git format-patch -o /tmp/ HEAD^
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/karnik_figure2.png)
|
|
||||||
|
|
||||||
主题是由冒号分隔的文件名组成,接下来是使用祈使语态来描述补丁做了什么。空行之后是强制规定的 `off` 标记,最后是你的补丁的 `diff` 信息。
|
|
||||||
|
|
||||||
下面是另外一个简单补丁的示例:
|
|
||||||
|
|
||||||
![](https://opensource.com/sites/default/files/karnik_figure3.png)
|
|
||||||
|
|
||||||
接下来,[使用 email 从命令行][2](在本例子中使用的是 Mutt)发送这个补丁:
|
|
||||||
```
|
|
||||||
mutt -H /tmp/0001-<whatever your filename is>
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
使用 [get_maintainer.pl 脚本][11],去了解你的补丁应该发送给哪位维护者的列表。
|
|
||||||
|
|
||||||
|
|
||||||
### 提交你的第一个补丁之前,你应该知道的事情
|
|
||||||
|
|
||||||
* [Greg Kroah-Hartman](3) 的 [staging tree][4] 是提交你的 [第一个补丁][1] 的最好的地方,因为他更容易接受新贡献者的补丁。在你熟悉了补丁发送流程以后,你就可以去发送复杂度更高的子系统专用的补丁。
|
|
||||||
|
|
||||||
* 你也可以从纠正代码中的编码风格开始。想学习更多关于这方面的内容,请阅读 [Linux 内核编码风格文档][5]。
|
|
||||||
|
|
||||||
* [checkpatch.pl][6] 脚本可以检测你的编码风格方面的错误。例如,运行如下的命令:
|
|
||||||
|
|
||||||
```
|
|
||||||
perl scripts/checkpatch.pl -f drivers/staging/android/* | less
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
* 你可以去补全开发者留下的 TODO 注释中未完成的内容:
|
|
||||||
```
|
|
||||||
find drivers/staging -name TODO
|
|
||||||
```
|
|
||||||
|
|
||||||
* [Coccinelle][7] 是一个模式匹配的有用工具。
|
|
||||||
|
|
||||||
* 阅读 [归档的内核邮件][8]。
|
|
||||||
|
|
||||||
* 为找到灵感,你可以去遍历 [linux.git log][9] 查看以前的作者的提交内容。
|
|
||||||
|
|
||||||
* 注意:不要为了评估你的补丁而在社区置顶帖子!下面就是一个这样的例子:
|
|
||||||
|
|
||||||
**错误的方式:**
|
|
||||||
|
|
||||||
Chris,
|
|
||||||
_Yes let’s schedule the meeting tomorrow, on the second floor._
|
|
||||||
|
|
||||||
> On Fri, Apr 26, 2013 at 9:25 AM, Chris wrote:
|
|
||||||
> Hey John, I had some questions:
|
|
||||||
> 1\. Do you want to schedule the meeting tomorrow?
|
|
||||||
> 2\. On which floor in the office?
|
|
||||||
> 3\. What time is suitable to you?
|
|
||||||
|
|
||||||
(注意那最后一个问题,在回复中无意中落下了。)
|
|
||||||
|
|
||||||
**正确的方式:**
|
|
||||||
|
|
||||||
Chris,
|
|
||||||
See my answers below...
|
|
||||||
|
|
||||||
> On Fri, Apr 26, 2013 at 9:25 AM, Chris wrote:
|
|
||||||
> Hey John, I had some questions:
|
|
||||||
> 1\. Do you want to schedule the meeting tomorrow?
|
|
||||||
_Yes tomorrow is fine._
|
|
||||||
> 2\. On which floor in the office?
|
|
||||||
_Let's keep it on the second floor._
|
|
||||||
> 3\. What time is suitable to you?
|
|
||||||
_09:00 am would be alright._
|
|
||||||
|
|
||||||
(所有问题全部回复,并且这种方式还保存了阅读的时间。)
|
|
||||||
|
|
||||||
* [Eudyptula challenge][10] 是学习内核基础知识的非常好的方式。
|
|
||||||
|
|
||||||
|
|
||||||
想学习更多内容,阅读 [KernelNewbies 第一个内核补丁教程][1]。之后如果你还有任何问题,可以在 [kernelnewbies 邮件列表][12] 或者 [#kernelnewbies IRC channel][13] 中提问。
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://opensource.com/article/18/8/first-linux-kernel-patch
|
|
||||||
|
|
||||||
作者:[Sayli Karnik][a]
|
|
||||||
选题:[lujun9972](https://github.com/lujun9972)
|
|
||||||
译者:[qhwdw](https://github.com/qhwdw)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
||||||
|
|
||||||
[a]:https://opensource.com/users/sayli
|
|
||||||
[1]:https://kernelnewbies.org/FirstKernelPatch
|
|
||||||
[2]:https://opensource.com/life/15/8/top-4-open-source-command-line-email-clients
|
|
||||||
[3]:https://twitter.com/gregkh
|
|
||||||
[4]:https://www.kernel.org/doc/html/v4.15/process/2.Process.html
|
|
||||||
[5]:https://www.kernel.org/doc/html/v4.10/process/coding-style.html
|
|
||||||
[6]:https://github.com/torvalds/linux/blob/master/scripts/checkpatch.pl
|
|
||||||
[7]:http://coccinelle.lip6.fr/
|
|
||||||
[8]:linux-kernel@vger.kernel.org
|
|
||||||
[9]:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/
|
|
||||||
[10]:http://eudyptula-challenge.org/
|
|
||||||
[11]:https://github.com/torvalds/linux/blob/master/scripts/get_maintainer.pl
|
|
||||||
[12]:https://kernelnewbies.org/MailingList
|
|
||||||
[13]:https://kernelnewbies.org/IRC
|
|
167
translated/tech/20181001 How to Install Pip on Ubuntu.md
Normal file
167
translated/tech/20181001 How to Install Pip on Ubuntu.md
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
如何在Ubuntu上安装Pip
|
||||||
|
======
|
||||||
|
**Pip是一个命令行工具,允许你安装Python编写的软件包。 学习如何在Ubuntu上安装Pip以及如何使用它来安装Python应用程序。**
|
||||||
|
|
||||||
|
有许多方法可以[在Ubuntu上安装软件][1]。 你可以从软件中心安装应用程序,也可以从下载的DEB文件,PPA(LCTT译者注:PPA即Personal Package Archives,个人软件包集),[Snap软件包][2],也可以使用[使用Flatpak][3],使用[AppImage][4],甚至从旧的源代码安装。
|
||||||
|
|
||||||
|
还有一种方法可以在[Ubuntu][5]中安装软件包。 它被称为Pip,你可以使用它来安装基于Python的应用程序。
|
||||||
|
|
||||||
|
### 什么是Pip
|
||||||
|
|
||||||
|
[Pip][6]代表“Pip Installs Packages”。 [Pip][7]是一个基于命令行的包管理系统。 用于安装和管理[Python语言][8]编写的软件。
|
||||||
|
|
||||||
|
你可以使用Pip来安装Python包索引([PyPI][9])中列出的包。
|
||||||
|
|
||||||
|
作为软件开发人员,你可以使用pip为你自己的Python项目安装各种Python模块和包。
|
||||||
|
|
||||||
|
作为最终用户,你可能需要使用pip来安装一些Python开发的并且可以使用pip轻松安装的应用程序。 一个这样的例子是[Stress Terminal][10]应用程序,你可以使用pip轻松安装。
|
||||||
|
|
||||||
|
让我们看看如何在Ubuntu和其他基于Ubuntu的发行版上安装pip。
|
||||||
|
|
||||||
|
### 如何在Ubuntu上安装Pip
|
||||||
|
|
||||||
|
![Install pip on Ubuntu Linux][11]
|
||||||
|
|
||||||
|
默认情况下,Pip未安装在Ubuntu上。 你必须安装它。 在Ubuntu上安装pip非常简单。 我马上展示给你。
|
||||||
|
|
||||||
|
Ubuntu 18.04默认安装了Python 2和Python 3。 因此,你应该为两个Python版本安装pip。
|
||||||
|
|
||||||
|
Pip,默认情况下是指Python 2。pip3代表Python 3中的Pip。
|
||||||
|
|
||||||
|
注意:我在本教程中使用的是Ubuntu 18.04。 但是这里的教程应该适用于其他版本,如Ubuntu 16.04,18.10等。你也可以在基于Ubuntu的其他Linux发行版上使用相同的命令,如Linux Mint,Linux Lite,Xubuntu,Kubuntu等。
|
||||||
|
|
||||||
|
#### 为Python 2安装pip
|
||||||
|
|
||||||
|
首先,确保已经安装了Python 2。 在Ubuntu上,可以使用以下命令进行验证。
|
||||||
|
|
||||||
|
```
|
||||||
|
python2 --version
|
||||||
|
```
|
||||||
|
|
||||||
|
如果没有错误并且显示了Python版本的有效输出,则说明安装了Python 2。 所以现在你可以使用这个命令为Python 2安装pip:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt install python-pip
|
||||||
|
```
|
||||||
|
|
||||||
|
它将使用它安装pip和许多其他的依赖项。 安装完成后,请确认你已正确安装了pip。
|
||||||
|
|
||||||
|
```
|
||||||
|
pip --version
|
||||||
|
```
|
||||||
|
|
||||||
|
它应该显示一个版本号,如下所示:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
|
||||||
|
```
|
||||||
|
|
||||||
|
这意味着你已经成功在Ubuntu上安装了pip。
|
||||||
|
|
||||||
|
#### 为Python 3安装pip
|
||||||
|
|
||||||
|
你必须确保在Ubuntu上安装了Python 3。 可以使用以下命令检查一下:
|
||||||
|
|
||||||
|
```
|
||||||
|
python3 --version
|
||||||
|
```
|
||||||
|
|
||||||
|
如果显示了像Python 3.6.6这样的数字,则说明Python 3在你的Linux系统上安装好了。
|
||||||
|
|
||||||
|
现在,你可以使用以下命令安装pip3:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo apt install python3-pip
|
||||||
|
```
|
||||||
|
|
||||||
|
你应该使用以下命令验证pip3是否已正确安装:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip3 --version
|
||||||
|
```
|
||||||
|
|
||||||
|
它应该显示一个这样的数字:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
|
||||||
|
```
|
||||||
|
|
||||||
|
这意味着pip3已成功安装在你的系统上。
|
||||||
|
|
||||||
|
### 如何使用Pip命令
|
||||||
|
|
||||||
|
现在你已经安装了pip,让我们快速看一些基本的pip命令。 这些命令将帮助你使用pip命令来搜索,安装和删除Python包。
|
||||||
|
|
||||||
|
要从Python包索引PypI中搜索包,可以使用以下pip命令:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip search <search_string>
|
||||||
|
```
|
||||||
|
|
||||||
|
例如,如果你搜索stress这个词,将会显示名称或描述中包含字符串'stress'的所有包。
|
||||||
|
|
||||||
|
```
|
||||||
|
pip search stress
|
||||||
|
stress (1.0.0) - A trivial utility for consuming system resources.
|
||||||
|
s-tui (0.8.2) - Stress Terminal UI stress test and monitoring tool
|
||||||
|
stressypy (0.0.12) - A simple program for calling stress and/or stress-ng from python
|
||||||
|
fuzzing (0.3.2) - Tools for stress testing applications.
|
||||||
|
stressant (0.4.1) - Simple stress-test tool
|
||||||
|
stressberry (0.1.7) - Stress tests for the Raspberry Pi
|
||||||
|
mobbage (0.2) - A HTTP stress test and benchmark tool
|
||||||
|
stresser (0.2.1) - A large-scale stress testing framework.
|
||||||
|
cyanide (1.3.0) - Celery stress testing and integration test support.
|
||||||
|
pysle (1.5.7) - An interface to ISLEX, a pronunciation dictionary with stress markings.
|
||||||
|
ggf (0.3.2) - global geometric factors and corresponding stresses of the optical stretcher
|
||||||
|
pathod (0.17) - A pathological HTTP/S daemon for testing and stressing clients.
|
||||||
|
MatPy (1.0) - A toolbox for intelligent material design, and automatic yield stress determination
|
||||||
|
netblow (0.1.2) - Vendor agnostic network testing framework to stress network failures
|
||||||
|
russtress (0.1.3) - Package that helps you to put lexical stress in russian text
|
||||||
|
switchy (0.1.0a1) - A fast FreeSWITCH control library purpose-built on traffic theory and stress testing.
|
||||||
|
nx4_selenium_test (0.1) - Provides a Python class and apps which monitor and/or stress-test the NoMachine NX4 web interface
|
||||||
|
physical_dualism (1.0.0) - Python library that approximates the natural frequency from stress via physical dualism, and vice versa.
|
||||||
|
fsm_effective_stress (1.0.0) - Python library that uses the rheological-dynamical analogy (RDA) to compute damage and effective buckling stress in prismatic shell structures.
|
||||||
|
processpathway (0.3.11) - A nifty little toolkit to create stress-free, frustrationless image processing pathways from your webcam for computer vision experiments. Or observing your cat.
|
||||||
|
```
|
||||||
|
|
||||||
|
如果要使用pip安装应用程序,可以按以下方式使用它:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip install <package_name>
|
||||||
|
```
|
||||||
|
|
||||||
|
Pip不支持使用tab键补全包名,因此包名称应该是准确的。 它将下载所有必需的文件并安装该软件包。
|
||||||
|
|
||||||
|
如果要删除通过pip安装的Python包,可以使用pip中的remove选项。
|
||||||
|
|
||||||
|
```
|
||||||
|
pip uninstall <installed_package_name>
|
||||||
|
```
|
||||||
|
|
||||||
|
你可以在上面的命令中使用pip3代替pip。
|
||||||
|
|
||||||
|
我希望这个快速提示可以帮助你在Ubuntu上安装pip。 如果你有任何问题或建议,请在下面的评论部分告诉我。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://itsfoss.com/install-pip-ubuntu/
|
||||||
|
|
||||||
|
作者:[Abhishek Prakash][a]
|
||||||
|
选题:[lujun9972](https://github.com/lujun9972)
|
||||||
|
译者:[Flowsnow](https://github.com/Flowsnow)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://itsfoss.com/author/abhishek/
|
||||||
|
[1]: https://itsfoss.com/how-to-add-remove-programs-in-ubuntu/
|
||||||
|
[2]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/
|
||||||
|
[3]: https://itsfoss.com/flatpak-guide/
|
||||||
|
[4]: https://itsfoss.com/use-appimage-linux/
|
||||||
|
[5]: https://www.ubuntu.com/
|
||||||
|
[6]: https://en.wikipedia.org/wiki/Pip_(package_manager)
|
||||||
|
[7]: https://pypi.org/project/pip/
|
||||||
|
[8]: https://www.python.org/
|
||||||
|
[9]: https://pypi.org/
|
||||||
|
[10]: https://itsfoss.com/stress-terminal-ui/
|
||||||
|
[11]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/10/install-pip-ubuntu.png
|
@ -0,0 +1,167 @@
|
|||||||
|
给受欢迎的包管理器加个前端
|
||||||
|
======
|
||||||
|
|
||||||
|
![](https://www.ostechnix.com/wp-content/uploads/2018/10/sysget-720x340.png)
|
||||||
|
|
||||||
|
你是一个喜欢每隔几天尝试Linux操作系统的新发行版的人吗? 如果是这样,我有一些东西对你有用。 尝试**Sysget**,这是类Unix操作系统中流行软件包管理器的前端。 你不需要了解每个包管理器来执行基本的操作,例如安装,更新,升级和删除包。 你只需要记住每个类Unix操作系统上每个包管理器的一种语法即可。 Sysget是包管理器的包装脚本,它是用C ++编写的。 源代码可在GitHub上免费获得。
|
||||||
|
|
||||||
|
使用Sysget,你可以执行各种基本的包管理操作,包括:
|
||||||
|
|
||||||
|
- 安装包,
|
||||||
|
- 更新包,
|
||||||
|
- 升级包,
|
||||||
|
- 搜索包,
|
||||||
|
- 删除包,
|
||||||
|
- 删除弃用包,
|
||||||
|
- 更新数据库,
|
||||||
|
- 升级系统,
|
||||||
|
- 清除包管理器缓存。
|
||||||
|
|
||||||
|
**给Linux学习者的一个重要提示:**
|
||||||
|
|
||||||
|
Sysget不会取代软件包管理器,绝对不适合所有人。 如果你是经常切换到新Linux操作系统的新手,Sysget可能会有所帮助。 当在不同的Linux发行版中使用不同的软件包管理器时,就必须学习安装,更新,升级,搜索和删除软件包的新命令,这时Sysget就是帮助发行版收割机用户(或新Linux用户)的包装脚本。
|
||||||
|
|
||||||
|
如果你是Linux管理员或想要学习Linux深层的爱好者,你应该坚持使用你的发行版的软件包管理器并学习如何使用它。
|
||||||
|
|
||||||
|
### 安装Sysget
|
||||||
|
|
||||||
|
安装sysget很简单。 转到[**发布页面**][1]并下载最新的Sysget二进制文件并按如下所示进行安装。 在编写本指南时,sysget最新版本为1.2。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo wget -O /usr/local/bin/sysget https://github.com/emilengler/sysget/releases/download/v1.2/sysget
|
||||||
|
$ sudo mkdir -p /usr/local/share/sysget
|
||||||
|
$ sudo chmod a+x /usr/local/bin/sysget
|
||||||
|
```
|
||||||
|
|
||||||
|
### 用法
|
||||||
|
|
||||||
|
Sysget命令与APT包管理器大致相同,因此它应该适合新手使用。
|
||||||
|
|
||||||
|
当你第一次运行Sysget时,系统会要求你选择要使用的包管理器。 由于我在Ubuntu,我选择了**apt-get**。
|
||||||
|
|
||||||
|
![](https://www.ostechnix.com/wp-content/uploads/2018/10/sysget-1.png)
|
||||||
|
|
||||||
|
你必须根据正在运行的发行版选择正确的包管理器。 例如,如果你使用的是Arch Linux,请选择**pacman**。 对于CentOS,请选择**yum**。 对于FreeBSD,请选择**pkg**。 当前支持的包管理器列表是:
|
||||||
|
|
||||||
|
1. apt-get (Debian)
|
||||||
|
2. xbps (Void)
|
||||||
|
3. dnf (Fedora)
|
||||||
|
4. yum (Enterprise Linux/Legacy Fedora)
|
||||||
|
5. zypper (OpenSUSE)
|
||||||
|
6. eopkg (Solus)
|
||||||
|
7. pacman (Arch)
|
||||||
|
8. emerge (Gentoo)
|
||||||
|
9. pkg (FreeBSD)
|
||||||
|
10. chromebrew (ChromeOS)
|
||||||
|
11. homebrew (Mac OS)
|
||||||
|
12. nix (Nix OS)
|
||||||
|
13. snap (Independent)
|
||||||
|
14. npm (Javascript, Global)
|
||||||
|
|
||||||
|
如果你分配了错误的包管理器,则可以使用以下命令设置新的包管理器:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo sysget set yum
|
||||||
|
Package manager changed to yum
|
||||||
|
```
|
||||||
|
|
||||||
|
只需确保你选择了本地包管理器。
|
||||||
|
|
||||||
|
现在,你可以像使用本机包管理器一样执行包管理操作。
|
||||||
|
|
||||||
|
要安装软件包,例如Emacs,只需运行:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo sysget install emacs
|
||||||
|
```
|
||||||
|
|
||||||
|
上面的命令将调用本机包管理器(在我的例子中是“apt-get”)并安装给定的包。
|
||||||
|
|
||||||
|
![](https://www.ostechnix.com/wp-content/uploads/2018/10/Install-package-using-Sysget.png)
|
||||||
|
|
||||||
|
同样,要删除包,只需运行:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo sysget remove emacs
|
||||||
|
```
|
||||||
|
|
||||||
|
![](https://www.ostechnix.com/wp-content/uploads/2018/10/Remove-package-using-Sysget.png)
|
||||||
|
|
||||||
|
**更新软件仓库(数据库):**
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo sysget update
|
||||||
|
```
|
||||||
|
|
||||||
|
**搜索特定包:**
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo sysget search emacs
|
||||||
|
```
|
||||||
|
|
||||||
|
**升级单个包:**
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo sysget upgrade emacs
|
||||||
|
```
|
||||||
|
|
||||||
|
**升级所有包:**
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo sysget upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
**移除废弃的包**
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo sysget autoremove
|
||||||
|
```
|
||||||
|
|
||||||
|
**清理包管理器的缓存**
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo sysget clean
|
||||||
|
```
|
||||||
|
|
||||||
|
有关更多详细信息,请参阅帮助部分:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sysget help
|
||||||
|
Help of sysget
|
||||||
|
sysget [OPTION] [ARGUMENT]
|
||||||
|
|
||||||
|
search [query] search for a package in the resporitories
|
||||||
|
install [package] install a package from the repos
|
||||||
|
remove [package] removes a package
|
||||||
|
autoremove removes not needed packages (orphans)
|
||||||
|
update update the database
|
||||||
|
upgrade do a system upgrade
|
||||||
|
upgrade [package] upgrade a specific package
|
||||||
|
clean clean the download cache
|
||||||
|
set [NEW MANAGER] set a new package manager
|
||||||
|
```
|
||||||
|
|
||||||
|
请记住,不同Linux发行版中的所有包管理器的sysget语法都是相同的。 你不需要记住每个包管理器的命令。
|
||||||
|
|
||||||
|
同样,我必须告诉你Sysget不是包管理器的替代品。 它只是类Unix系统中流行的包管理器的包装器,它只执行基本的包管理操作。
|
||||||
|
|
||||||
|
Sysget对于不想去学习不同包管理器的新命令的新手和发行版收割机用户可能有些用处。 如果你有兴趣,试一试,看看它是否有帮助。
|
||||||
|
|
||||||
|
而且,这就是本次所有的内容了。 更多干活即将到来。 敬请关注!
|
||||||
|
|
||||||
|
祝快乐!
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.ostechnix.com/sysget-a-front-end-for-popular-package-managers/
|
||||||
|
|
||||||
|
作者:[SK][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[Flowsnow](https://github.com/Flowsnow)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]: https://www.ostechnix.com/author/sk/
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://github.com/emilengler/sysget/releases
|
@ -0,0 +1,123 @@
|
|||||||
|
Minikube入门:笔记本上的Kubernetes
|
||||||
|
======
|
||||||
|
运行Minikube的分步指南。
|
||||||
|
|
||||||
|
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ)
|
||||||
|
|
||||||
|
在[Hello Minikube][1]教程页面上Minikube被宣传为基于Docker运行Kubernetes的一种简单方法。 虽然该文档非常有用,但它主要是为MacOS编写的。 你可以深入挖掘在Windows或某个Linux发行版上的使用说明,但它们不是很清楚。 许多文档都是针对Debian / Ubuntu用户的,比如[安装Minikube的驱动程序][2]。
|
||||||
|
|
||||||
|
### 先决条件
|
||||||
|
|
||||||
|
1. 你已经[安装了Docker][3]。
|
||||||
|
2. 你的计算机是一个RHEL / CentOS / 基于Fedora的工作站。
|
||||||
|
3. 你已经[安装了正常运行的KVM2虚拟机管理程序][4]。
|
||||||
|
4. 你有一个运行的**docker-machine-driver-kvm2**。 以下命令将安装驱动程序:
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -Lo docker-machine-driver-kvm2 https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \
|
||||||
|
chmod +x docker-machine-driver-kvm2 \
|
||||||
|
&& sudo cp docker-machine-driver-kvm2 /usr/local/bin/ \
|
||||||
|
&& rm docker-machine-driver-kvm2
|
||||||
|
```
|
||||||
|
|
||||||
|
### 下载,安装和启动Minikube
|
||||||
|
|
||||||
|
1. 为你要即将下载的两个文件创建一个目录,两个文件分别是:[minikube][5]和[kubectl][6]。
|
||||||
|
|
||||||
|
|
||||||
|
2. 打开终端窗口并运行以下命令来安装minikube。
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
|
||||||
|
```
|
||||||
|
|
||||||
|
请注意,minikube版本(例如,minikube-linux-amd64)可能因计算机的规格而有所不同。
|
||||||
|
|
||||||
|
3. **chmod**加执行权限。
|
||||||
|
|
||||||
|
```
|
||||||
|
chmod +x minikube
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 将文件移动到**/usr/local/bin**路径下,以便你能将其作为命令运行。
|
||||||
|
|
||||||
|
```
|
||||||
|
mv minikube /usr/local/bin
|
||||||
|
```
|
||||||
|
|
||||||
|
5. 使用以下命令安装kubectl(类似于minikube的安装过程)。
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
|
||||||
|
```
|
||||||
|
|
||||||
|
使用**curl**命令确定最新版本的Kubernetes。
|
||||||
|
|
||||||
|
6. **chmod**给kubectl加执行权限。
|
||||||
|
|
||||||
|
```
|
||||||
|
chmod +x kubectl
|
||||||
|
```
|
||||||
|
|
||||||
|
7. 将kubectl移动到**/usr/local/bin**路径下作为命令运行。
|
||||||
|
|
||||||
|
```
|
||||||
|
mv kubectl /usr/local/bin
|
||||||
|
```
|
||||||
|
|
||||||
|
8. 运行**minikube start**命令。 为此,你需要有虚拟机管理程序。 我使用过KVM2,你也可以使用Virtualbox。 确保是用户而不是root身份运行以下命令,以便为用户而不是root存储配置。
|
||||||
|
|
||||||
|
```
|
||||||
|
minikube start --vm-driver=kvm2
|
||||||
|
```
|
||||||
|
|
||||||
|
这可能需要一段时间,等一会。
|
||||||
|
|
||||||
|
9. Minikube应该下载并开始。 使用以下命令确保成功。
|
||||||
|
|
||||||
|
```
|
||||||
|
cat ~/.kube/config
|
||||||
|
```
|
||||||
|
|
||||||
|
10. 执行以下命令以运行Minikube作为上下文。 上下文决定了kubectl与哪个集群交互。 你可以在~/.kube/config文件中查看所有可用的上下文。
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl config use-context minikube
|
||||||
|
```
|
||||||
|
|
||||||
|
11. 再次查看**config** 文件以检查Minikube是否存在上下文。
|
||||||
|
|
||||||
|
```
|
||||||
|
cat ~/.kube/config
|
||||||
|
```
|
||||||
|
|
||||||
|
12. 最后,运行以下命令打开浏览器查看Kubernetes仪表板。
|
||||||
|
|
||||||
|
```
|
||||||
|
minikube dashboard
|
||||||
|
```
|
||||||
|
|
||||||
|
本指南旨在使RHEL / Fedora / CentOS操作系统用户操作更轻松。
|
||||||
|
|
||||||
|
现在Minikube已启动并运行,请阅读[通过Minikube在本地运行Kubernetes][7]这篇官网教程开始使用它。
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://opensource.com/article/18/10/getting-started-minikube
|
||||||
|
|
||||||
|
作者:[Bryant Son][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[Flowsnow](https://github.com/Flowsnow)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||||
|
|
||||||
|
[a]:
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://kubernetes.io/docs/tutorials/hello-minikube
|
||||||
|
[2]: https://github.com/kubernetes/minikube/blob/master/docs/drivers.md
|
||||||
|
[3]: https://docs.docker.com/install
|
||||||
|
[4]: https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver
|
||||||
|
[5]: https://github.com/kubernetes/minikube/releases
|
||||||
|
[6]: https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-using-curl
|
||||||
|
[7]: https://kubernetes.io/docs/setup/minikube
|
Loading…
Reference in New Issue
Block a user