mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-30 02:40:11 +08:00
translated
This commit is contained in:
parent
5175f5debc
commit
2b9a2b44cf
@ -1,78 +0,0 @@
|
|||||||
[#]: collector: (lujun9972)
|
|
||||||
[#]: translator: (geekpi)
|
|
||||||
[#]: reviewer: ( )
|
|
||||||
[#]: publisher: ( )
|
|
||||||
[#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It)
|
|
||||||
[#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/)
|
|
||||||
[#]: author: (SK https://www.ostechnix.com/author/sk/)
|
|
||||||
[#]: url: ( )
|
|
||||||
|
|
||||||
How To Fix Broken Ubuntu OS Without Reinstalling It
|
|
||||||
======
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Today, I was upgrading my Ubuntu 18.04 LTS system. Unfortunately, the power has gone in mid-way and the system powered off while updating Ubuntu OS. When the power is back, I boot the system again. Right after entering the password at the login screen, it’s gone blank and didn’t respond. Keyboard and mouse also didn’t work. All I see is just a blank screen! Thankfully, It’s just a test machine and there were no important data in it. I can simply wipe off the entire OS and install it again. But, I don’t want to do that. Since I have nothing to lose, I just wanted to repair my broken Ubuntu system without reinstalling it completely and it worked!!! If you ever find yourself in a situation like mine, don’t panic. This brief tutorial describes how to easily fix broken Ubuntu OS without losing data and without reinstalling it completely.
|
|
||||||
|
|
||||||
### Fix Broken Ubuntu OS
|
|
||||||
|
|
||||||
First of all, try to login with live cd and **backup your data** in an external drive. Just in case, if this method didn’t work, you can still have your data and reinstall everything!
|
|
||||||
|
|
||||||
At the login screen, press **CTRL+ALT+F1** to switch to **tty1**. You can learn more about switching between TTYs [**here**][1].
|
|
||||||
|
|
||||||
Now, type the following commands one by one to fix the broken Ubuntu Linux.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo rm /var/lib/apt/lists/lock
|
|
||||||
|
|
||||||
$ sudo rm /var/lib/dpkg/lock
|
|
||||||
|
|
||||||
$ sudo rm /var/lib/dpkg/lock-frontend
|
|
||||||
|
|
||||||
$ sudo dpkg --configure -a
|
|
||||||
|
|
||||||
$ sudo apt clean
|
|
||||||
|
|
||||||
$ sudo apt update --fix-missing
|
|
||||||
|
|
||||||
$ sudo apt install -f
|
|
||||||
|
|
||||||
$ sudo dpkg --configure -a
|
|
||||||
|
|
||||||
$ sudo apt upgrade
|
|
||||||
|
|
||||||
$ sudo apt dist-upgrade
|
|
||||||
```
|
|
||||||
|
|
||||||
Finally, reboot the system using command:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
You can now be able to login to your Ubuntu system as usual.
|
|
||||||
|
|
||||||
After I followed these steps, all of my data in Ubuntu 18.04 test system was there and everything is the same as I left it. This method may not work for everyone. However, this small tip worked for me and saved a couple minutes from reinstalling. If you know any other better way, please let me know in the comment section. I will add them in this guide as well.
|
|
||||||
|
|
||||||
And, that’s all for now. Hope this was useful.
|
|
||||||
|
|
||||||
More good stuffs to come. Stay tuned!
|
|
||||||
|
|
||||||
Cheers!
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/
|
|
||||||
|
|
||||||
作者:[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://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/
|
|
@ -0,0 +1,78 @@
|
|||||||
|
[#]: collector: (lujun9972)
|
||||||
|
[#]: translator: (geekpi)
|
||||||
|
[#]: reviewer: ( )
|
||||||
|
[#]: publisher: ( )
|
||||||
|
[#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It)
|
||||||
|
[#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/)
|
||||||
|
[#]: author: (SK https://www.ostechnix.com/author/sk/)
|
||||||
|
[#]: url: ( )
|
||||||
|
|
||||||
|
如何不重装修复损坏的 Ubuntu 系统
|
||||||
|
======
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
今天,我在升级我的 Ubuntu 18.04 LTS 系统。不幸的是,在更新 Ubuntu 时中途断电,系统关机。电源恢复后,我再次启动系统。在登录页面输入密码后,它变成空白并且没有响应。键盘和鼠标也没有作用。我只看到一个空白的屏幕!值得庆幸的是,它只是一台测试机,并且没有重要的数据。我可以直接擦除整个系统然后重新安装。但是,我不想这样做。由于我没有什么可失去的,我只是想不重装修复我损坏的 Ubuntu 系统,并且我成功了!如果你发现自己处于像我这样的境地,不要惊慌。这个简短的教程描述了如何在不丢失数据的情况下轻松修复损坏的 Ubuntu 系统,而无需重新安装。
|
||||||
|
|
||||||
|
### 修复损坏的 Ubuntu 系统
|
||||||
|
|
||||||
|
首先,尝试使用 live cd 登录并**在外部驱动器中备份数据**。以防这个方法没用,你仍然可以获取数据并重新安装系统!
|
||||||
|
|
||||||
|
在登录页上,按下 **CTRL+ALT+F1** 切换到 **tty1**。你可以在[**此处**][1]了解有关在 TTY 之间切换的更多信息。
|
||||||
|
|
||||||
|
现在,逐个输入以下命令来修复损坏的 Ubuntu Linux。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo rm /var/lib/apt/lists/lock
|
||||||
|
|
||||||
|
$ sudo rm /var/lib/dpkg/lock
|
||||||
|
|
||||||
|
$ sudo rm /var/lib/dpkg/lock-frontend
|
||||||
|
|
||||||
|
$ sudo dpkg --configure -a
|
||||||
|
|
||||||
|
$ sudo apt clean
|
||||||
|
|
||||||
|
$ sudo apt update --fix-missing
|
||||||
|
|
||||||
|
$ sudo apt install -f
|
||||||
|
|
||||||
|
$ sudo dpkg --configure -a
|
||||||
|
|
||||||
|
$ sudo apt upgrade
|
||||||
|
|
||||||
|
$ sudo apt dist-upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
最后,使用命令重启系统:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
你现在可以像往常一样登录到你的 Ubuntu 系统。
|
||||||
|
|
||||||
|
我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的贴士对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。
|
||||||
|
|
||||||
|
这是这些了。希望这篇文章有用。
|
||||||
|
|
||||||
|
还有更多好东西。敬请关注!
|
||||||
|
|
||||||
|
干杯!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/
|
||||||
|
|
||||||
|
作者:[SK][a]
|
||||||
|
选题:[lujun9972][b]
|
||||||
|
译者:[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/
|
||||||
|
[b]: https://github.com/lujun9972
|
||||||
|
[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/
|
Loading…
Reference in New Issue
Block a user