translated

This commit is contained in:
geekpi 2018-07-19 08:47:31 +08:00
parent 741577da3c
commit 401e1ab95a
2 changed files with 122 additions and 125 deletions

View File

@ -1,125 +0,0 @@
translating-----geekpi
How To Upgrade Everything Using A Single Command In Linux
======
![](https://www.ostechnix.com/wp-content/uploads/2018/06/topgrade-720x340.png)
As we all know already, keeping our Linux system up-to-date involves invoking more than one package manager. Say for instance, in Ubuntu you cant upgrade everything using “sudo apt update && sudo apt upgrade” command. This command will only upgrade the applications which are installed using APT package manager. There are chances that you might have installed some other applications using **cargo** , [**pip**][1], **npm** , **snap** , **flatpak** or [**Linuxbrew**][2] package managers. You need to use the respective package manager in order to keep them all updated. Not anymore! Say hello to **“topgrade”** , an utility to upgrade all the things in your system in one go.
You need not to run every package manager to update the packages. The topgrade tool resolves this problem by detecting the installed packages, tools, plugins and run their appropriate package manager to update everything in your Linux box with a single command. It is free, open source and written using **rust programming language**. It supports GNU/Linux and Mac OS X.
### Upgrade Everything Using A Single Command In Linux
The topgrade is available in AUR. So, you can install it using [**Yay**][3] helper program in any Arch-based systems.
```
$ yay -S topgrade
```
On other Linux distributions, you can install topgrade utility using **cargo** package manager. To install cargo package manager, refer the following link.
And, then run the following command to install topgrade.
```
$ cargo install topgrade
```
Once installed, run the topgrade to upgrade all the things in your Linux system.
```
$ topgrade
```
Once topgrade is invoked, it will perform the following tasks one by one. You will be asked to enter root/sudo user password wherever necessary.
1 Run your systems package manager:
* Arch: Run **yay** or fall back to [**pacman**][4]
* CentOS/RHEL: Run `yum upgrade`
* Fedora Run `dnf upgrade`
* Debian/Ubuntu: Run `apt update && apt dist-upgrade`
* Linux/macOS: Run `brew update && brew upgrade`
2\. Check if the following paths are tracked by Git. If so, pull them:
* ~/.emacs.d (Should work whether you use **Spacemacs** or a custom configuration)
* ~/.zshrc
* ~/.oh-my-zsh
* ~/.tmux
* ~/.config/fish/config.fish
* Custom defined paths
3\. Unix: Run **zplug** update
4\. Unix: Upgrade **tmux** plugins with **TPM**
5\. Run **Cargo install-update**
6\. Upgrade **Emacs** packages
7\. Upgrade Vim packages. Works with the following plugin frameworks:
* NeoBundle
* [**Vundle**][5]
* Plug
8\. Upgrade [**NPM**][6] globally installed packages
9\. Upgrade **Atom** packages
10\. Update [**Flatpak**][7] packages
11\. Update [**snap**][8] packages
12\. **Linux:** Run **fwupdmgr** to show firmware upgrade. (View only. No upgrades will actually be performed)
13\. Run custom defined commands.
Finally, topgrade utility will run **needrestart** to restart all services. In Mac OS X, it will upgrade App Store applications.
Sample output from my Ubuntu 18.04 LTS test box:
![][10]
The good thing is if one task is failed, it will automatically run the next task and complete all other subsequent tasks. Finally, it will display the summary with details such as how many tasks did it run, how many succeeded and how many failed etc.
![][11]
**Suggested read:**
Personally, I liked this idea of creating an utility like topgrade and upgrade everything installed with various package managers with a single command. I hope you find it useful too. More good stuffs to come. Stay tuned!
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/how-to-upgrade-everything-using-a-single-command-in-linux/
作者:[SK][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://www.ostechnix.com/author/sk/
[1]:https://www.ostechnix.com/manage-python-packages-using-pip/
[2]:https://www.ostechnix.com/linuxbrew-common-package-manager-linux-mac-os-x/
[3]:https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/
[4]:https://www.ostechnix.com/getting-started-pacman/
[5]:https://www.ostechnix.com/manage-vim-plugins-using-vundle-linux/
[6]:https://www.ostechnix.com/manage-nodejs-packages-using-npm/
[7]:https://www.ostechnix.com/flatpak-new-framework-desktop-applications-linux/
[8]:https://www.ostechnix.com/install-snap-packages-arch-linux-fedora/
[9]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[10]:http://www.ostechnix.com/wp-content/uploads/2018/06/topgrade-1.png
[11]:http://www.ostechnix.com/wp-content/uploads/2018/06/topgrade-2.png

View File

@ -0,0 +1,122 @@
如何在 Linux 中使用一个命令升级所有软件
======
![](https://www.ostechnix.com/wp-content/uploads/2018/06/topgrade-720x340.png)
众所周知,让我们的 Linux 系统保持最新状态涉及调用多个包管理器。比如说,在 Ubuntu 中,你无法使用 “sudo apt update 和 sudo apt upgrade” 命令升级所有软件。此命令仅升级使用 APT 包管理器安装的应用程序。你有可能使用 **cargo**、[**pip**][1]、**npm**、**snap** 、**flatpak** 或 [**Linuxbrew**][2] 包管理器安装了其他软件。你需要使用相应的包管理器才能使它们全部更新。再也不用这样了!跟 **“topgrade”** 打个招呼,这是一个可以一次性升级系统中所有软件的工具。
你无需运行每个包管理器来更新包。topgrade 工具通过检测已安装的软件包、工具、插件并运行相应的软件包管理器并使用一个命令更新 Linux 中的所有软件来解决这个问题。它是免费的、开源的,使用 **rust 语言**编写。它支持 GNU/Linux 和 Mac OS X.
### 在 Linux 中使用一个命令升级所有软件
topgrade 存在于 AUR 中。因此,你可以在任何基于 Arch 的系统中使用 [**Yay**][3 ] 助手程序安装它。
```
$ yay -S topgrade
```
在其他 Linux 发行版上,你可以使用 **cargo** 包管理器安装 topgrade。要安装 cargo 包管理器,请参阅以下链接。
然后,运行以下命令来安装 topgrade。
```
$ cargo install topgrade
```
安装完成后,运行 topgrade 以升级 Linux 系统中的所有软件。
```
$ topgrade
```
一旦调用了 topgrade它将逐个执行以下任务。如有必要系统会要求输入 root/sudo 用户密码。
1\. 运行系统的包管理器:
* Arch运行 **yay** 或者回退到 [**pacman**][4]
* CentOS/RHEL运行 `yum upgrade`
* Fedora :运行 `dnf upgrade`
* Debian/Ubuntu运行 `apt update 和 apt dist-upgrade`
* Linux/macOS运行 `brew update 和 brew upgrade`
2\. 检查 Git 是否跟踪了以下路径。如果有,则拉取它们:
* ~/.emacs.d (无论你使用 **Spacemacs** 还是自定义配置都应该可用)
* ~/.zshrc
* ~/.oh-my-zsh
* ~/.tmux
* ~/.config/fish/config.fish
* 自定义路径
3\. Unix运行 **zplug** 更新
4\. Unix使用 **TPM** 升级 **tmux** 插件
5\. 运行 **Cargo install-update**
6\. 升级 **Emacs**
7\. 升级 Vim 包。对以下插件框架均可用:
* NeoBundle
* [**Vundle**][5]
* Plug
8\. 升级 [**NPM**][6]全局安装的包
9\. 升级 **Atom**
10\. 升级 [**Flatpak**][7] 包
11\. 升级 [**snap**][8] 包
12\. ** Linux**运行 **fwupdmgr**显示固件升级。 (仅查看​​。实际不会执行升级)
13\. 运行自定义命令。
最后topgrade 将运行 **needrestart** 以重新启动所有服务。在 Mac OS X 中,它会升级 App Store 程序。
我的 Ubuntu 18.04 LTS 测试环境的示例输出:
![][10]
好处是如果一个任务失败,它将自动运行下一个任务并完成所有其他后续任务。最后,它将显示摘要,其中包含运行的任务数量,成功的数量和失败的数量等详细信息。
![][11]
**建议阅读:**
就个人而言,我喜欢创建一个像 topgrade 程序的想法,并使用一个命令升级使用各种包管理器安装的所有软件。我希望你也觉得它有用。还有更多的好东西。敬请关注!
干杯!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/how-to-upgrade-everything-using-a-single-command-in-linux/
作者:[SK][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.ostechnix.com/author/sk/
[1]:https://www.ostechnix.com/manage-python-packages-using-pip/
[2]:https://www.ostechnix.com/linuxbrew-common-package-manager-linux-mac-os-x/
[3]:https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/
[4]:https://www.ostechnix.com/getting-started-pacman/
[5]:https://www.ostechnix.com/manage-vim-plugins-using-vundle-linux/
[6]:https://www.ostechnix.com/manage-nodejs-packages-using-npm/
[7]:https://www.ostechnix.com/flatpak-new-framework-desktop-applications-linux/
[8]:https://www.ostechnix.com/install-snap-packages-arch-linux-fedora/
[9]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[10]:http://www.ostechnix.com/wp-content/uploads/2018/06/topgrade-1.png
[11]:http://www.ostechnix.com/wp-content/uploads/2018/06/topgrade-2.png