1

I'm trying to install Heroku CLI under instruction from the Odin Project. I followed their instructions and entered into terminal in Linux:

wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh

It appears to be installing but then the error message which appears is the following:

E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

I have no idea what to do with this information. (I typed "no" in response but that had no effect.) Does anyone out there know how to get past this?

ps. I have entered "heroku version" afterwards, but the only response is:

heroku: command not found

I'm stuck on this early stage because of this error.

2

The error message means that you're unable to create the lock for the apt package manager. Unless there's another process trying to install packages on the machine, the other option is that you don't have the necessary rights.

In fact, your error comes most probably from the fact that you're running the command

wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh

as an unprivileged user. You need to run it as root.

6
  • Thanks dr01, How do I run the command "as root"? Jul 17 '17 at 8:36
  • Switch to the root user via su - or sudo -i, then run the command.
    – dr_
    Jul 17 '17 at 8:37
  • I tried that now but I receive the following response. (I am the superuser and my login works in every other scenario that i have encountered): marc@marc-VirtualBox:~$ su - Password: su: Authentication failure Jul 17 '17 at 8:56
  • marc@marc-VirtualBox:~$ su -i su: invalid option -- 'i' Jul 17 '17 at 8:58
  • 1
    Yes! That worked! Thank you so much both of you dr01 and Philippos! You guys are great! Jul 17 '17 at 9:19

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.