Here are some commonly used apt-get options:
-
update: Updates the package index files from their sources.
sudo apt-get update -
upgrade: Upgrades all the installed packages to their latest versions.
sudo apt-get upgrade -
dist-upgrade: Upgrades packages and handles changing dependencies with new versions of packages.
sudo apt-get dist-upgrade -
remove: Removes a specified package but leaves its configuration files.
sudo apt-get remove package_name -
purge: Removes a specified package along with its configuration files.
sudo apt-get purge package_name -
autoremove: Removes packages that were automatically installed to satisfy dependencies for other packages and are no longer needed.
sudo apt-get autoremove -
install: Installs a specified package.
sudo apt-get install package_name -
search: Searches for a package in the package index.
apt-cache search package_name -
show: Displays detailed information about a specified package.
apt-cache show package_name -
clean: Clears out the local repository of retrieved package files.
sudo apt-get clean
These options can be combined with other flags to customize the behavior of the apt-get command further.
