7 Ways to Speed up Ubuntu

Speed Up Ubuntu Featured

Ubuntu is already zippy, especially if you’re coming to Linux from the world of Windows. However, why is Ubuntu sometimes responding slower than usual? Is there anything you can do to give it a boost? If you feel that your Ubuntu system is slow, this tutorial shows a few ways to speed it up.

1. Clean Unused Temp and Log Files with BleachBit or Your Terminal

The first step in speeding up your computer is to clean up the fluff left behind by daily use. This can be your temporary files or log files that can take up plenty of storage space. When storage space gets filled up, the system becomes slow.

You can solve this problem with BleachBit.

  1. Install BleachBit with:
sudo apt install bleachbit
  1. Run BleachBit from your apps menu.
  2. Choose the types of files you’d like it to clean. We suggest everything under Apt, journald, and the Temporary files entry under Deep scan.
  3. Click on Clean on the top left.
Speed Up Ubuntu Bleachbit

Using the Terminal

Although BleachBit may be useful to clean up your system, you may be hesitant to install extra software on your system.

Your Ubuntu system already has all the tools at its disposal to clean itself up, but without BleachBit, you’ll have to remember how to do these things yourself via the terminal.

  1. Delete the cache and thumbnail folders used by user-level applications like your browser and desktop environment:
rm -rf ~/.cache
rm -rf ~/.thumbs

Although you’re deleting folders that your applications use, it’s not going to cause any lasting damage. A few things you do on a regular basis may be slow at first as a new cache is built, then you’ll be sailing smooth!

  1. Delete the temporary files stored by your package manager, APT:
sudo apt autoclean && sudo apt clean && sudo apt autoremove

APT will sometimes store older versions of software you’ve installed. If you have many applications, your updates may sometimes eat up your storage considerably without cleaning out the older versions. This command sequence pretty much gobbles up that space for you.

Good to know: we show you how to change the screen resolution in Ubuntu.

2. Use Baobab to Spot Storage Usage

Ubuntu has a superb analysis tool preinstalled to aid you in determining where your storage is most in use.

Go to your Applications menu and look up “Baobab” or “Disk.” Open the “Disk Usage Analyzer” application.

Ubuntuspeed Baobab
Ubuntuspeed Drives

Once you’ve selected a drive from the list, Baobab will scan it, then spit out a graph of what’s occupying its space.

Ubuntuspeed Spacechart

As you hover your mouse over the pie, you get a visual indicator of what folder you’re actually viewing. In my case, since this is a rather new installation of Ubuntu, the largest amount of space is occupied by system libraries.

If you find a lot of space occupied by the home folder specifically, look to see what you can clear out with this tool. The drop-down panel will help you easily navigate trouble spots and clearly see how much space they occupy.

As a general rule, if you’re not very experienced, don’t touch anything on your system drive that isn’t inside the home folder. You can more easily avoid this by limiting baobab to scanning your home folder by selecting it at the beginning.

3. Speed Up Boot Time by Decreasing GRUB Timeout

GRUB is a boot loader that’s preinstalled in most Linux distributions, allowing the system to load what it needs to wake up. Editing its configuration will change the way your system starts. For example, you can reduce the amount of time GRUB’s boot screen shows up. If you do experience a splash screen that allows you to select an option for boot for a set number of seconds before moving onto booting the default option, follow these steps to shorten the amount of time it waits for an answer from you:

  1. Start by editing Grub’s configuration with:
sudo nano /etc/default/grub
Speed Up Ubuntu Gedit Grub
  1. Locate the line GRUB_TIMEOUT=X, where X is the time GRUB is currently set to wait for your choice.
Ubuntuspeed Grubconfig
  1. Change that to something like two seconds – enough time to make a choice but also short enough to not be annoying.
  2. Save your changes and exit your editor. Update GRUB with:
sudo update-grub
Speed Up Ubuntu Update Grub

Your changes will be active on the next reboot. These instructions are valid only if you get a GRUB boot screen that allows you to select an operating system or kernel to boot with. If you boot straight into Ubuntu from the moment the splash screen stops, you won’t notice the change.

Tip: If you have messed up your Grub and can’t boot up your computer, follow this guide for ways to restore Grub.

4. Remove Useless Stuff from AutoStart

When you boot Ubuntu, it starts all your startup applications at around the same time that the desktop begins to load its graphical interface. During this time, you may notice a few performance issues from your system soon after startup that persist for a while, then possibly disappear.

To minimize this issue as much as possible, you must either remove a number of your startup apps or add a delay so that they don’t all compete for system resources the moment it’s trying to wake up.

  1. Visit your app menu and search for “Startup Applications Preferences.” When the entry appears, run it.
  2. Look at the list of software that auto-loads when you log in to your desktop.
Speed Up Ubuntu Startup Apps
  1. Remove the ones you don’t need to be active by selecting them and clicking the “Remove” button on the right.

5. Improve Speed with zRam

zRam creates a compressed swap space in your RAM. When your RAM starts filling up, zRAM will start compressing some of its content without having to turn to swap space on your storage devices.

This is important for two reasons:

  1. Every storage device (even an extremely fast NVME SSD) on the consumer market is slower than RAM, regardless of what huge numbers the marketing team spits out. The RAM bus is specifically designed to move enormous chunks of data as fast as the clock on the controller allows, while storage devices are optimized for storage!
  2. Having a swap partition or file on your SSD that’s written to constantly will increase the rate at which it degrades. zRAM can literally prolong the lifespan of your storage device by avoiding swap.

Thankfully, using zRAM today is easier than ever. It’s supported in most modern kernels, and you only need to install a script included in the default repositories to configure it automatically for your PC’s specs. To do that, follow these steps:

  1. Open a terminal and install the zRAM config script:
sudo apt install zram-config
Speed Up Ubuntu Install Zram
  1. Reboot your computer, and zRAM will run automatically.

If you want to learn more about the zRAM and how to customize it, check out this comprehensive zRAM guide.

6. Prioritize Your Apps with Ananicy

Ananicy is an auto-nice daemon that runs automatically on startup and gives active software and services a certain “niceness.” In Linux, niceness is an analog to Windows’s process priority. The less “nice” an application is allowed to be, the more priority it will get.

By setting application niceness across your system to levels that correspond to your priorities as a user, you can end up feeling more responsiveness from the apps you use while changing very little about your system on a core level. For example, if you’re streaming a film while an update is running, setting the updater to a higher niceness will prioritize the film you’re watching while keeping background stuff from disrupting your experience.

Ananicy helps speed up your system by using a collection of predefined rules that set the niceness of applications to levels that allow for a more uninterrupted user experience. Theoretically, with its default configuration, Ubuntu will feel more responsive just by installing it.

Before we begin, make sure that make, schedtool, and git are installed on your system:

sudo apt install git make schedtool

Follow the directions below to install Ananicy:

  1. Open a terminal and clone the app from its GitHub page:
git clone https://github.com/Nefelim4ag/Ananicy.git
Speed Up Ubuntu Git Clone Ananicy
  1. Switch to the directory that was just created:
cd Ananicy
  1. Package the app for Ubuntu with:
./package.sh debian
Ubuntuspeed Ananicypackage
  1. Install the packaged version of Ananicy with:
sudo dpkg -i ./ananicy-*.deb
Ubuntuspeed Ananicydpkg

The app will be active after the next reboot.

If you want to expand beyond Ananicy’s default rules and customize your own priorities for your apps, check out our detailed guide on Ananicy here.

7. Use a Different Desktop Environment

Gnome is great, but it can be quite resource-intensive too. While you can optimize it to use less resources, it can never get as zippy as a more lightweight environment like XFCE. The beauty of Linux, though, is that you’re not stuck with Gnome. You can install and use any desktop environment you wish on Ubuntu.

Installing XFCE on Ubuntu is as easy as inputting the following in a terminal:

sudo apt install xfce4
Speed Up Ubuntu Install Xfce

This will install a “base” version of XFCE. If you want to turn it into Xubuntu intead, use the command:

sudo apt install xubuntu-desktop

At the next login, you’ll be able to switch between the various desktop environments.

Speed Up Ubuntu Choose De

Frequently Asked Questions

Why stick with Ubuntu if there are faster distros?

Ubuntu offers a complete desktop experience with the largest available support community. The combination of usability and universality that it boasts makes it (and its various derivatives) a first-choice platform for people coming to Linux for the first time.

Are there downsides to using zRAM?

As long as you have a pretty decent CPU that is at least slightly underutilized by your day-to-day activities, zRAM is a great choice to minimize how much your system depends on its swap space.

If your CPU struggles to cope with the heavier things you do throughout the day, you might notice zRAM actually slowing you down a bit, as you still have to run a compression algorithm for allocating and freeing memory from that particular space in your system memory.

In cases like these, you’re probably better off just purchasing more RAM or getting a stronger CPU. The former is more feasible in most cases than the latter.

How many desktop environments can I run?

Many desktop environments have their own suite of pre-installed applications. XFCE, as seen in this article, comes with an entire ecosystem of its own with a separate settings manager. Desktop environments like KDE Plasma even have their own software managers and use entirely different graphical libraries from GNOME.

If you plan to run multiple desktop environments in one distro, you have to keep in mind that one of them may clash with the other, especially when it comes to things like appearance settings.

To get the best experience possible, it’s always more “clean” when you run one or two desktop environments rather than keeping an entire repository of them. In the case of this article, I’d recommend keeping Ubuntu’s default environment around (which is likely to work just fine if things go wrong elsewhere) and adding just one other.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Miguel Leiva-Gomez
Miguel Leiva-Gomez - Staff Writer

Miguel has been a business growth and technology expert for more than a decade and has written software for even longer. From his little castle in Romania, he presents cold and analytical perspectives to things that affect the tech world.