Author Topic: Kubuntu prep script for 8.10 installs  (Read 10003 times)

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Kubuntu prep script for 8.10 installs
« 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


« Last Edit: February 19, 2011, 04:20:09 pm by l3mce »
I never quit... I just ping out.

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« Reply #1 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.
« Last Edit: February 20, 2011, 05:50:55 pm by l3mce »
I never quit... I just ping out.

aico

  • Veteran
  • ***
  • Posts: 74
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« 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

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« 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.
I never quit... I just ping out.

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« 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

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« 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 »
I never quit... I just ping out.

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« 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
I never quit... I just ping out.

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« 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)
I never quit... I just ping out.

ardirtbiker

  • Guru
  • ****
  • Posts: 308
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« Reply #8 on: February 28, 2011, 02:44:42 am »
funny map!!!

microchip

  • Making baby steps
  • Posts: 2
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« 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 »

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« Reply #10 on: March 26, 2011, 10:34:43 pm »
This script is now obsolete. The latest snaps have the correct sources.list
I never quit... I just ping out.

microchip

  • Making baby steps
  • Posts: 2
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« Reply #11 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.

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« Reply #12 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.
I never quit... I just ping out.

l3mce

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1084
    • View Profile
Re: Kubuntu prep script for 8.10 installs
« Reply #13 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.
« Last Edit: April 02, 2011, 12:16:40 am by l3mce »
I never quit... I just ping out.

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Kubuntu prep script for 8.10 installs
« Reply #14 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