Cannot Remove ondrej-php

Sometimes when trying to do a vagrant provision I get an error message cannot remove '/etc/apt/sources.list.d/ondrej-php-*'

When this happens, I need to comment out the line config.vm.provision :shell, :inline => "sudo rm /etc/apt/sources.list.d/ondrej-php-*" in C:\Vagrant\[my-vagrant-box]\scripts\homestead.rb (by putting a # in front of it), then run vagrant provision, then un-comment that line again.

Cannot Remove ondrej-php

2 thoughts on “Cannot Remove ondrej-php

  1. Given it’s running under sudo, the most likely reason for not being able to remove the file would be that it doesn’t exist. If that’s the case, you should be able to just add the `-f` option to `rm` and it’ll work whether or not the file exists to start with.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s