Tuesday, August 16, 2016

How to install new and updated packages WITHOUT AN INTERNET CONNECTION

Yesterday I received my System76 Meerkat via UPS, and I was super stoked to receive it since they only ship computers running Ubuntu, and I'm a total Linux (OK, OK GNU/Linux... you happy?) enthusiast. They are also a domestic computer company (a rare sight these days) that sells great products with awesome, personal customer service.

Even if I needed a Windows machine, I would still buy it from System76 just to support them. I'm sick and tired of people on forums bitching about how they are "too expensive."

  • First of all, they are not. They use only top notch components and have excellent build quality.
  • They have active and engaged staff who treat customers well, which indicates that System76 treat their employees well.
  • Those two things cost money, plain and simple.
  • Remember the devices you get with NO support, shoddy design and components are "cost effective" because their employees are treated horribly in most cases. Remember the FOXCONN controversy, all you Apple fans?
  • Factoring in all of the above, quality and service, System76 puts out some pretty good bargains!
But I digress.

I got the computer hooked up, and I installed my absolute favorite distro, elementary OS. I booted it up for the first time, and the machine wouldn't find the Intel Wireless AC wifi card that the machine shipped with.

A few chats later and some great help from both System76 and the elementary devs (from my laptop -- also running elementary, btw), I found out that the processor and/or motherboard that shipped with the machine was too new (See what I'm saying -- quality...) and wasn't supported by the underlying 14.04 base that elementary OS is based on. They gave me the terminal commands to run to enable the new hardware stack piecemeal while still running the 14.04 base, and I was off and running ... or so I thought!

I switched over to the Meerkat and thought, "How in the hell can I run these terminal commands here without an internet connection?" Hardwiring direct to the router would involve taking the machine, keyboard and mouse down to the basement, finding a spot, setting it all up, etc. etc. There had to be a better way, right? Isn't there a way to package them into a file and extract and install them offline?

The short answer is YES! While it's not quite as easy as downloading a zip or deb file, it isn't too hard. After all, I was able to do it. Here's how it works:

1. Install Synaptic Package Manager on both the online and offline machines. There may be other Package Managers that can do this, but Synaptic is what I used.



2. Open Synaptic and search for the packages you need for the OFFLINE machine. For this example, we'll download and install Abiword:


3. Left click on the checkbox next to the package or program you need on the OFFLINE machine and click on "Mark for Installation."


4. Synaptic will then go out to find all of the needed dependencies needed by Abiword and prompt you to also mark these packages for installation. Go ahead and click Mark.  


5. You can now see that Synpatic has marked all these packages for installation, but INSTEAD OF CLICKING "APPLY," go to File >> Generate Package download script.


6. Save this script as Abiword.sh on the removable drive you'll use to install this on the offline machine.


7. You'll then need to pop over to the Terminal to run this script to actually download the files that we will install on the offline machine. Once there cd to the directory on your removable storage where you saved abiword.sh.


8. We'll now need to make abiword.sh run as a program by running the following command:
sudo chmod +x abiword.sh

9. Now we'll run the executable bash script that will go out and download all the packages and save them on the removable drive! We're on the home stretch!


The script will then run...


11. Now make sure the files are saved on the removable drive, eject it and go to the offline machine:


12. ON THE OFFLINE MACHINE with the removable drive plugged in and mounted, open Synaptic, click File >> Add Downloaded Packages.


13. Then browse to the directory on your removable drive where abiword.sh and all the extracted packages are. Click Open.


14. Synaptic will then organize all the downloaded packages and offer to add them to the install queue in the correct order! Click Apply.


Synaptic will then perform the install...



15. You will now find the application installed and functional on the offline machine!!




Hope this is helpful to you all. Any other suggestions or feedback or questions are always welcome.



2 comments:

  1. What if you already have installed the package and/or dependencies?

    ReplyDelete
  2. I assume that, if the package or dependency is already installed on the offline machine (that's what you mean, right?), Synaptic will skip installing it again because "The newest version is already installed." Thanks!

    ReplyDelete