Run as root.
cd
into the netbox
installation directory
cd /opt/netbox
Find the latest stable release
git ls-remote --tags https://github.com/netbox-community/netbox.git \
| grep -o 'refs/tags/v[0-9]*\.[0-9]*\.[0-9]*$' \
| tail -n 1 \
| sed 's|refs/tags/||'
Checkout the version to upgrade to
git checkout v4.2.2
Run the upgrade script
./upgrade.sh
Restart Netbox after the upgrade script completes
systemctl restart netbox netbox-rq