Installing bc package/ floating point arithmetic in BASH

260 views
Skip to first unread message

Audrey

unread,
Mar 4, 2016, 5:22:29 PM3/4/16
to BeagleBoard
So I want to do floating point arithmetic in BASH, but I have trouble installing the bc package (https://www.gnu.org/software/bc/). 

I type in:
apt-get install bc

and it tells me:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package bc

So. Any idea on how to either do floating point arithmetic in BASH some other way, or how to install bc on beaglebone black?

Alternatively, is it possible to pass in a value from bash to like a java script or something?

Robert Nelson

unread,
Mar 4, 2016, 5:33:56 PM3/4/16
to Beagle Board, ao...@smith.edu
On Fri, Mar 4, 2016 at 4:22 PM, Audrey <ao...@smith.edu> wrote:
> So I want to do floating point arithmetic in BASH, but I have trouble
> installing the bc package (https://www.gnu.org/software/bc/).
>
> I type in:
> apt-get install bc
>
> and it tells me:
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> E: Unable to locate package bc
>
> So. Any idea on how to either do floating point arithmetic in BASH some
> other way, or how to install bc on beaglebone black?

apt-get update
apt-get install bc

Regards,

--
Robert Nelson
https://rcn-ee.com/

Audrey

unread,
Mar 4, 2016, 9:16:04 PM3/4/16
to BeagleBoard, ao...@smith.edu
Hi I tried that but it still didn't work. apt-get update had problems:

root@beaglebone:~# apt-get update
Err http://repos.rcn-ee.net wheezy Release.gpg
  Could not resolve 'repos.rcn-ee.net'
Err http://security.debian.org wheezy/updates Release.gpg
  Could not resolve 'security.debian.org'
Err http://ftp.us.debian.org wheezy Release.gpg
  Could not resolve 'ftp.us.debian.org'
Err http://ftp.us.debian.org wheezy-updates Release.gpg
  Could not resolve 'ftp.us.debian.org'
Reading package lists... Done




W: Some index files failed to download. They have been ignored, or old ones used instead.

William Hermans

unread,
Mar 4, 2016, 9:55:58 PM3/4/16
to beagl...@googlegroups.com
You should probably check to make sure you're actually connected to the internet . . . chances are really good based on your output that you're not..

--
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.

Audrey

unread,
Mar 6, 2016, 1:36:03 AM3/6/16
to BeagleBoard
You were right. Thanks! It works now.
Reply all
Reply to author
Forward
0 new messages