LinuxMCE Forums

General => Developers => Topic started by: l3mce on February 19, 2011, 06:24:30 am

Title: Kubuntu prep script for 8.10 installs
Post by: l3mce on February 19, 2011, 06:24:30 am
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.

Code: [Select]
#!/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
Code: [Select]
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


Title: Re: Kubuntu prep script for 8.10 installs
Post by: l3mce on February 20, 2011, 01:48:06 am
Better script.
Code: [Select]
#!/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.
Title: Re: Kubuntu prep script for 8.10 installs
Post by: 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
Title: Re: Kubuntu prep script for 8.10 installs
Post by: l3mce on February 20, 2011, 01:55:23 pm
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.
Title: Re: Kubuntu prep script for 8.10 installs
Post by: rperre on February 20, 2011, 04:17:00 pm
fastspeed.net must have taken the 0810 repo mirror down. Don't worry about it, use the old-releases in your sources.list

Richard
Title: Re: Kubuntu prep script for 8.10 installs
Post by: l3mce on February 20, 2011, 05:52:24 pm
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.
Title: Re: Kubuntu prep script for 8.10 installs
Post by: l3mce on February 21, 2011, 05:35:47 pm
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
Title: Re: Kubuntu prep script for 8.10 installs
Post by: l3mce on February 24, 2011, 10:58:45 am
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)
Title: Re: Kubuntu prep script for 8.10 installs
Post by: ardirtbiker on February 28, 2011, 02:44:42 am
funny map!!!
Title: Re: Kubuntu prep script for 8.10 installs
Post by: microchip on March 26, 2011, 01:23:10 pm
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 )
Title: Re: Kubuntu prep script for 8.10 installs
Post by: l3mce on March 26, 2011, 10:34:43 pm
This script is now obsolete. The latest snaps have the correct sources.list
Title: Re: Kubuntu prep script for 8.10 installs
Post by: microchip on March 29, 2011, 12:01:29 am
Mine didn't when I went to run the LinuxMCE installer, had gb.archive in front of everything, at least for the Ubuntu archives.
Title: Re: Kubuntu prep script for 8.10 installs
Post by: l3mce on March 29, 2011, 04:26:13 pm
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.
Title: Re: Kubuntu prep script for 8.10 installs
Post by: l3mce on March 31, 2011, 11:15:54 am
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.
Title: Re: Kubuntu prep script for 8.10 installs
Post by: Marie.O on April 02, 2011, 11:26:41 am
The script has been incorporated into svn, and snapshots > 23872 should have it included automatically.

Thanks l3mce