I am assuming that you have an Ubuntu server and it's 18.04 or later that could be from the EC2 instance or any other VPS from DigitalOcean or Azure.
Firstly, Update & upgrade the existing packages with the blew command
sudo apt update
sudo apt upg...