how to update make 3.81 linux

2020-06-03 03:27发布

问题:

I am new to Linux (new as in installed it yesterday), I need it for my programming course in the university and I've been told to install specific versions of specific programs, but though I've used apt-get install to install them (having previously done apt-get update) they aren't in the correct version.

The programs that I need are make 4.0 and valgrind 3.10.1.

apt-get installs make 3.81 and valgrind 3.10.0.SVN.

I have tried typing "apt-get install make4.0" and "apt-get install valgrind10.3.1" to no avail. I have downloaded them from the internet and followed what instructions I could understand to install the newer versions but it keeps saying that I have the older ones. (I'm not sure if I can post direct links here, if I can let me know and I'll post where I got them from).

What have I been doing wrong? How can I fix this?

I am currently running Linux Mint.

Thanks for any answer in advance.

回答1:

Due to a long-standing unresolved Debian bug report, GNU Make remained the age-old 3.81 in Debian for a very long time, and as a consequence, in Debian-based distributions such as Ubuntu and Mint.

The latest Debian release, Jessie, has upgraded to 4.0, so Debian-based distributions will have that upgrade. However, it is better to use 4.1.

This has been discussed many times on the GNU Make mailing list and elsewhere.

So to get a newer version, you must compile it from scratch. This is easy:

  1. Install the required packages (gcc, make and such).
  2. Open up a shell (if you're using the GUI, a terminal window).
  3. Type the following commands (or something equivalent, e.g. you can use curl instead of wget):

    cd /tmp
    wget http://ftp.gnu.org/gnu/make/make-4.1.tar.gz
    tar xvf make-4.1.tar.gz
    cd make-4.1/
    ./configure
    make
    sudo make install
    cd ..
    rm -rf make-4.1.tar.gz make-4.1
    

Now, make 4.1 is in /usr/local/bin/make.

You can verify it is there with whereis make.

You can make it your default make by prefixing /usr/local/bin to your $PATH variable in your shell startup file; for instance, in .profile or .bashrc if you use the bash shell.

Don't try to install a self-compiled make (or anything else that doesn't come from the distribution's package manager) into /bin or /usr/bin; doing that will confuse your package manager.