Failed to write keys.dev.pub to: /home/ubuntu/.composer

I follow the installation instructions for the composer ( which is located here ). I just ran the php composer-setup.php line php composer-setup.php and the terminal returned:

 All settings correct for using Composer Unable to write keys.dev.pub to: /home/ubuntu/.composer 

I am installing on an Ubuntu VM in Vagrant.

+6
source share
3 answers

When installing Composer in your project directory, you may get this error. Im Using Ubuntu 16, during installation I came across the same issue


All settings are correct for using Composer. Unable to write keys.dev.pub to: /home/ubuntu/.composer

Step 1: just go to your Project Directory and run the sudo su command

Step 2: then try installing Composer with the following command

curl -sS https://getcomposer.org/installer | Php

+14
source

This can happen if you have installed a previous composer installation that is not completely removed, or if you run the installer with a user other than the owner of the .composer folder.

You can rename the old folder (have a backup), and then try again:

 mv ~/.composer ~/.composer.old 

This is less dangerous than doing something unknown with sudo.

+6
source

Running the command as sudo fixed the problem. Thanks @Peh for noticing the permission issue.

+2
source

Source: https://habr.com/ru/post/1015211/


All Articles