LinuxMCE Forums
May 24, 2013, 03:26:34 am GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Kubuntu prep script for 8.10 installs  (Read 2042 times)
l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« 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:
#!/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:
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


« Last Edit: February 19, 2011, 04:20:09 pm by l3mce » Logged

I never quit... I just ping out.
l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« Reply #1 on: February 20, 2011, 01:48:06 am »

Better script.
Code:
#!/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.
« Last Edit: February 20, 2011, 05:50:55 pm by l3mce » Logged

I never quit... I just ping out.
aico
Veteran
***
Posts: 74


View Profile
« Reply #2 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
Logged
l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« Reply #3 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.
Logged

I never quit... I just ping out.
rperre
Guru
****
Posts: 264


View Profile
« Reply #4 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
Logged

l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« Reply #5 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.
« Last Edit: February 20, 2011, 07:44:14 pm by l3mce » Logged

I never quit... I just ping out.
l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« Reply #6 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
Logged

I never quit... I just ping out.
l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« Reply #7 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)
Logged

I never quit... I just ping out.
ardirtbiker
Guru
****
Posts: 217



View Profile
« Reply #8 on: February 28, 2011, 02:44:42 am »

funny map!!!
Logged
microchip
Making baby steps

Posts: 2


View Profile
« Reply #9 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 )
« Last Edit: March 26, 2011, 02:13:30 pm by microchip » Logged
l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« Reply #10 on: March 26, 2011, 10:34:43 pm »

This script is now obsolete. The latest snaps have the correct sources.list
Logged

I never quit... I just ping out.
microchip
Making baby steps

Posts: 2


View Profile
« Reply #11 on: March 28, 2011, 11:01:29 pm »

Mine didn't when I went to run the LinuxMCE installer, had gb.archive in front of everything, at least for the Ubuntu archives.
Logged
l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« Reply #12 on: March 29, 2011, 03: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.
Logged

I never quit... I just ping out.
l3mce
NEEDS to work for LinuxMCE
***
Posts: 1031



View Profile
« Reply #13 on: March 31, 2011, 10: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.
« Last Edit: April 01, 2011, 11:16:40 pm by l3mce » Logged

I never quit... I just ping out.
posde
Administrator
LinuxMCE God
*****
Posts: 2621


Wastes Life On LinuxMCE Since 2007


View Profile WWW
« Reply #14 on: April 02, 2011, 10:26:41 am »

The script has been incorporated into svn, and snapshots > 23872 should have it included automatically.

Thanks l3mce
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!