This topic describes how to upgrade the software packages in the Linux operating system of an Elastic Compute Service (ECS) instance to resolve the issue that services cannot be used or cannot run as expected on the instance due to known bugs in Linux system software.
Scenario
Specific services cannot be used or cannot run as expected on a Linux ECS instance due to known bugs in Linux system software. If the Linux operating system of the ECS instance is not of the latest version, you can upgrade the software packages in the operating system to resolve the issue.
The following issues may occur due to known bugs in Linux system software:
Issues that can be resolved by upgrading software packages in the instance operating system
A port conflict occurs when you start a service or a process on a CentOS or RHEL 7 instance
Problem description
When you start a service or a process on an ECS instance that runs a specific version of CentOS or RHEL 7, an error message appears indicating a port conflict, and the process cannot be started or the service becomes unavailable. You run the netstat
command to query port usage and find that the port used by the service or process is already being used by dhclient, as shown in the following figure. dhclient is short for Internet Systems Consortium (ISC) Dynamic Host Configuration Protocol (DHCP) client.
Cause
In normal cases, dhclient listens for DHCP version 4 (DHCPv4) packets on port 67 or 68 and DHCP version 6 (DHCPv6) packets on port 546 or 547. ECS instances that run specific versions of CentOS or RHEL 7 come with a dhclient version earlier than 4.2.5-60. The versions of dhclient that are earlier than 4.2.5-60 contain bugs and may listen on ports other than ports 67, 68, 546, and 547. If other services or processes on the ECS instances also use the preceding ports, port conflicts may occur and the other services or processes may fail to be started or may become unavailable.
Solution
Upgrade the dhclient
package on the CentOS or RHEL 7 instance to the latest version. For more information, see the Upgrade specific software packages to the latest versions or Upgrade all software packages to the latest versions section of this topic.
Slow SSH connection to a CentOS or RHEL 7 instance that is running for an extended period of time
Problem description
If a CentOS or RHEL 7 instance is running for an extended period of time, an SSH connection to the instance may become slow. You run a command to query the CPU utilization of system processes and find that the systemd-logind
process runs at 100% CPU utilization. Messages that are similar to the following messages appear in the system logs of the CentOS or RHEL 7 instance:
# journalctl -u dbus
Mar 30 17:23:19 localhost dbus[21]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesk...
Mar 30 17:23:42 localhost dbus[21]: [system] Failed to activate service 'org.freedesktop.login1': timed out...
Cause
The preceding issue occurs due to known bugs in the systemd-logind
and D-Bus components. You can resolve the issue by upgrading the preceding components.
Solution
Upgrade the dbus
package to the latest version on the CentOS or RHEL 7 instance. For more information, see the Upgrade specific software packages to the latest versions or Upgrade all software packages to the latest versions section of this topic.
We recommend that you upgrade the D-Bus component to the latest version on all Linux operating systems.
openSUSE and SUSE Linux Enterprise Server: The D-Bus package is named
dbus-1
.Other Linux distributions: The D-Bus package is named
dbus
.
Upgrade software packages in the operating system of a Linux ECS instance
If the issue that services cannot be used or cannot run as expected on a Linux ECS instance occurs due to known bugs in Linux system software, upgrade the operating system components to resolve the issue. For more information, see the Upgrade specific software packages to the latest versions or Upgrade all software packages to the latest versions section of this topic. In the following examples, the dhclient
package is used. The procedures for upgrading other software packages are similar to the procedure for upgrading the dhclient package.
Upgrade specific software packages to the latest versions
Connect to the Linux ECS instance. For more information, see Connection method overview.
Upgrade a specific software package to the latest version.
The commands that you can use to upgrade a software package vary based on the operating system.
Command that you can use on Alibaba Cloud Linux 2.1903, AnolisOS 7, CentOS 7 or earlier, and RHEL 7 or earlier:
sudo yum update <Software package name>
For example, to upgrade the
dhclient
package to the latest version, run the following command:sudo yum update dhclient
Command that you can use on AlmaLinux, AnolisOS 8 or later, CentOS 8 or later, CentOS Stream 8 or later, Fedora 33 or later, RHEL 8 or later, and Rocky Linux:
sudo dnf update <Software package name>
For example, to upgrade the
dhclient
package to the latest version, run the following command:sudo dnf update dhclient
Commands that you can use on Debian and Ubuntu:
# Update the software repository information that is stored on your on-premises device to obtain the latest information about software packages. sudo apt update # Upgrade a specific software package to the latest version. sudo apt upgrade <Software package name>
For example, to upgrade the
dhclient
package to the latest version, run the following commands:sudo apt update sudo apt upgrade dhclient
Commands that you can use on openSUSE and SUSE Linux Enterprise Server:
# Update the software repository information that is stored on your on-premises device to obtain the latest information about software packages. sudo zypper refresh # Upgrade a specific software package to the latest version. sudo zypper update <Software package name>
For example, to upgrade the
dhclient
package to the latest version, run the following commands:sudo zypper refresh sudo zypper update dhclient
The following command output indicates that the dhclient package is upgraded.
Upgrade all software packages to the latest versions
Connect to the Linux ECS instance. For more information, see Connection method overview.
Upgrade all software packages to the latest versions. The commands that you can use to upgrade all software packages vary based on the operating system.
Command that you can use on Alibaba Cloud Linux 2.1903, AnolisOS 7, CentOS 7 or earlier, and RHEL 7 or earlier:
sudo yum update
Command that you can use on AlmaLinux, AnolisOS 8 or later, CentOS 8 or later, CentOS Stream 8 or later, Fedora 33 or later, RHEL 8 or later, and Rocky Linux:
sudo dnf update
Commands that you can use on Debian and Ubuntu:
# Update the software repository information that is stored on your on-premises device to obtain the latest information about software packages. sudo apt update # Upgrade all installed software packages to the latest versions. sudo apt upgrade
Commands that you can use on openSUSE and SUSE Linux Enterprise Server:
# Update the software repository information that is stored on your on-premises device to obtain the latest information about software packages. sudo zypper refresh # Upgrade all installed software packages to the latest versions. sudo zypper update