13

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.

DJA
  • 313
  • 1
  • 2
  • 10
  • 1
    The current version of [`valgrind`](http://www.valgrind.org/) is 3.10.1, not 10.3.1. The current version of GNU make is 4.1. You can obtain the source and then compile on your machine. It is likely to be straight-forward. Think carefully before installing the new versions over the existing software. I'd not do that; I'd create a new directory, such as `/usr/gnu` or `/opt/software` and place the new programs in there, and add `/usr/gnu/bin` or `/opt/software/bin` ahead of the standard locations in my PATH. Or you can use `/usr/local` — or any other names you desire. – Jonathan Leffler Aug 10 '15 at 06:04
  • Sorry! That was my Dyslexia (or something similar), I actually had to read your comment a couple of times before actually realizing there was a difference between the order of the numbers you had written. I now correctly wrote "sudo apt-get install valgrind 3.10.1", it did a bunch of things which it hadn't done before I assume because I was inputing different numbers, but when I wrote "valgrind --version" it still said "valgrind-3.10.0.SVN" :/. Ok, this is my first time here, I hadn't seen that your comment was bigger than that, going to read it now. – DJA Aug 10 '15 at 06:23
  • Version-number numbness can afflict anyone. If `apt-get` won't get the new versions, then they are not yet officially available to you via that mechanism. You need to decide whether the newer version is crucial to you. If not, go with what's available — what you've already got. This is by far the simplest. If you think the new version is critical, then you have to get the code yourself and compile and install it yourself. That's not very hard, but it is harder than installing prebuilt software. I have 3.11.0.SVN for the version I built (a while ago) from a clone of the SVN repository. – Jonathan Leffler Aug 10 '15 at 06:27
  • 2
    Generic advice *if* you build from source: Use `--prefix=/opt/make`, and add the `bin/` to your path. **Never** use the default prefix (`/usr`) for anything that hasn't come through your distribution's package manager. That's just asking for trouble. If the distribution catches up, you can just `rm /opt/make`. – DevSolar Aug 10 '15 at 13:24
  • In practice, it is likely that for your beginner needs `make` version 3.81 is equivalent to `make` version 4. So I would not bother installing `make-4` – Basile Starynkevitch Nov 22 '18 at 06:34

1 Answers1

30

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.

J Smith
  • 181
  • 1
  • 5
reinierpost
  • 8,425
  • 1
  • 38
  • 70
  • Debian squeeze and wheezie are at 3.81, jesse / stretch at 4.0. That more or less syncs with the release of GNU make 4.0 (which was released after wheezie and before jesse). I'd be interested which bug you're referring to. Any links? – DevSolar Aug 10 '15 at 09:02
  • Wow! Good news. I have fixed my wording and added a link to a page that links to the bug report. – reinierpost Aug 10 '15 at 09:03
  • Can you explain a little more how to make it my default? I don't know where those files are, can't seem to find them, I have seen that I can add them through the terminal itself, but didn't really understand how and I don't want to try anything that I'm not sure what will do in case I change something important, having all the access in the world is cool and all, but it is also dangerous since I don't know what I am doing. – DJA Aug 17 '15 at 20:56
  • What do you mean by 'those files'? You set the search path for executables by setting the `$PATH` variable. You can make variable settings permanent by putting them into a script that your shell automatically reads at startup. Different shells read different files and which files they read also depends on how they are started. Look up the details in the manual for your shell. If it's `bash`, type `man bash` for the manual. – reinierpost Aug 21 '15 at 14:13