running ntpdate to get time

762 views
Skip to first unread message

rjc2827

unread,
Jan 2, 2015, 8:56:11 PM1/2/15
to beagl...@googlegroups.com
I'm new, so there's some early step that I've overlooked, but I can't set the time, and I don't know why.  I'm running the Ver C BBB with Debian pre-installed.  I have flashed the newest OS version, and have found PuTTY to get me access to the SSH shell.  I've even got a single LED to light up with some sample code that I've found.  I now want to apt-get update and install, but I've been told to get my date set up first so that the update/install goes smoothly, but ...

Both of:
root@beaglebone:~# ntpdate pool.ntp.org 
root@beaglebone:~# sudo ntpdate pool.ntp.org

get me a response of:
Error resolving pool.ntp.org: Name or service not known (-2)
15 May 07:34:42 ntpdate[5292]: Can't find host pool.ntp.org: Name or service not known (-2)
15 May 07:34:42 ntpdate[5292]: no servers can be used, exiting

While we're at it, when should sudo be used or avoided ... I'm really not clear on this.

Thanks
rjc

David Lambert

unread,
Jan 2, 2015, 9:23:39 PM1/2/15
to beagl...@googlegroups.com
It seems like your name resolver (DNS) may not be set up correctly. Try something like "ping google.com". If that doesn't work, then look at /etc/resolv.conf which should contain the IP addresses of your nameservers.
BTW sudo is only necessary to run a command that needs root privileges from a non-root account. In your case it appears that you are running as root (the "#" prompt).

HTH,

Dave.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Charles Steinkuehler

unread,
Jan 2, 2015, 9:36:59 PM1/2/15
to beagl...@googlegroups.com
On 1/2/2015 7:56 PM, rjc2827 wrote:
> I'm new, so there's some early step that I've overlooked, but I can't set
> the time, and I don't know why. I'm running the Ver C BBB with Debian
> pre-installed. I have flashed the newest OS version, and have found PuTTY
> to get me access to the SSH shell. I've even got a single LED to light up
> with some sample code that I've found. I now want to apt-get update and
> install, but I've been told to get my date set up first so that the
> update/install goes smoothly, but ...
>
> Both of:
> root@beaglebone:~# ntpdate pool.ntp.org
> root@beaglebone:~# sudo ntpdate pool.ntp.org
>
> get me a response of:
> Error resolving pool.ntp.org: Name or service not known (-2)
> 15 May 07:34:42 ntpdate[5292]: Can't find host pool.ntp.org: Name or
> service not known (-2)
> 15 May 07:34:42 ntpdate[5292]: no servers can be used, exiting

Reading between the lines, I suspect you're connected via USB, so you
won't have networking on the 'Bone unless you configure your host system
to forward traffic for the 'Bone to the internet or (easier) hook up an
Ethernet cable to the BBB.

--
Charles Steinkuehler
cha...@steinkuehler.net

rjc2827

unread,
Jan 2, 2015, 11:46:19 PM1/2/15
to beagl...@googlegroups.com
Thank you gentlemen!

Pinging google.com did not get an answer.  Adding the ethernet cable worked for the Google ping once I halted and rebooted the BBB.  The ntpdate pool.ntp.org then worked just as it should.  A little digging should get me a parameter of some sort to add, to tell the ntp system that I'm offset by -8 hours from GMT (or CUT as I hear it more often now).

A nice bonus too is now knowing what that sudo stuff is all about.  I'm not new to computing (mainly business management systems), but BBB, Debian, editors, shells, Python all at once is quite a nice challenge.  I've had quite a few small victories on my own with this, but I don't doubt that I'll be back with my hand raised again.

Thanks again
Bob

Jane leona

unread,
Jul 13, 2015, 3:17:55 AM7/13/15
to beagl...@googlegroups.com
Hey, rjc
Now I'm having the same problem as you did. Like:
root@beaglebone:~# ntpdate pool.ntp.org
Error resolving pool.ntp.org: Name or service not known (-2)
24 Apr 04:50:13 ntpdate[1143]: Can't find host pool.ntp.org: Name or service not known (-2)
24 Apr 04:50:13 ntpdate[1143]: no servers can be used, exiting
Can you tell me how exactly you figure your problem before? That will help me a lot.
Thanks, 
Jane

在 2015年1月3日星期六 UTC+8下午12:46:19,rjc2827写道:

evilwulfie

unread,
Jul 13, 2015, 10:06:01 AM7/13/15
to beagl...@googlegroups.com
lemme guess you are connected to your bone with USB and you dont have internet connection sharing enabled ?
--
Reply all
Reply to author
Forward
0 new messages