添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
讲道义的硬盘  ·  C++ 将 ...·  10 月前    · 
耍酷的炒饭  ·  Flutter-Focus树 - 简书·  1 年前    · 

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge

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 is 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.

    For more information, see Endorsed Linux distributions on Azure

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

    Ubuntu Red Hat / CentOS Debian Oracle Linux
  • To enable it, run:
  • sudo sed -i 's/# AutoUpdate.Enabled=y/AutoUpdate.Enabled=y/g' /etc/waagent.conf
    
  • Restart the waagent service
  • sudo systemctl restart walinuxagent
    
  • Validate waagent service is up and running
  • sudo systemctl status walinuxagent
    
  • To enable it, run:
  • sudo sed -i 's/\# AutoUpdate.Enabled=y/AutoUpdate.Enabled=y/g' /etc/waagent.conf
    
  • Restart the waagent service
  • sudo systemctl restart waagent
    
  • Validate waagent service is up and running
  • sudo systemctl status waagent
    
  • Check available updates. The above output will show you if the package is up to date.

  • Install the latest package version

    sudo zypper install python-azure-agent
    
  • 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=n/AutoUpdate.Enabled=y/g' /etc/waagent.conf
    
  • Restart the waagent service
  • sudo systemctl restart waagent
    
  • Validate waagent service is up and running
  • sudo systemctl status waagent
    
  • To enable it, run:
  • sudo sed -i 's/AutoUpdate.Enabled=n/AutoUpdate.Enabled=y/g' /etc/waagent.conf
    
  • Restart the waagent service:
  • sudo systemctl restart walinuxagent.service
    
  • Validate waagent service is up and running
  • sudo systemctl status walinuxagent
    
  • For Oracle Linux, make sure that the Addons repository is enabled.

  • To validate if the repository is enabled, use the following command
  • sudo yum repolist all | grep -i addons
    
  • In case the Addons repository is disabled, you can enable it using the following command:

  • Oracle Linux 6.x:
  • sudo yum-config-manager --enable ol6_addons
    
  • Oracle Linux 7.x:
  • sudo yum-config-manager --enable ol7_addons
    
  • Oracle Linux 8.x:
  • sudo yum-config-manager --enable ol8_addons
    
  • Oracle Linux 9.x:
  • sudo yum-config-manager --enable ol9_addons
    
  • If you don't find the add-on repository, you can simply add these lines at the end of your .repo file according to your Oracle Linux release:

  • For Oracle Linux 6 virtual machines:
  • [ol6_addons]
    name=Add-Ons for Oracle Linux $releasever ($basearch)
    baseurl=https://public-yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64
    gpgkey=https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
    gpgcheck=1
    enabled=1
    
  • For Oracle Linux 7 virtual machines:
  • [ol7_addons]
    name=Oracle Linux $releasever Add ons ($basearch)
    baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/addons/$basearch/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpgcheck=1
    enabled=1
    
  • For Oracle Linux 8 virtual machines:
  • [ol8_addons]
    name=Oracle Linux $releasever Add ons ($basearch)
    baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL8/addons/$basearch/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpgcheck=1
    enabled=1
    
  • For Oracle Linux 9 virtual machines:
  • [ol9_addons]
    name=Oracle Linux 9 Addons ($basearch)
    baseurl=https://public-yum.oracle.com/repo/OracleLinux/OL9/addons/$basearch/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpgcheck=1
    enabled=1
    

    Important

    Keep in consideration Oracle Linux 6.x is already EOL. Oracle Linux version 6.10 has available ELS support, which will end on 07/2024.

  • Then install the latest version of the Azure Linux Agent using the following command:
  • sudo yum install WALinuxAgent -y
    
  • Enable agent auto update.
  • 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
    
  • Restart the waagent service:
  • sudo systemctl restart waagent
    
  • Validate waagent service is up and running
  • sudo systemctl status waagent
    
  • In case of issues, execute the following commands and validate the waagent status one more time:
  • sudo systemctl daemon-reload
    sudo systemctl restart waagent
    sudo systemctl status waagent
    

    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

    Install wget, there are some distros that don't install it by default, such as Red Hat, CentOS, and Oracle Linux versions 6.4 and 6.5.

    1. Download the latest version

    Open the release of Azure Linux Agent in GitHub in a web page, and find out the latest version number. (You can locate your current version by typing waagent --version.)

    For version 2.2.x or later, type:

    wget https://github.com/Azure/WALinuxAgent/archive/refs/tags/v2.2.x.zip 
    unzip v2.2.x.zip
    cd WALinuxAgent-2.2.x
    

    The following line uses version 2.2.14 as an example:

    wget https://github.com/Azure/WALinuxAgent/archive/refs/tags/v2.2.14.zip
    unzip v2.2.14.zip  
    cd WALinuxAgent-2.2.14
    

    2. Install the Azure Linux Agent

  • For version 2.2.x, use: You may need to install the package setuptools first--see setuptools. Then run:
  • sudo python setup.py install
    
  • 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 entry, it's enabled:
  • AutoUpdate.Enabled=y
    
  • To enable it, run:
  • sudo sed -i 's/# AutoUpdate.Enabled=n/AutoUpdate.Enabled=y/g' /etc/waagent.conf
    

    3. Restart the waagent service

    For most of Linux distros:

    sudo service waagent restart
    

    For Ubuntu and Debian, use:

    sudo service walinuxagent restart
    

    4. Confirm the Azure Linux Agent version

    sudo waagent -version
    

    You'll see that the Azure Linux Agent version has been updated to the new version.

    For more information regarding the Azure Linux Agent, see Azure Linux Agent README.

  •