2

I have a Rpi2 and it is not connected to wifi and I cant connect it to Ethernet.

I have a Windows 10 pc and want to install packages offline on my rpi2.

Is this possible?

1

4 Answers 4

1

Is your problem the internet connection, or connecting to the Pi?

Given your host computer is connected to the internet, you can download the packages there, either by searching the debian repos (be sure to download packages for armhf architecture, if available), or by setting up a linux virtual machine.

You can then copy these packages over to the Pi, or put them somewhere on the sd card to install them as Gotschi suggested.

sudo dpkg -i package_name.deb

Protip: Have all of them in a new folder to install in bulk with '*' instead of the package name.

If you can't connect the Pi to your router, you could also use a direct connection via Ethernet. Here's an approach without any additional hardware(keyboard, etc.) This would also enable you to bridge the network connections (especially if your host is using WLAN), to give your Pi internet without linking it to your router.

2
  • 1
    You don't have to use Debian armhf repos this way (although you could...but beware I think those are ARMv7, in which case you'd actually want the armel repos to fit Raspbian); Raspbian's repos are also HTTP based and indexed (although there is no nifty search interface as w/ Debian).
    – goldilocks
    Jun 20, 2016 at 15:17
  • 1
    it only works with $ sudo dpkg -i package_name.deb. Please change :) Jun 27, 2016 at 17:03
2

Well, technically it is possible.

For example use this:

dpkg -i package.deb

But most packages depend on other packages. So you will always have to manually download and install all referenced packages too for it to work.

You get all the referenced packages via

apt-cache rdepends packagename

To download all the packages you will need at once:

aptitude clean
aptitude --download-only install <your_package_here>
cp /var/cache/apt/archives/*.deb <your_directory_here>
0
2

One easy way to install offline if you have another computer with internet connection is to install synaptic: apt-get install synaptic.

  • Search for the package you want and check mark it.
  • A menu will come up. Selection mark for installation.

  • It will find the dependencies you need for the package and ask if you want to install those. Say yes.

  • Then in the Application Menu selection generate package download script. Move the script file it made to a Linux computer with wget on it and run it. It will download all the packages you need.
  • Then move all the packages to /var/cache/apt/archives/partial and run dpkg -i /var/cache/apt/archives/partial/*.deb to install.
2
  • I only have a windows 10 pc, so that wont work :( Jun 21, 2016 at 18:59
  • Well actually it is still a feasible solution...add a ".txt" to the end of the script it generates and open it on your Windows PC with a text editor. Copy all the links and download the files manually. This is obviously not as fast but it works.
    – NULL
    Jun 22, 2016 at 12:57
1

All packages are stored online, there's just no way of doing it offline. Your Pi will need internet access, either directly (WiFi or Ethernet) or indirectly (connect to a laptop with a bridged connection).

3
  • Is it not possible to download the packages on the computer, place them on the SD card and add that location to the APT source list? Jun 20, 2016 at 6:32
  • Yes. I suggest you search our larger sibling site Unix & Linux for, e.g., "mirror apt repository". Another search term here might be deb, the package file extension. Beware the repo is potentially hundreds (thousands?) of GB and keeping it in sync will probably require a fair bit of traffic at whatever interval. You probably want to exclude the source packages. Debian has fairly extensive documentation including a decent wiki.
    – goldilocks
    Jun 20, 2016 at 11:10
  • E.g. From a quick search of that: wiki.debian.org/…
    – goldilocks
    Jun 20, 2016 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.