Install build-essential
build-essential
sudo apt install build-essential
sudo apt update && sudo apt build-dep emacs
Download emacs (tarball) and open the directory
./autogen.sh
./configure
sudo make install