61

How to install BLAS & LAPACK in Ubuntu 14.04? When I am trying to install these packages with apt-get install BLAS:

Error occurred  
Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
2
  • how are you installing?
    – Maythux
    May 14, 2015 at 11:18
  • 3
    I recommend the OpenBLAS implementation (sudo apt install libopenblas-dev), which is as fast as it can get (take a look at benchmarks on the web). As a bonus, it offers a LAPACK implementation as well. Aug 28, 2019 at 4:53

3 Answers 3

83

There's a typo in @Maythux's answer: there should be no e in liblapacke.

A more minimalist set of packages can be installed with:

sudo apt-get install libblas-dev liblapack-dev

Also, if you're installing these to get scipy to install with pip, it may not be the complete solution (I failed to use pip install scipy in an ARM architecture Ubuntu 14.04 system). I found success with apt-get install python-scipy, but it was an older version (0.13.3). If you need a newer version via pip, you may also need:

sudo apt-get install gfortran

I found this info on StackOverflow here

1
  • This works for me in Ubuntu 20.04 LTS Windows.
    – K J
    Nov 11, 2021 at 15:08
12

In my case, the solution is

sudo apt-get install libatlas-base-dev
12

In order to solve the administrator directory lock problem, search for processes.

sudo rm /var/lib/apt/lists/lock
sudo apt-get update

Then try the commands to install

sudo apt-get install libblas-dev checkinstall
sudo apt-get install libblas-doc checkinstall
sudo apt-get install liblapack-dev checkinstall
sudo apt-get install liblapack-doc checkinstall
4
  • 3
    Should we be recommending removal of a lock file before confirming that it's actually stale? As well, what are all the checkinstalls for? May 14, 2015 at 12:26
  • @hamx0r's answer is the one you want to use. This is no longer correct. Mar 9, 2016 at 17:58
  • @Zanna when you fixed the typo here in 2016, you missed an identical typo just above it! (You'll need to fix it; I don't have enough rep to do so.)
    – Mark Amery
    Jan 8, 2020 at 11:58
  • 2
    @MarkAmery the package liblapacke-dev exists. liblapack-dev also exists though and I'm not sure which was intended...
    – Zanna
    Jan 8, 2020 at 13:00

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.