Upgrade da Lenny a Squeeze: Difference between revisions

From RVM Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 321: Line 321:


  /tmp/confronta /etc/nomefile
  /tmp/confronta /etc/nomefile
==Fancontrol==
* Verificare se ci sono sensori
sudo sensors-detect
* Abilitare
sudo pwnconfig
* Se non ci sono sensori, rimuovere:
sudo apt-get remove --purge fancontrol


==Verifica aggiornamento grub2==
==Verifica aggiornamento grub2==
Line 386: Line 396:
* Se non si desidera più utilizzare il proxy per APT, eliminarlo dalla configurazione:
* Se non si desidera più utilizzare il proxy per APT, eliminarlo dalla configurazione:
  sudo sed -i '/Acquire::http::Proxy/d' /etc/apt/apt.conf
  sudo sed -i '/Acquire::http::Proxy/d' /etc/apt/apt.conf
* Commit etc
cd /etc
sudo ~/bin/svnaddmissing
sudo ~/bin/svndelmissing
sudo svn ci -m "* First Squeeze commit"


* sudo reboot
* sudo reboot
Line 391: Line 407:
==Altro==
==Altro==


Expected removals
* dhcp3 (replaced by isc-dhcp)
dhcp3 (replaced by isc-dhcp)


During the upgrade, you will normally have been offered the option to "chainload" GRUB 2: that is, to keep GRUB Legacy as the primary boot loader but to add an option to it to load GRUB 2 and then start your Debian GNU/Linux system from that. This allows you to verify that GRUB 2 works on your system before committing to use it permanently.
D* uring the upgrade, you will normally have been offered the option to "chainload" GRUB 2: that is, to keep GRUB Legacy as the primary boot loader but to add an option to it to load GRUB 2 and then start your Debian GNU/Linux system from that. This allows you to verify that GRUB 2 works on your system before committing to use it permanently.


Once you have confirmed that GRUB 2 works, you should switch to using it properly: the chainloading setup is only intended to be used temporarily. You can do this by running upgrade-from-grub-legacy.
Once you have confirmed that GRUB 2 works, you should switch to using it properly: the chainloading setup is only intended to be used temporarily. You can do this by running upgrade-from-grub-legacy.


4.9. Obsolete packages
* mysql-server-5.0, successor is mysql-server-5.1.
To remove automatically installed packages that are no longer used, run:


# apt-get autoremove
* Munin web path change
 
mysql-server-5.0, successor is mysql-server-5.1.
 
5.8. Munin web path change


For squeeze, the default location for the generated web content of munin has been changed from /var/www/munin to /var/cache/munin/www and therefore /etc/munin/munin.conf needs to be adapted on upgrades, if it has been changed by the admin. If you are upgrading, please read /usr/share/doc/munin/NEWS.Debian.gz.
For squeeze, the default location for the generated web content of munin has been changed from /var/www/munin to /var/cache/munin/www and therefore /etc/munin/munin.conf needs to be adapted on upgrades, if it has been changed by the admin. If you are upgrading, please read /usr/share/doc/munin/NEWS.Debian.gz.
The system will automatically select for installation hardware-specific packages when they are appropriate. This is achieved through the use of discover-pkginstall from the discover package.
This release of the installer supports the use of the ext4 file system
To install Debian on hardware that needs non-free firmware, you can either provide the firmware yourself during installation or use pre-made non-free CDs/DVDs which include the firmware. See the Getting Debian section on the Debian website for more information.

Revision as of 14:44, 11 May 2011

Guida completa

Backup del Sistema

Come sempre ...

  • Fare una copia di comodo locale della etc:
sudo mkdir -p /files; sudo tar --exclude=.svn -cvf /files/etc.tar /etc
  • Se la etc è sotto versioning
cd /etc; sudo svn ci

Preconfigurazione APT

  • Aggiornare all'ultimo rilascio di etch:
sudo apt-get update && sudo apt-get dist-upgrade

Pulizia Pacchetti

  • Rimuovere i pacchetti non necessari
  • Marcare come non rimovibili da deborphan i pacchetti al bisogno
if (dpkg -l | grep -q avg85flx) && (uname -a | grep -q x86_64 ) ; then sudo  deborphan -A libc6-i386 ; fi
  • Rimuovere i pacchetti che non hanno dipendenze necessarie:
if [ ! -e /usr/bin/deborphan ]; then sudo aptitude install deborphan; fi
if [ -z "$(deborphan)" ]; \
  then \
      echo "Nothing to Remove"; \
  else \
     sudo apt-get remove --purge $(deborphan)
fi
sudo apt-get --purge  autoremove
  • Rimuovere le configurazione dei pacchetti disinstallati:
 
if [ -z "$(dpkg -l | grep ^rc | tr -s ' ' | cut -f 2 --delim=' ')" ]; \
  then \
      echo "Nothing to Purge"; \
  else \
      sudo dpkg --purge $(dpkg -l | grep ^rc | tr -s ' ' | cut -f 2 --delim=' '); \
fi

Disabilitazione Pinning APT

Svuotare, se non si usano backports particolari, il file /etc/apt/preferences

cat /etc/apt/preferences
sudo rm /etc/apt/preferences
sudo touch /etc/apt/preferences


Verifica Stato Pacchetti

  • Verificare se ci sono pacchetti con problemi di installazione:
dpkg --audit
  • Verificare se ci sono pacchetti in HOLD per aptitude:
sudo aptitude search "~ahold" | grep "^.h"
  • Per apt-get:
sudo dpkg --get-selections | grep hold
  • Toglierli dallo stato HOLD con
sudo aptitude unhold package_name


  • Sostituire "lenny" con "squeeze" in /etc/apt/sources.list
sudo sed -i 's/lenny/squeeze/g' /etc/apt/sources.list
  • Sostituire il repository volatile con squeeze-updates
sudo sed -i 's/^deb.*volatile.*$/deb http:\/\/ftp.it.debian.org\/debian squeeze-updates main contrib non-free/' /etc/apt/sources.list
  • La lista delle sorgenti dovrebbe essere simile a:
sudoedit /etc/apt/sources.list
deb http://ftp.it.debian.org/debian/ squeeze main non-free contrib
#deb-src http://ftp.it.debian.org/debian/ squeeze main non-free contrib

deb http://security.debian.org/ squeeze/updates main contrib non-free
#deb-src http://security.debian.org/ squeeze/updates main contrib non-free

deb http://ftp.it.debian.org/debian squeeze-updates main contrib non-free
deb-src http://ftp.it.debian.org/debian squeeze-updates main contrib non-free

deb http://support.rvmgroup.it/debian           binary/

Verifica Dimensione Cache APT

  • Pulire la cache apt
sudo apt-get clean
  • Impostare un valore alto per la cache APT se serve:
cat /etc/apt/apt.conf
echo 'APT::Cache-Limit "12500000";' | sudo tee -a /etc/apt/apt.conf >/dev/null

Altrimenti RIMUOVERE questo limite.

sudo rm /etc/apt/apt.conf ; sudo touch /etc/apt/apt.conf


Impostazione Proxy APT

Se si prevede di aggiornare più macchine, impostare l'utilizzo del proxy per apt:

echo "Acquire::http::Proxy \"http://proxy.$(cat /etc/resolv.conf | grep search | cut -f 2 --delim=' '):3128\";" | sudo tee -a /etc/apt/apt.conf

Accorgimenti

  • NON fare l'upgrade da un collegamento VPN, perchè verrà interrotto
  • Direct upgrades from Debian releases older than 5.0 (lenny) are not supported. Please follow the instructions in the Release Notes for Debian GNU/Linux 5.0 to upgrade to 5.0 first.
  • Script per merge delle configurazioni sovrascritte:
cat > /tmp/confronta <<'EOFile'
#!/bin/bash
sudo vimdiff $1.dpkg-old $1
EOFile

chmod +x /tmp/confronta

Uso:

/tmp/confronta /etc/nomefile


  • Avviare la registrazione della sessione:
script -t 2>>~/upgrade-squeeze.time -a ~/upgrade-squeeze.script


Scaricamento pacchetti

  • Aggiornare le nuove fonti APT:
sudo aptitude update
  • Scaricare i pacchetti necessari:
sudo apt-get dist-upgrade -d

Aggiornamento APT

sudo apt-get install apt apt-listchanges

Aggiornamento Kernel

  • Identificare i kernel installati
dpkg -l "linux-image*" | grep ^ii
  • Identificare il kernel in uso
uname -r
  • Installare i firmware non free per ogni hardware che li necessita :
sudo aptitude install firmware-linux-nonfree firmware-realtek

  • Installare la versione più recente nel caso di kernel standard, oppure quello adeguato:
sudo apt-get install linux-image-2.6-686
  • Make sure that update-grub is run as part of the kernel upgrade, or run it manually:
sudo update-grub
  • Aggiornare udev
sudo apt-get install udev
  • Nel caso di dischi SCSI o lenti ad essere identificati, che potrebbero dare un errore di root non montabile, aggiungere il flag di boot al kernel
rootdelay=9
  • Nel caso si utilizzino dischi PATA e sia attivo il il raid software, assicurarsi che gli array siano definiti con i nomi sdX:
sudo sed -i 's@/dev/hd@/dev/sd@g' /etc/mdadm/mdadm.conf
  • Nel caso si utilizzino dischi PATA e si utilizza smart, assicurarsi che i dischi siano definiti con i nomi sdX:
 sudoedit /etc/smartd.conf

Aggiornamento MySQL

  • Proporrà la rimozione della versione 5.0:
sudo aptitude install mysql-server mysql-client

Aggiornamento Postfix

  • Aggiornare, se serve anche con mysql:
sudo apt-get install postfix postfix-mysql
  • La versione attuale non supporta più l'elenco delle opzioni su più righe. Ad esempio, formattare le opzioni come:
sudoedit /etc/postfix/main.cf
mynetworks = 127.0.0.0/8, 192.168.15.254


Aggiornamento base

  • Aggiornare i pacchetti che non richiedono rimozioni, oppure proseguire con i singol:
sudo apt-get upgrade


Aggiornamento restanti pacchetti

  • Aggiornare gli altri pacchetti:
sudo apt-get dist-upgrade
  • Se rimangono dei pacchetti held back, aggiornarli usando ancora
sudo apt-get dist-upgrade

oppure

sudo apt-get -f install package

oppure, VERIFICANDO le eventuali rimozioni proposte

sudo aptitude dist-upgrade

Modifiche configurazioni

Aggiornamento amanda

  • Togliere la direttiva tapebufs, deprecata
sudo sed -i 's/^tapebufs/#tapebufs/' /etc/amanda/DailySet1/amanda.conf
sudo sed -i  's/^rawtapedev/#rawtapedev/' /etc/amanda/DailySet1/amanda.conf

Aggiornamento dhcp3-server

Il pacchetto è sostituito da

isc-dhcp-server

La configuration directory diventa

/etc/dhcp

Il file di default configuration è

/etc/default/isc-dhcp-server

Il file init.d è

/etc/init.d/isc-dhcp-server

Aggiornamento nut

  • I files di configurazione usano delle nuove direttive, cambiate come segue.
  • ACL ACCEPT e REJECT non si usano più. Si usa listen:
sudoedit /etc/nut/upsd.conf
LISTEN 127.0.0.1 3493
LISTEN 192.168.x.x 3493
  • allowfrom non si usa più, perchè lagestione degli accessi via ip è demandata a tcp-wrappers, togliere quindi da
sudoedit /etc/nut/upsd.users
allowfrom = localhost

Aggiornamento fetchmail

  • È necessario inserire il parametro bad-header, altrimenti i messaggi mal formattati verranno skippati:
sudoedit /etc/fetchmailrc
poll server.name.dom
   bad-header accept

Aggiornamento configurazione dovecot

  • Utilizza ucf, quindi il confronta non va:
cd /etc/dovecot
sudo vimdiff dovecot.conf.ucf-old dovecot.con
sudo invoke-rc.d dovecot restart

Aggiornamento Configurazione postgrey

sudo sed -i 's/check_policy_service inet:127.0.0.1:60000/check_policy_service inet:127.0.0.1:10023/' /etc/postfix/main.cf

Migrazione concurrent boot

Se la migrazione al nuovo sistema non avviene automaticamente, rilanciare la migrazione e leggere gli errori:

sudo dpkg-reconfigure sysv-rc
  • Se ci sono errori tipo
package packagename removed but not purged

è necessario purgare il pacchetto

sudo aptitude purge packagename
  • Se ci sono errori tipo:
insserv: warning: script 'firewall' missing LSB tags and overrides

Aggiungere un'intestazione LSB allo script, tipo:

sudoedit /etc/init.d/firewall
#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          firewall
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     S
# Default-Stop:      0 1 6
# X-Interactive:     false
# Short-Description: Start/stop iptables firewall
### END INIT INFO
# sudo update-rc.d firewall start 43 S . stop 32 0 . stop 32 1 . stop 32 6 .

Disabilitazione errore pcspkr

Amavisd-new e AVG

Come scritto in Installazione e configurazione di AVG su Debian, impostare l'uso con socket

sudoedit /etc/amavis/conf.d/15-av_scanners

 ['AVG Anti-Virus',
  \&ask_daemon, ["SCAN {}\n", '/opt/avg/avg8/var/run/avgsocket'],
  qr/^200/m, qr/^403/m, qr/^403 .*?: ([^\r\n]+)/m ],

Pulizia modprobe.d

sudo svn delete /etc/modprobe.d/arch/

Aggiornamento configurazione locale

cat /etc/environment

sudoedit /etc/default/locale
sudo rm /etc/environment

Merge delle configurazioni sovrascritte

Usare lo script:

cat > /tmp/confronta <<'EOFile'
#!/bin/bash
sudo vimdiff $1.dpkg-old $1
EOFile

chmod +x /tmp/confronta
/tmp/confronta /etc/nomefile

Fancontrol

  • Verificare se ci sono sensori
sudo sensors-detect
  • Abilitare
sudo pwnconfig
  • Se non ci sono sensori, rimuovere:
sudo apt-get remove --purge fancontrol

Verifica aggiornamento grub2

  • Se non si aggiorna grub2, fare
sudo apt-get install -f grub
  • Riavviare
sudo reboot
  • Se tutto è ok, passare a grub2
sudo upgrade-from-grub-legacy
  • Impostare la modalità testuale e l'impostazione della root come device name
sudo sed -i 's/^#GRUB_DISABLE_LINUX_UUID=true/GRUB_DISABLE_LINUX_UUID=true/; s/^#GRUB_TERMINAL=console/GRUB_TERMINAL=console/' /etc/default/grub
sudo update-grub
  • Riavviare
sudo reboot
  • Se il boot ha successo, eliminare i vecchi files di configurazione:
sudo rm -f /boot/grub/menu.lst*

Migrazione ext4

Pulizia pacchetti

  • Rimuovere i vecchi kernel:
dpkg -l | grep linux-image | tr -s ' ' | cut -f 2 --delim=' ' | sort

sudo apt-get remove --purge linux-image-2.6.26-2-686 package_name
  • Se non servono, rimuovere i seguenti pacchetti:
sudo apt-get remove --purge portmap avahi-daemon avahi-utils dbus
  • Rimuovere i pacchetti auto non necessari
sudo apt-get autoremove --purge
  • Rimuovere i pacchetti che non hanno dipendenze necessarie:
 
if [ -z "$(deborphan)" ]; \
  then \
      echo "Nothing to Remove"; \
  else \
     sudo apt-get remove --purge $(deborphan)
fi
  • Rimuovere le configurazione dei pacchetti disinstallati:
 
if [ -z "$(dpkg -l | grep ^rc | tr -s ' ' | cut -f 2 --delim=' ')" ]; \
  then \
      echo "Nothing to Purge"; \
  else \
      sudo dpkg --purge $(dpkg -l | grep ^rc | tr -s ' ' | cut -f 2 --delim=' '); \
fi
sudo aptitude purge ~c

  • Se non si desidera più utilizzare il proxy per APT, eliminarlo dalla configurazione:
sudo sed -i '/Acquire::http::Proxy/d' /etc/apt/apt.conf
  • Commit etc
cd /etc
sudo ~/bin/svnaddmissing
sudo ~/bin/svndelmissing
sudo svn ci -m "* First Squeeze commit"
  • sudo reboot

Altro

  • dhcp3 (replaced by isc-dhcp)

D* uring the upgrade, you will normally have been offered the option to "chainload" GRUB 2: that is, to keep GRUB Legacy as the primary boot loader but to add an option to it to load GRUB 2 and then start your Debian GNU/Linux system from that. This allows you to verify that GRUB 2 works on your system before committing to use it permanently.

Once you have confirmed that GRUB 2 works, you should switch to using it properly: the chainloading setup is only intended to be used temporarily. You can do this by running upgrade-from-grub-legacy.

  • mysql-server-5.0, successor is mysql-server-5.1.
  • Munin web path change

For squeeze, the default location for the generated web content of munin has been changed from /var/www/munin to /var/cache/munin/www and therefore /etc/munin/munin.conf needs to be adapted on upgrades, if it has been changed by the admin. If you are upgrading, please read /usr/share/doc/munin/NEWS.Debian.gz.