- Learn Linux
- Learn Electronics
- Raspberry Pi
- LPI certification
- News & Reviews
This is a guide for performing offline installs on a Raspberry Pi, or other debian based Linux computers where you don't have an Internet connection.
Imagine you have a Raspberry Pi that you want to use for controlling some NeoPixels and for whatever reason you don't have an Internet connection. This could be because you are running this at a Raspberry Jam, or that your SD Card has been corrupted and you don't happen to have an Internet connection. This guide will work through the steps you need to follow to complete the instructions in NeoPixel worksheet without having an Internet connection on the Raspberry Pi.
You will still need another computer that does have Internet access (or to have prepared the files in advance) and some way of transferring the files (eg. a USB flash drive).
If you have first need to install Debian software then you can first query the files required on the Raspberry Pi offline computer and then download those on a different computer. The files can then be transferred to the offline computer by USB flash drive an installed using dpkg.
To identify the required files first run the following command on the offline computer:
apt-get install scons swig --print-uris | tee offline.txt
This will not install the files, but will log the details into a file called offline.txt. An example output is shown below:
Reading package lists... Building dependency tree... Reading state information... The following extra packages will be installed: swig2.0 Suggested packages: swig-doc swig-examples swig2.0-examples swig2.0-doc The following NEW packages will be installed: scons swig swig2.0 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 1,874 kB of archives. After this operation, 6,547 kB of additional disk space will be used. Do you want to continue? [Y/n] 'http://mirrordirector.raspbian.org/raspbian/pool/main/s/scons/scons_2.3.1-2_all.deb' scons_2.3.1-2_all.deb 518336 MD5Sum:c0955330e5fc8675cacd4fa8f985172c 'http://mirrordirector.raspbian.org/raspbian/pool/main/s/swig2.0/swig2.0_2.0.12-1_armhf.deb' swig2.0_2.0.12-1_armhf.deb 1070816 MD5Sum:5031c2378631356c03a2f96f1c83fdb5 'http://mirrordirector.raspbian.org/raspbian/pool/main/s/swig2.0/swig_2.0.12-1_armhf.deb' swig_2.0.12-1_armhf.deb 285096 MD5Sum:56571ae6501620ce6001c3f4f34e1415
As you can see all the required files (including a required dependency) are listed at the bottom of the file.
You can download these on another computer using wget followed by the name of the file (or download directly within a browser).
wget http://mirrordirector.raspbian.org/raspbian/pool/main/s/scons/scons_2.3.1-2_all.deb wget http://mirrordirector.raspbian.org/raspbian/pool/main/s/swig2.0/swig2.0_2.0.12-1_armhf.deb wget http://mirrordirector.raspbian.org/raspbian/pool/main/s/swig2.0/swig_2.0.12-1_armhf.deb
Now copy the files to the offline computer (eg. using a USB flash drive) and then run:
sudo dpkg -i *.deb
(in some circumstances you may need to install these in a specific order, however as long as all the files are in the same directory it usually works as a single install.
The next stage in the NeoPixel install is to download some files from github. The instructions in the Raspberry Pi NeoPixel install guide, assume this will be done online, but this can be done using another computer and easily transferred to the offline computer.
To download files from github then you can use either wget on the master.zip file or use the "get ZIP" option from a web broser. The unzip command can then be used to extract the files.
For example instead of using git clone download the files using:
Or download using a web browser from:
You may need to rename these once downloading (especially the wget file which will create files called master.zip).
Transfer these to the Raspberry Pi and extract the files by entering unzip followed by the name of the .zip file.
When downloading the master files from github then it adds "-master" to the end of the directory. You may need to rename the to remove -master eg.
mv rpi_ws281x-master rpi_ws281
mv neopixel-gui-master neopixel-gui
One of the steps in the install of the NeoPixel ws281x library involves downloading and install the Python setuptools from the Internet.
The best way to identify what it is expecting is to run the normal installer and look for any errors where it attempts to get files from the Internet.
In this case the rpi_ws281x library install (eg. sudo python3 setup.py install) attempts to use the python easyinstall which first needs the setuptools. The error message shows this as
Download this using wget and copy that to the offline computer and install using pip3.
sudo pip3 install setuptools-5.7.zip
Now retry the install
sudo python3 setup.py install
and hopefully it should now work. If not then look for any other errors where it attempts to download something and perform that manually offline.
See the guides and blog posts relating to the Raspberry Pi. Also see the Linux Tutorials for more information on using Linux.