0

I'm very new in Rpi community and sure enough had to spent the last 24 hours to figure out how to ssh connect from my MacBook to my Pi3 via an ethernet cable. I'm following the steps in the second method in here for this: http://smirshekari.wikidot.com/rpi

Now when I want to update and install packages required for what I'm planning to do in terminal window in usual Ubuntu format (which I expected to work just fine, but they don't!):

sudo apt-get install gphoto2
sudo apt-get update

I get errors like the one below which I believe it is all because of issues in internet connection. I've tried my best to find a solution for it and tested a few suggested methods that I found online, no success yet. Any comment and/or suggestion on that will be appreciated.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  vim-runtime
Suggested packages:
  ctags vim-doc vim-scripts
The following NEW packages will be installed:
  vim vim-runtime
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,198 kB of archives.
After this operation, 30.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://mirrordirector.raspbian.org/raspbian stretch/main armhf vim-runtime all 2:8.0.0197-4+deb9u1
  Temporary failure resolving 'mirrordirector.raspbian.org'
Err:2 http://mirrordirector.raspbian.org/raspbian stretch/main armhf vim armhf 2:8.0.0197-4+deb9u1
  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/v/vim/vim-runtime_8.0.0197-4+deb9u1_all.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/v/vim/vim_8.0.0197-4+deb9u1_armhf.deb  Temporary failure resolving 'mirrordirector.raspbian.org'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Chetan Bhargava
  • 1,252
  • 3
  • 15
  • 29
Rotail
  • 111
  • 5

3 Answers3

1

Thanks for the replies above with which I could resolve the issue. This error was because my Pi3 was not connected to the internet.

To connect Pi3 to internet, I had to:

sudo raspi-config

and from the main menu there, I could insert the name of my wifi along with its password. It is pretty straightforward and self descriptive in that menu.

Rotail
  • 111
  • 5
0

From the article you linked to, it appears your mac is connected to your rpi for ssh, but I don't think you've connected your rpi to the internet yet.

Based on the above assumption, I think you first need to connect your rpi to a local network that has internet access via the ethernet cable. Before you do this however, you can enable SSH in an easier way following these instructions:

  1. Put the SD card in your laptop (via an SD Reader)
  2. Open the SD Card in your Mac Finder
  3. In the top-level directory of the SD Card, add a file with the specific file name ssh and no extension after it.
  4. Safely remove the SD Card from your Mac and put it in the Rpi again (steps courtesy https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0)

Now, when you boot your rpi it will have SSH enabled. You just need to use your router to find its IP address and you can then SSH directly into it over your local network.

With your RPi on the local network, and your local network having internet, the sudo apt-get update command will successfully download the package lists from the mirror sites.

J Mac
  • 133
  • 5
0

The link is underwhelming. The Pi will have a Link-local address by default, and there is no point in trying to set another manually.

You can easily connect from OS X with ssh pi@hostname.local (the default hostname is raspberrypi) without knowing the IP Address. See How to set up networking/WiFi for more detail.

You have not said HOW you are trying to connect to the internet - it CANNOT be done through the Mac without interfering with ssh.

Milliways
  • 62,573
  • 32
  • 113
  • 225