4

I'm connecting to internet with my pc using Ethernet cable, I just have one internet cable input and one RJ45 cable, so I cant share internet with my Raspberry.

is there any solution to install Rapsbian packages from Ubuntu by just accessing Raspbian SD card on Ubuntu and using chroot command, and run apt-get as though I'm on raspberry??

Ghanima
  • 15,855
  • 15
  • 61
  • 119
Lkaf Temravet
  • 1,195
  • 4
  • 15
  • 32
  • do they sell routers, switches and hubs in your country? get one and share the internet connection. – lenik Oct 04 '14 at 12:50
  • 1
    I believe you can tell apt-get to download a specific architecture. Obviously, you'd have to add the Raspbian archives to your system and then run apt-get specifically targeting the RPis arch, but it should be doable. – RPiAwesomeness Oct 04 '14 at 14:17
  • When I first got my Pi I went down this route, downloading individual .deb packages and copying them onto the SD card then booting the Pi then installing them only to find I was missing just one more dependency. usb wifi is very cheap and a better long term solution. – rob Oct 06 '14 at 10:11
  • @rob yes this is the problem, I want to use usb wifi, but before i should install driver, so I would use the sd card on ubuntu to install the driver – Lkaf Temravet Oct 06 '14 at 10:26
  • a number of the usb wifi devices work out of the box. I have a Tenda device id 148f:5370 that just works and another (make) that does not work on the Pi until I have connected via ethernet and run sudo apt-get update; sudo apt-get upgrade. – rob Oct 06 '14 at 12:16

1 Answers1

15

First, install two packages on your Ubuntu system: qemu-user, and proot.

After you mount the Raspbian SD card, you can do the equivalent of a 'chroot' with:

sudo proot -q qemu-arm -S /mnt/path/to/raspbian/

From there, you can use apt-get commands as though you are actually on the Raspberry Pi. (Use the exit command to exit.)

nerd65536
  • 266
  • 2
  • 3
  • I got this error with -S option proot error: unknown option -S. proot error: see proot --help or man proot. i removed -S and apt-get not working ,???? – Lkaf Temravet Oct 21 '14 at 17:42
  • 2
    Bah, proot keeps changing their commandline options. If one of the following forms of the command works for you, let us know. sudo proot -q qemu-arm -B -r /mnt/path/to/raspbian/ or sudo proot -Q qemu-arm -r /mnt/path/to/raspbian/ – nerd65536 Oct 22 '14 at 12:55
  • 1
    sudo proot -q qemu-arm -B -r ./rootfs-mnt did the job for me on Raspbian 2015-05-05 – Isaac May 14 '15 at 15:00