1

I want to have two versions of Gmsh: 2.10.1 (http://gmsh.info/bin/Linux/gmsh-2.10.1-Linux64.tgz) and 3.0.6 (the latest) on my Ubuntu 16.04 LTS machine. Both of which I seem to have installed successfully. However, I observed something weird: apt-cache policy gmsh gives this:

  gmsh:
    Installed: 2.10.1+dfsg1-1ubuntu4
    Candidate: 2.10.1+dfsg1-1ubuntu4
    Version table:
   *** **2.10.1+dfsg1-1ubuntu4** 500
          500 http://gb.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
          100 /var/lib/dpkg/status

While gmsh -version gives

3.0.6

What does it mean? Is this also related to another observation that the Ubuntu Software listed only 2.10.1 version before I installed 3.0.6 and after installation of 3.0.6 it doesn't list anything for gmsh.

Running gmsh starts the 3.0.6 version. I don't know how to start the other.

Assuming I've both the versions, I believe I'll have to do something like source the correct files from .bashrc with some aliases? I'm not sure how. Can someone help? What's going on and how can I use both versions as per need?

  • Locally compiled executables (with sudo make install) are usually placed in /usr/local/bin. Do you have Gmsh here - please add output of ls -al /usr/local/bin/gmsh to the question. – N0rbert Jul 2 '18 at 16:50
  • I get this: '-rwxr-xr-x 1 root root 198622472 Jun 12 16:15 /usr/local/bin/gmsh' Also, 'dpkg -L gmsh-2.10.1+dfsg1-1ubuntu4' gives: 'dpkg-query: package 'gmsh-2.10.1+dfsg1-1ubuntu4' is not installed' – 83ingD33p Jul 2 '18 at 17:09
  • I did not ask for dpkg -L gmsh. Please add output of ls -al /usr/local/bin/gmsh to the question. And /usr/local/bin/gmsh -version or /usr/local/bin/gmsh --version (do not remember real syntax). – N0rbert Jul 2 '18 at 17:09
  • Hi, I did add the output.This was my first comment so made a typo. Anyway. Again.. -rwxr-xr-x 1 root root 198622472 Jun 12 16:15 /usr/local/bin/gmsh. The version command gives 3.0.6. – 83ingD33p Jul 2 '18 at 17:14
0

It seems that you have two versions:

  • locally compiled and installed 3.0.6, located in /usr/local/bin/gmsh
  • version 2.10.1 installed from official ubuntu package, located in /usr/bin/gmsh

So you can call them with full execution path or set aliases in ~/.bashrc:

alias gmsh2='/usr/bin/gmsh'
alias gmsh3='/usr/local/bin/gmsh'
  • This worked! Thank you very much. However, why aren't both versions listed when I check for any gmsh related applications? If I specifically check: dpkg -L gmsh-2.10.1+dfsg1-1ubuntu4 it says not installed. Why? – 83ingD33p Jul 3 '18 at 20:31
  • Great! But dpkg -L gmsh-2.10.1+dfsg1-1ubuntu4 command has wrong syntax. It should be dpkg -L gmsh (without version). You can list available versions with other commands - apt-cache policy gmsh. You can consult dpkg man-page and apt-cache man-page for details. – N0rbert Jul 3 '18 at 20:35
  • Well, about policy gmsh I've mentioned in the question description. It shows only pre-compiled version and dpkg -L gmsh too doesn't list anything in /usr/local/bin/gmsh (the 3.0.6 version). – 83ingD33p Jul 3 '18 at 21:05
  • Please remember, that things in /usr/local/ do not use APT/dpkg-database. APT knows nothing about them. They are placed here by user of by script. See this answer for details. – N0rbert Jul 3 '18 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.