Product SiteDocumentation Site

6.6. Aggiornare da una distribuzione stabile alla successiva

Una delle caratteristiche più note di Debian è la sua capacità di aggiornare il sistema installato da un rilascio stabile a quello successivo: dist-upgrade, un termine ben noto, ha in gran parte contribuito alla reputazione del progetto. Con alcune precauzioni, l'aggiornamento di un computer può richiedere da un minimo di pochi, fino a qualche decina, di minuti a seconda della velocità di scaricamento dai repository dei pacchetti.

6.6.1. Procedura raccomandata

Dal momento che Debian ha un tempo abbastanza lungo per evolvere fra i rilasci stabili, si consiglia di leggere le note di rilascio prima di fare l'aggiornamento.
In this section, we will focus on upgrading a Wheezy system to Jessie. This is a major operation on a system; as such, it is never 100% risk-free, and should not be attempted before all important data has been backed up.
Un'altra buona abitudine che permette un aggiornamento più facile (e veloce) è di riordinare i pacchetti installati e mantenere solo quelli che sono realmente necessari. Strumenti utili per fare questo sono aptitude, deborphan e debfoster (vedere la Sezione 6.2.7, «Tenere traccia dei pacchetti installati automaticamente»). Per esempio, è possibile usare il comando seguente e poi usare la modalità interattiva di aptitude per ricontrollare e aggiustare le rimozioni pianificate:
# deborphan | xargs aptitude --schedule-only remove
Now for the upgrading itself. First, you need to change the /etc/apt/sources.list file to tell APT to get its packages from Jessie instead of Wheezy. If the file only contains references to Stable rather than explicit codenames, the change isn't even required, since Stable always refers to the latest released version of Debian. In both cases, the database of available packages must be refreshed (with the apt update command or the refresh button in synaptic).
Once these new package sources are registered, you should first do a minimal upgrade with apt upgrade. By doing the upgrade in two steps, we ease the job of the package management tools and often ensure that we have the latest versions of those, which might have accumulated bugfixes and improvements required to complete the full distribution upgrade.
Once this first upgrade is done, it is time to handle the upgrade itself, either with apt full-upgrade, aptitude, or synaptic. You should carefully check the suggested actions before applying them: you might want to add suggested packages or deselect packages which are only recommended and known not to be useful. In any case, the front-end should come up with a scenario ending in a coherent and up-to-date Jessie system. Then, all you need is to do is wait while the required packages are downloaded, answer the Debconf questions and possibly those about locally modified configuration files, and sit back while APT does its magic.

6.6.2. Gestire i problemi dopo un aggiornamento

Nonostante i migliori sforzi dei manutentori Debian, un importante aggiornamento di sistema non va sempre liscio come si spera. Le nuove versioni del software possono essere incompatibili con quelle precedenti (per esempio, il loro comportamento predefinito o il loro formato dei dati potrebbe essere cambiato). Inoltre, alcuni bug possono sfuggire, nonostante la fase di sperimentazione, che precede sempre un rilascio di Debian.
Per anticipare alcuni di questi problemi, è possibile installare il pacchetto apt-listchanges, che visualizza le informazioni sui possibili problemi all'inizio dell'aggiornamento di un pacchetto. Queste informazioni sono compilate dai manutentori dei pacchetti e inserite nel file /usr/share/doc/pacchetto/NEWS.Debian a beneficio degli utenti. Leggere questi file (possibilmente attraverso apt-listchanges) dovrebbe aiutare ad evitare brutte sorprese.
You might sometimes find that the new version of a software doesn't work at all. This generally happens if the application isn't particularly popular and hasn't been tested enough; a last-minute update can also introduce regressions which are only found after the stable release. In both cases, the first thing to do is to have a look at the bug tracking system at https://bugs.debian.org/package, and check whether the problem has already been reported. If it hasn't, you should report it yourself with reportbug. If it is already known, the bug report and the associated messages are usually an excellent source of information related to the bug:
  • a volte una soluzione esiste già, ed è disponibile nella segnalazione di bug; si può allora ricompilare localmente una versione corretta del pacchetto non funzionante (vedere la Sezione 15.1, «Rigenerare un pacchetto dai suoi sorgenti»);
  • in altri casi, gli utenti potrebbero aver trovato un modo di superare il problema e condiviso le loro conoscenze al riguardo nelle loro risposte alla segnalazione;
  • in altri casi ancora, un pacchetto corretto potrebbe essere già stato preparato e reso pubblico da parte del manutentore.
Depending on the severity of the bug, a new version of the package may be prepared specifically for a new revision of the stable release. When this happens, the fixed package is made available in the proposed-updates section of the Debian mirrors (see Sezione 6.1.2.3, «Aggiornamenti proposti»). The corresponding entry can then be temporarily added to the sources.list file, and updated packages can be installed with apt or aptitude.
Sometimes the fixed package isn't available in this section yet because it is pending a validation by the Stable Release Managers. You can verify if that's the case on their web page. Packages listed there aren't available yet, but at least you know that the publication process is ongoing.