Three Ways to Install Software
In Linux, there are three primary methods for installing software. Using a package manager is almost always the best choice, but understanding all three is key to being a versatile system administrator. Select a method to learn more.
Live Example: Installing `htop`
Let’s see a practical comparison. Hereβs how you would install `htop`, a popular interactive process viewer, using each of the three methods on a Debian/Ubuntu system. Notice the difference in complexity and number of steps.
Method 1: Package Manager
Clean, simple, and recommended.
1. Update package lists
sudo apt update2. Install htop
sudo apt install htopMethod 2: Compile from Source
More complex, requires manual dependency handling.
1. Install build tools
sudo apt install build-essential libncurses-dev autotools-dev automake2. Download & Extract
wget https://github.com/htop-dev/htop/releases/download/3.2.2/htop-3.2.2.tar.xz
tar -xf htop-3.2.2.tar.xz
cd htop-3.2.23. Configure, Make, Install
./configure
make
sudo make installMethod 3: Manual Placement
Quick for single binaries, but less common.
1. Download pre-compiled binary
# (Assuming a pre-compiled binary exists)
wget https://example.com/htop-linux-amd642. Make it executable
chmod +x htop-linux-amd643. Move to PATH
sudo mv htop-linux-amd64 /usr/local/bin/htopTroubleshooting Guide
Even with the best methods, you can run into issues. Here are some common problems and their solutions, visible for quick reference.
