Skip to content

Linux & shell: Install packages

7 Linux & shell commands: Install packages. Click a command to see what each part does.

Index
7 items
Click a command to see what each part does.

Install packages7

  • sudo apt update && sudo apt upgrade -yRefresh package lists and upgrade (Debian/Ubuntu)

    What each part does

    1. apt updatedownload the latest package lists (installs nothing)
    2. &&only if that worked
    3. apt upgradeinstall newer versions of installed packages
    4. -yanswer yes to the prompt
  • sudo apt install -y <package>Install a package

    What each part does

    1. apt installinstall a package and its dependencies
    2. -yno confirmation prompt
  • sudo apt remove <package>Remove a packageCaution

    What each part does

    1. apt removeuninstall (keeps config files; apt purge removes those too)
  • apt search <word>Find a package

    What each part does

    1. apt searchsearch package names and descriptions
  • apt list --installed | grep <package>Is it installed?

    What each part does

    1. apt list --installedevery installed package
    2. | grep <package>filter to the one you want
  • sudo dnf install -y <package>Install on RHEL / Fedora / Amazon Linux

    What each part does

    1. dnf installinstall with the dnf package manager (yum on older systems)
    2. -yno prompt
  • apk add --no-cache <package>Install on Alpine (common in containers)

    What each part does

    1. apk addAlpine's package manager
    2. --no-cachedon't keep the package index: smaller images

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…