From b9246f66148532703d7ce7c6439033a95b02d6d8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Dec 2018 23:25:57 +0800 Subject: [PATCH 1/7] PRF:20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @geekpi --- ...arch Or Find Files And Folders in Linux.md | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md index a95aef6e7d..8358a9ebb0 100644 --- a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md +++ b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @@ -1,26 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux) [#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/) [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) -四种简单的方法来搜索或查找 Linux 中的文件和文件夹 +搜索 Linux 中的文件和文件夹的四种简单方法 ====== -Linux 管理员一天都不能离开搜索文件,因为这是他们的日常活动。 +Linux 管理员一天都不能离开搜索文件,因为这是他们的日常活动。了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。这些命令记忆起来不复杂,因为它们使用的是标准语法。 -了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。 - -这些命令记忆起来不复杂,因为它们使用的是标准语法。 - -这里执行四个 Linux 命令,每个命令都有自己独特的功能。 +可以通过四个 Linux 命令啦执行此操作,每个命令都有自己独特的功能。 ### 方法 1:使用 find 命令在 Linux 中搜索文件和文件夹 -find 命令被广泛使用,并且是非常著名的在 Linux 中搜索文件和文件夹的命令。它搜索当前目录中的给定文件,并根据搜索条件递归遍历其子目录。 +`find` 命令被广泛使用,并且是在 Linux 中搜索文件和文件夹的著名命令。它搜索当前目录中的给定文件,并根据搜索条件递归遍历其子目录。 它允许用户根据大小、名称、所有者、组、类型、权限、日期和其他条件执行所有类型的文件搜索。 @@ -72,19 +68,19 @@ find 命令被广泛使用,并且是非常著名的在 Linux 中搜索文件 ### 方法 2:使用 locate 命令在 Linux 中搜索文件和文件夹 -locate 命令比 find 命令运行得更快,因为它使用 updatedb 数据库,而 find 命令在真实系统中搜索。 +`locate` 命令比 `find` 命令运行得更快,因为它使用 `updatedb` 数据库,而 `find` 命令在真实系统中搜索。 它使用数据库而不是搜索单个目录路径来获取给定文件。 -locate 命令未在大多数发行版中预安装,因此,请使用你的包管理器进行安装。 +`locate` 命令未在大多数发行版中预安装,因此,请使用你的包管理器进行安装。 -数据库通过 cron 定期更新,但我们可以通过运行以下命令手动更新它。 +数据库通过 cron 任务定期更新,但我们可以通过运行以下命令手动更新它。 ``` $ sudo updatedb ``` -只需运行以下命令即可列出给定的文件或文件夹。在 locate 命令中不需要指定特定选项来打印文件或文件夹。 +只需运行以下命令即可列出给定的文件或文件夹。在 `locate` 命令中不需要指定特定选项来打印文件或文件夹。 在系统中搜索 `ssh` 文件夹。 @@ -107,13 +103,13 @@ $ sudo updatedb ### 方法 3:在 Linux 中搜索文件使用 which 命令 -which 返回在终端输入命令时执行的可执行文件的完整路径。 +`which` 返回在终端输入命令时执行的可执行文件的完整路径。 当你想要为可执行文件创建桌面快捷方式或符号链接时,它非常有用。 -which 命令搜索当前用户而不是所有用户的 PATH 环境变量中列出的目录。我的意思是,当你登录自己的帐户时,你无法搜索 root 用户文件或目录。 +`which` 命令搜索当前用户而不是所有用户的 `$PATH` 环境变量中列出的目录。我的意思是,当你登录自己的帐户时,你无法搜索 root 用户文件或目录。 -运行以下命令以打印 vim 可执行文件的完整路径。 +运行以下命令以打印 `vim` 可执行文件的完整路径。 ``` # which vi @@ -132,12 +128,13 @@ which 命令搜索当前用户而不是所有用户的 PATH 环境变量中列 ### 方法 4:使用 whereis 命令在 Linux 中搜索文件 -whereis 命令用于搜索给定命令的二进制、源码和手册页文件。 +`whereis` 命令用于搜索给定命令的二进制、源码和手册页文件。 ``` # whereis vi vi: /usr/bin/vi /usr/share/man/man1/vi.1p.gz /usr/share/man/man1/vi.1.gz ``` + -------------------------------------------------------------------------------- via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/ @@ -145,9 +142,9 @@ via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders 作者:[Prakash Subramanian][a] 选题:[lujun9972][b] 译者:[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/) 荣誉推出 [a]: https://www.2daygeek.com/author/prakash/ -[b]: https://github.com/lujun9972 \ No newline at end of file +[b]: https://github.com/lujun9972 From f7b88e3744d9acbf35afab82437378d96b75aac8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Dec 2018 23:26:46 +0800 Subject: [PATCH 2/7] PUB:20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @geekpi https://linux.cn/article-10362-1.html --- ... Easy Ways to Search Or Find Files And Folders in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md (98%) diff --git a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md similarity index 98% rename from translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md rename to published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md index 8358a9ebb0..d9326f0904 100644 --- a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md +++ b/published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10362-1.html) [#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux) [#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/) [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) From 13b7fc841a5a6fdb39245fe1d483c99bc14c7b08 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 00:44:58 +0800 Subject: [PATCH 3/7] PRF:20180419 Migrating to Linux- Network and System Settings.md @ScarboroughCoral --- ...g to Linux- Network and System Settings.md | 102 ++++++++---------- 1 file changed, 44 insertions(+), 58 deletions(-) diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md index 480aa05239..b9fe12b66e 100644 --- a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md +++ b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md @@ -1,106 +1,92 @@ -# 迁移到 Linux 工作环境: 网络和系统设置 +迁移到 Linux:网络和系统设置 +====== + +> 这个系列我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux;这篇中我们涉及到 Linux 桌面系统上的一些常见设置。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO) -在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到Linux。如果你错过了以前的文章,可以从这访问: +在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux。如果你错过了以前的文章,可以从这访问: -[Part 1 - 基本介绍][1] +- [第1部分 - 入门介绍][1] +- [第2部分 - 磁盘、文件和文件系统][2] +- [第3部分 - 图形操作环境][3] +- [第4部分 - 命令行][4] +- [第5部分 - 使用 sudo][5] +- [第5部分 - 安装软件][6] -[Part 2 - 磁盘、文件和文件系统][2] +Linux 提供了一系列网络和系统设置。在你的桌面计算机上,Linux 允许您调整系统上的任何内容。大多数这些设置都出现在 `/etc` 目录下的纯文本文件中。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。 -[Part 3 - 图形界面环境][3] +大多数设置都能够在“设置”程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。 -[Part 4 - 命令行][4] +### 连接互联网 -[Part 5 - 使用 sudo 命令][5] +在 Linux 中连接到互联网通常非常简单。如果您通过以太网电缆连接,Linux 通常会在插入电缆时或启动时(如果电缆已连接)获得 IP 地址并自动连接。 -[Part 6 - 软件安装][6] +如果您使用无线网络,则在大多数发行版中都有一个菜单,可以在指示器面板中或在“设置”中(取决于您的发行版),您可以在其中选择无线网络的 SSID。如果网络受密码保护,它通常会提示您输入密码。然后连接,这个过程相当顺利。 -Linux 提供了一系列网络和系统设置。在桌面上,Linux允许您调整系统上的任何内容。大多数这些设置都在/ etc目录下的纯文本文件中公开。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。 - - - -大多数设置都能够在设置程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。 - - - -### 连接因特网 - -在Linux中连接到Internet通常非常简单。如果您通过以太网电缆连接,Linux通常会在插入电缆时或启动时获得IP地址并自动连接(如果电缆已连接)。 - -如果您使用无线,则在大多数发行版中都有一个菜单,可以在指示器面板中或在设置中(取决于您的发行版),您可以在其中选择无线网络的SSID。如果网络受密码保护,它通常会提示您输入密码。 然后连接,这个过程相当顺利。 - -在图形界面您可以通过进入设置来调整网络设置。通常称为系统设置或者是设置。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。 +在图形界面您可以通过进入设置来调整网络设置。通常称为“系统设置”或者是“设置”。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。 ![Network Settings][8] -图1: Gnome 桌面网络设置指示器图标. - -[经许可使用][9] +*图1: Gnome 桌面网络设置指示器图标。* ### 网络接口名称 -在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 - 或以太网和无线。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。 +在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 —— 或“以太网”和“无线网络”。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0 和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。 ### 通过命令行进行网络管理 如果您希望更好地控制网络设置,或者如果您在没有图形桌面的情况下管理网络连接,则还可以从命令行管理网络。 -请注意,用于在图形桌面中管理网络的最常用服务是网络管理器,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。 +请注意,用于在图形桌面中管理网络的最常用服务是“网络管理器Network Manager”,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。 -更改图形环境中的设置很可能与网络管理器交互,您还可以使用名为nmtui的工具从命令行更改网络管理器设置。nmtui工具提供了您在图形环境中找到的所有设置,但是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图2)。 +在图形环境中的更改设置与在网络管理器中很类似,您还可以使用名为 `nmtui` 的工具从命令行更改网络管理器设置。`nmtui` 工具提供了您在图形环境中找到的所有设置,但是是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图 2)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ) -图 2:nmtui 界面 +*图 2:nmtui 界面* -[经许可使用][9] - -在命令行上,有一个名为 ifconfig 的旧工具来管理网络,还有一个名为 ip 的新工具。在某些发行版中,ifconfig 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,ifconfig 仍可以使用。 +在命令行上,有一个名为 `ifconfig` 的旧工具来管理网络,还有一个名为 `ip` 的新工具。在某些发行版中,`ifconfig` 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,`ifconfig` 仍可以使用。 以下是一些允许您显示和更改网络设置的命令: ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ) -[经许可使用][9] - ### 进程和系统信息 -在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能.。 +在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能。 -在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可以使用的图形工具。大多数所共有的工具是 System Monitor 和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。 +在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可用的图形工具。大多数所共有的工具是“系统监视器”和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA) -图 3:NetHogs 截图 - -[经许可使用][9] +*图 3:NetHogs 截图* 在这些工具中,你也可以查看系统全局网络流量(图 4)。 ![System Monitor][11] -图4: Gnome System Monitor 的截图 - -[经许可使用][9] +*图 4:Gnome System Monitor 的截图* ### 管理进程和系统使用 -您还可以从命令行使用相当多的工具。使用 ps 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 ps 命令不会使用可以使用命令 info ps 或者 man ps。 +您还可以从命令行使用相当多的工具。使用 `ps` 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 `ps` 命令不会使用,可以使用命令 `info ps` 或者 `man ps` 获取帮助。 -大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或CPU时间的进程。这种情况下有两个非常简单的命令,分别是 top 和 htop 命令(图 5)。 +大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或 CPU 时间的进程。这种情况下有两个非常简单的命令,分别是 `top` 和 `htop` 命令(图 5)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl) -top 和 htop 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。 +*图 5:top 截屏* -使用两个命令时 (top and htop),你可以输入 ”?“ 来获取使用帮助,输入 ”q“ 来退出程序。使用 top 命令你可以按”k“键然后输入进程 ID 来杀死某个进程。 +`top` 和 `htop` 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。 -使用 htop 命令时你可以使用 ↑↓ 键来将列表中的一条记录进行高亮显示,按下 F9 键会杀死进程(需要回车确认)。 +使用这两个命令时(`top` 和 `htop`),你可以输入 `?` 来获取使用帮助,输入 `q` 来退出程序。使用 `top` 命令你可以按 `k` 键然后输入进程 ID 来杀死某个进程。 + +使用 `htop` 命令时你可以使用 `↑` `↓` 键来将列表中的一条记录进行高亮显示,按下 `F9` 键会杀死进程(需要回车确认)。 本系列中提供的信息和工具将帮助您开始使用 Linux。 只需一点时间和耐心,您就会感到这非常舒服。 -想学习更多 Linux 内容可访问免费的 ["Linux 简介" ][12]课程,此课程来自 Linux 基金会和 edx. +想学习更多 Linux 内容可访问免费的 [Linux 简介][12]课程,此课程来自 Linux 基金会和 edx。 ------ @@ -109,20 +95,20 @@ via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system- 作者:[John Bonesio][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[ScarboroughCoral](https://github.com/ScarboroughCoral) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.linux.com/users/johnbonesio -[1]: https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction -[2]: https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems -[3]: https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments -[4]: https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line -[5]: https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo -[6]: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software +[1]: https://linux.cn/article-9212-1.html +[2]: https://linux.cn/article-9213-1.html +[3]: https://linux.cn/article-9293-1.html +[4]: https://linux.cn/article-9565-1.html +[5]: https://linux.cn/article-9819-1.html +[6]: https://linux.cn/article-9823-1.html [7]: https://www.linux.com/files/images/figure-1png-2 -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings" +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings" [9]: https://www.linux.com/licenses/category/used-permission [10]: https://www.linux.com/files/images/figure-4png-1 -[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor" +[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor" [12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 5bae0d23ac4dfdf272d8cb162c8b1ddc0389daad Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 00:45:38 +0800 Subject: [PATCH 4/7] PUB:20180419 Migrating to Linux- Network and System Settings.md @ScarboroughCoral https://linux.cn/article-10363-1.html --- .../20180419 Migrating to Linux- Network and System Settings.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180419 Migrating to Linux- Network and System Settings.md (100%) diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/published/20180419 Migrating to Linux- Network and System Settings.md similarity index 100% rename from translated/tech/20180419 Migrating to Linux- Network and System Settings.md rename to published/20180419 Migrating to Linux- Network and System Settings.md From 2b9a2b44cf96f43fa321c18b88f089658ff56f3f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 Dec 2018 08:51:41 +0800 Subject: [PATCH 5/7] translated --- ...roken Ubuntu OS Without Reinstalling It.md | 78 ------------------- ...roken Ubuntu OS Without Reinstalling It.md | 78 +++++++++++++++++++ 2 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md create mode 100644 translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md diff --git a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md deleted file mode 100644 index 0d24e0d7c6..0000000000 --- a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md +++ /dev/null @@ -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 -====== - -![](https://www.ostechnix.com/wp-content/uploads/2018/12/Fix-Broken-Ubuntu-OS-720x340.jpg) - -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/ diff --git a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md new file mode 100644 index 0000000000..2fbdc6f07e --- /dev/null +++ b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @@ -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 系统 +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/Fix-Broken-Ubuntu-OS-720x340.jpg) + +今天,我在升级我的 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/ \ No newline at end of file From 66b22351b1d9b10c097ad36d8989173e5bbe5166 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 Dec 2018 08:59:31 +0800 Subject: [PATCH 6/7] translating --- ...nt Dropbox Folder Locally As Virtual File System In Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md b/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md index 691600a4cc..ae559de4c6 100644 --- a/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md +++ b/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md @@ -1,3 +1,5 @@ +translating---geekpi + Dbxfs – Mount Dropbox Folder Locally As Virtual File System In Linux ====== From 2132fc3343ac37a09ecbbb1deaac05790124f4d8 Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 19 Dec 2018 11:16:42 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...23 Celebrate Christmas In Linux Way With These Wallpapers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md index e59286ddbc..94c08d72ae 100644 --- a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md +++ b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (jlztan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers)