Migrare da gNewSense a Trisquel senza reinstallare

Attenzione: L'utilizzo di questo script potrebbe rendere il tuo sistema operativo inutilizzabile. Il tempo richiesto per la eventuale riparazione supera abbondantemente il tempo che impiegheresti a fare una nuova installazione di Trisquel. Fai un backup dei tuoi dati prima di iniziare la seguente procedura! Uomo avvisato mezzo salvato!

L'informazione contenuta in questa pagina e lo script stesso si basano sull'articolo "Migrare da Ubuntu a Trisquel senza reinstallare". Dal momento che gNewSense è una distribuzione completamente libera di GNU, alcuni dei passi contenuti nella guida relativa a Ubuntu sono stati omessi.

Lo script automatizza i passi della procedura necessari alla migrazione da gNewSense a Trisquel senza la re-installazione del sistema operativo. Il set predefinito di pacchetti di Trisquel verrà installato.

Al fine di aggiornare completamente il sistema, potrebbe essere necessario eseguire i comandi sudo aptitude safe-upgrade e sudo aptitude full-upgrade una volta portato a termine il procedimento operato dallo script. Preparati all'insorgenza di eventuali conflitti e differenze tra versioni locali di file di configurazione e quelli forniti dai pacchetti. Il programma di installazione chiederà puntualmente di selezionare la preferenza. Raccomandiamo di esaminare le differenze e di decidere quindi come procedere.

Potrebbe inoltre essere necessario riavviare il computer affinché lo stesso funzioni correttamente, una volta aggiornato.

Copia lo script in un file, nomina il file trisquelize-gnewsense.sh e digita nel terminale sudo sh trisquelize-gnewsense.sh.

Sono disponibili due opzioni di linea di comando.

--no-desktop

Se avviamo lo script con l'opzione precedente, verranno installati i pacchetti “trisquel-base” e “trisquel-base-recommended”, invece di “trisquel” e “trisquel-recommended”. Ciò farà in modo che il risultante sistema operativo sia basato sulla console, il che è conveniente per un server.

--server-kernel

Questa opzione installa “linux-image-server” invece di “linux-image-generic” se l'opzione non viene omessa.

Appunti:

  • Edita le variabili MIRROR, RELEASE ed EDITION secondo la tua preferenza.
  • I contenuti campione di queste variabili sono intesi per la migrazione verso Trisquel 4.0. Lo script è stato testato con gNewSense 3.0 MetaD.
  • Se il tuo disco fisso è crittato assicurati di appuntare su di un foglio la chiave di decrittazione, nel caso che qualcosa vada storto.
  • Raccomandiamo di eseguire un backup dei dati.
  • Lo script contiene alcune linee di testo molto lunghe; appunta le eventuali modifiche.
  • Se qualcosa va storto ed hai bisogno di aiuto, incolla il contenuto di /var/log/trisquelize-gnewsense.log in http://trisquel.pastebin.com e cerca informazione nel forum allegando il link per il log contenuto in pastebin.
  • Raccomandiamo agli utenti di connettersi al canale IRC #trisquel su irc.freenode.org durante il procedimento, nel caso si abbia bisogno di aiuto.
#!/bin/bash
#
#    Copyright (C) 2010  Rubén Rodríguez <name at domain>
#    Copyright (C) 2011  Ivaylo Valkov <name at domain>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 2110-1301 USA
#
 
# Edit this lines if you want to use a different mirror, release or edition.
# Available editions are trisquel and trisquel-mini
MIRROR="http://es.archive.trisquel.info/trisquel/"
RELEASE="taranis"
EDITION="trisquel"

no_desktop=0
server_kernel=0

while test -n "$1"
do 
    # Install console packages, no GUI
    if test "$1" = "--no-desktop"
    then
    echo You are about to convert you distribution to Trisquel.
    echo The resulting system will have only *console* interface - *no* graphical user interface.
    echo Are you sure you want to continue?

    answer=0
    while test $answer != 'y' && test $answer != 'n'
    do
        echo -n Yes/No \(y/n\)\>
        read answer

        answer=$(echo $answer | tr 'A-Z' 'a-z');

        if test $answer = 'n'
        then
        exit 3;
        elif test $answer != 'y'
        then
        echo 
        echo Please type 'y' or 'n'.
        fi

        no_desktop=1;
    done
    fi

    # Install server optimised kernel flavour
    if test "$1" = "--server-kernel"
    then
    server_kernel=1;
    fi

    # Get next argument in $1
    shift 
done

if ! touch /etc/apt/sources.list 2>/dev/null
then
    echo You need to run this script with sudo!
    echo Try: sudo sh $0
    exit 1;
fi

if ! grep -i gnewsense /etc/issue 2>&1 > /dev/null
then
    echo It seems the distribution you are trying to convert to Trisquel is not any version of gNewSense.
    echo Exiting.
    exit 2;
fi


cp /etc/apt/sources.list /etc/apt/sources.list.gnewsense-orig
cat << EOF > /etc/apt/sources.list
deb $MIRROR $RELEASE main
deb $MIRROR $RELEASE-security main
deb $MIRROR $RELEASE-updates main
deb $MIRROR $RELEASE-backports main
deb-src $MIRROR $RELEASE main
deb-src $MIRROR $RELEASE-security main
deb-src $MIRROR $RELEASE-updates main
deb $MIRROR $RELEASE-backports main
EOF

if test -d /etc/apt/sources.list.d
then
    sed -i 's/\(.*\)/#\1/' /etc/apt/sources.list.d/* 2> /dev/null
fi

if test ! -d /etc/apt/preferences.d/
then
    mkdir /etc/apt/preferences.d 2> /dev/null
fi

cat << EOF > /etc/apt/preferences.d/pinning
Package: *
Pin: release o=Trisquel
Pin-Priority: 1001
EOF

if test $no_desktop
then
    META_PACKAGE=${EDITION}-base 
    RECOMMENDED_PACKAGE=${EDITION}-base-recommended
else
    META_PACKAGE=${EDITION}
    RECOMMENDED_PACKAGE=${EDITION}-recommended
fi

if test $server_kernel
then
    KERNEL_IMAGE_PACKAGE=linux-image-server
else
    KENREL_IMAGE_PACKAGE=linux-image-generic
fi

export DEBIAN_FRONTEND=noninteractive
apt-get update 2>&1 | COLUMNS=500 tee /var/log/trisquelize-gnewsense.log
apt-get -y --force-yes install trisquel-keyring 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize-gnewsense.log
apt-key add /var/lib/apt/keyrings/trisquel-archive-keyring.gpg 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize-gnewsense.log
apt-get -y --force-yes dist-upgrade 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize-gnewsense.log
apt-get install -y --force-yes --no-install-recommends $META_PACKAGE $RECOMMENDED_PACKAGE 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize-gnewsense.log
apt-get install -y --force-yes --no-install-recommends $KERNEL_IMAGE_PACKAGE 2>&1 | COLUMNS=500 tee -a /var/log/trisquelize-gnewsense.log
rm /etc/apt/preferences.d/pinning

echo -------------------------------------------
echo All Trisquel packages succesfully installed.

echo -------------------------------------------
echo System succesfully Trisquelized!
echo If you want to use the Trisquel default desktop layout and
echo other gconf settings, run this as user:
echo gconftool --recursive-unset /apps

Revisioni

02/10/2015 - 22:32
SuperTramp83
04/07/2017 - 22:58
moby1984