I got an outdated extension from Klarna. In order to update this extension, I need to first update my composer. How do I go about updating it. Tried self-update
command, and it didn't work.
Running the command composer self-update -vvv threw the following error. How to fix it?
Reading ./composer.json
Loading config file /home/magento/.config/composer/config.json
Loading config file /home/magento/.config/composer/auth.json
Loading config file ./composer.json
Loading config file /home/magento/web/magento2.perfectmakeupmirrors.com/public_html/auth.json
Reading /home/magento/web/magento2.perfectmakeupmirrors.com/public_html/auth.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Failed to initialize global composer: Composer could not find the config file: /home/magento/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /home/magento/web/magento2.perfectmakeupmirrors.com/public_html/vendor/composer/installed.json
Loading plugin MagentoHackathon\Composer\Magento\Plugin
activate magento plugin
Loading plugin Magento\InventoryComposerInstaller\Plugin
Loading plugin Magento\ComposerRootUpdatePlugin\Plugin\PluginDefinition
Loading plugin Laminas\DependencyPlugin\DependencyRewriterPluginDelegator
Activating Laminas\DependencyPlugin\DependencyRewriterV1
Loading plugin Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin
Running 1.9.3 (2020-02-04 12:58:49) with PHP 7.4.13 on Linux / 4.15.0-50-generic
In Laminas\DependencyPlugin\DependencyRewriterV1::onPreCommandRun
Downloading https://getcomposer.org/versions
Updating to version 2.1.5 (stable channel).
Downloading https://getcomposer.org/download/2.1.5/composer.phar.sig
Downloading https://getcomposer.org/download/2.1.5/composer.phar
Downloading (100%)
[ErrorException]
rename(/home/magento/.cache/composer/composer-temp.phar,/usr/bin/composer):
Permission denied
Exception trace:
() at phar:///usr/bin/composer/src/Composer/Command/SelfUpdateCommand.php:356
Composer\Util\ErrorHandler::handle() at n/a:n/a
rename() at phar:///usr/bin/composer/src/Composer/Command/SelfUpdateCommand.php:356
Composer\Command\SelfUpdateCommand->setLocalPhar() at phar:///usr/bin/composer/src/Composer/Command/SelfUpdateCommand.php:241
Composer\Command\SelfUpdateCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:267
Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:106
Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:61
require() at /usr/bin/composer:24
self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--set-channel-only] [--] [<version>]