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 update
2. Install htop
sudo apt install htop
Method 2: Compile from Source
More complex, requires manual dependency handling.
1. Install build tools
sudo apt install build-essential libncurses-dev autotools-dev automake
2. 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.2
3. Configure, Make, Install
./configure
make
sudo make install
Method 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-amd64
2. Make it executable
chmod +x htop-linux-amd64
3. Move to PATH
sudo mv htop-linux-amd64 /usr/local/bin/htop
Troubleshooting Guide
Even with the best methods, you can run into issues. Here are some common problems and their solutions, visible for quick reference.