How to Use BleachBit to Optimize Ubuntu Linux

BleachBit is a cross-platform, free and open source tool for helping you get rid of junk files on your machine. It is powerful and easy to use, allowing you to not only delete junk files, but also to shred and wipe files. This is useful for keeping your keeping system clean and organized, as well as offering you well-deserved privacy.

In this article, I’m going to guide you through the installation process and show you how to make basic usage of BleachBit, while also including screenshots where needed.

Note: I’ll be using Ubuntu, but the steps are similar for most Linux distributions.

Installing BleachBit on Ubuntu

The simplest way to install BleachBit is using the package manager or the software. Here you can search for BleachBit and when you find it, click on it and then press Install. Removing it is as simple as searching for it again and pressing Remove.

BleachBit in Ubuntu Software Center
BleachBit in Ubuntu Software Center

If you are a terminal lover, you can use apt command to install BleachBit:

sudo apt install bleachbit -y

However, the Ubuntu repositories or the Software Center may not contain the latest version – which is 3.2, at the time of updating this article.

So, to grab the latest version, you can head down to official download page:

BleachBit Download Page

Here, download the right package for your system (in my case it’s Ubuntu 18.04 LTS) by clicking on the corresponding link. It will download a .deb file.

Installing packages from deb files is simple. Simply double click on it and it will run in the software center. And, you can proceed to install it then.

Using BleachBit to clean your system

Search for BleachBit and click on the bleachbit icon in the Applications Menu:

Bleachbit in Applications Menu

Note

To run BleachBit with administrator privileges, click on the second icon (BleachBit as Administrator/root).

And, depending on what you click on – the list of files will be different. So, if you don’t want to delete system junk files, you don’t need to launch the second one (BleachBit as Adminstrator).

Either of this methods should open up the start screen:

Bleachbit Startscreen New

This is the Preferences menu and you can open it up at any time by clicking on the menu icon (top-right corner of the window) and then click Preferences.

Some important options include:

  • Overwrite contents of files to prevent recovery: although slower, this will actually shred your files. Files are normally marked as deleted and allowed to be overwritten if there isn’t any space left. However, selecting this options will fill the space with junk (that will still act as a deleted file), making the shredded file irrecoverable. Keep in mind that this process is slower.
  • Languages: here you can choose which languages to keep (although they don’t really take up that much space).
  • Drives: in this sub-menu you can add directories where all free space should be replaced with junk (as when shredding files), making sure no file can be recovered from those locations.
  • There’s a dark mode too!

Closing the Preferences menu will leave you in the Main Menu. In either case, you may end up directly on the main page of the app and can choose to check the preferences for advanced options.

Bleachbit Main Screen

On the left side, you can select what type of files you want to delete (this includes system-wide files and application-specific files). Some of them require administrator privileges (such as APT cache and System-related options), and some of them will prompt warnings (such as Firefox warning you that your saved passwords will be deleted).

After making your selection, I suggest clicking on the Preview (the magnifying glass icon). This will show you exactly what is going to be deleted:

By pressing Clean, you are going to start the deleting process. You’ll get a message when BleachBit finishes:

Bleachbit Task

Another thing you can do is quickly shred or wipe a specific directory or file. You’ll find the options as shown in the screenshot below:

Bleachbit Settings

With the new updates, BleachBit has also added an option to “Make Chaff“. For most of the users, it’s not a useful feature – but if you need a bunch of files with information to confuse digital forensics when finding traces on your computer, this could come in handy.

You can read more about it in their official documentation.

Using BleachBit in command line

Bleachbit Command Line Options

As you can observe in the image above, you can do a lot of stuff through the terminal as well. You just need to type in “bleachbit -help” in the terminal know all the options and its usage.

For instance, to list cleaners run:

bleachbit -l

This will produce output in the vein of:

...
thunderbird.index
thunderbird.passwords
thunderbird.vacuum
transmission.blocklists
transmission.history
transmission.torrents
tremulous.cache
vim.history
vlc.mru
vuze.backup_files
vuze.cache
vuze.logs
vuze.tmp
warzone2100.logs
wine.tmp
winetricks.temporary_files
x11.debug_logs
xine.cache
yum.clean_all
yum.vacuum
...

Now you can run any cleaner or group of cleaners. For example:

bleachbit -c google_chrome* thunderbird.passwords

This command will delete all Google Chrome saved data and all saved Thunderbird passwords.

Similarly, you can utilize the –-wipe-free-space command and others to make the most out of it. The CLI is useful because you can write bash scripts that execute BleachBit commands and you can even schedule cleaning actions using tools such as cron.

Wrapping Up

There are other ways to clean up Ubuntu but having a dedicated GUI tool is always handy. Whether you are simply looking for a neat way to keep your system clean of any unnecessary data, optimizing your machine, or trying to keep your personal details safe, BleachBit is a tool that will surely come in handy, being so easy to get the hang of (while still being powerful).

Do you use any system cleaner? If so, which one and how? Let us know in the comments!

About the author
Sergiu

Sergiu

I'm a student passionate about anything involving creativity, especially music and poetry. I play music with friends, write and code. Linux and coffee are also at the top of my ever-growing list of p

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.