Merge pull request #6909 from stevenzdg988/master

Set Ubuntu Derivatives Back to Default with Resetter --------Translated.
This commit is contained in:
Xingyu.Wang 2018-01-04 22:12:56 +08:00 committed by GitHub
commit 7440ae6e25
2 changed files with 149 additions and 183 deletions

View File

@ -1,183 +0,0 @@
translating by stevenzdg988
Set Ubuntu Derivatives Back to Default with Resetter
======
How many times have you dived deep into Ubuntu (or a Ubuntu derivative), configuring things and installing software, only to find that your desktop (or server) platform isn't exactly what you wanted. This situation can be problematic when you already have all of your user files on the machine. In this case, you have a choice, you can either back up all your data, reinstall the operating system, and copy your data back onto the machine, or you can give a tool like [Resetter][1] a go.
有多少次你投入到Ubuntu或Ubuntu衍生版本配置某项内容和安装软件却发现你的桌面或服务器平台并不是你想要的。当在机器上产生了大量的用户文件时这种情况可能会出现问题。既然这样你有一个选择你或者可以备份你所有的数据重新安装操作系统然后将您的数据复制回本机或者也可以利用一种类似于[Resetter][1]的工具做同样的事情。
Resetter is a new tool (written by Canadian developer that goes by the name "[gaining][2]"), written in Python and pyqt, that will reset Ubuntu, Linux Mint (and a few other, Ubuntu-based distributions) back to stock configurations. Resetter offers two different reset options: Automatic and Custom. With the Automatic option, the tool will:
Resetter 是一个新的工具由加拿大开发商被称为“获得”用python和PyQt将重置UbuntuLinux Mint和一些其他的基于Ubuntu的衍生版回到初始配置。Resetter 提供了两种不同的复位选项:自动和自定义。利用自动选项,工具就会完成以下内容:
* Remove user-installed apps 删除用换装的应用软件
* Delete users and home directories 删除用户及其家目录
* Create default backup user 创建默认的备份用户
* Auto install missing pre-installed apps (MPIAs) 自动安装预装的应用软件
* Remove non-default users 删除为初始化的用户
* Remove snap packages 删除协议软件包
The Custom option will:
* Remove user-installed apps or allow you to select which apps to remove
* Remove old kernels
* Allow you to choose users to delete
* Delete users and home directories
* Create default backup user
* Allow you to create custom backup user
* Auto install MPIAs or chose which MPIAs to install
* Remove non-default users
* View all dependent packages
* Remove snap packages
I'm going to walk you through the process of installing and using Resetter. However, I must tell you that this tool is very much in beta. Even so, resetter is definitely worth a go. In fact, I would encourage you to test the app and submit bug reports (you can either submit them via [GitHub][3] or send them directly to the developer's email address, [gaining7@outlook.com][4]).
It should also be noted that, at the moment, the only supported distributions are:
* Debian 9.2 (stable) Gnome edition
* Linux Mint 17.3+ (support for mint 18.3 coming soon)
* Ubuntu 14.04+ (Although I found 17.10 not supported)
* Elementary OS 0.4+
* Linux Deepin 15.4+
With that said, let's install and use Resetter. I'll be demonstrating on [Elementary OS Loki][5].
### Installation
There are a couple of ways to install Resetter. The method I chose is by way of the gdebi helper app. Why? Because it will pick up all the necessary dependencies for installation. First, we must install that particular tool. Open up a terminal window and issue the command:
```
sudo apt install gdebi
```
Once that is installed, point your browser to the [Resetter Download Page][6] and download the most recent version of the software. Once it has downloaded, open up the file manager, navigate to the downloaded file, and click (or double-click, depending on how you've configured your desktop) on the resetter_XXX-stable_all.deb file (where XXX is the release number). The gdebi app will open (Figure 1). Click on the Install Package button, type your sudo password, and Resetter will install.
## [resetter_1.jpg][7]
![gdebi][8]
Figure 1: Installing Resetter with gdebi.
[Used with permission][9]
Once Resetter is installed, you're ready to go.
### Using Resetter
Remember, before you do this, you must back up your data. You've been warned.
From your terminal window, issue the command sudo resetter. You'll be prompted for your sudo password. Once Resetter opens, it will automatically detect your distribution (Figure 2).
## [resetter_2.jpg][10]
![Resetter][11]
Figure 2: The Resetter main window.
[Used with permission][9]
We're going to test the Resetter waters by running an automatic reset. From the main window, click Automatic Reset. The app will offer up a clear warning that it is about to reset your operating system (in my case, Elementary OS 0.4.1 Loki) to its factory defaults (Figure 3).
## [resetter_3.jpg][12]
![warning][13]
Figure 3: Resetter warns you before you continue on.
[Used with permission][9]
Once you click Yes, Resetter will display all of the packages it will remove (Figure 4). If you're okay with that, click OK and the reset will begin.
## [resetter_4.jpg][14]
![remove packages][15]
Figure 4: All of the packages to be removed, in order to reset Elementary OS to factory defaults.
[Used with permission][9]
During the reset, the application will display a progress window (Figure 5). Depending upon how much you've installed, the process shouldn't take too long.
## [resetter_5.jpg][16]
![progress][17]
Figure 5: The Resetter progress window.
[Used with permission][9]
When the process completes, Resetter will display a new username and password for you to use, in order to log back into your newly reset distribution (Figure 6).
## [resetter_6.jpg][18]
![new username][19]
Figure 6: New username and password.
[Used with permission][9]
Click OK and then, when prompted, click Yes to reboot the system. Once you are prompted to login, use the new credentials given to you by the Resetter app. After a successful login, you'll need to recreate your original user. That user's home directory will still be intact, so all you need to do is issue the command sudo useradd USERNAME (where USERNAME is the name of the user). Once you've done that, issue the command sudo passwd USERNAME (where USERNAME is the name of the user). With the user/password set, you can log out and log back in as your old user (enjoying the same home directory you had before resetting the operating system).
### My results
I have to confess, after adding the password back to my old user (and testing it by using the su command to change to that user), I was unable to log into the Elementary OS desktop with that user. To solve that problem, I logged in with the Resetter-created user, moved the old user home directory, deleted the old user (with the command sudo deluser jack), and recreated the old user (with the command sudo useradd -m jack).
After doing that, I checked the original home directory, only to find out the ownership had been changed from jack.jack to 1000.1000. That could have been fixed simply by issuing the command sudo chown -R jack.jack /home/jack. The lesson? If you use Resetter and find you cannot log in with your old user (after you've re-created user and given it a new password), make sure to change the ownership of the user's home directory.
Outside of that on issue, Resetter did a great job of taking Elementary OS Loki back to a default state. Although Resetter is in beta, it's a rather impressive tool. Give it a try and see if you don't have the same outstanding results I did.
Learn more about Linux through the free ["Introduction to Linux" ][20]course from The Linux Foundation and edX.
--------------------------------------------------------------------------------
via: https://www.linux.com/learn/intro-to-linux/2017/12/set-ubuntu-derivatives-back-default-resetter
作者:[Jack Wallen][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linux.com/users/jlwallen
[1]:https://github.com/gaining/Resetter
[2]:https://github.com/gaining
[3]:https://github.com
[4]:mailto:gaining7@outlook.com
[5]:https://elementary.io/
[6]:https://github.com/gaining/Resetter/releases/tag/v1.1.3-stable
[7]:/files/images/resetter1jpg-0
[8]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_1_0.jpg?itok=3c_qrApr (gdebi)
[9]:/licenses/category/used-permission
[10]:/files/images/resetter2jpg
[11]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_2.jpg?itok=bmawiCYJ (Resetter)
[12]:/files/images/resetter3jpg
[13]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_3.jpg?itok=2wlbC3Ue (warning)
[14]:/files/images/resetter4jpg-1
[15]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_4_1.jpg?itok=f2I3noDM (remove packages)
[16]:/files/images/resetter5jpg
[17]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_5.jpg?itok=3FYs5_2S (progress)
[18]:/files/images/resetter6jpg
[19]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_6.jpg?itok=R9SVZgF1 (new username)
[20]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux

View File

@ -0,0 +1,149 @@
translated by stevenzdg988
利用 Resetter 将 Ubuntu 衍生版重置为初始状态
======
有多少次你投入到Ubuntu或Ubuntu衍生版本配置某项内容和安装软件却发现你的桌面或服务器平台并不是你想要的。当在机器上产生了大量的用户文件时这种情况可能会出现问题。既然这样你有一个选择你或者可以备份你所有的数据重新安装操作系统然后将您的数据复制回本机或者也可以利用一种类似于[Resetter][1]的工具做同样的事情。
Resetter 是一个新的工具(由加拿大开发者,被称为"[gaining][2]"用python和PyQt将重置UbuntuLinux Mint和一些其他的基于Ubuntu的衍生版回到初始配置。Resetter 提供了两种不同的复位选项:自动和自定义。利用自动选项,工具就会完成以下内容:
* 删除用户安装的应用软件
* 删除用户及家目录
* 创建默认备份用户
* 自动安装预装的应用软件(MPIAs)
* 删除非默认用户
* 删除协议软件包
自定义选项:
* 删除用户安装的应用程序或者允许你选择要删除的应用程序
* 删除旧的内核
* 允许你选择用户进行删除
* 删除用户及家目录
* 创建默认备份用户
* 允许您创建自定义备份用户
* 自动安装MPIAs或选择MPIAs进行安装
* 删除非默认用户
* 查看所有相关依赖包
* 删除协议软件包
我将带领您完成安装和使用Resetter的过程。但是我必须告诉你这个工具非常的测试版。即便如此resetter绝对值得一试。实际上我鼓励您测试应用程序并提交bug报告(您可以通过[GitHub][3]提交,或者直接发送给开发人员的电子邮件地址[gaining7@outlook.com][4])。
It should also be noted that, at the moment, the only supported distributions are:
还应注意的是,目前仅支持的衍生版有:
* Debian 9.2(稳定)Gnome版本
* Linux Mint 17.3 +(支持Mint 18.3即将推出)
* Ubuntu 14.04+(虽然我发现不支持17.10)
* Elementary OS 0.4+
* Linux Deepin 15.4+
说到这里让我们安装和使用Resetter。我将在[Elementary OS Loki][5]平台展示
### 安装
有几种方法可以安装Resetter。我选择的方法是通过gdebi辅助应用程序为什么?因为它将获取安装所需的所有依赖项。首先,我们必须安装那个特定的工具。打开终端窗口并发出命令:
```
sudo apt install gdebi
```
一旦安装完毕,请将浏览器指向[Resetter下载页面][6],并下载该软件的最新版本。一旦下载完毕,打开文件管理器,导航到下载的文件,然后单击(或双击,这取决于你如何配置你的桌面)在resetter_xxx - stable_all.deb文件(XXX是版本号)。gdebi应用程序将会打开(图1)。点击安装包按钮输入你的sudo密码接下来 Resetter 将开始安装。
## [resetter_1.jpg][7]
![gdebi][8]
图1:利用gdebi安装Resetter
[使用许可][9]
当安装完成,准备接下来的操作。
### 使用 Resetter
记住,在做这个之前,必须备份数据。别怪我没提醒你。从终端窗口发出命令```sudo resetter```。您将被提示输入sudo密码。一旦Resetter打开它将自动检测您的发行版(图2)。
## [resetter_2.jpg][10]
![Resetter][11]
图2: Resetter 主窗口
[使用许可][9]
我们将通过自动重置来测试 Resetter 的流程。从主窗口点击Automatic Reset自动复位。这款应用将提供一个明确的警告它将把你的操作系统(的实例Elementary OS 0.4.1 Loki)重新设置为出厂默认状态(图3)。
## [resetter_3.jpg][12]
![警告][13]
图3:在继续之前Resetter警告您。
[用户许可][9]
单击Yes,Resetter将显示它将删除的所有包(图4)。如果您没有问题单击OK重置将开始。
## [resetter_4.jpg][14]
![移除软件包][15]
图4:所有要删除的包,以便将 Elementary OS 重置为出厂默认值。
[使用许可][9]
在重置过程中,应用程序将显示一个进度窗口(图5)。根据安装的数量,这个过程不应该花费太长时间。
## [resetter_5.jpg][16]
![进度][17]
图5: Resetter 进度窗口
[使用许可][9]
当进程完成时Resetter将显示一个新的用户名和密码以便重新登录到新重置的发行版(图6)。
## [resetter_6.jpg][18]
![新用户][19]
图6:新用户及密码
[使用许可][9]
单击OK然后在提示单击Yes以重新启动系统。当提示登录时使用 Resetter 应用程序提供给您的新凭证。成功登录后,您需要重新创建您的原始用户。该用户的主目录仍然是完整的,所以您需要做的就是发出命令```sudo useradd USERNAME (USERNAME 是用户名)```。完成之后,发出命令```sudo passwd USERNAME (USERNAME 是用户名)```。使用设置的用户/密码,您可以注销并以旧用户的身份登录(在重新设置操作系统之前使用相同的家目录)。
### 我的成果
我必须承认,在将密码添加到我的老用户(并通过使用su命令对该用户进行更改)之后,我无法使用该用户登录到 Elementary OS 桌面。为了解决这个问题我登录了Resetter-created 用户,移动了老用户的家目录,删除了老用户(使用命令``` sudo deluser jack```),并重新创建了老用户(使用命令```sudo useradd -m jack```)。
这样做之后,我检查了原始的家目录,只发现了用户的所有权从 jack.jack 变成了 1000.1000。利用命令 ```sudo chown -R jack.jack /home/jack```就可以容易的修正这个问题。这非常关键如果您使用Resetter并发现无法用您的老用户登录(在您重新创建用户并设置一个新密码之后),请确保更改用户的家目录的所有权限。
在这个问题之外Resetter在将 Elementary OS Loki 恢复到默认状态方面做了大量的工作。虽然 Resetter 处在测试中,但它是一个相当令人印象深刻的工具。试一试,看看你是否有和我一样出色的成绩。
从Linux基金会和edX的免费[" Linux入门"][20]课程学习更多关于Linux的知识。
--------------------------------------------------------------------------------
via: https://www.linux.com/learn/intro-to-linux/2017/12/set-ubuntu-derivatives-back-default-resetter
作者:[Jack Wallen][a]
译者:[stevenzdg988](https://github.com/stevenzdg988)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linux.com/users/jlwallen
[1]:https://github.com/gaining/Resetter
[2]:https://github.com/gaining
[3]:https://github.com
[4]:mailto:gaining7@outlook.com
[5]:https://elementary.io/
[6]:https://github.com/gaining/Resetter/releases/tag/v1.1.3-stable
[7]:/files/images/resetter1jpg-0
[8]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_1_0.jpg?itok=3c_qrApr (gdebi)
[9]:/licenses/category/used-permission
[10]:/files/images/resetter2jpg
[11]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_2.jpg?itok=bmawiCYJ (Resetter)
[12]:/files/images/resetter3jpg
[13]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_3.jpg?itok=2wlbC3Ue (warning)
[14]:/files/images/resetter4jpg-1
[15]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_4_1.jpg?itok=f2I3noDM (remove packages)
[16]:/files/images/resetter5jpg
[17]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_5.jpg?itok=3FYs5_2S (progress)
[18]:/files/images/resetter6jpg
[19]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/resetter_6.jpg?itok=R9SVZgF1 (new username)
[20]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux