---
updatedAt: 2025-08-14T13:34:26.000Z
agentTools:
  siteIndex: https://developer.n-able.com/llms.txt
  projectIndex: https://developer.n-able.com/n-central/llms.txt
---

# Update Ubuntu Linux

```powershell Automation Policy
<?xml version="1.0" encoding="utf-8" standalone="yes"?><Policy ID="bc8bf05a-23bb-41f3-86eb-ff3d4e2d71d6" Name="Update Ubuntu Linux" Description="dXBkYXRlIGFsbCB1YnVudHUgcGFja2FnZXM=" Version="2.10.0.19" RemoteCategory="2" ExecutionType="Local" MinimumPSVersionRequired="0.0.0">
  <Object ID="{8f0ec6a7-1c4c-4b0d-a08a-d2059393a47e}" Type="{B6FA6D8B-EEAA-47A6-8463-7F9A4F5BBB6E}" Data="&lt;xml&gt;&lt;Parameters&gt;&lt;Parameter ParameterName=&quot;inuser&quot; Label=&quot;Username&quot; ParameterType=&quot;string&quot; Value=&quot;marcadmin&quot; /&gt;&lt;Parameter ParameterName=&quot;inpwd&quot; Label=&quot;Password&quot; ParameterType=&quot;password&quot; Value=&quot;&quot; /&gt;&lt;Parameter ParameterName=&quot;inip&quot; Label=&quot;ip address&quot; ParameterType=&quot;string&quot; Value=&quot;52.170.129.9&quot; /&gt;&lt;/Parameters&gt;&lt;/xml&gt;" />
  <LinkManager xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PolicyExecutor">
    <hashset xmlns:d2p1="http://schemas.datacontract.org/2004/07/System" />
  </LinkManager>
  <Diagnostics OriginalVersion="2.18.3.1" />
  <Activity mc:Ignorable="sads sap" x:Class="Policy Builder" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="clr-namespace:PolicyExecutor;assembly=PolicyExecutionEngine" xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <x:Members>
      <x:Property Name="PolicyGUID" Type="InArgument(x:String)" />
    </x:Members>
    <sap:VirtualizedContainerService.HintSize>522,855</sap:VirtualizedContainerService.HintSize>
    <mva:VisualBasic.Settings>Assembly references and imported namespaces serialized as XML namespaces</mva:VisualBasic.Settings>
    <p:PolicySequence DisplayName="Policy Builder" sap:VirtualizedContainerService.HintSize="522,855" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
      <p:PolicySequence.Activities>
        <p:OpenSession Password_Item="{x:Null}" Password_ItemProp="{x:Null}" PortNumber_Item="{x:Null}" PortNumber_ItemProp="{x:Null}" SSHServer_Item="{x:Null}" SSHServer_ItemProp="{x:Null}" UserName_Item="{x:Null}" UserName_ItemProp="{x:Null}" AssemblyName="PolicyExecutionEngine, Version=2.18.3.1, Culture=neutral, PublicKeyToken=null" Cipher="[OpenSession_Cipher]" ClientVersion="[OpenSession_ClientVersion]" Connected="[OpenSession_Connected]" DisplayName="Open Session" ExpectPattern="[OpenSession_ExpectPattern]" sap:VirtualizedContainerService.HintSize="486,196" Host="[OpenSession_Host]" HostKey="[OpenSession_HostKey]" HostNameArrow="[OpenSession_HostNameArrow]" IO="[OpenSession_IO]" Mac="[OpenSession_Mac]" Moniker="478cf757-2906-4e98-9f28-f52ebab24d06" Password="[inpwd]" Password_DisplayArg="Input Parameters.Password" Port="[OpenSession_Port]" PortNumber="22" PortNumber_DisplayArg="22" Pwd="[OpenSession_Pwd]" RemoveTerminalEmulationCharacters="[OpenSession_RemoveTerminalEmulationCharacters]" Result="[OpenSession_Result]" ResultString="[OpenSession_ResultString]" RunAsCurrentLoggedOnUser="False" SSHOutput="[OpenSession_SSHOutput]" SSHServer="[inip]" SSHServer_DisplayArg="Input Parameters.ip address" ScriptExecutionMethod="None" ServerVersion="[OpenSession_ServerVersion]" SessionId="[OpenSession_SessionId]" ShellConnected="[OpenSession_ShellConnected]" ShellOpened="[OpenSession_ShellOpened]" TypeName="OpenSession" UserName="[inuser]" UserName_DisplayArg="Input Parameters.Username" Username="[OpenSession_Username]" m_bTextLinkChange="False" />
        <p:EnableCisco EnableCommandNameOverride_Item="{x:Null}" EnableCommandNameOverride_ItemProp="{x:Null}" EnablePassword_Item="{x:Null}" EnablePassword_ItemProp="{x:Null}" SessionId_Item="{x:Null}" SessionId_ItemProp="{x:Null}" AssemblyName="PolicyExecutionEngine, Version=2.18.3.1, Culture=neutral, PublicKeyToken=null" DisplayName="Enable (Cisco)" EnableCommandNameOverride="sudo su -" EnableCommandNameOverride_DisplayArg="sudo su -" EnablePassword="[inpwd]" EnablePassword_DisplayArg="Input Parameters.Password" sap:VirtualizedContainerService.HintSize="486,160" HostNameHash="[EnableCisco_HostNameHash]" Moniker="0202ffd8-26d9-426b-8a4d-1034b1f9d73a" Result="[EnableCisco_Result]" ResultString="[EnableCisco_ResultString]" RunAsCurrentLoggedOnUser="False" SSHOutput="[EnableCisco_SSHOutput]" ScriptExecutionMethod="None" SessionId="[OpenSession_SessionId]" SessionId_DisplayArg="Open Session.SSH Session Id" TypeName="EnableCisco" m_bTextLinkChange="False" />
        <p:SendCommandsandReceiveResponse SSHCommand_Item="{x:Null}" SSHCommand_ItemProp="{x:Null}" SSHOutputExpect="{x:Null}" SSHOutputExpect_DisplayArg="{x:Null}" SSHOutputExpect_Item="{x:Null}" SSHOutputExpect_ItemProp="{x:Null}" SessionId_Item="{x:Null}" SessionId_ItemProp="{x:Null}" Timeout_Item="{x:Null}" Timeout_ItemProp="{x:Null}" AssemblyName="PolicyExecutionEngine, Version=2.18.3.1, Culture=neutral, PublicKeyToken=null" DisplayName="Send Commands and Receive Response" sap:VirtualizedContainerService.HintSize="486,196" Moniker="f17cf9fd-9659-418d-b08c-f06dd9b0527a" Result="[SendCommandsandReceiveResponse_Result]" ResultString="[SendCommandsandReceiveResponse_ResultString]" RunAsCurrentLoggedOnUser="False" SSHCommand="apt update &amp;&amp; apt upgrade -y" SSHCommand_DisplayArg="apt update &amp;&amp; apt upgrade -y" SSHOutput="[SendCommandsandReceiveResponse_SSHOutput]" ScriptExecutionMethod="None" SessionId="[OpenSession_SessionId]" SessionId_DisplayArg="Open Session.SSH Session Id" Timeout="600" Timeout_DisplayArg="600" TypeName="SendCommandsandReceiveResponse" m_bTextLinkChange="False" />
      </p:PolicySequence.Activities>
      <p:PolicySequence.Variables>
        <Variable x:TypeArguments="x:String" Name="OpenSession_HostNameArrow" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_Host" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_ShellOpened" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_ShellConnected" />
        <Variable x:TypeArguments="x:Boolean" Name="OpenSession_RemoveTerminalEmulationCharacters" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_Connected" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_SSHOutput" />
        <Variable x:TypeArguments="x:Double" Name="OpenSession_Port" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_Username" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_IO" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_ExpectPattern" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_Cipher" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_Mac" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_ServerVersion" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_ClientVersion" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_Pwd" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_HostKey" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_SessionId" />
        <Variable x:TypeArguments="x:String" Name="OpenSession_ResultString" />
        <Variable x:TypeArguments="x:Double" Name="OpenSession_Result" />
        <Variable x:TypeArguments="x:String" Name="EnableCisco_SSHOutput" />
        <Variable x:TypeArguments="x:String" Name="EnableCisco_HostNameHash" />
        <Variable x:TypeArguments="x:String" Name="EnableCisco_ResultString" />
        <Variable x:TypeArguments="x:Double" Name="EnableCisco_Result" />
        <Variable x:TypeArguments="x:String" Name="SendCommandsandReceiveResponse_SSHOutput" />
        <Variable x:TypeArguments="x:String" Name="SendCommandsandReceiveResponse_ResultString" />
        <Variable x:TypeArguments="x:Double" Name="SendCommandsandReceiveResponse_Result" />
        <Variable x:TypeArguments="x:String" Default="marcadmin" Name="inuser" />
        <Variable x:TypeArguments="p:Password" Name="inpwd">
          <Variable.Default>
            <Literal x:TypeArguments="p:Password">
              <p:Password PasswordValue="Jn6NaNSK3vhaWb1KmyyXuA==" />
            </Literal>
          </Variable.Default>
        </Variable>
        <Variable x:TypeArguments="x:String" Default="52.170.129.9" Name="inip" />
      </p:PolicySequence.Variables>
    </p:PolicySequence>
  </Activity>
</Policy>
```

```json Response Example
{"success":true}
```

# SCRIPT