Optimizing Ubuntu Desktop Performance: Transform Your PC into a Smooth Workstation

Ubuntu tutorial - IT technology blog
Ubuntu tutorial - IT technology blog

Hey everyone! If you’ve been using Ubuntu Desktop for a while, you’ve probably experienced your computer suddenly becoming sluggish and slow, especially when opening many applications or after a few months of use. This situation is not only frustrating but also directly impacts productivity. In my experience, performance optimization is an essential skill that anyone working with computers should master.

In this article, I’ll share the tuning steps and useful tools I’ve applied to make my Ubuntu Desktop run significantly smoother and faster. Don’t worry, these aren’t advanced tricks, but mostly basic steps that yield surprising results. Let’s dive in!

Instant Boost: Get Faster in 5 Minutes!

Need your computer to run faster right now? Here are things you can do in just a few minutes to see a noticeable difference.

1. Update Your System

The first and most important step is to update your system. Updates not only patch security vulnerabilities but also frequently bring performance improvements. Make sure your Ubuntu is always updated to the latest version.


    sudo apt update
    sudo apt upgrade -y
    sudo apt dist-upgrade -y # Sometimes necessary for larger updates

2. Remove Unnecessary Packages and Clean Cache

Over time, we often install many software packages and then forget about them. These superfluous packages not only waste disk space but can also run in the background, consuming system resources. I remember when I first switched from CentOS to Ubuntu, even though I was familiar with yum and dnf, it still took me about a week to get used to apt. But once I mastered it, I realized how powerful apt is for system management and cleanup.


    sudo apt autoremove --purge -y # Remove no longer needed dependency packages
    sudo apt clean # Delete downloaded installation files (deb) from apt's cache
    sudo apt autoclean # Delete old installation files that are no longer usable

3. Check Startup Applications

Many applications automatically configure themselves to start with the system, which slows down the boot process and consumes RAM right from startup. You can easily find “Startup Applications” in Ubuntu’s application menu and disable unnecessary ones.

Detailed Explanation: Diving Deeper into Optimization

After performing the quick steps above, it’s time to delve deeper into each aspect to thoroughly optimize your system.

1. Efficient System Resource Management

Monitor Resources

Before you start optimizing, it’s crucial to identify which “culprits” are consuming system resources. I typically use htop or gnome-system-monitor.


    # Install htop if not already present
    sudo apt install htop
    # Run htop
    htop

htop provides a visual, detailed overview of CPU, RAM, and active processes in the Terminal. If you prefer a graphical interface, gnome-system-monitor is a more user-friendly option.

Control Startup Applications

Beyond the default “Startup Applications” tool, you can use gnome-tweaks (also known as Tweaks) for more granular control over startup applications. If you haven’t installed it yet, do so now:


    sudo apt install gnome-tweaks

In Tweaks, you can easily navigate to the “Startup Applications” section to enable or disable applications. Additionally, don’t forget to check active systemd services:


    systemctl list-unit-files --type=service --state=enabled

To disable a service you don’t need (e.g., Bluetooth if you don’t use it):


    sudo systemctl disable bluetooth.service
    sudo systemctl stop bluetooth.service

2. Optimize Graphical Interface (GNOME Desktop)

A visually appealing graphical interface often comes with a significant consumption of system resources. Fortunately, we can alleviate this burden.

Reduce Graphical Effects

In gnome-tweaks, navigate to the “General” or “Appearance” section (depending on your GNOME version) to disable unnecessary animations. This will make the system significantly more responsive, especially useful on machines with modest specifications.

Choose a Lighter Theme

Some GNOME themes can be very heavy and consume a lot of RAM. Instead, try the system’s default themes or themes designed to be lighter. For example, I often stick with Ubuntu’s default theme or Adwaita to ensure the best performance.

3. Optimize File System and SWAP

Clean Up Junk Files and Find Large Files

A full hard drive is also a common reason for a slow computer. I often use the ncdu tool to quickly find the directories or files that are taking up the most space:


    sudo apt install ncdu
    ncdu /

Once identified, you can decide to delete unnecessary files in directories such as ~/.cache, ~/.local/share/Trash (trash bin), or your download folders.

Fine-tune SWAP (Swap Memory)

SWAP is a portion of disk space used as virtual memory when physical RAM is full. The swappiness value controls the kernel’s preference for using SWAP. The default value is usually 60, meaning the kernel tends to move less-used data to SWAP quite early, even when RAM is still free. Reducing this value will make the system prioritize keeping data in RAM, limiting read/write operations to the disk (especially important for SSDs to extend their lifespan), thus making the computer more responsive.


    # View current swappiness value
    cat /proc/sys/vm/swappiness

    # Change temporarily (will be lost on reboot)
    sudo sysctl vm.swappiness=10

    # Change permanently: add this line to the end of /etc/sysctl.conf
    echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf

I usually set swappiness to 10 or 20 for desktop machines, unless the machine has very little RAM and genuinely needs to use SWAP extensively.

Advanced: More Progressive Solutions

If the basic optimization steps above aren’t enough, here are a few more advanced options for your consideration.

1. Use ZRAM: Compressed RAM Instead of Disk SWAP

ZRAM creates a compressed block device in RAM and stores data there after compressing it. This significantly increases the effective use of RAM while minimizing data writes to physical disk SWAP (which is much slower). This is an extremely useful solution for machines with limited RAM (e.g., under 8GB) or when you want to extend the lifespan of an SSD.


    sudo apt install zram-tools

After installation, ZRAM will typically configure and activate automatically. You can check its operational status using the command:


    swapon --show

You should see a /dev/zramX device (e.g., /dev/zram0) listed in the SWAP list.

2. Switch to a Lighter Desktop Environment

GNOME is a powerful Desktop Environment (DE), but it’s also quite resource-intensive. If your computer has weak specifications (e.g., under 8GB of RAM or an older CPU), switching to a lighter DE can make a significant difference in performance. Popular choices include XFCE (Xubuntu), LXQt (Lubuntu) or MATE (Ubuntu MATE).


    # Install XFCE (Xubuntu desktop)
    sudo apt install xubuntu-desktop
    # After installation, log out and select Xubuntu Session when logging back in

I once had an old laptop with rather modest specifications, and switching from GNOME to XFCE helped it run smoothly again in an impressive way.

3. Fine-tune Other Kernel Parameters

Beyond swappiness, you can also fine-tune other kernel parameters via the /etc/sysctl.conf file. For example, vm.vfs_cache_pressure controls how aggressively the kernel reclaims inode and dentry cache memory. The default value is 100. Reducing this value (e.g., to 50) can help the kernel retain more data in the cache, thereby improving file system performance.


    echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf

After modifying the /etc/sysctl.conf file, you need to apply the changes for them to take effect:


    sudo sysctl -p

Practical Tips from My Experience

  • Use Your Browser Smartly: Web browsers are probably the most RAM and CPU-hungry applications (a single Chrome tab can consume hundreds of MBs of RAM!). Consider disabling unnecessary extensions, limiting the number of open tabs, or trying lighter browsers like Brave or Vivaldi if Chrome/Firefox is too heavy for your machine.
  • Limit PPA Usage: Personal Package Archives (PPAs) are convenient for installing the latest software, but they also carry the risk of package conflicts or system instability. Only add PPAs from trusted sources and when absolutely necessary.
  • Invest in an SSD: If your computer is still using an HDD, upgrading to an SSD is one of the most effective ways to achieve impressive overall system speed improvements, especially for boot times and application loading. This is the most worthwhile investment I’ve ever made for any computer.
  • Check Graphics Card Drivers: Ensure that your graphics card drivers (NVIDIA, AMD) are correctly installed and are the latest version. Incompatible drivers can cause serious graphics performance issues, and even display errors.
  • Restart Regularly: Sometimes, a simple reboot can resolve many performance issues by clearing RAM and terminating stuck or faulty processes.
  • Less Is More: The “less is more” philosophy always holds true in system optimization. The fewer background applications running, and the fewer unnecessary graphical effects, the smoother and more stable your system will be.

I hope that with these shared tips, you’ll be able to make your Ubuntu Desktop faster and smoother, boosting your productivity. Remember, optimization is an ongoing process. So, don’t forget to regularly check and fine-tune your system to keep it in the best possible state. Good luck!

Share: