You might have experienced that the system starts running slow after using Ubuntu for some time. In this article, we shall see several tweaks and tips to make Ubuntu run faster.
Before we see how to improve overall system performance in Ubuntu, first letโs ponder on why the system gets slower over time. There could be various reasons for it. You may have a computer with a basic configuration and might have installed numerous applications which are eating up resources at boot time.
It is not rocket science, but as you continue using a system, installing apps, and carrying out many tasks, it affects your system resources in one way or the other. So, to ensure a fast-performing system, you will have to manage numerous aspects of your Linux distribution.
Here I have listed various small tweaks along with some suggestions for best practices that can help you speed up Ubuntu a little.
1. Reduce the default grub load time:
By default, the GRUB load time is set to 0 in Ubuntu. This speeds up the system boot.
But, if you are using some dual boot system, the grub gives you some time to change between OSs or recovery. To some, this could be a slow experience.
If you are one of them, you can simply use the following command to open the grub configuration:
sudo gedit /etc/default/grub &
And change GRUB_TIMEOUT
to something lower than 5, as convenient for your specific needs. For example, GRUB_TIMEOUT=2
will change the boot time to 2 seconds.
Once you have changed the grub configuration, update grub to make the change count:
sudo update-grub
If you are more comfortable with a GUI tool, you can refer to our resource on using grub customizer.
2. Manage startup applications:
Over time, you tend to start installing applications. If you are a regular Itโs FOSS reader, you might have installed many apps from our first look series.
Some of these apps start at each startup, and, of course, resources will be busy in running these applications. Result, a slow computer for a significant time duration at each boot. Go to overview and look for Startup Applications:
Here, look at what applications are loaded at startup. Now, think if there are any applications that you donโt require to be started up every time you boot into Ubuntu. Please donโt hesitate to remove them.
But what if you donโt want to remove the applications from startup?
For example, if you installed one of the best indicator applets for Ubuntu, you will want them to be started automatically at each boot.
What you can do here is, delay the start of some programs. This way you will free up the resource at boot time and your applications will be start automatically, after the specified time. Giving some breathing space to the computer to process all the startup programs.
For example, if you want to delay the running of the Flameshot indicator, for letโs say 20 seconds, you just need to add a command like this in the existing startup configuration:
sleep 20;
So, the command flameshot
changes to sleep 20;flameshot
. This means that now Flameshot will start with a 20-second delay. You can change the start time of other start-up applications similarly.
3. Install preload to speed up application load time:
Preload is a daemon that runs in the background and analyzes user behavior and frequently run applications. It will move binaries/dependencies of your most-used apps in to the memory by predicting as per your usage.
Sure, this could also mean using the memory unnecessarily (if you change your behavior). But, as far as user feedback is concerned, it is not something that causes a slowdown.
You can always uninstall it through the terminal if you do not find it helpful.
Open a terminal and use the following command to install preload:
sudo apt install preload
After installing it, restart your computer and forget about it. It will be working in the background.
4. Choose the best mirror for software updates:
It is good to verify that you are using the best mirror to update the software. Ubuntu software repositories are mirrored across the globe, and it is quite advisable to use the one which is nearest to you. This will result in a quicker system update as it reduces the time to get the packages from the server.
Navigate through Software & Updates โพ Ubuntu Software โพ Download From, and click on Other (as shown in the screenshot below) and thereafter click on Select Best Server:
It will run a test and tell you which is the best mirror for you. Normally, the best mirror is already set, but as I said, no harm in verifying it. Furthermore, this may result in some delay in getting the updates if the nearest mirror where the repository is cached is not updated frequently. This is useful for people with a relatively slow internet connection.
You can also refer to our other resource to speed up Wi-Fi speed in Ubuntu.
Once the tests are finished, click on Choose Server and then click Close.
This will ask you to reload the software cache. Use the Reload button when asked.
It's better to run an update after this via the terminal:
sudo apt update
5. Use apt-fast instead of apt-get for a speedy update:
apt-fast
is a shell script wrapper for โapt-getโ that improves update and package download speed by downloading packages from multiple connections simultaneously.
If you frequently use terminal and apt-get to install and update the packages, you may want to give apt-fast a try. Install apt-fast via the official PPA using the following commands:
sudo add-apt-repository ppa:apt-fast/stable
sudo apt-get update
sudo apt-get install apt-fast
Read more about configuring apt-fast from their official repository.
6. Remove language-related sources from apt update:
Have you ever noticed the output of sudo apt update?
There are three kinds of lines in it, hit, ign and get. You can explore their meanings in our apt command guide.
You may not notice the IGN lines, depending on the repositories you have.
However, if you look at IGN lines, you will find that most of them are related to language translation. If you use all the applications, and packages in English, there is absolutely no need for a translation of the package database from English to English.
If you suppress these language-related updates from repositories, it will slightly increase the apt update speed. To achieve that, open the following file:
sudo gedit /etc/apt/apt.conf.d/00aptitude
And add the following line at the end of this file:
Acquire::Languages "none";
7. Reduce overheating
Overheating is a common problem in computers these days. An overheated computer runs quite slow. It takes ages to open a program when thermal throttling affects your system. There are several tools that you can use to reduce overheating and thus get a better system performance on Ubuntu.
The GNOME power-profiles-daemon will be preinstalled on all the latest Ubuntu releases. You can use this tool from the power option in the settings to change the system to three modes, like Power Save, Balanced, and Performance Mode.
Similarly, CPUFREQ can help you adjust the CPU frequency. To install CPUFREQ indicator use the following command:
sudo apt install indicator-cpufreq
Restart your computer. Do note that you will be saving battery in this mode by compensating with some performance hit.
For an older system, you can install and use TLP, with the following commands in a terminal:
sudo apt update
sudo apt install tlp tlp-rdw
sudo tlp start
You donโt need to do anything after installing TLP. It works in the background.
8. Use a lightweight desktop environment (if you can)
Usually, the default GNOME desktop-powered Ubuntu distribution takes up more system resources/memory to work snappier.
In such cases, you may opt for a lightweight desktop environment like Xfce or LXDE, or even KDE.
You can learn the differences between KDE and GNOME if you are curious.
These desktop environments use less system resources and could give you a faster performance overall. They also come with a set of lightweight applications that further help run Ubuntu faster.
You can choose to install a desktop environment manually by referring to our tutorial on how to install Xfce on Ubuntu. Or, you can pick another flavour of Ubuntu for your system, like Kubuntu, Xubuntu, or Ubuntu MATE.
9. Use lighter alternatives for different applications
This is more of a suggestion and liking. Some default or popular applications are resource heavy and may not be suitable for an old computer. You can replace them with some alternatives.
For example, use Gdebi to install packages. Use AbiWord instead of LibreOffice Writer etc.
10. Remove Unnecessary software
Sure, it is exciting to install various software to enhance the desktop experience. But, often, we forget to remove them from our system, even if we discontinue using it.
So, it is always good to make a habit of regularly evaluating the software installed and removing the unnecessary ones as per your current requirements.
It is a good to use the autoremove
command to remove various leftover packages in the system.
sudo apt autoremove
Furthermore, if you are a Flatpak user, then there can be unused runtimes present, that were not removed, when the corresponding app is removed. You can clear them using:
flatpak uninstall --unused
Suggested Read ๐
11. Remove Unnecessary Extensions
GNOME provides various extensions, that enhance the performance of the system. But, as the number of extensions on your system increases, it can cause significant performance issues. So, always keep the extensions to those that you cannot avoid.
If you are considering the speed and performance of the system, you can stay away from heavily customizing extensions.
12. Use a system cleaner app
If tidying up your system takes more effort than you intended, you can try using system optimizing applications like Stacer.
It can help you clean up junk files, manage startup processes, monitor system resources, and let you do many things from a single app.
With all the functions available, you can end up with a fast-performing Linux system.
13. Free up space in /boot partition
If you happen to use a /boot partition separately, often it gets to the point where you have to free some space to be able to install new apps or work without any performance issues.
And, if you get the same warning, and have no clue what to do, fret not, we have a dedicated guide on it to free up space.
14. Optimizing SSD Drive
When you delete a file, it is not actually deleted from your system; instead, it is marked for removal, and is removed only when some data is written over it.
So, without proper care, this can lead to fragmentation and degraded performance of SSDs over time. On Ubuntu and other Linux systems, there is this tool called fstrim, that helps keep SSD clean, by freeing up unused blocks of data periodically.
If you have an SSD, it is automatically enabled most of the time. You can check the status by using:
sudo systemctl status fstrim.timer
If not enabled, enable it using;
sudo systemctl enable fstrim.timer
Now reboot your system.
15. Remove Trash Periodically
You know that, usually, the right-click option in Nautilus file manager has only โMove to Trashโ button, unless you tweaked it. This means, the removed files are going to the trash.
You can set it to remove the trash item automatically in a periodic fashion.
For this, go to Settings โพ Privacy โพ File History and Trash.
Here, set Automatically Delete Trash Content and then choose at what interval you want to clear the trash. You can also remove temporary files in this fashion, but you should know what you are removing.
Suggested Read ๐
16. Use the Memory Saver Feature of Browsers
Nowadays, most of the browsers, especially the Chromium-based browsers, come with a feature called Tab Sleep/Memory Saver. In this feature, you can set a Tab as idle after some time inactive so that you can save some memory.
This will be a good setting if you have numerous tabs open, and do not mind if some tabs go idle.
You can also exclude sites from the list so that they will be kept active all the time.
[Bonus] Change Swappiness (Advanced)
Your operating system moves some process to the swap memory (disk storage), on top of RAM, to make room for things when you already have several processes active.
However, just because the disk drive is used for swap memory, it is slower than your RAM.
Hence, it is better to avoid using swap memory as much as possible.
You can explore more about it in our swap guide:
The Swappiness is a Linux kernel parameter that determines the degree of utilizing swap memory. The default value of Swappiness on Ubuntu is 60. You can check this by running:
cat /proc/sys/vm/swappiness
Setting a low swappiness value like 10, 35 or 45, will reduce the chances of the system using swap, resulting in a faster performance.
Above all, it depends on the system hardware, workload, etc. So, you need to experiment with the value. To change the swappiness value for the current session, use the command:
sudo sysctl vm.swappiness=45
This will be reset to 60 when the system is rebooted. Once you find the optimum performance value for your system, and satisfied with it, you can change it permanently, by writing it to the sysctl.conf
file.
sudo nano /etc/sysctl.conf
Enter the following line to the bottom.
vm.swappiness=45
Save this and reboot your system.
Suggested Read ๐
Wrapping Up
That concludes the collection of tips to make Ubuntu 22.04, 20.04, and other versions faster. I am sure these tips would provide an overall better system performance.
While the above-mentioned tips are worth considering, it is also important to keep your system regularly updated so that it will be more reliable in the long run.
Furthermore, if you prefer a faster page load while browsing, you can opt for third-party DNS, like Google, or Cloudflare.
Do you have some tricks up your sleeves as well to speed up Ubuntu? Did these tips help you as well? Do share your views. Feel free to drop your thoughts in the comment section.