How to install python-dev (for python 2.7) on ubuntu 18.04?

sudo sed -i s,//us.archive,//archive,g  /etc/apt/sources.list

or use

software-properties-gtk 

enter image description here

and choose download from main server.

after that

sudo apt update && sudo apt install python-dev

Both ways change the apt sources to main server.