1、提权进入root
sudo -i
2、卸载composer
apt-get remove composer
3、下载composer.phar
wget https://getcomposer.org/composer.phar
4、增加可执行权限
chmod +x composer
5、加入全局命令
mv composer /usr/bin/composer
6、升级composer
composer self-update
7、退出root账户
exit
8、清除缓存
composer clear
composer使用阿里源
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer取消使用阿里源
composer config -g --unset repo.packagist