The installation directory “/usr/local/bin” is not writable - How to fix this? I am trying to install the...











up vote
-1
down vote

favorite












ERROR message while trying to setup Composer:
ERROR message while trying to setup Composer



192:~ biancalouisedairo$  php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
192:~ biancalouisedairo$ php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
Installer verified
192:~ biancalouisedairo$ php composer-setup.php --install-dir=/usr/local/bin
All settings correct for using Composer
The installation directory "/usr/local/bin" is not writable
192:~ biancalouisedairo$









share|improve this question




















  • 1




    Use sudo then.
    – mario
    Nov 11 at 12:08










  • Ive tried but it says File exists.
    – Bianca Piper
    Nov 11 at 12:11















up vote
-1
down vote

favorite












ERROR message while trying to setup Composer:
ERROR message while trying to setup Composer



192:~ biancalouisedairo$  php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
192:~ biancalouisedairo$ php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
Installer verified
192:~ biancalouisedairo$ php composer-setup.php --install-dir=/usr/local/bin
All settings correct for using Composer
The installation directory "/usr/local/bin" is not writable
192:~ biancalouisedairo$









share|improve this question




















  • 1




    Use sudo then.
    – mario
    Nov 11 at 12:08










  • Ive tried but it says File exists.
    – Bianca Piper
    Nov 11 at 12:11













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











ERROR message while trying to setup Composer:
ERROR message while trying to setup Composer



192:~ biancalouisedairo$  php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
192:~ biancalouisedairo$ php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
Installer verified
192:~ biancalouisedairo$ php composer-setup.php --install-dir=/usr/local/bin
All settings correct for using Composer
The installation directory "/usr/local/bin" is not writable
192:~ biancalouisedairo$









share|improve this question















ERROR message while trying to setup Composer:
ERROR message while trying to setup Composer



192:~ biancalouisedairo$  php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
192:~ biancalouisedairo$ php -r "if (hash_file('sha384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
Installer verified
192:~ biancalouisedairo$ php composer-setup.php --install-dir=/usr/local/bin
All settings correct for using Composer
The installation directory "/usr/local/bin" is not writable
192:~ biancalouisedairo$






javascript php composer-php laravel-5.1






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 12:08









Zoe

10.6k73575




10.6k73575










asked Nov 11 at 12:07









Bianca Piper

1




1








  • 1




    Use sudo then.
    – mario
    Nov 11 at 12:08










  • Ive tried but it says File exists.
    – Bianca Piper
    Nov 11 at 12:11














  • 1




    Use sudo then.
    – mario
    Nov 11 at 12:08










  • Ive tried but it says File exists.
    – Bianca Piper
    Nov 11 at 12:11








1




1




Use sudo then.
– mario
Nov 11 at 12:08




Use sudo then.
– mario
Nov 11 at 12:08












Ive tried but it says File exists.
– Bianca Piper
Nov 11 at 12:11




Ive tried but it says File exists.
– Bianca Piper
Nov 11 at 12:11












2 Answers
2






active

oldest

votes

















up vote
0
down vote













This will remove any already-installed Composer and install it correctly for you:



sudo rm -f /usr/local/bin/composer
EXPECTED_SIGNATURE=$(curl -s https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

if [ "$EXPECTED_SIGNATURE" == "$ACTUAL_SIGNATURE" ]
then
php composer-setup.php --quiet
rm composer-setup.php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod 777 /usr/local/bin/composer
fi





share|improve this answer




























    up vote
    0
    down vote













    Use sudo before your command



    like this sudo php composer-setup.php --install-dir=/usr/local/bin






    share|improve this answer





















      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248573%2fthe-installation-directory-usr-local-bin-is-not-writable-how-to-fix-this-i%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      This will remove any already-installed Composer and install it correctly for you:



      sudo rm -f /usr/local/bin/composer
      EXPECTED_SIGNATURE=$(curl -s https://composer.github.io/installer.sig)
      php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
      ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

      if [ "$EXPECTED_SIGNATURE" == "$ACTUAL_SIGNATURE" ]
      then
      php composer-setup.php --quiet
      rm composer-setup.php
      sudo mv composer.phar /usr/local/bin/composer
      sudo chmod 777 /usr/local/bin/composer
      fi





      share|improve this answer

























        up vote
        0
        down vote













        This will remove any already-installed Composer and install it correctly for you:



        sudo rm -f /usr/local/bin/composer
        EXPECTED_SIGNATURE=$(curl -s https://composer.github.io/installer.sig)
        php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
        ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

        if [ "$EXPECTED_SIGNATURE" == "$ACTUAL_SIGNATURE" ]
        then
        php composer-setup.php --quiet
        rm composer-setup.php
        sudo mv composer.phar /usr/local/bin/composer
        sudo chmod 777 /usr/local/bin/composer
        fi





        share|improve this answer























          up vote
          0
          down vote










          up vote
          0
          down vote









          This will remove any already-installed Composer and install it correctly for you:



          sudo rm -f /usr/local/bin/composer
          EXPECTED_SIGNATURE=$(curl -s https://composer.github.io/installer.sig)
          php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
          ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

          if [ "$EXPECTED_SIGNATURE" == "$ACTUAL_SIGNATURE" ]
          then
          php composer-setup.php --quiet
          rm composer-setup.php
          sudo mv composer.phar /usr/local/bin/composer
          sudo chmod 777 /usr/local/bin/composer
          fi





          share|improve this answer












          This will remove any already-installed Composer and install it correctly for you:



          sudo rm -f /usr/local/bin/composer
          EXPECTED_SIGNATURE=$(curl -s https://composer.github.io/installer.sig)
          php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
          ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

          if [ "$EXPECTED_SIGNATURE" == "$ACTUAL_SIGNATURE" ]
          then
          php composer-setup.php --quiet
          rm composer-setup.php
          sudo mv composer.phar /usr/local/bin/composer
          sudo chmod 777 /usr/local/bin/composer
          fi






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 at 12:24









          Elliot Reed

          4113724




          4113724
























              up vote
              0
              down vote













              Use sudo before your command



              like this sudo php composer-setup.php --install-dir=/usr/local/bin






              share|improve this answer

























                up vote
                0
                down vote













                Use sudo before your command



                like this sudo php composer-setup.php --install-dir=/usr/local/bin






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Use sudo before your command



                  like this sudo php composer-setup.php --install-dir=/usr/local/bin






                  share|improve this answer












                  Use sudo before your command



                  like this sudo php composer-setup.php --install-dir=/usr/local/bin







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 16 at 14:26









                  M.Bilal Murtaza

                  285




                  285






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248573%2fthe-installation-directory-usr-local-bin-is-not-writable-how-to-fix-this-i%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown