Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude a package from updating in composer

Tags:

composer-php

Whenever I try to add a new package using composer like "composer require packagename/package" or use "composer.phar update", I am getting all the installed packages updated. Is there any option in composer to exclude some package that I don't need to get updated?

like image 296
user7282 Avatar asked May 14 '15 10:05

user7282


2 Answers

  1. run this command and see what is your package version:

    composer show -i
    
  2. go to composer.json and edit which package you want never change by composer update and write version correctly for that :

    "jacopo/laravel-authentication-acl": "1.3.*", 
    

    change to :

    "jacopo/laravel-authentication-acl": "1.3.11",
    

Done! now if you run composer update this package not update.

like image 57
Hamid Naghipour Avatar answered Oct 13 '22 22:10

Hamid Naghipour


From my experience, the best way to exclude 1 or some packages is to use --interactive in composer update.

$ composer update --interactive

When you do this you can select which package you want to update and skip the package that you don't want to update.

like image 26
arungisyadi Avatar answered Oct 13 '22 22:10

arungisyadi