Prompted an index error that caused xxx to not be found, took some time to solve this problem.
First, delete the cache:
sudo rm -vrf /var/lib/apt/lists/*
Usually, this will solve the problem. If it doesn't solve it.
Delete the cache again, then modify the DNS:
sudo vim /etc/resolv.conf
nameserver 8.8.8.8
At this point, the update should work without any issues.