Unleash Your Linux System's Potential
Tips and Tricks for Optimal Usage with Simplified Explanation
Introduction
Everybody have a different story of them starting with Linux. No matter which distribution you use (not so many) you always have a freedom to personalize. But have you ever considered optimizing it? I know it might sound complicated and unnecessary but there is always a room for improvement even in a perfect system.
When we talk about optimizations for an operating system, They are targeted to improve performance, memory, power, security, customization or overall experience. Each have their own importance depending on your working profile. No distribution is out of the box perfect for you, as it was design to cater a large group of people. You might just accept it and move on, or you fine-tune it in order to match with your specifications and usage.
Here the optimization doesn't stands for improving the Linux itself but rather tweaking the system to perform better on your machine. I won't be going in depth of everything (still figuring out...) but will try to share things that I learn so far. Just keep in mind that not everything supposed to be meant for you and may have some consequences afterwords so read carefully before performing anything.
Desktop Environment
Desktop environment is the GUI that you use to interact with you operating system, it usually comes with the distribution itself or you can always install on your own. Gnome, KDE, Xfce, Cinnamon, Mate etc are some of the popular desktop environments. Each perform differently and comes with different features. Linux always allows you switching from one to another. Checkout the comparison of some of the popular desktop environments based on their performance.
Don't just pick one based on this, take your time and consider your priorities, do some research weather it matches with your preferences, perform tests on a virtual machine and when you have enough confidence you can perform the switch.
If you don't find it useful you still can switch back (with consequences).
It is always recommended to install the distribution flavors (if they are provided) instead of switching the desktop environment yourself.
Trade-offs:
Changing desktop environment often lead to compatibility issues with other packages hence not suitable for all distributions.
There is a learning curve to master the new interface.
Compatibility of the desktop environment itself also matters.
lack of features support depending where you switch from.
Services
There are bunch of services running in the background while you are using your operating system, some of them are important and some of them are unnecessary. systemctl
is an in-built Linux command to manage the services of your operating system. You can start, stop, restart, check status, enable/disable, and perform other advanced actions on a service.
- First list down all the services using,
systemctl -a
- Identify the services that are failed or not-running properly based on their status check if is a necessary one then disable it using,
systemctl stop service_name.service
- If its an important one then try to restart of reload the service using,
systemctl reload-or-restart service_name.service
- It is likely to have unnecessary services running on a freshly installed system.
Performance monitoring
If you are familiar with task manager from Windows, You'll agree that It really comes handy in many situations. Linux have similar tools like
top
,htop
,btop
,iotop
,vmsat
etc (I personally recommend usingbtop
that isbpytop
but written in c++). These can be installed using your package manager. It is most likely that your system will always comes with one of these or its own.If you are curious about how each and every application is performing on your system and want to see their performance profiles consider using the performance analysis tools like
perf
,gprof
. Which can help you to chose between multiple application distributions. Check out this blog covering the details.You can also optimize the booting performance by disabling unnecessary start-up applications or services.
Trade-offs:
Messing with the services that you are not aware of will have pretty bad consequences so be careful, always check is it is safe to interrupt it.
Performance analysis sometimes becomes really hectic and complicated and not highly remanded for a beginner.
Applications and Tools
You can install an application on your system through different package distributions and each have their advantages and disadvantages, But it is up to you which one to chose. Snap, Flatpacks and AppImage are the most popular and widely used distributions. Which one to choose may vary depending on your preferences. I will try to make it easier for you to chose one,
App Number. The Snapcraft online store (hub for snap packs) wins if the number of available apps is the most critical factor.
App Speed. AppImage is the fastest one of the three regarding app startup, speed, and performance. It is the ideal solution for a performant experience.
App Integration. Some package formats integrate better on specific distributions. For example, Snaps integrate better with Ubuntu, Arch Linux, and CentOS, while Flatpak integrates seamlessly with Fedora, Linux Mint, or Debian. AppImages work great on Arch Linux, CentOS, Debian, OpenSUSE, Red Hat Linux, and Fedora.
App Control. Flatpaks offer more control to developers compared to AppImage or Snaps.
Portability. AppImage packages are top-notch when it comes to portability. Snaps may have dependencies in other Snap apps, and Flatpaks can share libraries with another Flatpak. AppImages use only the resources from the package itself.
App Updates. Snaps and Flatpaks use the repositories to update apps automatically, while AppImage uses the AppImageUpdate tool. Additionally, AppImage doesn't get as many updates as the other two package formats.
Usability. Flatpak and AppImage packages are designed to install and update applications. While Snaps have the same purpose, their usability extends to installing anything. For example, developers are now working on putting the entire Linux printing stack in a single Snap. If you have Arch based system you should consider AUR packages or a Debian based distribution then consider Deb files as well. And still confuse then checkout this video explaining everything you need to know.
CLI Tools
Many applications have a CLI versions which consume less memory and processing power.
These are some useful tools that you can give a try,
cmus: Music player for all kinds of media and inputs.
spotify-tui: Terminal interface for Spotify music streaming written in
RUST
.fd: The fastest tool to find entries in your file-system written in
RUST
.neovim: A Vim based text editor, with large support of plugins and community that can be consider as an alternative to VS Code or any other code editor.
and many more can be found here...
CLI tools are highly recommended for apps running in the background.
Trade-offs:
Using a CLI tools looks boring and difficult to operate so usually people avoid it.
Requires remembering the commands and keyboard shortcuts in order to perform operations.
Hardware
Utilizing your hardware should be the primary in order to harness the maximum output of your system. It varies depending on your machine weather its a PC or a laptop.
Always install your operating system on an SSD rather than an HDD. All modern laptops now comes with SSDs but if you are a PC user consider buying one it will drastically change the performance.
Many monitors supports higher refresh-rates and resolutions, do consider checking out your system settings if they are enabled.
Use proprietary drivers over the open-sourced ones for your GPUs. They are closed soured but have better performance.
Battery
Battery is a crucial part of your hardware and requires the most maintenance. Every battery has a fixed number of cycles after which it needs replacement. Improving your battery-life really helps.
If your laptop device supports the power profile management like Normal, Fast and Conversation mode of charging like in Lenovo series. There won't be a dedicated tool preinstalled but do some research about it might be the case that your device supports and there is a tool for your desktop environment that allows you. It can help to improve your battery life. (For Lenovo people, consider using Plasma Vantage which is KDE alternative of Lenovo Vantage.)
Set up the daemon service of auto-cpufreq, one of the greatest tool I found so far. It dynamically controls the CPU speed for better power optimization. Provide different performance profiles depending on your usage and improves battery-life.
If you owns a machine with both Integrated and Dedicated GPUs with a MUX switch, then you should consider using the Optimums Manager, It allows to run the GPUs in three different modes - Integrated, Dedicated and Hybrid. Running on hybrid mode will let your system to switch between the hardware depending on the task. This really improves the power consumption.
Power state management is a small setting in your operating system that decides when to change the state of the system to either of these - hibernate, lock, log-out or shutdown when you are away from it or close the lid.
Use Dark theme as much as possible.
Trade-offs:
- Many open-source drivers are often unofficial or might have conflicts with other packages on your system hence always read the guides before installing them.
Conclusion
Optimizing your system is one of the many ways to personalize and getting familiar with your system. It really improves your overall experience and workflow. If you have any questions kindly share in the comments I'll try my best to answer them. I might have missed few things any if you have some do share them in the comments as well. If you find this blog useful then consider sharing with your friends and colleagues.
Linux is like a Swiss knife, it can do a lot if you know how. It might break or break you but over all its an experience. Beginners usually gets overwhelmed by the information but if you give some time to it, you can't get over with it.
Thank for taking time to read this blog...