If your script re-install package, it could be because you have some install.packages command in your script ? Can you check ?
You did not share your script so it is difficult to help you without the detail.
About the warning / question, it is just because a source version is more recent than the available binary, so it asks you which one you one.