Operating Systems
On an Ubuntu desktop with working internet access, sudo apt install htop returns "E: Unable to locate package htop". Which command should the technician run before retrying?
Show the answer
Correct answerD. sudo apt update
AWhy not this: It installs newer versions of installed packages and does not repair a stale package index.
BWhy not this: It removes an installed package, but htop is not installed, so it does not help.
CWhy not this: dnf makecache builds metadata for dnf on RPM-based systems, not for apt on Ubuntu.
DWhy this is right: It refreshes the local package index from the repositories, so apt can locate the package by name.
apt update refreshes the local package index from the configured repositories, so apt can find the package. apt upgrade installs newer versions of installed packages but does not refresh the list of available packages.