Not sure how much we'll be able to help without examining your system.
It seems strange it's trying to install from Cran even when install.packages(...) is commented out. Do you have any other install.packages(...) calls? Has the line quoted in the error message changed?
The other thing you could try is set up the default cran mirror if you haven't already. The layout in this video will be a bit out of date, but it'll give you an idea where to check.