Here’s an easy three step procedure to update your ESXi to the latest build using the CLI.
Step1- SSH into your ESXi host and modify the firewall:
esxcli network firewall ruleset set -e true -r httpClient
Step2- List latest available packages:
esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep -i ESXi-6.5
Step3- Select latest, install and reboot:
esxcli software profile update -p ESXi-6.5.0-4564106-standard -d http://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
Note I had to run Step3 twice on some hosts.