How to update the Azure Linux Agent on a VM

Caution

This article references CentOS, a Linux distribution that is nearing End Of Life (EOL) status. Please consider your use and planning accordingly.

To update your Azure Linux Agent on a Linux VM in Azure, you must already have:

  • A running Linux VM in Azure.
  • A connection to that Linux VM using SSH.

You should always check for a package in the Linux distro repository first. It's possible the package available may not be the latest version, however, enabling autoupdate will ensure the Linux Agent will always get the latest update. Should you have issues installing from the package managers, you should seek support from the distro vendor.

Note

For more information, see Endorsed Linux distributions on Azure

Verify the Minimum version support for virtual machine agents in Azure before proceeding.

  1. Check your current package version
sudo apt list --installed | grep walinuxagent
  1. Update package cache
sudo apt-get -qq update
  1. Install the latest package version
sudo apt-get install walinuxagent
  1. Ensure auto update is enabled.
  • First, check to see if it's enabled:
sudo cat /etc/waagent.conf | grep -i autoupdate
  • Find 'AutoUpdate.Enabled'. If you see this output, it's enabled:
AutoUpdate.Enabled=y
  • To enable it, run:
sudo sed -i 's/# AutoUpdate.Enabled=y/AutoUpdate.Enabled=y/g' /etc/waagent.conf
  1. Restart the waagent service
sudo systemctl restart walinuxagent
  1. Validate waagent service is up and running
sudo systemctl status walinuxagent

Typically this is all you need, but if for some reason you need to install it from https://github.com directly, use the following steps.

Update the Linux Agent when no agent package exists for distribution

For more information regarding updating the Azure Linux Agent when no package exists, see Azure Linux Agent README.