Linux

Chapter 6: Installing and Managing Software in WSL Ubuntu Using APT

Chapter 6: Installing and Managing Software in WSL Ubuntu Using APT

One of the biggest strengths of Linux is the vast number of free and open-source tools available — and in Ubuntu, installing software is incredibly easy using the APT package manager.

In this chapter, you’ll learn how to install, update, upgrade, and remove software packages in WSL Ubuntu using apt. This is one of the most practical and essential skills for any Linux user.

📦 What is APT?

APT stands for Advanced Package Tool. It is used to manage software packages from Ubuntu’s official repositories.

APT commands connect to Ubuntu’s online software servers, download packages, resolve dependencies, and keep your system updated.

🛠️ Updating the Package List

Before installing anything, always refresh the list of available packages:

sudo apt update

This command does not install or upgrade any packages — it simply fetches the latest list of available software.

⬆️ Upgrading Installed Packages

sudo apt upgrade

This will upgrade all upgradable packages on your system.

To upgrade both packages and kernel-level components (less relevant in WSL), you can use:

sudo apt full-upgrade

📥 Installing Software

📌 Install a Single Package

sudo apt install package-name

Example:

sudo apt install git
sudo apt install curl
sudo apt install neofetch

📌 Install Multiple Packages

sudo apt install git curl htop

APT will ask for confirmation before proceeding with installation.

🔍 Searching for Packages

Use apt search or apt-cache search to find packages:

apt search editor
apt-cache search python

🧾 Viewing Package Information

apt show package-name

Example:

apt show git

🧹 Removing Packages

📌 Remove Package Only

sudo apt remove package-name

📌 Remove Package and Config Files

sudo apt purge package-name

📌 Remove Unused Dependencies

sudo apt autoremove

⚠️ Troubleshooting Common Issues

  • E: Unable to locate package → Run sudo apt update first.
  • Permission denied → You forgot to use sudo.
  • Package has unmet dependencies → Try sudo apt --fix-broken install

🧪 Practice Exercise

# Update system
sudo apt update
sudo apt upgrade

# Install useful tools
sudo apt install curl git htop

# View info
apt show htop

# Remove one
sudo apt remove htop

# Cleanup
sudo apt autoremove

✅ Summary

  • sudo apt update – Refresh package list
  • sudo apt upgrade – Upgrade installed packages
  • sudo apt install – Install new software
  • sudo apt remove – Uninstall software
  • sudo apt autoremove – Clean up unused dependencies

▶️ Coming Up Next

Chapter 7 – Shell Scripting Basics in WSL Ubuntu
Learn how to write simple shell scripts to automate tasks in Linux using Bash.

Leave a Reply

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