I created 2 (but planning to create 999 :) ) extensions and a meta package for it.

The meta package extension contains only composer.json`

    "name": "sergei/module-main",
    "version": "1.0.0",
    "type": "metapackage",
    "require": {
        "sergei/module-one": "1.0.0",
        "sergei/module-two": "1.0.0"      

For installation I run composer require sergei/module-main and all of required modules

sergei/module-one (Sergei_One in registration.php)
sergei/module-two (Sergei_Two in registration.php)

were successfully installed.

Each of these modules has Setup/Uninstall.php

In vendor directory metapackage (suppose sergei/module_main) was't added and I cannot run bin/magento module:uninstall Sergei_Main

How can I run bin/magento module:uninstall for meta package?

I run bin/magento module:uninstall Sergei_One Sergei_Two - it works, but this method is ugly for me:

Sergei_One and Sergei_Two (... planning to create 999+ extensions...)) were deleted, but link to the meta package extension remain in the composer.json file.

1 Answer 1


I assume you will have at least one module that is a dependency to other modules.
I mean one that is required by every other module directly or indirectly.
You can create your own console command in this module that removes all the installed modules.
Here is a nice tutorial that shows you how to create a command.
Just create something that can be executed like bin/magento sergei:uninstall that collects all your modules and runs bin/magento module:uninstall with all the module names as parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.