ubuntu升级composer到最新版本(2.0-dev)

Song4006 次浏览2个评论2020年07月30日

Laravel部署过程中,发现Composer版本过低,准备对其升级:

composer self-update

结果提示:

  [InvalidArgumentException]             
  Command "self-update" is not defined.

一、卸载重新安装composer

没有升级名利,所以我准备卸载重装,但是发现并不是最新版本,应该是源没有更新:

# 卸载composer
apt-get remove composer
# 安装composer
apt-get install composer

结果安装的还是1.0.0~beta2-1版本:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
composer is already the newest version (1.0.0~beta2-1).
0 upgraded, 0 newly installed, 0 to remove and 334 not upgraded.

二、安装最新版本的composer

# 下载composer.phar
wget https://getcomposer.org/composer.phar
# 重命名composer.phar为composer
mv composer.phar composer
# 增加可执行权限
chmod +x composer

进入其他目录执行composer找到目录,并且将composer移动过去:

sudo mv composer /usr/bin/composer

然后执行composer即可知道是否安装成功

composer

命令参考ubnutu/apt命令大全

提交评论

请登录后评论

用户评论

    当前暂无评价,快来发表您的观点吧...

更多相关好文