Have you ever experienced a problem with your operating system — one that was self-inflicted? You might have misconfigured something, only to find that whatever you did caused a cascade failure of other services or apps.
When that happens, you might not even remember what you did to cause the problem. Maybe it was a config file in /etc, which is often the case.
Also: 10 Linux apps I always install first – and you should too
What if I told you there’s an app to restore your Linux distribution to a working state, and it’s easy to use?
That app is called Timeshift. It creates restore points you can use to return your computer to a working state.
Before I continue, it’s important to note that Timeshift is not a backup tool. Rather, it’s an application to help you recover from self-inflicted situations where you need to get your system back up and running.
Let’s install Timeshift and see how it’s used.
How to install Timeshift
What you’ll need: The only things you’ll need for this are a running instance of Linux and a user with sudo privileges.
Log into your Linux desktop and open a terminal window.
Fortunately, Timeshift is found in most standard repositories. In the case of Arch Linux, it is found in AUR (Arch User Repository). The installation command for Timeshift looks like this:
- Ubuntu-based distributions – sudo apt-get install timeshift -y
- Fedora-based distributions – sudo dnf install timeshift -y
- Arch-based distributions – yay -S timeshift
Now that Timeshift is installed, let’s see how it’s used.
How to use Timeshift
Whether or not your machine uses the btrfs file system determines how Timeshift is used. My Pop!_OS system does not use btrfs, so I’ll demonstrate the rsync way.
1. Open timeshift
Open Timeshift from your desktop menu, and you will be prompted to type your sudo password. Once the Timeshift window opens, select Rsync or Btrfs. Choose Rsync and click Next.
2. Select a destination for the snapshot
Timeshift will then estimate the system size and then present you with a window to select the location that will house the snapshot. I would recommend saving the snapshot to an external drive and not the same drive housing your operating system.
3. Configure your snapshot level and retention
On the next screen, you will select how often your snapshots are taken (boot, hourly, daily, weekly, monthly) and how many of those snapshots you want to retain. Click Next to continue.
4. Select a user home directory (optional)
By default, user directories are excluded in snapshots. If you have a lot of app and bash configurations, you could include your home directory and then only include Hidden files; otherwise, leave the defaults and click Finish (as that’s the last step).
Once you click Finish, the main Timeshift window will open where you’ll see that no snapshots have been taken. You can either wait for the first snapshot to run or create one manually by clicking Create.
After creating a snapshot, should something go wrong, you can open Timeshift, select the snapshot you want to restore, and click Restore. This will return your system to a known, working state and you should be good to go.
Also: 5 Linux terminal apps that are better than your default – and free to install
If you worry that you might misconfigure something on your Linux system, I would highly recommend you consider installing and using Timeshift, so you can easily restore it to a working state.
Open Source