Tar error 127

User avatar

ksu

Posts: 62
Joined: 2014-01-13 14:59

deb9 — strange tar behavior

#1

Post

by ksu » 2019-01-04 20:54

Hello,

I am using tar with mbuffer to prevent buffer underruns when dumping data to a LTO tape drive on a remote system. The included in Stretch tar version is 1.29 — it fails for some reason ( data sender side ):

Code: Select all

.
tar cv --preserve-permissions --numeric-owner -f >(mbuffer -s $MBUFBLK -m 8G -O 10.0.0.113:8000) $2 $3
.

/bin/sh: 1: p�~��V: not found
tar: /dev/fd/63: Wrote only 4096 of 10240 bytes
tar: Child returned status 127
tar: Error is not recoverable: exiting now

initially i thought it is mbuffer version, recompiled the older version that I have tested fine on two old Gentoo boxes, but it looks like it is ‘tar’
the old systems run tar 1.27.1 on the sender side and 1.26 on the receiver.

I compiled 1.27.1 on Stretch — it runs with mbuffer as expected…

the problem is the new tar, v1.29, on the sender side… looks like it is not that POSIX…

any suggestions? should i maybe go directly to GNU.org with this?

Thanks Folks!!

Mike

«They did not know it was impossible so they did it” — Mark Twain



User avatar

ksu

Posts: 62
Joined: 2014-01-13 14:59

Re: deb9 — strange tar behavior

#3

Post

by ksu » 2019-01-04 22:06

Thanks for your reply, but I run all from:
bash-4.4#
directly..
and specify
#!/bin/bash
in the script…

Mike

edit: i understand, this could be the interpreter/ bash issue, but in this case, the old version of tar should err out as well…

Last edited by ksu on 2019-01-04 22:10, edited 1 time in total.

«They did not know it was impossible so they did it” — Mark Twain


User avatar

bw123

Posts: 3940
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 10 times

Re: deb9 — strange tar behavior

#4

Post

by bw123 » 2019-01-04 22:07

ksu wrote:Thanks for your reply, but I run all from:
bash-4.4#
directly..
and specify
#!/bin/bash
in the script…

Mike

then why does error say

«/bin/sh: 1: p�~��V: not found» ?

Something wrong with line 1 in the script? Do you run the same script on another gnu/linux? Do you mind showing it to the forum?

resigned by AI ChatGPT


User avatar

ksu

Posts: 62
Joined: 2014-01-13 14:59

Re: deb9 — strange tar behavior

#5

Post

by ksu » 2019-01-04 22:15

That is a good question, in the beginning i have scp the original again from the gentoo box, and even did hexdump on it initially :) … not line 1 issue in the script… it is actually line 32 — line 1 is shebang…

and this is the old script: ( sender side )

Code: Select all

#!/bin/bash

# use older version of tar: 1.27.1 or 1.6 as on gentoo3/4

ssh gentoo4 '~/bin/backup.mbuffer.receive.sh &>/tmp/backup.mbuffer.progress.out' &


NAME="$1"
#export TAR_OPTIONS="--use-compress-program=lbzip2"
export TAR_OPTIONS="--use-compress-program=pigz"
LOG="/root/log/$NAME.`date +%F`.log"
LOGERR="$LOG.errors"
MBUFBLK=256k

if [ ! $1 ] || [ ! $2 ]; then
   echo " Usage: $0 [set_name] [src].[.].."
   exit 1
fi

echo "backup_name: $LOG"
echo "source: $2 $3 $4 $5 $6 $7 $8 $9"
echo "Calculating total MB for this job:"
du -ksmc $2 $3 $4 $5 $6 $7 $8 $9
echo
echo "position the tape if needed..."
echo "starting to mbuffer... in 5 sec."
sleep 5
echo "start: `date`"
date > $LOG
echo $* >> $LOG

~/bin/tar cv --preserve-permissions --numeric-owner -f >(mbuffer -s $MBUFBLK -m 8G -O 10.0.0.113:8000) $2 $3 $4 $5 $6 $7 $8 $9 1>> $LOG 2> $LOGERR

echo "finish: `date`"
echo "set name: $1" >> $LOG
echo "backup path: $2 $3 $4 $5 $6 $7 $8 $9" >> $LOG
echo "mbuffer blk size used: $MBUFBLK" >> $LOG
echo "Calculating total MB for this job:"
du -ksmc $2 $3 $4 $5 $6 $7 $8 $9
echo "Calculating total MB for this job:" >> $LOG
du -ksmc $2 $3 $4 $5 $6 $7 $8 $9 >> $LOG
echo "finish: `date`" >> $LOG

export TAR_OPTIONS=""

on the receiver i disable tape h/w compression, etc… and dump it to a non-rewind…

«They did not know it was impossible so they did it” — Mark Twain


User avatar

bw123

Posts: 3940
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 10 times

Re: deb9 — strange tar behavior

#6

Post

by bw123 » 2019-01-04 22:23

I did not read it all, but does anything inyour script run any subshells with dash instead of bash? Is this what your intend to do? Does the other gnu/linux where the script works use dash also? Is this really a deb9- strange tar behavior issue, or something with default shell?

resigned by AI ChatGPT




User avatar

ksu

Posts: 62
Joined: 2014-01-13 14:59

Re: deb9 — strange tar behavior

#9

Post

by ksu » 2019-01-04 22:38

bw123 wrote:I did not read it all, but does anything inyour script run any subshells with dash instead of bash? Is this what your intend to do? Does the other gnu/linux where the script works use dash also? Is this really a deb9- strange tar behavior issue, or something with default shell?

sh is now bash…. the error is «similar»:

Code: Select all

bash-4.4# cat ~/log/test.2019-01-04.log.errors 
/bin/sh: $'p27236316320311U': command not found
tar: /dev/fd/63: Wrote only 4096 of 10240 bytes
tar: Child returned status 127
tar: Error is not recoverable: exiting now
bash-4.4# 

«They did not know it was impossible so they did it” — Mark Twain


User avatar

ksu

Posts: 62
Joined: 2014-01-13 14:59

Re: deb9 — strange tar behavior

#10

Post

by ksu » 2019-01-04 22:43

nah…. i need mbuffer on receiver, and sender first — that’s the whole purpose — and mbuffer opens it’s own socket to for data transmit..

Last edited by ksu on 2019-01-04 22:47, edited 2 times in total.

«They did not know it was impossible so they did it” — Mark Twain


User avatar

ksu

Posts: 62
Joined: 2014-01-13 14:59

Re: deb9 — strange tar behavior

#11

Post

by ksu » 2019-01-04 22:45

bw123 wrote:did a hexdump on it? wow.. sounds cool. I like to read while doing hexdump.

for sure that’s a less «efficient» way :) but I like to «see it» :)

«They did not know it was impossible so they did it” — Mark Twain


User avatar

ksu

Posts: 62
Joined: 2014-01-13 14:59

Re: deb9 — strange tar behavior

#12

Post

by ksu » 2019-01-04 22:48

ksu wrote:

bw123 wrote:I did not read it all, but does anything inyour script run any subshells with dash instead of bash? Is this what your intend to do? Does the other gnu/linux where the script works use dash also? Is this really a deb9- strange tar behavior issue, or something with default shell?

sh is now bash…. the error is «similar»:

Code: Select all

bash-4.4# cat ~/log/test.2019-01-04.log.errors 
/bin/sh: $'p27236316320311U': command not found
tar: /dev/fd/63: Wrote only 4096 of 10240 bytes
tar: Child returned status 127
tar: Error is not recoverable: exiting now
bash-4.4# 

and this is using the default, 1.29 tar… not the one specified in the script — the old one works as it should regardless of the symlink…

«They did not know it was impossible so they did it” — Mark Twain



User avatar

GarryRicketson

Posts: 5871
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: deb9 — strange tar behavior

#14

Post

by GarryRicketson » 2019-01-05 01:18

This is how I learned how,
How would you debug a script?
I don’t feel like going into details just now, but the results do. Hint, better results can be obtained if the type of script is specified, IE: csh,ksh, bash ,etc …(the search bot assumes it is bash, mostly, or shell scripts in general.


User avatar

ksu

Posts: 62
Joined: 2014-01-13 14:59

Re: deb9 — strange tar behavior

#15

Post

by ksu » 2019-01-05 02:02

I still don’t get this…

old tar:

Code: Select all

+ echo test testdir/
+ /root/bin/tar cv --preserve-permissions --numeric-owner -f /dev/fd/63 testdir/
++ mbuffer -s 256k -m 8G -O 10.0.0.113:8000
testdir/
testdir/somejunkfile

summary: 3560 KiByte in  0.1sec - average of 57.3 MiB/s
++ date

new tar:

Code: Select all

+ echo test testdir/
+ tar cv --preserve-permissions --numeric-owner -f /dev/fd/63 testdir/
++ mbuffer -s 256k -m 8G -O 10.0.0.113:8000
testdir/
testdir/somejunkfile
/bin/sh: $'p272.234260': command not found
tar: /dev/fd/63: Wrote only 4096 of 10240 bytes
tar: Child returned status 127
tar: Error is not recoverable: exiting now
++ date

when ran directly from bash, eg:

old tar:

Code: Select all

bash-4.4# ~/bin/tar cv --preserve-permissions --numeric-owner -f >(mbuffer -s 256k -m 8G -O 10.0.0.113:8000) testdir/
testdir/
testdir/somejunkfile
bash-4.4# 
summary: 43.4 MiByte in  0.4sec - average of  112 MiB/s

bash-4.4# 

new tar:

Code: Select all

bash-4.4# tar cv --preserve-permissions --numeric-owner -f >(mbuffer -s 256k -m 8G -O 10.0.0.113:8000) testdir/
testdir/
testdir/somejunkfile
bash-4.4# 
summary: 43.4 MiByte in  0.4sec - average of  113 MiB/s

bash-4.4# 

both complete fine…

so why the behavior of tar v1.27.1 ( and 1.26 ) versus v1.29 in the bash shell script is so different?
I need to start understanding this one way or another — «debugging a script» does not provide me with answer to the tar behavior question

«They did not know it was impossible so they did it” — Mark Twain


User avatar

llivv

Posts: 5484
Joined: 2007-02-14 18:10
Location: cold storage

Re: deb9 — strange tar behavior

#16

Post

by llivv » 2019-01-05 02:16

ksu wrote:I still don’t get this…

I need to start understanding this one way or another — «debugging a script» does not provide me with answer to the tar behavior question

Correct, debugging the script does not answer your question concerning the tar behavior.

Are you still trying to send a tarball to a remote hosts tape drive?

In memory of Ian Ashley Murdock (1973 — 2015) founder of the Debian project.


User avatar

ksu

Posts: 62
Joined: 2014-01-13 14:59

Re: deb9 — strange tar behavior

#17

Post

by ksu » 2019-01-05 02:47

yes, I am still trying to send the tarball, using mbuffer… in many cases it does prevent buffer underruns, it depends on the tape drive/tape type ( LTO-3…5 ), the type of data it is dealing with ( I rather do compression on a multicore system, than let the data being dealt with on the h/w provided compression ), plus it also gives me choice of using a different compression algorithm…. on small amounts of data, the improvement is questionable and often shows disadvantage, but I confirmed the backup to be much quicker when the tape drive does not get to buffer underruns… it stops being a «streamer» and continues to re-position the tape… this is not only bad for performance, but for the hardware/media itself. Adding eg. 8GB of buffer on both ends either prevents this from happening completely, or minimizes it.

I have no issue using the old version of tar for this purpose, but then this becomes limited to availability of tar (or even gcc) on a specific system.

What bothers me, is the difference of behavior directly from shell, and script… debugging might become a nightmare when dealing with similar cases, and maybe there is a single explanation that could potentially be applied to similar cases — I just wish/want to get to the bottom of it… it always helps when you know the cause, rather than just look for a workaround…

Thanks!

«They did not know it was impossible so they did it” — Mark Twain


User avatar

llivv

Posts: 5484
Joined: 2007-02-14 18:10
Location: cold storage

Re: deb9 — strange tar behavior

#18

Post

by llivv » 2019-01-05 19:21

sorry if not being clear enough….
My next step would be to
sending a test tarball from each tar version to the remote hosts tape
both with and without mbuffer

In memory of Ian Ashley Murdock (1973 — 2015) founder of the Debian project.


Basically, I wanted to practice how to compile the latest Linux kernel because Linux 5.11 is going to come with Syscall User Dispatch. (This function can make the Linux kernel capable of telling the difference between a Windows game written with DirectX APIs in mind and a Windows game that is using OpenGL or Vulkan. If the game runs on OpenGL or Vulkan, the kernel is going to treat those games as native Linux programs because they’re requesting POSIX syscalls, unlike DirectX games, which they are requesting Windows NT syscalls. But with the DX games, this function is also going to optimise Wine for them, which is also very good. This is why I decided that I would like to learn how to compile the Linux kernel by myself; to get this new function as early as when Linus Torvalds blesses us with this new creation of his and Valve’s.)

The warm-up with my Linux Mint VM was pretty good. I just downloaded the kernel sources into a specific compilation directory, installed the necessary dependencies, made a 100% optimised config file and ran this chain of commands:

make -j4 && sudo make modules_install -j4 && sudo make headers_install -j4 && sudo make install -j4

Then I regenerated the initramfs and the GRUB config file, rebooted the VM and it worked like a charm.

I cannot say the same thing with my daily driver machine running Arch Linux.

I copied the tar file over and edited the config file to make it fit for the needs of my bare metal, extracted it, followed the Arch Wiki for Arch-specific commands and ran the same make commands, but the compliler has just stopped at a random point, and for the second instance of running the make command chain, it has now spit out an error message saying this:

  ...
  CC      fs/direct-io.o
  CC      fs/mpage.o
  CC      fs/proc_namespace.o
  CC [M]  fs/f2fs/debug.o
  CC [M]  fs/f2fs/xattr.o
  CC      fs/eventpoll.o
  CC      fs/anon_inodes.o
  CC      fs/signalfd.o
  CC [M]  fs/f2fs/acl.o
  CC [M]  fs/f2fs/verity.o
  CC      fs/timerfd.o
  CC      fs/eventfd.o
  CC      fs/userfaultfd.o
  LD [M]  fs/f2fs/f2fs.o
  CC      fs/aio.o
  CC      fs/io_uring.o
  CC      fs/io-wq.o
  CC      fs/dax.o
  CC      fs/locks.o
  CC      fs/binfmt_script.o
  CC      fs/binfmt_elf.o
  CC      fs/compat_binfmt_elf.o
  CC      fs/mbcache.o
  CC      fs/posix_acl.o
  CC      fs/coredump.o
  CC      fs/drop_caches.o
  CC      fs/fhandle.o
  CC      fs/dcookies.o
  CC [M]  fs/binfmt_misc.o
  AR      fs/built-in.a
[ironicfur@IronicFur-PC linux-5.10.1]$ make -j4 && sudo make modules_install -j4 && sudo make headers_install -j4 && sudo make install -j4
  DESCEND  objtool
  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CHK     kernel/kheaders_data.tar.xz
  GEN     kernel/kheaders_data.tar.xz
make[1]: *** [kernel/Makefile:146: kernel/kheaders_data.tar.xz] Error 127
make: *** [Makefile:1805: kernel] Error 2
make: *** Waiting for unfinished jobs....

It clearly says something about some kheaders file, but I don’t know what Error 127 means. I tried to redo it with a clean build directory, without using the

command, but it still shows this error message.

What can I do with this (seemingly Arch-specific) issue?

Last edited by TheFurryWeeb (2020-12-20 12:11:27)


A computer and Linux nerd, an avid 2D platformer and RPG gamer and a furry combined into one person.

I hope I can help you out with your Arch issues and get myself helped out, as well.

I am installing SageMath from the source code, I get an issue while installing the tar.bZ2 file.
I am doing it giving the make -j4 command but I get the error shown below. I also have python3.8.2 by default on my ubuntu 20.04. Please kindly help me to remove this error. If I have to bring themake command into the path of sage then, how can I do? Please kindly help.
Note: I have gone through some similar posts on this plateform, but yet my problem is not solved. I am sure there is no GNU issue because GNU Make 4.2.1 is present by default in the system.

The sage folder contains the files shown in the image, if there is lacking something I may not undestand while downloading the source code, then please guide

This is the sage root directory where I have put everything

Thank yoou in adavance

xenoid's user avatar

xenoid

5,2092 gold badges15 silver badges33 bronze badges

asked Jul 28, 2020 at 5:58

Karim's user avatar

It’s not necessary to compile sagemath from source because sagemath is in the default repositories of Ubuntu 20.04. To install SageMath in Ubuntu 18.04 and later open the terminal and type:

sudo apt install sagemath

If you install SageMath with the above command it will be updated when a software update to the sagemath package becomes available. SageMath is a viable free open source alternative to Magma, Maple, Mathematica and Matlab.

answered Jul 28, 2020 at 7:01

karel's user avatar

karelkarel

107k93 gold badges263 silver badges290 bronze badges

2

python used to start a Python v2 interpreter. Python v2 is is now deprecated so there is no longer a default python on Ubuntu from 20.04 onwards.

You can still install a python2 or python2-minimal package that provides a python2 command (sudo apt install python2-minimal), and then create a soft link to it in a directory which is in your path.

To avoid modifying your system, you can create a ~/bin directory (default bash profiles include it in your PATH if they find it), add in it your PATH, and create a soft link to the python2 command in it: ln -s /usr/bin/python2 ~/bin/python.

answered Jul 28, 2020 at 6:41

xenoid's user avatar

xenoidxenoid

5,2092 gold badges15 silver badges33 bronze badges

2

I have used both of the methods suggested above, I am thankful to both. The soft link option might go better, I might not have done in an exact way as suggested. But my problem was resolved with the help of the Sage support Team, with the following command.

«the standard Ubuntu’s way to deal with the python problem seems to be to use
update-alternatives command, something like this:»

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 10

Thanks to the Sage support team, and
Dima Pasechnik especially. it may be useful for someone who may face the same issue.
Note: I have Python3.8.2, in the command I used Python3.8 but I do not know why not to write the full version.

answered Jul 28, 2020 at 8:29

Karim's user avatar

KarimKarim

11 bronze badge

This semester I got this new subject where we get to work with Discovery STM32 F4, and we are still in the phase of setting it up. But I have this problem in the beginning.

When I try to compile this «blink» code I get this error:

Error 127

So, as I got it so far, we are using this shortcut command «make» to compile code, and we were given instruction to set it up as it’s shown in images below:

Setup]

Can anyone see what’s the problem here?

Paolo's user avatar

Paolo

18k6 gold badges33 silver badges62 bronze badges

asked Apr 1, 2016 at 20:59

Emir's user avatar

4

Error 127 means one of two things:

  1. file not found: the path you’re using is incorrect. double check that the program is actually in your $PATH, or in this case, the relative path is correct — remember that the current working directory for a random terminal might not be the same for the IDE you’re using. it might be better to just use an absolute path instead.
  2. ldso is not found: you’re using a pre-compiled binary and it wants an interpreter that isn’t on your system. maybe you’re using an x86_64 (64-bit) distro, but the prebuilt is for x86 (32-bit). you can determine whether this is the answer by opening a terminal and attempting to execute it directly. or by running file -L on /bin/sh (to get your default/native format) and on the compiler itself (to see what format it is).

if the problem is (2), then you can solve it in a few diff ways:

  1. get a better binary. talk to the vendor that gave you the toolchain and ask them for one that doesn’t suck.
  2. see if your distro can install the multilib set of files. most x86_64 64-bit distros allow you to install x86 32-bit libraries in parallel.
  3. build your own cross-compiler using something like crosstool-ng.
  4. you could switch between an x86_64 & x86 install, but that seems a bit drastic ;).

answered Apr 2, 2016 at 1:02

Mike Frysinger's user avatar

Mike FrysingerMike Frysinger

2,6901 gold badge21 silver badges24 bronze badges

2

I attempted to follow this guide to run a Node application as a service. However, it is failing to start, with exit code 127. Is there any way to fix this?

This is the journal.

sudo  journalctl --follow -u serviceName
-- Logs begin at Tue 2017-08-08 16:27:10 GMT. --
Aug 08 17:06:57 raspberrypi systemd[1]: Started serviceName.
Aug 08 17:06:57 raspberrypi app.js[7234]: [46B blob data]
Aug 08 17:06:57 raspberrypi systemd[1]: serviceName.service: main process exited, code=exited, status=127/n/a
Aug 08 17:06:57 raspberrypi systemd[1]: Unit serviceName.service entered failed state.
Aug 08 17:06:57 raspberrypi systemd[1]: serviceName.service holdoff time over, scheduling restart.
Aug 08 17:06:57 raspberrypi systemd[1]: Stopping serviceName...
Aug 08 17:06:57 raspberrypi systemd[1]: Starting serviceName...
Aug 08 17:06:57 raspberrypi systemd[1]: serviceName.service start request repeated too quickly, refusing to start.
Aug 08 17:06:57 raspberrypi systemd[1]: Failed to start serviceName.
Aug 08 17:06:57 raspberrypi systemd[1]: Unit serviceName.service entered failed state.

This is the serviceName.service.

[Unit]
Description=ServiceName
After=network.target

[Service]
ExecStart=/home/pi/projects/ServiceName/app.js
Restart=always
User=root
Group=root
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/home/pi/projects/ServiceName

[Install]
WantedBy=multi-user.target

This is at the top of my app.js.

#!/usr/bin/env node

asked Aug 8, 2017 at 17:35

Chris Talman's user avatar

4

ExecStart=/home/pi/projects/ServiceName/app.js

This is telling systemd to run app.js directly. Is this .js file directly executable? If not, the shell will throw an exit code 127 — «Unknown command».

answered Aug 8, 2017 at 17:51

DopeGhoti's user avatar

DopeGhotiDopeGhoti

71.4k8 gold badges94 silver badges132 bronze badges

3

127 is a command not found.

Make sure root user has access to node binary else change following lines with the user for which you have installed node

User=root
Group=root

Else Try following

[Unit]
Description="ServiceName"
After=network.target

[Service]
ExecStart=path_to_node/node /home/pi/projects/ServiceName/app.js
Restart=always
# Restart service after 10 seconds if node service crashes
RestartSec=10

# Output to syslog
StandardOutput=syslog
StandardError=syslog
#Change this to find app logs in /var/log/syslog
SyslogIdentifier=nodejs-api
# Followig will require if you are using the PORT or Node from Envirnoment
Environment=NODE_ENV=production PORT=3000

[Install]
WantedBy=multi-user.target

Once your server machine is up & you are not able to access server, you troubleshoot by checking logs from /var/log/syslog by the following command

sudo grep "nodejs-api" /var/log/syslog

Start on boot: sudo systemctl enable rocketch

Josip Rodin's user avatar

answered May 29, 2018 at 12:04

Chandani Patel's user avatar

To debug just run this (substuting the <> parts with the value from your systemd unit file:

sudo runuser -l <User> -g <Group> -c "cd <WorkingDirectory> && <PATH> <ExecStart>"

The issue is the given User cannot access the ExecStart within the PATH you have set.

If anybody is still stuck I’ve written a step by step guide to: debugging systemd

answered Jun 15, 2020 at 10:21

Gerry's user avatar

GerryGerry

1,0109 silver badges9 bronze badges

For them who are using NVM. try this

ExecStart=/home/<you_username>/.nvm/versions/node/<node_version>/bin/node /home/<you_username>/.nvm/versions/node/<node_version>/bin/verdaccio --config /home/<you_username>/.config/verdaccio/config.yaml

answered Apr 18, 2021 at 5:35

9me's user avatar

Hey for anyone interested, I had this issue and tried everything under the sun, but in the end upgrading from Node 6 to Node 12 fixed the issue.

answered Apr 24, 2020 at 3:11

Epicism's user avatar

I am trying to install shc on Ubuntu 18.04

wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
tar xvfz shc-3.8.9.tgz
cd shc-3.8.9
make

But receive the following error:

cc -Wall  shc.c -o shc
make: cc: Command not found
makefile:31: recipe for target 'shc' failed
make: *** [shc] Error 127

The makefile:

# Makefile
#

INSTALL_PATH = /usr/local

# For SCO
CFLAGS = -b elf -O -D_SVID

# For IRIX
CFLAGS = -xansi -fullwarn -O3 -g0

# For Solaris
CFLAGS = -fast -xO4 -s -v -Xa

# For HPUX
CFLAGS = -Wall -O -Ae

# For OSF1
CFLAGS = -w -verbose -fast -std1 -g0

# For GNU C compiler
CFLAGS = -Wall # -O6 -pedantic

#SHELL = /bin/sh

SHCFLAGS = -v -T # Add -T option to allow binary to be traceable

all: shc ask_for_test

shc: shc.c
    $(CC) $(CFLAGS) $@.c -o $@

ask_for_test:
    @echo '***  �Do you want to probe shc with a test script?'
    @echo '***  Please try...   make test'

test: make_the_test ask_for_strings

make_the_test: match.x
    @echo '***  Running a compiled test script!'
    @echo '***  It must show files with substring "sh" in your PATH...'
    ./match.x sh

match.x: shc match
    @echo '***  Compiling script "match"'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -f match

ask_for_strings:
    @echo '***  �Do you want to see strings in the generated binary?'
    @echo '***  Please try...   make strings'

strings: make_the_strings ask_for_expiration

make_the_strings: match.x
    @echo '***  Running: "strings -n 5 'match.x'"'
    @echo '***  It must show no sensible information...'
    strings -n 5 match.x

ask_for_expiration:
    @echo '***  �Do you want to probe expiration date?'
    @echo '***  Please try...   make expiration'

expiration: til_yesterday ask_for_install

til_yesterday: shc match
    @echo '***  Compiling "match" to expired date'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -vv -e `date "+%d/%m/%Y"` -f match
    @echo '***  Running a compiled test script!'
    @echo '***  It must fail showing "./match.x: has expired!"'
    ./match.x

ask_for_install:
    @echo '***  �Do you want to install shc?'
    @echo '***  Please try...   make install'

install: shc
    @echo '***  Installing shc and shc.1 on '$(INSTALL_PATH)
    @echo -n '***   �Do you want to continue? '; read ANS; case "$$ANS" in y|Y|yes|Yes|YES) ;; *) exit 1;; esac;
    install -c -s shc $(INSTALL_PATH)/bin/
    install -c -m 644 shc.1 $(INSTALL_PATH)/man/man1/

clean:
    rm -f *.o *~ *.x.c

cleanall: clean
    rm -f shc *.x

I have no idea how to fix this error. Can anyone help?

mature's user avatar

mature

3,7199 gold badges29 silver badges64 bronze badges

asked Nov 22, 2018 at 17:24

2

cc is an alias for the GNU C compiler (gcc). You can install it as follows:

 sudo apt install gcc

If, for some reason, the gcc compiler is already installed, but the symbolic link /usr/bin/cc is missing, you can also do:

 make CC=gcc

answered Nov 22, 2018 at 18:07

Peter Selinger's user avatar

1

sudo apt install build-essential

This will install a C compiler (providing the cc command) as well as other tools that you may need for building software from source.

answered Nov 22, 2018 at 19:39

Mark's user avatar

MarkMark

5724 silver badges13 bronze badges

@john-light

Background

I am attempting to upgrade my installed version of LND and getting this error:

make clean && make && make install
/bin/sh: 1: go: not found
/bin/sh: 1: go: not found
 Cleaning source.
rm -f ./lnd-debug ./lncli-debug
rm -f ./lnd-itest ./lncli-itest
rm -f -r ./vendor .vendor-new
/bin/sh: 1: go: not found
/bin/sh: 1: go: not found
 Building debug lnd and lncli.
GO111MODULE=on go build -v -tags="dev" -o lnd-debug -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=queue/v1.0.1-136-g6ad8be25e1aaf4700bd86303ae534cf36c6199bf" github.com/lightningnetwork/lnd
/bin/sh: 1: go: not found
Makefile:94: recipe for target 'build' failed
make: *** [build] Error 127

Your environment

  • version of lnd lnd version 0.5.2-99-beta commit=v0.5.1-beta-814- g2a652455aaea661b147b6adca0ff51edcd268508

  • which operating system (uname -a on *Nix)
    Ubuntu 16.04.6 x86_64

  • version of btcd, bitcoind, or other backend
    bitcoind

Steps to reproduce

Tell us how to reproduce this issue. Please provide stacktraces and links to code in question.

Following the update instructions:

To update your version of lnd to the latest version run the following commands:

cd $GOPATH/src/github.com/lightningnetwork/lnd
git pull
make clean && make && make install

Expected behaviour

I expect to be update to update LND without error message.

Actual behaviour

I get the error message indicated above.

@wpaulino

/bin/sh: 1: go: not found

The go binary is not in your PATH.

@john-light

@wpaulino why isn’t it? I followed the instructions exactly as written in this repo.

@Roasbeef

Check your PATH, you may have installed Go in a slightly different directory. Also you can do which go to find where it’s pointing to atm.

@isdanni

As @Roasbeef suggested, use the following command to check your path setting:

echo $GOPATH  # this should point to your workspace
echo $PATH
go version  # check go version, it should be at least 1.12
gedit ~/.profile  # to modify PATH
source ~/.profile  # to activate changes

I also use Ubuntu so I know the struggle when configuring the Go. If all the above not working, I suggest you remove and install Go again, directly installing tar package. Installation guide here. Following is tested and worked perfectly fine on my Ubuntu 18.04

which go  # output like /usr/local/go/bin/go
rm -rvf /usr/local/go/
sudo apt-get remove golang-go
sudo apt-get remove --auto-remove golang-go

Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?
Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!

  • Форум русскоязычного сообщества Ubuntu »
  • Поддержка »
  • Настройка системы (Модераторы: Дмитрий Бо, www777) »
  • make Error 127
  • Печать

Страницы: [1]   Вниз

Тема: make Error 127  (Прочитано 6994 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
w2e

Ubuntu 12.04
трей
—————————————————————————

000@1000:~/dd/dir320$ make kernel_menuconfig
make[1]: Entering directory `/home/000/dd/dir320/target/linux'
make[2]: Entering directory `/home/000/dd/dir320/target/linux/brcm47xx'
if [ -s "/home/000/dd/dir320/build_dir/linux-brcm47xx/linux-2.6.32.27/patches/series" ]; then (cd "/home/000/dd/dir320/build_dir/linux-brcm47xx/linux-2.6.32.27"; if quilt --quiltrc=- next >/dev/null 2>&1; then quilt --quiltrc=- push -a; else quilt --quiltrc=- top >/dev/null 2>&1; fi ); fi
make[2]: *** [/home/000/dd/dir320/build_dir/linux-brcm47xx/linux-2.6.32.27/.quilt_checked] Error 127
make[2]: Leaving directory `/home/000/dd/dir320/target/linux/brcm47xx'
make[1]: *** [menuconfig] Error 2
make[1]: Leaving directory `/home/000/dd/dir320/target/linux'
make: *** [kernel_menuconfig] Ошибка 2
что  делать?  кто нить знает?


Пользователь решил продолжить мысль 30 Июня 2012, 16:59:41:


проблема решена  не хватала пакета quilt.

« Последнее редактирование: 30 Июня 2012, 16:59:41 от w2e »


Оффлайн
victor00000


  • Печать

Страницы: [1]   Вверх

  • Форум русскоязычного сообщества Ubuntu »
  • Поддержка »
  • Настройка системы (Модераторы: Дмитрий Бо, www777) »
  • make Error 127

SMF 2.0.19 |
SMF © 2011, Simple Machines | Карта форума

Страница сгенерирована за 0.095 секунд. Запросов: 25.

Понравилась статья? Поделить с друзьями:
  • Python как изменить цвет фона
  • Tail grep error
  • Syntax error missing after argument list
  • Python как изменить тип данных массива
  • Tabman error typeerror объект не поддерживает свойство или метод