apt update, synchronize the list of packages and their versions that are available from ubuntu servers.
apt upgrade, downloads and upgrade packages to the newest versions available.
upgrade is used to install the newest versions of all packages
currently installed on the system from the sources enumerated in
/etc/apt/sources.list. Packages currently installed with new
versions available are retrieved and upgraded; under no
circumstances are currently installed packages removed, or packages
not already installed retrieved and installed. New versions of
currently installed packages that cannot be upgraded without
changing the install status of another package will be left at
their current version. An update must be performed first so that
apt-get knows that new versions of packages are available.
apt dist-upgrade
dist-upgrade in addition to performing the function of upgrade,
also intelligently handles changing dependencies with new versions
of packages; apt-get has a "smart" conflict resolution system, and
it will attempt to upgrade the most important packages at the
expense of less important ones if necessary. So, dist-upgrade
command may remove some packages. The /etc/apt/sources.list file
contains a list of locations from which to retrieve desired package
files. See also apt_preferences(5) for a mechanism for overriding
the general settings for individual packages.
Vicuna
# 1. Identify the Package
Name
# apt search <keyword or partial package name>
apt search firefox
# Before installing or upgrading any package, it is recommended to update the package list
sudo apt update
# Once you know the package name, use the following command to upgrade it to the latest available version:
# sudo apt install --only-upgrade <package_name>
sudo apt install --only-upgrade firefox
# * **`sudo`**: This command executes the following command
with root privileges, as package management operations require elevated
permissions.
# * **`apt install`**: This is the core command for installing
and upgrading packages.
# * **`--only-upgrade`**: This flag tells `apt` to only
upgrade the specified package, without installing any other dependencies or
packages. This ensures a focused update.
# * **`<package_name>`**: Replace this with the actual
name of the package you want to update.
# After the upgrade, you can check the installed version of the package using the following command:
apt show <package_name>
Vikuna 2
sudo apt update
sudo apt upgrade example-package
# Alternatively, if you just want to install the latest version of a package without checking for updates on all other installed packages, you can use the `install` command instead of `upgrade`. This will reinstall the package with the latest version. Here's how you can do it:
sudo apt install example-package
The sudo apt update command is a Linux/Debian system administration command that updates the list of available packages and their versions stored in the system’s package index.
man apt
NAME
apt - command-line interface
SYNOPSIS
apt [-h] [-o=config_string] [-c=config_file] [-t=target_release] [-a=architecture] {list | search | show |
update | install pkg [{=pkg_version_number | /target_release}]... | remove pkg... | upgrade |
full-upgrade | edit-sources | {-v | --version} | {-h | --help}}
Lets take a close look since we used apt update
- apt update
- apt upgrade
- apt full-upgrade
- apt install, reinstall, remove, purge
Options (man apt-get)
- –no-install-recomends
- -d, –download-only
- -f, –fix-broken
- -s –simulate
- -y, –yes, –assume-yes
- –assume-no
- -v, verbose-version
–y takes all
lets run it
sudo apt upgrade
Without the yes, it prompts for all upgrades
Like this
Example
Zabbix minor update easy (apache2 also?) – e-lo:Engineer log out. (follow-e-lo.com)
Here you can see that apt update, upgrade takes care of minor releases of a installed software.