roadrunner35
Posts: 3
Joined: Sat Aug 10, 2019 1:20 pm

install gawk on raspbian

Sat Aug 10, 2019 1:48 pm

Hi ther I'm a new user to this forumalbeit not new to linux , used to be an unix admin prior to having a stroke I'm trying to install gawk on my Raspberry pi 4B+ (OSis raspbian stretch) and I do the following steps:
-sudo apt-get update
- sudo apt -get upgrade
and finally:
-sudo apt install gawk with the following result:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gawk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'gawk' has no installation candidate



I have managed to find and down load the following"package":
gawk_4.1.4+dfsg-1_armhf.deb
and have tried:
$sudo dpkg -i ./gawk_4.1.4+dfsg-1_armhf.deb with the following result:

regarding ./gawk_4.1.4+dfsg-1_armhf.deb containing gawk, pre-dependency problem:
gawk pre-depends on libsigsegv2 (>= 2.9)
libsigsegv2 is not installed.

dpkg: error processing archive ./gawk_4.1.4+dfsg-1_armhf.deb (--install):
pre-dependency problem - not installing gawk
Errors were encountered while processing:
./gawk_4.1.4+dfsg-1_armhf.deb
and it seems that apt cannot find the libsigsegv2 either, so I am at a complete loss here, all help will be greatly appreciated

jbudd
Posts: 1021
Joined: Mon Dec 16, 2013 10:23 am

Re: install gawk on raspbian

Sat Aug 10, 2019 2:05 pm

My Pi 3B with stretch already has gawk but I tried uninstalling and reinstalling it and libsigsegv2 - no problem.
On my Pi 4B (buster) sudo apt-get install gawk worked too.

Edit - The Pi does come with awk
$ ls -l /etc/alternatives/awk
lrwxrwxrwx 1 root root 13 Jun 20 17:42 /etc/alternatives/awk -> /usr/bin/mawk

Mawk is a cut down version of awk. Do you have scripts that don't work with mawk?

fruitoftheloom
Posts: 20945
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: install gawk on raspbian

Sat Aug 10, 2019 2:15 pm

roadrunner35 wrote:
Sat Aug 10, 2019 1:48 pm
I'm trying to install gawk on my Raspberry pi 4B+ (OSis raspbian stretch)

Confused

There is no 4B+ Raspberry Pi ??

Raspbian Stretch only supports up to 3A+ / 3B+ / CM3+
Retired disgracefully.....

roadrunner35
Posts: 3
Joined: Sat Aug 10, 2019 1:20 pm

Re: install gawk on raspbian

Sat Aug 10, 2019 2:40 pm

Sorry, my bad it is a 3B+ with stretch, but problem still persists with installing gawk
awk,nawk and mawk are installed on my system, but no gawk and I really want the new features of gawk, so std. awk does not work for methe damn stroke does quite often make me being not too accurate like stating 4B+ instead of 3B+problem is that I've just just been reading about the 4B, so that's the first that comes to my fingertips aty the keyboard. Can any one suggest how to make apt be able to locate and install gawk:
pi@raspberrypi:~ $ apt search gawk
Sorting... Done
Full Text Search... Done
mawk/now 1.3.3-17 armhf [installed,local]
a pattern scanning and text processing language

pi@raspberrypi:~ $
----- so apt seems to find awk and not gawk
-I have managed to pull a binary file out of the .deb file (Don't ask me how I did it, can't remember, but invoking it gives the following result:
:~/Downloads/usr/bin $ ./gawk
./gawk: error while loading shared libraries: libsigsegv.so.2: cannot open shared object file: No such file or directory
pi@raspberrypi:~/Downloads/usr/bin $

jbudd
Posts: 1021
Joined: Mon Dec 16, 2013 10:23 am

Re: install gawk on raspbian

Sat Aug 10, 2019 2:58 pm

This is what I get on Stretch:
sudo apt-get install gawk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libsigsegv2
Suggested packages:
gawk-doc
The following NEW packages will be installed:
gawk libsigsegv2
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 536 kB of archives.
After this operation, 2,154 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive-bm.raspbian.org/raspbian stretch/main armhf libsigsegv2 armhf 2.10-5 [28.4 kB]
Get:2 http://archive-bm.raspbian.org/raspbian stretch/main armhf gawk armhf 1:4.1.4+dfsg-1 [508 kB]
You say you ran sudo apt-get update.
Maybe you have something unusual in /etc/apt/sources.list?

klricks
Posts: 6609
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: install gawk on raspbian

Sat Aug 10, 2019 3:09 pm

I had no problem installing gawk on 3B+ Raspbian Buster.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Ernst
Posts: 1252
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: install gawk on raspbian

Sat Aug 10, 2019 3:34 pm

klricks wrote:
Sat Aug 10, 2019 3:09 pm
I had no problem installing gawk on 3B+ Raspbian Buster.
I had no problem installing gawk on 3B Raspbian Stretch.

Code: Select all

pi@raspis:~ $ gawk
-bash: gawk: command not found
pi@raspis:~ $ sudo apt install gawk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  gawk-doc
The following NEW packages will be installed:
  gawk
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 508 kB of archives.
After this operation, 2,104 kB of additional disk space will be used.
Get:1 http://debian.bio.lmu.de/raspbian/raspbian stretch/main armhf gawk armhf 1:4.1.4+dfsg-1 [508 kB]
Fetched 508 kB in 0s (594 kB/s)
Selecting previously unselected package gawk.
(Reading database ... 36694 files and directories currently installed.)
Preparing to unpack .../gawk_1%3a4.1.4+dfsg-1_armhf.deb ...
Unpacking gawk (1:4.1.4+dfsg-1) ...
Setting up gawk (1:4.1.4+dfsg-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
pi@raspis:~ $

The road to insanity is paved with static ip addresses

User avatar
scruss
Posts: 2583
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: install gawk on raspbian

Sat Aug 10, 2019 4:22 pm

Code: Select all

sudo apt update
sudo apt install libsigsegv2
sudo dpkg -i ./gawk_4.1.4+dfsg-1_armhf.deb
should fix it unless something else is not right with your system.

I went back to a very old system running Jessie, and the installation process worked.


jbudd wrote:
Sat Aug 10, 2019 2:05 pm
Mawk is a cut down version of awk. Do you have scripts that don't work with mawk?
mawk's a full implementation and quite fast, too. gawk handles UTF-8 better: by no means well, but better than other awk interpreters.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

roadrunner35
Posts: 3
Joined: Sat Aug 10, 2019 1:20 pm

Re: install gawk on raspbian

Sat Aug 10, 2019 4:54 pm

SOLVED: yup there was a problem with /etc/apt/sources.list I have at some point tried to install vscode and I think that have messed things upI had another SD card with an old Stretch installation, so I just copied the Sources.list from that
so now gawk invokes as expected Thankyou for the Hint , I would never have figured this out without your help:
pi@raspberrypi:/etc/apt $ gawk -W v
GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.5, GNU MP 6.1.2)
Copyright (C) 1989, 1991-2016 Free Software Foundation.

Return to “Beginners”