Try:
for ip in $(seq 1 254); do

If it still doesn't work, look at your sources.list file

Then do apt-get upgrade && apt-get update