0

My linking looks broken. It's showing below error.

$ opt
The program 'opt' is currently not installed. You can install it by typing:
apt-get install llvm

and apt-get install llvm-3.6 shows that:

$ apt-get install llvm-3.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
llvm-3.6 is already the newest version.

What am I missing here?

Edit

With opt, even llvm is also broken. Could anyone please clear that as well?

$ apt-cache policy llvm
llvm:
  Installed: (none)
  Candidate: 1:3.4-0ubuntu1
  Version table:
    1:3.4-0ubuntu1 0
    500 http://my.org.url/ubuntu/ trusty/universe amd64 Packages

which opt showing nothing.

  • Edit your question and add the output of apt-cache policy llvm and which opt – A.B. Aug 19 '15 at 13:49
  • The output of apt-cache policy llvm. Not llvm-3.6 and the output of which opt – A.B. Aug 19 '15 at 13:59
  • @A.B. I would like to know the solution as well as reason to downvote. – Saumya Suhagiya Aug 20 '15 at 6:19
  • Again, install llvm as described in my answer. The reason for the downvote, I can not tell you. For this you have to know who it was. And that's not possible. – A.B. Aug 20 '15 at 6:23
  • @A.B. Thanks A.B. The problem with installing llvm directly is: it gives me llvm-3.4 by default, to install llvm-3.6 I need to specify as apt-get install llvm-3.6. I am assuming that might be because it goes by default to our org repo for finding any packages. – Saumya Suhagiya Aug 20 '15 at 6:46
1

The binary (symbolic link) /usr/bin/opt is in the package llvm. Therefore install with

sudo apt-get install llvm

The installation of this package creates a symbolic link

/usr/bin/opt -> ../lib/llvm-3.6/bin/opt

Or create the link via

sudo ln -s /usr/lib/llvm-3.6/bin/opt /usr/bin/opt

You can check this via apt-file

sudo apt-get install apt-file
sudo apt-file update
apt-file search --regex /opt$

Sample output

glibc-source: /usr/src/glibc/debian/control.in/opt
llvm: /usr/bin/opt
llvm-3.4: /usr/lib/llvm-3.4/bin/opt
llvm-3.5: /usr/lib/llvm-3.5/bin/opt
llvm-3.6: /usr/lib/llvm-3.6/bin/opt
scsh-0.6: /usr/lib/scsh-0.6/opt
|improve this answer|||||
  • Thanks for the answer. But, it is also not working for llvm command. Since I tried for clang as well, it was straight forward with this question, but in same way, its difficult to figure out for llvm. – Saumya Suhagiya Aug 19 '15 at 13:45
  • What do you mean with "I think", have you installed the llvm package? – A.B. Aug 19 '15 at 13:47
  • Yes, I have already installed it, as it's clear from question itself. (I removed unclear part of my comment as well. :) ) – Saumya Suhagiya Aug 19 '15 at 13:48
  • Has this been solved? Although I can confirm your output of apt-file, the file /usr/lib/llvm-4.0/bin/opt simply does not exist. I install llvm and llvm-dev. – Max Beikirch May 11 '17 at 20:12

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.