How to remove Ubuntu and restore Windows on a PC

Removing an Ubuntu installation from a dual-boot setup and restoring Windows is something that users looking to stop using Linux want to know. Sadly, not a lot of information is out there for new users, and as a result, many that try to delete Ubuntu from a Windows/Linux dual-booting setup often break their computers.

In this guide, we’ll go over in-depth how to completely remove Ubuntu from your computer and restore the Windows boot manager. However, before we begin, please back up all critical data from your Windows partition to an external hard drive to prevent any data loss if an accident occurs. Be sure also to back up your data on your Ubuntu installation as well, as it will be deleted during this process.

Note: though this guide focuses on Windows 10, any recent release of Windows (7/8/8.1) works with the instructions in this guide, though the repair functions will differ.

Create Windows installation USB disk

Fixing a system so that it no longer loads up Ubuntu and only has Windows on it starts by creating a Windows installation disk, as the installation disk, in addition to coming with a fresh version of Windows, has some recovery utilities that we can use to remove Ubuntu.

To create a Windows installation disk on your Ubuntu partition, download a free copy of Windows 10 from Mircosoft, and follow this guide to learn how to create an installation disk. Or load into the Windows partition on your system, download Windows, and create your USB live disk with this app here.

When the disk is made, reboot your computer and load into the Windows installation system. You may need to access your BIOS settings to boot from USB.

Cleare out the Grub bootloader

With the Windows installation USB disk created and ready to go, it’s time to take the first step in uninstalling Ubuntu Linux: clearing out the Grub bootloader screen that appears during a reboot.

To get rid of the boot screen through the Windows installation USB, you need to select the “Repair my computer” button, followed by “troubleshoot.”

Once you select the Troubleshoot option, you’ll be taken to a blue screen with a few tools to repair a non-working Windows 10 install. Look for the “Command-prompt” option, and select it with the mouse to access the command-line in Windows 10 for your PC.

Inside of the command prompt window in the Windows 10 installation disk, only one command needs to be run. This command will set the Windows boot manager as the default boot option on your computer.

bootrec /fixmbr

After running the bootrec command on the Windows 10 installation disk, type in the exit command to return to the repair selection screen. After that, reboot your PC, and unplug the USB, as it is no longer necessary to get rid of Ubuntu.

Delete Ubuntu partitions

Now that the bootloader for Ubuntu is removed as default on your computer, it’s time to delete Ubuntu from your hard drive. The way to do this is with a partition editor that comes with Windows 10. To access the Windows 10 partition editor, start by pressing the Win + S key on your keyboard. From there, type in “partition,” and a search result should appear that says “Create and format hard disk partitions”. Click on this search result to launch the Windows 10 partition editing tool.

Inside of the Windows 10 partition editor, you’ll notice quite a few partitions on the main hard drive. These partitions are labeled by “volume” in a descending list. Look through the list and determine which ones are related to Windows. Once you’ve figured out which ones are Windows’ volumes, write them down on a piece of paper to ensure that you don’t accidentally delete them.

Note: with UEFI, ignore any Fat32 partitions, as the bootrec command re-writes the Linux boot, so deletion isn’t necessary.

After taking note at the Windows-related partitions, find the Ubuntu-related once. These ones will have no drive label, or any other information, other than “healthy primary partition”.

Select the partition in the graphic layout with the mouse. Once you’ve made the selection, right-click on the partition to open up the right-click mouse menu. From there, look through the mouse-menu and choose the “Delete Volume” option.

As soon as you select the “Delete Volume” button, a message will appear that says “The selected partition was not created by Windows and might contain data recognized by other operating systems. Do you want to delete this partition?” Select the “Yes” option to remove the Ubuntu partition.

With the partition removed, right-click on the free-space that now occupies the old partition and create a new volume, extend the existing free space to Windows, etc. Then, reboot your PC.

As you log back into your Computer, you will boot directly into Windows, and Ubuntu Linux will be gone from the system!

Read How to remove Ubuntu and restore Windows on a PC by Derrik Diener on AddictiveTips – Tech tips to make you smarter

How to back up Linux terminal history

The Linux terminal has a “history” feature. With this feature, every command operation you enter will be backed up for later. Since all of your terminal commands are saved in “history,” it’s essential to keep a backup of it for safekeeping.

In this guide, we’ll show you how to back up Linux terminal history and how to restore backups as well. So, open up your favorite Linux terminal emulator and follow along!

Where is Linux terminal history stored?

The Linux terminal stores its history in a file. This file is named “.bash_history.” Anyone can edit it, and it is stored in the home directory. Since the terminal history file for Linux is stored in a user directory, every single user on the system has a file.

Special permissions do not protect these history files, and any user on the system can take a look at the history of another with a simple command. So, for example, if I want to take a look at the terminal/command-line history of username “user” on my Linux system, I’d do:

cat /home/user/.bash_history

Users can also view the history of the current user they’re logged into in the Linux terminal shell, by simply executing the “history” command.

history

Best of all, since “history” is just a file, it can be searched like a regular text file using the grep function. So, for example, to find instances of “git clone” in username with the command below.

cat /home/user/.bash_history | grep 'git clone'

It also works as the current logged in user with the “history” command.

history | grep 'search term'

Save terminal history to a backup

In the previous section of this guide, I talked about how the “history” for the Linux terminal is just a neatly hidden text file that contains all user-entered commands. Well, since it’s just a file, that means it’s super easy to back up for safekeeping.

To create a backup, make use of the cat command. Why? With cat, you can view the entirety of a text file right in the terminal. We can use this command in combination with the “>” symbol to redirect the viewing output to a backup file.

So, for example, to backup your current history, run the cat command against “~/.bash_history” and save it to a file with the label of “history_backup.”

cat ~/.bash_history > history_backup

You can also run the history command in combination with “>” and save it that way.

history > history_backup

Lastly, it’s possible to back up the command-line/terminal history of another user not logged in by running the command below.

Note: be sure to change “username” to the user that you’d like to save history from.

cat /home/username/.bash_history > history_backup

Only backing up certain history items

You may only want to back up specific commands in your Linux terminal history. The way to do this is to view the history file and combine it with the grep command, which will filter specific keywords.

For example, to only backup commands in your Linux terminal history that contain the git clone or git commands, you can run the operation below.

Note: in these examples, we are using “>>” rather than “>.” The reason for “>>” is that it will not overwrite the contents of the history file backup, and can be re-run multiple times to add to the backup.

cat ~/.bash_history | grep 'git' >> history_backup

Or

cat /home/username/.bash_history | grep 'git' >> history_backup

Filtering with grep can also be applied to the history command, like so.

history | grep 'git' >> history_backup

To back up certain keywords from the history file, replace “git” in the examples above with whatever commands you’d like to back up. Feel free to re-run this command as much as necessary.

How to restore the history backup

Restoring the history backup is as simple as deleting the original file and putting the backup in its place. To delete the original history file, use the rm command in a terminal window to delete “.bash_history.”

rm ~/.bash_history

Once the original history file is deleted from the home folder of the user in which you want to restore history, use the mv command to rename “history_backup” to “.bash_history.”

mv history_backup ~/.bash_history

Now that the new history file is in place run the history -rw command to reload the terminal’s history function.

history -rw

You’ll then be able to see your terminal history with:

history

Restore backups for other users

Need to restore history backups from other users on the system? To do this, start by logging into their user using the su command.

su username

After logging in to the user, delete the current history file that resides in the user’s home directory (~).

rm ~/.bash_history

From there, rename the history backup file as the new “.bash_history” file in the user’s directory.

mv /path/to/backup/file/history-backup ~/.bash_history

Write the changes with:

history -rw

When done, run history to view the restored commands in the terminal window.

Read How to back up Linux terminal history by Derrik Diener on AddictiveTips – Tech tips to make you smarter

How to fix a frozen XFCE Linux desktop

The XFCE4 desktop environment is a lightweight powerhouse of a desktop environment. It’s rock-solid and rarely crashes, due to how reliable and stable its codebase is. That said, nothing is 100% perfect, and problems can happen on even the most sturdy of desktops. So, here’s how to fix a frozen XFCE Linux desktop.

Refresh the XFCE4 panel

Most of the time, the problems, issues, and crashes on XFCE4 involve the XFCE4 panel. It’s understandable, as the panel can sometimes have plugins added to it that cause it to fail.

Sadly, there’s no built-in way for XFCE users to click a button so that the panel will restart, and there’s no secret reset function built-in like there is in Gnome Shell. Instead, users looking to fix a non-responsive XFCE4 panel must force-quit it and re-launch it.

The best way to kill and re-run the XFCE4 panel is with the terminal. Mainly because the terminal emulator will give you program output details, and you’ll be able to troubleshoot the issues causing your panel to lock up and fail. So, press Ctrl + Alt + T or Ctrl + Shift + T on the keyboard and get a terminal window open. Once the terminal window is ready to use, run the pidof command to determine the process ID code for the panel.

pidof xfce4-panel

Read the output number and place it into the kill command below.

kill number-from-pidof

Alternatively, if the top command doesn’t kill the panel, try this command.

killall xfce4-panel

With the XFCE4 panel closed, you can re-launch it directly from the terminal with:

xfce4-panel &

Running this command from the terminal will add a new XFCE4 panel onto the screen. From there, you can execute disown to send it to run in the background as a process, outside of the terminal.

disown

Refresh the XFCE4 window manager

Though the XFCE4 panel is a major annoyance, it’s not the only thing with the potential to break your desktop session. The XFCE4 window manager can also run into some problems when it crashes and can make it so that you can’t minimize/maximize windows open on the desktop.

Much like the panel, the Window manager can be dealt with through the terminal. So, launch a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. From there, you’ll need to run the xfwm4 command with the “–replace” switch, so that it can replace itself with the current instance of the window manager that is broken.

xfwm4 --replace

Upon running the command above, you’ll see your desktop flicker for a second. Don’t panic! This flash is a good thing, and it means that the window manager and everything handling your desktop session is refreshing. From here, all window-switching issues should be gone!

Is the window manager not refreshing when you run the replace command? Try to re-run it a few times. Or, if all else fails, run a kill command and the XFCE4 desktop environment should automatically restart the window manager on its own.

killall xfwm4

or

pidof xfwm4
kill number-from-pidof

Make a reset script

Using a few commands in the Linux terminal to restart the XFCE4 panel or the XFCE4 window manager works in a pinch, but if you’d like to do it all in one go, the best way is to write a script.

The first step in creating a reset script for the XFCE4 desktop is to create the file where the code will be stored. To create a new file, use the touch command below.

touch xfce4-restart

After running the touch command above, a file with the name “xfce4-restart” will appear in your home directory (~). From here, open up the script file with the Nano text editor.

nano -w xfce4-restart

At the top of the restart file, write in the first line of code. This code is known as the “shebang,” and it will help your Linux operating system run the script properly.

#!/bin/bash

Following the shebang code, add in the command that will kill the XFCE4 panel.

killall xfce4-panel

Press Enter to make a new line underneath the panel command, then add in a command to re-run the panel.

xfce4-panel

Following the second panel command, you must add in the code to refresh the window manager. To refresh the window manager press Enter to make another new line. Then, write in the xfwm4 –replace command.

xfwm4 --replace &

Save your edits to the xfce4-restart file in the Nano text editor by pressing Ctrl + O on the keyboard. After that, exit Nano by pressing Ctrl + X. Once out of the Nano text editor, update the permissions of your restart file using the chmod command.

chmod +x xfce4-restart

With the file permissions up to date, move the file into “/usr/bin/” with the mv command.

sudo mv xfce4-restart /usr/bin/

You’ll now be able to restart both the panel and window manager on the XFCE4 desktop by merely bringing up the quick launcher with Alt + F2, entering the command below and pressing the Enter key!

 xfce4-restart

Read How to fix a frozen XFCE Linux desktop by Derrik Diener on AddictiveTips – Tech tips to make you smarter

How to install the Zafiro icon pack on Linux

The Zafiro icon pack is a flat, clean icon theme created for Linux users. It follows along with the ever-popular flat design scheme that many other Linux icon themes stick to these days, but with a twist. Each of the icons is carefully crafted, well colored, and beautiful to look at.

If you’re looking for a brand new icon theme to replace the one on your current Linux operating system, follow along with this guide and learn all about how to set up the Zafiro icon theme!

Download Zafiro icons

Getting a copy of the Zafiro icon theme can be done in two ways. The first way to grab Zafiro is by visiting it’s download page on Gnome-look.org, clicking “files” and choosing from one of the many different choices of icons available (Classic, Green, Purple, White-Yellow, Black-Red, and Variant.) The second way to download the Zafiro icons directly from its Git repository. In this guide, we’ll focus on both.

Downloading via Gnome-look

Choosing to download the Zafiro icon theme through gnome-look.org is a good choice if you want to try out Zafiro, but you’d prefer to try some of the color variants (like Purple, or Green) rather than the stock, default Zafiro setup. To start your download, head over to the Zafiro page on Gnome-look.org, and click on “Files.” Then, click the download icon next to one of the eight themes they have in the “Files” list.

Upon selecting the download icon, a pop-up window will appear on the screen. In this pop-up window, you’ll see a brief message that your download is ready to go. From there, select the blue “Download” button to save the theme to your Linux PC.

Feel free to download multiple Zafiro icon themes, as you like!

Extracting Zafiro icon files

When you download Zafiro icons files from Gnome-look, they come in a locked file archive. These files must be extracted so that the icon files inside can be installed correctly on a Linux system.

The quickest way to extract the Zafiro icon files on Linux is with the tar command in terminal. So, press Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, with the terminal window open, move to “Downloads” with the CD command.

cd ~/Downloads

Once inside of the “Downloads” directory, run the commands to extract the Zafiro icon archive files.

Classic

tar xvf Zafiro-Icons-Classic.tar.xz
rm Zafiro-Icons-Classic.tar.xz

Green

tar xvf Zafiro-Icons-green.tar.xz
rm Zafiro-Icons-green.tar.xz

Purple

tar xvf Zafiro-Icons-purple.tar.xz
rm Zafiro-Icons-purple.tar.xz

White-Yellow

tar xvf Zafiro-Icons-White-Yellow.tar.xz
rm Zafiro-Icons-White-Yellow.tar.xz

Black-Red

tar xvf Zafiro-Icons-Black-Red.tar.xz
rm Zafiro-Icons-Black-Red.tar.xz

Variant-A

tar xvf Zafiro-Icons-Variant-A.tar.xz
rm Zafiro-Icons-Variant-A.tar.xz

Light

tar xvf Zafiro-Icons-Light.tar.xz
rm Zafiro-Icons-Light.tar.xz

Blue

tar xvf Zafiro-Icons-Blue.tar.xz
rm Zafiro-Icons-Blue.tar.xz

Downloading via GitHub

Going the GitHub route for Zafiro is best if you want to use the icon theme, but don’t much care about the various color modifications on Gnome-look.org. To get a copy of the latest Zafiro icons from the developer’s GitHub page, you’ll first need to install the “git” package.

To install the “git” package on Linux, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, with the terminal window open, follow the command-line instructions below that correspond with the Linux OS you currently use.

Ubuntu

sudo apt install git

Debian

sudo apt-get install git

Arch Linux

sudo pacman -S git

Fedora

sudo dnf install git

OpenSUSE

sudo zypper install git

Generic Linux

The “git” package is integral to a lot of Linux operating systems, as most developers use a Git-based source control system. As a result, the “git” tool should readily be available for installation on even the most unknown of Linux OSes. To install it, open up a terminal, search for “git” and install it the way you typically install software to your system. Or, download it from the official web site, here.

With the “git” package downloaded, use the CD command to move your terminal session from the home directory (~) to “Downloads.” After that, use the git clone command to pull down the latest Zafiro icon theme files.

cd ~/Downloads
git clone https://github.com/zayronxio/Zafiro-icons.git Zafiro-Icons

Installing Zafiro icons

There are two ways to install the Zafiro icons on Linux (system-wide and single-user). To start the installation, follow the instructions below.

Single-user

Installing Zafiro as a single-user is the best way to go if you’re the only one who will use the icon theme, and you don’t have plans to enable it for other users. To start, create a new folder labeled “.icons” using the mkdir command.

mkdir -p ~/.icons

Next, move the Zafiro icon folder(s) from the “Download” directory to the newly created “.icons” folder.

mv ~/Downloads/Zafiro-Icons* ~/.icons

When the mv command is complete, run ls to verify that the Zafiro icon folder(s) are in the right place.

ls ~/.icons | grep 'Zafiro'

System-wide

Need every user on your Linux PC to be able to use the Zafiro icon theme? If so, you must install it to “/usr/share/icons/” AKA a “system-wide” installation.

To start, move the terminal session from the home directory (~) to the “Downloads” folder using CD.

cd ~/Downloads

Then, use the mv command to place the Zafiro icon folder(s) inside “/usr/share/icons/”.

sudo mv Zafiro-Icons* /usr/share/icons/

When the mv command completes, run the ls command to check that the files made it to the right place.

ls /usr/share/icons/ | grep 'Zafiro'

Enabling Zafiro icons

To use Zafiro as your new icon theme on Linux, it must be enabled through appearance settings. Open up “System Settings” on your Linux PC, locate “icons” and set it as the default icon theme.

Unsure about how to set Zafiro as your default icon theme on Linux? Check out the links in the list below. They go over how to customize each Linux desktop environment, outline, in detail, how to change icon themes.

Read How to install the Zafiro icon pack on Linux by Derrik Diener on AddictiveTips – Tech tips to make you smarter

How to make Snaps easier to install on Elementary OS with Snaptastic

Elementary OS doesn’t officially support Snap packages out of the box on their latest Juno release. The reason for the lack of support is that Snaps don’t fit into the Elementary style. Understandably, developers have preferences for what technologies they choose to support. So if you’re on Elementary OS and want to use Snaps, you’ll have to resort to third-party tools like Snaptastic.

What is Snaptastic? It’s an Elementary-focused program that takes the headaches out of setting up Ubuntu Snap packages from the command-line and replaces it with a thoughtful, easy to use GUI interface that matches the Elementary OS aesthetic. Here’s how to get it working on your system.

Setting up Snaps on Elementary OS

Elementary OS Juno does not have Snap packages enabled out of the box, and if you try to use any of the snap commands in a terminal, you’ll be disappointed. So, before attempting to set up the Snaptastic tool, Snap support must be enabled on Elementary OS.

Note: in this guide, we’ll be focusing on Elementary OS Juno, but this guide should also work for future versions.

The first step in enabling Snap support on Elementary OS is to install the actual Snap software. To do this, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T. Then, once the terminal window is open, enter the following command to install the Snap package software on your system.

sudo apt install snapd

Once the software is done installing through the package manager, everything should be ready to use. Run the snap refresh command in the terminal to check if the system is working. If something is wrong, try rebooting the computer.

Install Snaptastic

With the Snap software backend installed and enabled on Elementary OS, it’s time to get around to installing the Snaptastic program. There are two ways to set up this app. The first way is to get it directly through AppCenter. The second way is to build it from the source code. We’ll be covering both in this guide.

AppCenter

Snaptastic is available in the AppCenter app store on all Elementary OS installations. So, if you’re not the type of person to compile source code, this is a great way to get the app.

To install Snaptastic, open up the AppCenter app, search for “snaptastic,” set your price, and install it by clicking the “install” button.

Source Code

AppCenter is nice, but not for everyone. If you’d prefer to build the program yourself, here’s what to do. To start, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. Then, use the commands below to install the program dependencies necessary to build the app.

sudo apt install elementary-sdk git valac meson libgtk-3-dev libgranite-dev libsnapd-glib-dev -y

With the dependencies taken care of, use the git clone command to clone the latest source code of Snaptastic down from GitHub.

git clone https://github.com/bartzaalberg/snaptastic.git

Once the code is done downloading to your Elementary OS PC, use the CD command to move the terminal session into the “snaptastic” directory.

cd snaptastic

Using the meson command, set the build environment prefix to “user.”

meson build --prefix=/usr

Move into the “build” directory using the CD command.

cd build

Run the ninja command to build the program.

ninja

Install the program with:

sudo ninja install

When the Snaptastic application is installed, update the database files so that you’ll be able to install Snaps from the browser.

sudo update-desktop-database /usr/share/applications

Using Snaptastic

Snaptastic isn’t an app store per se, and it doesn’t allow users to search for Snap apps to easily install within the interface. That said, it can handle Snap packages and install them directly from Snap files, and the Snapcraft website (which is arguably simpler than an app store.)

To use Snaptastic to install Snap apps, start by opening the program. From there, go to the Snapcraft website, and click on the “Store” button at the top of the website.

Once you’ve selected “Store,” locate the search box that says “search thousands of apps,” and write in the name of the Snap app you’d like to install.

Look through the search results that appear, and click on the app in the list to go to its dedicated Snapcraft app page. From there, find the green “Install” button and click on it. Then, after selecting the “Install” button, locate the “View in Desktop store” button and select it. Tell your web browser to open up the link inside of Snaptastic.

With the Snap app opened inside of Snaptastic, select the “Install” button to start the installation. Repeat this process to install as many Snap apps as you’d like.

Read How to make Snaps easier to install on Elementary OS with Snaptastic by Derrik Diener on AddictiveTips – Tech tips to make you smarter