You can download the required files from another system which is connected to Internet. For that you have to create a download script from the server.
apt-get --allow-unauthenticated -y install --print-uris build-essential | cut -d\' -f2 | grep http:// > download-list
This will create a new file named download-list in which the required files for download is included.
Now copy this file download-list
to the system where you have Internet facility.
Run the following command to download all files.
wget -c -i ./download-list
Now copy all the downloaded .deb files to the /var/cache/apt/
folder of your server. You will need root permission for this.
After this you can install build-essential
simply as we do regularly.
sudo apt-get install build-essential
apt-cdrom
is what you are looking for it still seems to need an internet connection help.ubuntu.com/community/AptCdrom