Better script.
#!/bin/bash
n1=$(grep -e 'security.' -e 'archive.' /etc/apt/sources.list | wc -l) #looks for references that shouldn't be there and counts them
o1=0;
if [ "$n1" -gt "$o1" ] ; then echo "Changing Repositories"
sed -i.backup -e 's/us.archive/old-releases/' -e 's/security.ubuntu/old-releases.ubuntu/' -e 's/\/archive/\/old-releases/' /etc/apt/sources.list; #changes us.archive, security.ubuntu, and /archive to old-releases
< /etc/apt/sources.tmp
else
echo "Repositories correct, running update."
fi
sort -u /etc/apt/sources.list > /etc/apt/sources.tmp; #removes duplicates in temp file
cat /etc/apt/sources.tmp > /etc/apt/sources.list; #rewrites sources.list without duplicates
apt-get update
n1=$(grep -e 'security.' -e 'archive.' /etc/apt/sources.list | wc -l) #looks for references that shouldn't be there and counts them
o1=0;
if [ "$n1" -gt "$o1" ] ; then echo "Changing Repositories"
sed -i.backup -e 's/us.archive/old-releases/' -e 's/security.ubuntu/old-releases.ubuntu/' -e 's/\/archive/\/old-releases/' /etc/apt/sources.list; #changes us.archive, security.ubuntu, and /archive to old-releases
< /etc/apt/sources.tmp
sort -u /etc/apt/sources.list > /etc/apt/sources.tmp; #removes duplicates in temp file
cat /etc/apt/sources.tmp > /etc/apt/sources.list; #rewrites sources.list without duplicates
else
echo "Repositories correct, running dist-upgrade"
fi
apt-get dist-upgrade -ydu --force-yes
n1=$(grep -e 'security.' -e 'archive.' /etc/apt/sources.list | wc -l) #looks for references that shouldn't be there and counts them
o1=0;
if [ "$n1" -gt "$o1" ] ; then echo "Changing Repositories"
sed -i.backup -e 's/us.archive/old-releases/' -e 's/security.ubuntu/old-releases.ubuntu/' -e 's/\/archive/\/old-releases/' /etc/apt/sources.list; #changes us.archive, security.ubuntu, and /archive to old-releases
< /etc/apt/sources.tmp
else
echo "Repositories Correct."
fi
sort -u /etc/apt/sources.list > /etc/apt/sources.tmp; #removes duplicates in temp file
cat /etc/apt/sources.tmp > /etc/apt/sources.list; #rewrites sources.list without duplicates
#echo "Installing LMCE"
#env
#sad=$SUDO_USER
#sh /home/$sad/Desktop/LinuxMCE
Can, but do not wish to launch install prog... would rather instantiate the rest of the processes from here, or push the button.