AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 591167
Accepted
cmehmen
cmehmen
Asked: 2015-03-01 11:57:18 +0800 CST2015-03-01 11:57:18 +0800 CST 2015-03-01 11:57:18 +0800 CST

将 Ubuntu 重置为出厂设置

  • 772

我最近遇到了很多问题,现在我在登录屏幕上登录时遇到了问题。我要放弃了,只想重新开始。在这种情况下,我如何“恢复出厂设置”Ubuntu,或者一般来说,以供将来参考?

reset
  • 4 4 个回答
  • 88629 Views

4 个回答

  • Voted
  1. Best Answer
    Rinzwind
    2015-03-01T12:24:12+08:002015-03-01T12:24:12+08:00

    我可以看到几个选项,但它们取决于您是否能够通过有效的互联网连接进入命令提示符。

    1. 安装另一个桌面。
    2. 从命令行刻录一个新的 USB 安装程序。

    安装另一个桌面

    但这并不能保证桌面正常工作。您的问题可能与视频卡有关,也可能出现在其他桌面上。转到命令行并以此开始:

    sudo apt-get update
    

    然后选择其中之一(以安装该特定桌面):

    xubuntu-desktop 
    lubuntu-desktop 
    ubuntu-mate-desktop
    

    我只列出了一些(你也可以安装 kUbuntu,但仅仅获得一个能够制作安装盘的桌面可能有点矫枉过正)。

    从命令行刻录新的 USB 安装程序

    从命令行下载 Ubuntu

    wget http://releases.ubuntu.com/14.04/ubuntu-14.04-desktop-amd64.iso
    

    (将 url 更改为您想要的版本。请参阅http://releases.ubuntu.com和下面的目录以获取您需要的内容)。它将显示如下内容:

    ~/Downloads$ wget http://releases.ubuntu.com/14.04/ubuntu-14.04-desktop-amd64.iso
    --2015-02-28 21:09:59--  http://releases.ubuntu.com/14.04/ubuntu-14.04-desktop-amd64.iso
    Resolving releases.ubuntu.com (releases.ubuntu.com)... 
    91.189.92.151, 2001:67c:1360:8c01::1e
    Connecting to releases.ubuntu.com (releases.ubuntu.com)|
    91.189.92.151|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1010827264 (964M) [application/x-iso9660-image]
    Saving to: ‘ubuntu-14.04-desktop-amd64.iso   6%  58,05M  1,36MB/s   eta 7m 47s
    

    然后将 ISO“dd”到 USB 闪存驱动器。请特别注意设备名称。如果你搞砸了,你可以覆盖你当前的安装......我倾向于使用dmesg:

    [26005.823077] sd 7:0:0:0: Attached scsi generic sg3 type 0
    [26006.953612] sd 7:0:0:0: [sdc] 30299520 512-byte logical blocks: (15.5 GB/14.4 GiB)
    [26006.954291] sd 7:0:0:0: [sdc] Write Protect is off
    [26006.954298] sd 7:0:0:0: [sdc] Mode Sense: 23 00 00 00
    [26006.954912] sd 7:0:0:0: [sdc] No Caching mode page found
    [26006.954918] sd 7:0:0:0: [sdc] Assuming drive cache: write through
    [26006.972919]  sdc: sdc1
    [26006.976297] sd 7:0:0:0: [sdc] Attached SCSI removable disk
    

    所以那将是“sdc”。这将刻录它(如果您仍在下载中,请跳过第一个,如果已经安装,请跳过第二个):

    cd ~/Downloads
    sudo apt-get install gddrescue
    sudo ddrescue -d -D --force ubuntu-14.04-desktop-amd64.iso /dev/sdc
    

    结果:

    GNU ddrescue 1.19
    Press Ctrl-C to interrupt
    rescued:    63504 kB,  errsize:     230 B,  current rate:     196 kB/s
       ipos:    63504 kB,   errors:       1,    average rate:   12700 kB/s
       opos:    63504 kB, run time:       5 s,  successful read:       0 s ago
    Finished                                     
    

    以及新创建的 USB ISO 的图像:

    在此处输入图像描述

    • 14
  2. Kulfy
    2019-02-14T08:52:24+08:002019-02-14T08:52:24+08:00

    来自恢复出厂设置 - 维基百科:

    计算机恢复出厂设置会将计算机恢复到计算机的原始操作系统,并删除计算机上存储的所有用户数据。

    这可以通过重新安装操作系统或使用恢复出厂设置选项来实现。但是在 Linux 中,没有内置的恢复出厂设置选项。因此,需要寻找可以实现上述目标的替代方案。

    虽然重新安装操作系统是删除用户、用户文件和用户应用程序的首选方法,但它有些繁琐。有一个名为Resetter的工具可以使“重置 Ubuntu”变得更容易,并且可以执行出厂重置通常执行的操作。

    介绍:

    Resetter是一种用于将 Ubuntu 安装重置为出厂默认设置的工具。Ubuntu系统会回到第一次安装时的状态。它会找到所有在 Ubuntu 全新安装后安装的应用程序并删除它们。不仅是应用程序,它还会删除用户。删除用户也意味着删除他们的家,这意味着所有用户文件和配置。您不必从头开始安装所有内容。只需将您的 Ubuntu 重置为其出厂默认设置并开始安装其他所有内容。

    安装:

    • 从GitHub下载最新版本的Resetter和add-apt-key_versionX.deb或使用直接下载。在发布此答案时,v3.0.0 是最新版本。要使用使用下载:wgetwget

      wget https://github.com/gaining/Resetter/releases/download/v3.0.0-stable/resetter_3.0.0-stable_all.deb
      wget https://github.com/gaining/Resetter/releases/download/v3.0.0-stable/add-apt-key_1.0-0.5_all.deb
      
    • 安装一些依赖项:

      sudo apt install libqt5clucene5 libqt5designer5 libqt5help5 python3-psutil python3-pyqt5 python3-pyqt5.qtsvg python3-sip
      
    • 安装下载的 .deb包:

      sudo dpkg -i package1.deb package2.deb
      

    使用复位器:

    • 从 Dash 打开 Resetter 并进行身份验证。执行管理任务需要身份验证。

      欢迎屏幕

    • 要重置 Ubuntu,请单击自动重置。但是,如果您想一次删除多个包,请单击自定义重置。

      重置

    • 单击“是”进行确认。您将看到一个对话框,其中列出了所有将被删除的包。

      包裹清单

    • 单击“确定”开始。恢复出厂设置将开始:

      重置

    • 将创建一个新用户以使用管理权限访问系统。将出现一个对话框,显示有关该新创建用户的详细信息。之后将出现重新启动确认。

      新用户详情

      重启系统

    • 如果您的 Ubuntu 启动到 TTY 模式(命令行/控制台模式),请使用新用户的凭据登录并再次安装桌面环境。

      sudo apt install ubuntu-desktop
      sudo reboot 
      
    • 使用之前提供的密码登录。

      登录

    • 根据方便修改用户名和密码。

    • 10
  3. WinEunuuchs2Unix
    2019-02-13T16:58:09+08:002019-02-13T16:58:09+08:00

    重新安装可能意味着擦除所有内容、重新格式化分区、丢失所有数据并使用全新/home/user目录安装 Ubuntu。这是进行谷歌搜索时的常见结果。

    这个答案是关于重新安装 Ubuntu 和保留 /home/user目录的。以下来自:Ubuntu重装


    重新安装Ubuntu

    介绍

    有时重新安装是解决问题的最快方法,例如,如果升级失败或图形驱动程序损坏。重新安装时,您很可能希望保留两件事:

    • /home包含您的文件和设置的文件夹
    • 启动菜单中的条目(如果安装了多个操作系统)

    如何重新安装 Ubuntu

    由于 Hardy,可以在不丢失文件夹内容的情况下重新安装 Ubuntu /home(该文件夹包含程序设置、互联网书签、电子邮件和所有文档、音乐、视频和其他用户文件)。即使 /home 不在单独的分区上也可以这样做(如果您最初安装 Ubuntu 时没有手动将其分开,则默认情况下就是这种情况)。本教程也可用于升级 Ubuntu(例如,从 12.04 live-CD 升级到 11.04 -> 12.04)。

    在做任何事情之前

    此操作不应损坏您的文档,但为了安全起见,请将您的文档和设置(包括 /home 隐藏文件)备份到外部磁盘或 DVD 上。(例如通过 CloneZilla)注意:一些特殊的应用程序设置可能位于系统文件夹中,例如 LAMP,请参阅下面的主题。

    运行 Ubuntu 安装程序

    • 运行 Ubuntu 安装程序
    • 按照提示直到出现“安装类型”(或“分配磁盘空间”)菜单
    • 如下所述选择正确的选项:

    请选择正确的选项

    有两种可能性 - 选择适合安装程序显示的一种:

    • 如果“将 1X.XX 升级到 1Y.YY ”选项可用(如下面的屏幕截图所示),请选择它。

    在此处输入图像描述

    • 或者,如果上述选项不可用,请选择手动分区(“Something-else”选项),然后选择 Ubuntu 系统分区,将其挂载点设置为“/”。请务必保持相同的格式类型、相同的大小,并取消勾选“格式”复选框,否则“/”上的所有数据将被删除!。如果需要,还可以设置其他分区(/boot、/home...请参阅 DiskSpace)。

    然后完成安装过程。(这可能需要几个小时,就像正常安装一样)

    重装后

    重新安装后,必须使用相同的登录名和密码重新创建用户帐户。

    也可以看看

    1. 论坛讨论

    创建实时 USB

    • 如何创建一个可引导的 Linux USB 闪存驱动器,简单的方法
    • 4
  4. sudodus
    2019-02-19T12:54:01+08:002019-02-19T12:54:01+08:00

    Ubuntu 没有标准的出厂重置

    • Ubuntu 没有标准的显式出厂重置标准,但有几种方法可以产生相同或相似的结果。

    您的个人档案

    • Even if the current system does not work, you can probably copy or recover many or all of your personal files, when you boot from another drive, for example an Ubuntu live drive (USB pendrive or DVD disk).

    • With a good backup routine you will have peace of mind, even if the drive crashes physically.

    • Maybe your system drive or the file system(s) of your Ubuntu is damaged. You can check that and maybe repair the file system(s) according to this link.

    Re-installation

    • A complete re-installation of Ubuntu is much faster than the corresponding installation of Windows. Re-install into

      • the same partition(s) as before or
      • different partition(s) or
      • the whole drive (if you no longer want to dual boot or multi boot).
    • A limited re-installation of Ubuntu can make things easier.

      • The most typical case is to preserve the /home directory, easiest using a separate 'home' partition.
      • Maybe you want to preserve some system files, that you think are good, from the /etc directory tree.
    • There are already good and detailed answers here describing re-installation.

    Fresh installation

    • If there are problems, a fresh installation can be a good alternative to 'factory reset'.

    • The [re-]installation can be to the original version and flavour of Ubuntu, but it can also be to new version or community flavour, a fresh installation. Please notice that you should stay with the same flavour of Ubuntu and use the same userIDs and names, if you want to keep /home.

    • Compared to upgrading with do-release-upgrade it is often a reliable and efficient method to install a newer version, for example the most current 'first point release', 16.04.1 LTS, 18.04.1 LTS ... with long time support.

    • But sometimes there are problems with hardware drivers, so you had better 'Try Ubuntu without installing', try live from a USB drive or DVD disk, before installing a newer version.

    Resetter

    • Using the tool 'Resetter' is described in an answer here.

    Make an early backup. You may need it in the future

    • Think ahead and backup your Ubuntu system when it is new (or maybe the whole drive if a dual boot system). There are several backup tools. A full backup can be a cloned [compressed] image of the whole drive made with Clonezilla.

      When you want to reset your system, restore it using this backup.

    Restore points or snapshots

    • You can create several backups and use them as possible 'restore points' or 'snapshots' of the system, maybe once or twice per year.

    • 但是你也应该更频繁地(每天或每周)备份你的个人文件,至少是“你不能丢失的一切”。

    • 4

相关问题

  • 是否可以“重置”坏块?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve