Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Install Apps on Ubuntu Linux Using the Terminal

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To install an application on Ubuntu Linux using the terminal, you use the apt package manager with the command sudo apt install <package-name>. This downloads and installs the software from Ubuntu's official repositories, handling dependencies automatically. You'll need to know the exact package name, which you can find with apt search. This guide walks you through the entire process, from updating your system to verifying the installation.

What You'll Need

  • A computer running Ubuntu (or a derivative like Linux Mint, though commands may vary slightly).
  • An internet connection.
  • A user account with sudo privileges (administrative rights).
  • Basic familiarity with opening a terminal (press Ctrl+Alt+T to open one).

Step-by-Step

  1. Open the terminal. Press Ctrl+Alt+T on your keyboard, or search for "Terminal" in the applications menu.
  2. Update your package lists. Run sudo apt update. This refreshes the list of available packages from the repositories. Enter your password when prompted (it won't show as you type).
  3. Upgrade existing packages (optional but recommended). Run sudo apt upgrade to install any pending updates. This helps avoid conflicts. If there are no updates, it will simply say so.
  4. Find the exact package name. If you know the name, skip to step 5. Otherwise, search for it. For example, to find a media player, run apt search media player. The output shows package names and short descriptions. Note the exact name (e.g., vlc).
  5. Install the package. Run sudo apt install <package-name>, replacing <package-name> with the actual name. For example, sudo apt install vlc.
  6. Confirm the installation. When prompted, type Y and press Enter. The terminal will download and install the package and its dependencies. This may take a few minutes.
  7. Verify the installation. After it finishes, you can launch the app by typing its command (e.g., vlc) in the terminal, or find it in your applications menu. To confirm it's installed, run apt list --installed | grep <package-name>.

Common Mistakes

  • Forgetting sudo. Without it, you'll get a "Permission denied" error. Always use sudo for installation.
  • Using the wrong package name. For example, firefox is correct, but firefox-browser may not exist. Always search first.
  • Skipping apt update. If you don't update, you might get errors about missing packages or outdated versions.
  • Typing a capital letter. Package names are case-sensitive. Use lowercase unless the search shows otherwise.
  • Mixing package managers. Don't use apt-get and apt interchangeably in the same session; stick to apt for simplicity.

Tips

  • Use tab completion. Type the first few letters of a package name and press Tab to auto-complete it, avoiding typos.
  • Install multiple packages at once. Separate them with spaces: sudo apt install vlc gimp inkscape.
  • Remove a package later. Use sudo apt remove <package-name> to uninstall, or sudo apt purge to also delete configuration files.
  • Check if a package is already installed. Run apt list --installed | grep <package-name>.
  • Use the official repositories first. They are tested and secure. Only use third-party PPAs or .deb files from official sources when necessary.

Troubleshooting

If the installation fails, try these steps in order:

  1. Run sudo apt update again. Sometimes the package list is stale.
  2. Check for broken dependencies. Run sudo apt --fix-broken install. This repairs missing or broken dependencies.
  3. Clear the apt cache. Run sudo apt clean and then sudo apt update.
  4. If you get a "Unable to locate package" error, the package may not be in the default repositories. Search online for the official installation method for that specific app (e.g., a PPA or a .deb download from the vendor's website).
  5. If the app won't launch after installation, try running its command from the terminal to see error messages. For example, type vlc and look for output.

Frequently Asked Questions

How do I know the exact package name?

Use apt search <keyword>. For example, apt search video editor lists all packages related to video editing. The package name is the first word on each line.

Can I install apps from the Ubuntu Software Center using the terminal?

Yes, but the terminal installs the same packages directly. The Software Center is a graphical front-end for apt. You can also use snap for some apps (e.g., sudo snap install spotify), but this guide focuses on apt.

What's the difference between apt and apt-get?

apt is a newer, more user-friendly command that combines the functionality of apt-get and apt-cache. For basic installs, they are interchangeable, but apt is recommended for beginners.

Do I need to be connected to the internet?

Yes, apt downloads packages from online repositories. If you're offline, installation will fail.

How do I uninstall an app?

Use sudo apt remove <package-name>. To also delete configuration files, use sudo apt purge <package-name>.

Is it safe to install apps this way?

Yes, as long as you use packages from Ubuntu's official repositories or from trusted sources. Avoid third-party PPAs unless you know they are reliable.