Upgrade da Lenny a Squeeze
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\";"
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
Aggiornamento base
- Aggiornare le nuove fonti APT:
sudo aptitude update
- Scaricare i pacchetti necessari:
sudo apt-get dist-upgrade -d
- Aggiornare i pacchetti che non richiedono rimozioni:
sudo apt-get upgrade
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:
sudo apt-get install linux-image-2.6-flavor
- 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
- Fare il merge delle configurazioni sovrascritte.
- Reboot
Aggiornamento restanti pacchetti
- Avviare la registrazione della sessione:
script -t 2>>~/upgrade-squeeze.time -a ~/upgrade-squeeze.script
sudo apt-get dist-upgrade
- Se rimangono dei pacchetti held back, aggiornarli usando
sudo aptitude dist-upgrade
oppure
sudo apt-get -f install package
Modifiche configurazioni
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: # Default-Stop: # X-Interactive: false # Short-Description: Start/stop iptables firewall ### END INIT INFO
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/
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
Verifica aggiornamento grub2
- Se non si aggiorna grub2, fare
sudo apt-get install -f grub
- sudo reboot
- Se tutto è ok
sudo upgrade-from-grub-legacy sudo reboot
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 package_name
- Pulizia vecchi files initramfs-tools: vedi Evitare l'errore update-initramfs /boot/initrd.img-x.x.xx-x-xxx does not exist. Cannot update.
- Se non servono, rimuovere i seguenti pacchetti:
sudo apt-get remove --purge fam
sudo apt-get remove --purge portmap
sudo apt-get remove --purge avahi-daemon avahi-utils
sudo apt-get remove --purge dbus
- Rimuovere i pacchetti auto non necessari
sudo apt-get autoremove
- 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
- 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 reboot
Altro
Expected removals 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.
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 To remove automatically installed packages that are no longer used, run:
- apt-get autoremove
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.
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.