'Magento2 create new sample data

I had a fresh install of Magento2 and was trying to install sample data by bin/magento sampledata:deploy but it gave back error In PluginManager.php(196) : eval()'d code line 188: chmod(): Operation not permitted . There is an error during sample data deployment. Composer file will be reverted .

Do somebody know what have gone wrong ?



Solution 1:[1]

That is probably a permission issue. Go to root

sudo su

Then installed magento directory:

cd var/www/html/{magento Directory}

Run command:

php bin/magento sampledata:deploy

Make sure to run indexing and clean the cache after that:

php bin/magento indexer:reindex
php bin/magento c:f

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Michel_T.