Unable to upgrade Home Assistant to 2021.10.x

I got the same error when I was trying to update to 2022.11.1. Thought I’d share how I fixed it just in case someone else is looking for a solution.

Change to the virtual environment:

sudo -u homeassistant -H -s

Install rust:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Update HA:

/home/homeassistant/homeassistant-update.sh