2

I have a Windows machine with internet and an Ubuntu 16.04 machine without an internet connection, and I need build-essentials to compile some of my code. I've read about it online, but I'm having trouble finding a documented way of doing this. What are my options for installing build-essentials offline?

karel
  • 114,770
ryan
  • 21

1 Answers1

3

In your Ubuntu machine run:

apt-get install build-essential  --print-uris -y | grep -Po "http.*?deb"

it gives you a list of links to deb package (build-essential and its dependecies).

Download them using Windows and finally move them into:

/var/cache/apt/archive

then again run:

sudo apt install build-essential

to install it.

Ravexina
  • 55,668
  • 25
  • 164
  • 183
  • From your first command, I get the follow " E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)." – ryan Jun 19 '17 at 19:11
  • so you've got some dependencies issue, check this out: https://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies-after-adding-a-ppa it might be helpful to you. – Ravexina Jun 19 '17 at 19:13
  • I've looked at this article, but not getting anywhere.. Any suggestions? I've ran sudo apt-get clean and sudo apt-get -f install. Sometimes I get 'Ubuntu-Server 16.04.2 LTS Xenial Xerus - Release amd64 (20170215.8)' in the drive '/media/cdrom/' and press [Enter], but I'm on a VM – ryan Jun 19 '17 at 19:52
  • Ok, fixed the above issue. Now your initial command just yields: E: Unable to locate package build-essential – ryan Jun 19 '17 at 19:55
  • If you have the installation CD/USB key they are likely on it, so just add the CD/key to your software sources. You don't tell which VM application you are using but if it's VirtualBox you should be able to tell Windows to share the CD or key with the VM. – xenoid Jun 19 '17 at 20:16
  • If you have internet access on another machine you can try to download it from here https://packages.ubuntu.com/ .. anyway it has a lot of dependencies and you would have to get them one by one in the worst case – derHugo Jun 19 '17 at 20:46