First things

Update the operating system

Install every pending system update from the terminal, including security fixes.

  1. See which updates are waiting
    Terminal
    softwareupdate --list
  2. Install them allNeeds sudo
    Terminal
    sudo softwareupdate --install --all --restart

    Your Mac restarts by itself if an update needs it. Save your work first.

Check it worked

  1. Check your macOS version
    Terminal
    sw_vers
  1. Download the list of updates and install themNeeds sudo
    Terminal · Ubuntu / Debian
    sudo apt update && sudo apt full-upgrade -y
  2. Remove packages nothing needs any moreNeeds sudo
    Terminal · Ubuntu / Debian
    sudo apt autoremove -y
  3. Restart if an update asks for itNeeds sudo
    Terminal · Ubuntu / Debian
    [ -f /var/run/reboot-required ] && sudo reboot

    Nothing happens if no restart is needed.

Check it worked

  1. Check your Ubuntu version
    Terminal · Ubuntu / Debian
    cat /etc/os-release
  1. Add the Windows Update module to PowerShell
    PowerShell
    Install-Module PSWindowsUpdate -Scope CurrentUser -Force

    If it asks to install the NuGet provider, type Y.

  2. Install every updateRun as administrator
    PowerShell
    Get-WindowsUpdate -Install -AcceptAll -AutoReboot

    Your PC restarts by itself if an update needs it. Save your work first.

Check it worked

  1. Check your Windows version
    PowerShell
    Get-ComputerInfo -Property OsName, OsVersion, OsBuildNumber