Software packages on Linux distributions are constantly updated to add new features, fix bugs, and provide security updates. You can update software to the latest versions based on your business requirements. This topic describes how to update a piece of software or all software on different Linux distributions. In this topic, the CentOS, Debian, Ubuntu, and OpenSUSE distributions are used.
Prerequisites
Software repositories that contain software package updates are added. For more information, see Add a software repository.
Procedure
Update software on CentOS
Connect to a CentOS instance.
For more information, see Connect to a Linux instance by using a password or key.
Update software on the instance.
Update a piece of software. For example, run the following command to update Apache:
yum update httpd
NoteIf you want to update other software, replace
httpd
in the preceding command with the name of the software that you want to update.Update all software on the instance.
ImportantThe following command may update the system kernel, which causes issues, such as system startup failures or incompatibility between the kernel and software. We recommend that you configure the system kernel not to be updated and then run the command.
yum update
Check the version of software.
<Software name> -V #Replace <Software name> with an actual software name.
If the specified software is updated, the latest version number is displayed in the command output.
Update software on Ubuntu or Debian
Connect to an Ubuntu or Debian instance.
For more information, see Connect to a Linux instance by using a password or key.
Obtain the list of software package updates.
apt-get update
Update software on the instance.
Update a piece of software. For example, run the following command to update Python:
apt-get install python
NoteIf you want to update other software, replace
python
in the preceding command with the name of the software that you want to update.Update all software on the instance.
ImportantThe following command may update the system kernel, which causes issues, such as system startup failures or incompatibility between the kernel and software. We recommend that you configure the system kernel not to be updated and then run the command.
apt-get upgrade
Check the version of software.
<Software name> -V #Replace <Software name> with an actual software name.
If the specified software is updated, the latest version number is displayed in the command output.
Update software on openSUSE
Connect to an openSUSE instance.
For more information, see Connect to a Linux instance by using a password or key.
Obtain the list of software package updates.
zypper list-updates
Update software on the instance.
Update a piece of software. For example, run the following command to update Python:
zypper update Python
NoteIf you want to update other software, replace
python
in the preceding command with the name of the software that you want to update.Update all software on the instance.
ImportantThe following command may update the system kernel, which causes issues, such as system startup failures or incompatibility between the kernel and software. We recommend that you configure the system kernel not to be updated and then run the command.
zypper update
Check the version of software.
<Software name> -V #Replace <Software name> with an actual software name.
If the specified software is updated, the latest version number is displayed in the command output.