0

I need to update m4 to 1.4.19 on Ubuntu 18.04, but how to do this ? This is a follow up from https://stackoverflow.com/a/69195008/1079990

I did:

wget ftp.gnu.org/gnu/m4/m4-1.4.19.tar.gz 
tar -xvzf m4-1.4.19.tar.gz 
cd m4-1.4.19/ 
./configure --prefix=/usr/local/m4 
make
sudo make install  # <-- suggested by @git-bruh
export PATH=/usr/local/m4/bin:$PATH
export PATH=/usr/local/m4:$PATH

But Ubuntu 18.04 still uses 1.4.18

Update after accept answer

But I still run into follow up error

| ERROR: Function failed: do_compile (log file is located at /home/hannes/git/alexa-auto-sdk/builder/build/tmp-android-22/work/x86_64-linux/m4-native/1.4.18-r0/temp/log.do_compile.86882)
ERROR: Task (/home/hannes/git/oe-core/meta/recipes-devtools/m4/m4-native_1.4.18.bb:do_compile) failed with exit code '1'
hannes ach
  • 16,247
  • 7
  • 61
  • 84

1 Answers1

2

It would be better to go for a distro package as manually overwriting files managed by the package manager is not a good idea, but if you still want to overwrite them you need to build it like this:

./configure --prefix=/usr # Install to /usr/bin as that path has precedence over /usr/local
make
sudo make install

Instead of this you could just install to /usr/local and export PATH=/usr/local/bin:$PATH to use the new m4 without overwriting files. Note that the PATH must be set in every shell where the new m4 needs to be used.

git-bruh
  • 333
  • 1
  • 7
  • I use export PATH=/usr/local/m4/bin:$PATH and export PATH=/usr/local/m4:$PATH unfortunately both are not successful – hannes ach Sep 22 '21 at 06:57
  • Did you `sudo make install` it ? I dont see that command in the question – git-bruh Sep 22 '21 at 06:58
  • To not update my system is very charmful. So I only set PATH and I updated my question. Doing so, I guess, I don't need sudo make install , or ? – hannes ach Sep 22 '21 at 07:08
  • without running `sudo make install` the binary wouldn't be installed at all. So you need to run it first. Installing to /usr/local/m4 is fine as it doesnt touch any package manager files. /usr/local is meant for this. – git-bruh Sep 22 '21 at 07:10
  • I accept this answer, but I run into an other follow up error | ERROR: Function failed: do_compile (log file is located at /home/hannes/git/alexa-auto-sdk/builder/build/tmp-android-22/work/x86_64-linux/m4-native/1.4.18-r0/temp/log.do_compile.86882) ERROR: Task (/home/hannes/git/oe-core/meta/recipes-devtools/m4/m4-native_1.4.18.bb:do_compile) failed with exit code '1' – hannes ach Sep 22 '21 at 07:23
  • That error would probably be influenced by the rest of your build environment and not to the m4 binary itself. You'd probably want to create a new post for that with the log or make an issue on the project's github – git-bruh Sep 22 '21 at 07:33