1

I'm on ubuntu 20.04 LTS and I have installed Composer directly using the terminal, but I'm getting this error:

[Composer\Downloader\FilesystemException]                                    
  Filesystem exception:                                                        
  Composer update failed: "/usr/local/bin/composer" could not be written.      
  rename(/home/smiley/.cache/composer/composer-temp5193870.phar,/usr/local/bin/composer): Permission denied  

I was searching on Google and Stack, but some suggestions I tried are not working.

Can you please help? Thanks in advance.

SMILEY
  • 11

2 Answers2

2

Run composer update with admin privileges

sudo composer self-update
S.M. Pat
  • 121
1

You could temporarily add the rights to your working user, then update composer w/o errors and then get back the rights.

sudo chmod 777 /usr/bin/
composer self-update
sudo chmod 755 /usr/bin/