This is a little script I wrote for those of us who install a lot.
It looks for references in sources.list that should not be there and changes them.
It then removes any duplicates.
It then performs update and then dist-upgrade.
It then starts the LMCE install.
This is not fully tested as of this second (am fresh installing now)... but it will not do any harm if it bombs.
Feel free to test, and post your results.
#!/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
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 update, and dist-upgrade"
fi
apt-get update && apt-get dist-upgrade -ydu --force-yes
#echo "Installing LMCE"
#env
#sad=$SUDO_USER
#sh /home/$sad/Desktop/LinuxMCE
Save as something.sh
sudo chmod +x something.sh
sudo ./something.sh
Any feedback is welcome.
Spawning the installer appears to break things, so have commented out.
http://svn.linuxmce.org/trac.cgi/ticket/1003
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.
Hi,
I have tested both scripts but I can not connect to http://fastspeedtest.net
I have tryed to connect to http://fastspeedtest.net using FireFox and it tells me that it is not possible to connect to the site.
Anyone else having this problem?
Regards
Johannes
Quote from: aico on February 20, 2011, 08:14:02 AM
Hi,
I have tested both scripts but I can not connect to http://fastspeedtest.net
I have tryed to connect to http://fastspeedtest.net using FireFox and it tells me that it is not possible to connect to the site.
Anyone else having this problem?
Regards
Johannes
This script should not affect your ability to connect to any websites, only what is available for install.
fastspeed.net must have taken the 0810 repo mirror down. Don't worry about it, use the old-releases in your sources.list
Richard
Had a small oversight. Corrected.
Script works well... but leaves sources LMCE does not require. Will hone it down to what is needed.
*juast noticed dist-upgrade works in download only mode. will tweak.
More changes, works well, but will eliminate unneeded repos. Also added the Dolphin's Places script to beginning to add LMCE folders.
http://svn.linuxmce.org/trac.cgi/attachment/ticket/1003/repoplaces.sh?format=raw
http://svn.linuxmce.org/trac.cgi/attachment/ticket/1003/repoplaces.4.sh?format=raw
Should be just about finished as a pre-install script.
No longer dist-upgrades in download only mode. Much cleaner process, and now works in any country (silly Americans forget)
(http://1.bp.blogspot.com/_wxZUnN00WM4/SxKhe-2xMwI/AAAAAAAABY0/cOdoXjAQJHs/s1600/the-world-according-to-americans.jpg)
funny map!!!
Minor bug spotted on line 40 - sed is set to work on /home/rec/code/sources.list instead of /etc/apt/sources.list, so it's not updating properly.
Edit: Ah, this has already been updated, under http://svn.linuxmce.org/trac.cgi/attachment/ticket/1003/repoplaces.4.2.sh?format=raw
I assume that double slash wouldn't break anything? ( /etc/apt//sources.list )
This script is now obsolete. The latest snaps have the correct sources.list
Mine didn't when I went to run the LinuxMCE installer, had gb.archive in front of everything, at least for the Ubuntu archives.
Well then let me try and fix this script. It did not produce the results I wanted... and sort of forgot about it on hearing that it was no longer needed...
Thank you for the feedback.
http://svn.linuxmce.org/trac.cgi/attachment/ticket/1003/repoplaces.5.2.sh?format=raw
Fixed. (again) Should work like a charm now.
It should be noted that IF your sources are correct, this will not affect them. This does not just overwrite the sources.list with the list from the wiki... it actively edits your sources to replace prefixes. The install script process will add the appropriate linuxmce specific sources at the appropriate times.
So to recap, the script:
Adds a folder to Dolphins "places" for LMCE.
Fixes sources.list
Runs update/dist-upgrade/autoclean
I leave it to you to push the "Install LMCE" button on the desktop.
The script has been incorporated into svn, and snapshots > 23872 should have it included automatically.
Thanks l3mce