I've had a lot of problems lately and now I'm having problems logging in at the login screen. I'm giving up and just want to reset and start over. How can I "factory reset" Ubuntu, in this situation, or, for future reference, in general?
I've had a lot of problems lately and now I'm having problems logging in at the login screen. I'm giving up and just want to reset and start over. How can I "factory reset" Ubuntu, in this situation, or, for future reference, in general?
I can see a couple of options but they depend on you being able to get to a command prompt with a working internet connection.
This does not guarantee a working desktop though. Your problem might be something related to video card and also present in other desktops. Drop to a command line and start of with this:
and then pick ONE of these (to install that specific desktop):
I only listed a few (you could also install kUbuntu but for just getting a desktop to be able to make an installation disk might be overkill).
Download Ubuntu from command line with
(change the url to a release you want. see http://releases.ubuntu.com and the directories below that for what you need). It will show something like this:
and then "dd" the ISO to the USB flash drive. Pay extra attention to the device name. If you mess this up you could overwrite your current install... I tend to use
dmesg
:So that would be "sdc". This will burn it (skip the 1st one if you are still in Downloads, skip the 2nd one if it is already installed):
Results:
and an image of the freshly created USB ISO:
From Factory reset - Wikipedia:
This can be achieved either by re-installation of the OS or using a factory reset option. But in Linux, there is no option for factory reset inbuilt. So, it is required to look for alternatives which can achieve above said things.
While re-installation of the OS is the preferred method in order to remove users, user files and user applications but it is somewhat a tedious task. There is a tool called Resetter which would make "resetting Ubuntu" easier and will do what factory resets usually do.
Introduction:
Resetter is a tool which is used to reset Ubuntu installation to factory default. The Ubuntu system will go back to the state when it was installed for the first time. It finds all applications which are installed after Ubuntu fresh installation and delete them. Not just applications, it also deletes the users too. Deleting users means deleting their home too which means all user files and configurations. You don't have to install everything from the beginning. Just reset your Ubuntu to its factory defaults and start installing everything else.
Installation:
Download the latest release of Resetter and add-apt-key_versionX.deb from GitHub or use
wget
to direct download. At the time of posting this answer v3.0.0 was the latest release. To download usingwget
use:Install some dependencies:
Install downloaded .deb packages:
Using Resetter:
Open Resetter from Dash and authenticate. Authentication is required to perform administrative tasks.
To reset Ubuntu, click on Automatic Reset. But if you want to remove multiple packages at once click on custom reset.
Click "Yes" to confirm. You'll get a dialog which would list all the packages which would be removed.
Click "OK" to start. The factory reset will begin:
A new user will be created to access the system using administrative privileges. A dialog will appear which would show details about that newly created user. After that confirmation for Reboot will appear.
If your Ubuntu boots into TTY mode (command line/console mode), login with the credentials of new user and install desktop environment again.
Use previously provided password to login.
Modify Username and Password as per convenience.
Reinstalling can mean erasing everything, reformatting the partition, loosing all data and installing Ubuntu with a brand new
/home/user
directory. This is the common result when doing a google search.This answer is about reinstalling Ubuntu and keeping
/home/user
directory. The following is from: Ubuntu ReinstallationUbuntu Reinstallation
Introduction
Sometimes reinstalling is the quickest way to solve a problem, for example if an upgrade failed or if your graphics driver is broken. When reinstalling, you're most likely want to preserve two things:
/home
folder with your files and settingsHow To Reinstall Ubuntu
Since Hardy it is possible to reinstall Ubuntu without losing the content of the
/home
folder (the folder that contains program settings, internet bookmarks, emails and all your documents, music, videos and other user files). This can be done even if /home is not on a separate partition (which is the case by default if you did not manually separate it when installing Ubuntu originally). This tutorial can also be used to upgrade Ubuntu (eg 11.04 -> 12.04 from a 12.04 live-CD).Before doing anything
This operation should not damage your documents but, for security, backup your documents and settings (including /home hidden files) on external disk or DVDs. (eg via CloneZilla) Note: Some special applications settings may be in system folders, eg LAMP, see below in the thread.
Run the Ubuntu installer
Choose the right option
There are two possibilities - choose the one that fits what the installer is showing:
Then finish the installation process. (this may take several hours, like a normal install)
After reinstalling
After reinstalling, user accounts must be re-created with the same login and password.
See also
Create a Live USB
No standard factory reset for Ubuntu
Your personal files
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
A limited re-installation of Ubuntu can make things easier.
/home
directory, easiest using a separate 'home' partition./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
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.
But you should also have a more frequent (daily or weekly) backup routine for your personal files, at least 'everything that you cannot afford to lose'.