Optimize your system and free up disk space in Ubuntu and derivatives with these steps

optimize system

Disk space today is not a problem, as more and more discs with large capacities are being launched on the market and discs with lower capacity are beginning to be displaced.

Although in the case of SDD things is different since in the first place the capacity of these is still relatively low but the prices are not, as higher capacity SDDs are still expensive. That's one of the reasons that even a high-end notebook still ships with 256 to 500 GB SSDs.

Occasionally there comes a time when you may want to free up disk space. Like any other operating system, if not properly maintained, Ubuntu also consumes a considerable amount of space over a period of time.

Disk space can easily be filled with cached package files, old kernels, and unused applications.

It is because of that Today we are going to see some ways to free up disk space and get rid of junk files from the system.

Remove unnecessary packages

Whenever some applications or even system updates are installed, these are downloaded by the package manager and then stored in the cache before installing them, in case they need to be installed again.

If the installation was successful, Ubuntu does not delete these packages and they remain cached.

So cleaning these packages is recommended to save disk space, improve your PC performance, and speed up boot times.

These packages are stored in the / var / cache / apt / archives folder.

To remove all this garbage from the system, just run the following command from the terminal:

sudo apt-get -s clean

This command will clean up the following system directories:

/ var / cache / apt / archives / partial / *

/ var / lib / apt / lists / partial / *

/var/cache/apt/pkgcache.bin

/var/cache/apt/srcpkgcache.bin

Remove old kernels from the system

As we should know, the Linux Kernel is the heart of the system, but it is also known that it is updated every so often, so they are released new versions which are installed in the system displacing the old versions which remain stored without being eliminated.

This allows us at each login to choose with which version of the Kernel we want to start the system, although by default it will always start with the most recent one.

Although the ideal would only be to work with a single Kernel, it is advisable to leave the current version and a previous one for any backup issue and delete all the others above.

For this we must type the following command

sudo dpkg 'linux-image *' --list

Next, they must identify their oldest kernels and execute the following command to remove the previous versions.

Just replace xxxxx with the version of Linux you want to delete.

sudo apt-get remove linux-image-xxxxx

As an alternative, an easier way to clean up these old kernels is to use 'autoremove'.

sudo apt-get autoremove  --purge

Optimizing the system with Stacer

stacer main screen

Stacer main screen

Stacer is an application built in Electron, with a very clean and modern user interface, this will show us a graphical interface with information about the use of the CPU, RAM memory, hard disk usage, etc.

With its System Cleaner function, allows us to eliminate the app cache, empty our trash, generate reports of problems, system logs, among many others. It has several functions similar to those offered by CCleaner

Among the characteristics of Stacer we find:

  • Dashboard to give you a quick view of system resources
  • System Cleaner to free up space in one click
  • Manage startup applications in Ubuntu to optimize performance
  • Find and manage services, daemons
  • Find and uninstall software to free up space

This application has an official repository so for its installation we only have to execute the following in the terminal:

sudo add-apt-repository ppa:oguzhaninan/stacer
sudo apt-get update
sudo apt-get install stacer

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Manual of Jesus said

    Excellent application, I had seen it before and I really liked it ,,,,

  2.   Saint James of the Cross said

    A very useful application.

  3.   Israel Fernandez said

    Thanks for the advice, it worked

  4.   Ramiro said

    I am new to this linux environment try to install it using the indicated commands

    sudo add-apt-repository ppa: oguzhaninan / stacer
    sudo apt-get update
    sudo apt-get install stacer

    I even looked for it in the Ubuntu store and it appears as unsupported