Tuesday, September 03, 2013

ubuntu / debian - installing packages offline (Raspberry Pi)

I now have a Raspberry Pi deployed in a commercial situation in a building with no internet connection. This means I have to take software there on removable media. I have a second Pi at home with the same software on it, so I can figure out dependencies.

First run a command on my local, internet connected Pi to get the links to the .deb packages for the package I want - in my case xscreensaver.

sudo apt-get --print-uris --yes install xscreensaver | grep ^\' | cut -d\' -f2 >downloads.list


Now on my local machine I need to download them
wget --input-file downloads.list


At this stage I have all the packages required to install my xscreensaver package in the current directory. I then put them onto a memory stick (or whatever) and transfer them onto the Pi with no network. Once on the Pi the files must be moved into the correct directory so apt-get can see them, and will not try to download them
sudo mv *.deb /var/cache/apt/archives/


All that remains is to install the packages (it will look like its going to download stuff, just answer 'Y' and it will install
sudo apt-get install xscreensaver


And voila - the package and all its dependencies are installed! Simple.




Reference : http://www.tuxradar.com/answers/517

No comments: