Mastering Linux: Key Actions to Take After Installation


Introduction
Hello,
I recently explored various Linux commands while preparing for a Sys Admin role. Initially, I spent over 10 hours mastering these commands, but with the right guidance, I could have learned them in just a few hours. This blog aims to provide practical guidance on when and where to use these commands, without lengthy lectures. You can read and implement them on your system. If you're already familiar with them but need a quick recap, this guide is for you. Before starting, I recommend understanding the basic functioning of the operating system to grasp advanced topics like process management, memory management, and more.
Let's get right into it.
🛠️ Step 1: System Update and Upgrade
The first thing you should do after installing your OS is to update the software to the latest version.
Updating and upgrading your system right after installation is crucial because it ensures that you have the latest security patches and software improvements. This helps protect your system from vulnerabilities and enhances its performance and stability. Additionally, updates often include bug fixes and new features that can improve your overall user experience. By starting with an up-to-date system, you set a solid foundation for a secure and efficient computing environment.
Here's a handy CLI command to help you do just that.
$ apt update && apt upgrade -y
Note: Run as an administrator or add sudo
to execute with administrator privileges.
apt update refreshes the local package index — a database of all available packages from the enabled repositories.
apt upgrade installs the latest available versions of all packages currently installed on the system.
You can check which packages are ready for upgrade using:
$ apt list --upgradable
This command displays a list of installed packages with available updates from the repositories.
For more thorough upgrades (including handling dependency changes), there's:
$ apt full-upgrade
This upgrades all packages and intelligently handles dependencies, even if it means removing or replacing some packages.
🧰 APT (Advanced Packaging Tool)
APT (Advanced Package Tool) is a powerful command-line utility used for managing software packages on Debian-based Linux distributions, such as Ubuntu. It simplifies the process of installing, updating, and removing software packages by providing a high-level interface for the APT package management system.
dpkg is a low-level tool used in Debian-based systems to install, remove, and manage .deb packages directly. Think of it like a delivery service that brings a package to your door. When you use dpkg, you're manually handling each package, similar to unpacking and setting up a delivery yourself. In contrast, APT is like an online shopping service that not only delivers but also helps you find and choose items, and then uses dpkg to handle the actual delivery and setup.
APT maintains a local index (or database) of packages from repositories. This is what I meant earlier when I mentioned the local package index. APT keeps a cached copy of all available packages from online repositories right on your system. This way, it doesn’t have to check the internet every time you search or install — making things much faster and more efficient. Here's a quick comparison between APT's online packages and its local indexing system:
Aspect | 🛒 APT Online Packages | 📋 Local Indexing (APT Cache) |
What it is | Actual .deb package files stored on internet-based repositories | A local list (index) of available packages and versions |
Where it comes from | Downloaded from remote servers like archive.ubuntu.com | Generated by running apt update |
Used by | apt install , apt full-upgrade , etc. | apt search , apt list --upgradable , etc. |
Requires Internet? | ✅ Yes, to download the actual packages | ❌ No, once the index is updated |
Storage Location | /var/cache/apt/archives/ | /var/lib/apt/lists/ |
When it’s used | When installing or upgrading packages | When checking for available or upgradable packages |
How to update | No need to update manually—APT fetches when needed | Use sudo apt update to refresh the index |
Installing Software on Linux
If you’re not sure of the exact package name or just want to explore what’s available, you can use:
$ apt list <package-name-or-keyword>
While apt list
only matches package names, if you want to find a package based on its description because you don't know the exact name, you should use apt search
. This command allows you to look through the package descriptions to find what you're looking for, making it easier to discover packages that match your needs even if you're unsure of their exact names.
$ apt search <package-name-or-keyword>
It’s like browsing through a google play store—helpful for discovering related tools or new utilities you might find useful.
- To see details about any specific package—like version, dependencies, and description—you can use:
$ apt show <package-name>
Once you've searched for and explored a package using apt search
and apt show
, you're ready to install it. Think of it just like tapping “Install” on an app in the Google Play Store.
In Linux, you'd use:
$ sudo apt install <package-name>
Just like the Play Store downloads and installs the app to your phone, apt install
fetches the .deb
package from the online repository and installs it on your system, handling any necessary dependencies automatically.
✅ You don’t need to go hunting for setup files — APT handles everything for you behind the scenes!
To view all the installed packages on your system, similar to checking the "Installed Apps" section in your Play Store, run:
$ apt list --installed
Uninstalling Software on Linux
After installation, the package is ready to use, just like any newly installed app on your phone.
Just like you can uninstall an app from your phone when you no longer need it, Linux lets you remove packages too.
To uninstall a package without deleting its configuration files, use:
$ sudo apt remove <package-name>
This removes the program but leaves behind its config files (in case you want to reinstall it later without losing your settings).
If you want to completely wipe out the package, including its configuration files, use:
$ sudo apt purge <package-name>
This is like doing a “clean uninstall” — as if the app was never there.
And don’t forget: after removing packages, you can free up even more space by cleaning up unused dependencies:
$ sudo apt autoremove
I discovered that Ubuntu caches all downloaded .deb files in /var/cache/apt/archives/
. To clear this local cache and free up disk space, use:
$sudo apt clean
It removes everything in the cache directory except for log files.
📝 Note:apt
can only uninstall applications that were installed using the package manager*.
It* cannot remove software that was compiled and installed from source (e.g., using ./configure && make && make install
).
For such software, you’ll need to manually delete the binaries or use make uninstall
if available.
This is how we manage packages and software on Linux. Stay tuned for the next article on basic file management commands. You'll get the hang of it all once you practice them!
Subscribe to my newsletter
Read articles from Mohan Chandra Anukula directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
