From Fedora Project Wiki
Warning.png
Traduzione incompleta; fare riferimento alla pagina in lingua inglese.

Cos'é il 'DNF system upgrade'

dnf-plugin-system-upgrade è un plugin per il manager di pacchetti dnf che gestisce gli aggiornamenti di sistema. É il metodo di aggiornamento raccomandato per le versioni di Fedora superiori alla 21.

Funzionamento

Il 'DNF system upgrade' aggiorna il sistema ad una nuova versione di Fedora usando un meccanismo simile a quello usato per gli aggiornamenti in locale (offline). I pacchetti aggiornati vengono scaricati mentre il sistema funziona normalmente, per poi riavviarsi in una modalità adatta ad installarli. Una volta terminato, il sistema si riavvìa di nuovo nella nuova Fedora.

Come si usa

  1. Backup dei propri dati. Ogni cambiamento del sistema è potenzialmente a rischio, quindi essere prepararsi all'eventualità. Nel caso si voglia aggiornare la propria (Fedora) workstation, è ancora preferibile scaricare una immagine live della Workstation ed assicurarsi che il proprio hardware (scheda grafica, wifi, etc) funzioni bene con l'ultimo kernel disponibile.
  2. Aggiornare il sistema usando gli strumenti grafici standard oppure pkcon o dnf:
    $ sudo dnf update --refresh

    É raccomandato riavviare il computer, specie se viene installato un nuovo kernel.
    Si prega di tener presente che esiste un problema se si usa un tema plymouth non predefinito.

    Seguire i seguenti passaggi.

  3. Installare Package-x-generic-16.pngdnf-plugin-system-upgrade:
    $ sudo dnf install dnf-plugin-system-upgrade
  4. Scaricare i pacchetti aggiornati:
    $ sudo dnf system-upgrade download --refresh --releasever=39

    Modificare il numero --releasever= in base al sistema a cui si vuole aggiornare. Molti utenti aggiornano all'ultimo sistema stabile disponibile, cioé 39, ma se si usa una Fedora 37, si potrebbe voler aggiornare ad una Fedora 38. Si può anche usare 40 oppure rawhide per avere una Rawhide (attenzione: queste sono versioni instabili di Fedora).

    • Se alcuni pacchetti hanno dipendenze insoddisfatte, l'aggiornamento non andrà avanti a meno che non si usi l'opzione --allowerasing. Spesso accade se si usano pacchetti provenienti da scaricamenti esterni a quelli ufficiali.
    • In caso di dipendenze insoddisfatte, si possono avere ulteriori dettagli aggiungendo l'opzione --best.
  5. Innescare il processo di aggiornamento:
     $ sudo dnf system-upgrade reboot

    Il sistema verrà riavviato immediatamente, ed apparirà il processo di aggiornamento all'avvìo.

  6. Attenderne il completamento.

FAQ

Come riportare eventuali bug

Innanzitutto dare uno sguardo ai Common F39 bugs o Common F40 bugs per controllare se il problema è già conosciuto. Se non c'é, fare una ricerca per un eventuale bug report esistente. Se non esiste ancora, se ne può aprire uno seguendo le istruzioni nel file README ed in man dnf.plugin.system-upgrade.

Se si incontrano problemi con uno specifico pacchetto, aprire un bug report riferito a quello stesso RPM.

Il 'DNF system upgrade' verifica il software in esecuzione o quello che installa durante l'aggiornamento ?

Sì. Le chiavi firmate per i nuovi rilasci di Fedora vengono inviati al vecchio sistema in modo da permettere a dnf di verificare l'integrità dei pacchetti scaricati. É possibile scaricare questa funzione con il parametro --nogpgcheck (non raccomandato, il sistema sarebbe poi vulnerabile ad attacchi di software malevole).

I pacchetti da repository non-fedora verranno aggiornati ?

Sì, se impostati come repository per dnf. I repository non-fedora comunemente usati di solito funzionano, ma meglio verificare che siano già disponibili i pacchetti adatti alla nuova versione di Fedora. In caso contrario non impedirebbe il completamento dell'aggiornamento.

Posso usare questa procedura per aggiornamenti a versioni non-stabili di Fedora (ad esempio ad un rilascio Beta) ?

Sì. Sarebbe sempre possibile farlo, tuttavia questa funzione potrebbe essere soggetta a malfunzionamenti temporanei proprio per la natura non-stabile dei pacchetti.

Operazioni optionali post-aggiornamento

Queste sono operazioni che è possibile fare dopo un aggiornamento avvenuto con successo. Sono da utilizzare per utenti esperti, se non si è abituati ad usare un terminale non bisogna preoccuparsi.

Aggiornamento dei file di configurazione di sistema

La maggior parte dei file di configurazione sono immagazzinati in /etc. Se c'é qualche aggiornamento e questi file sono stati modificati prima, RPM creerà nuovi file con il suffisso .rpmnew (il nuovo file config), oppure con .rpmsave (il vecchio file config conservato). É possibile cercarli per recuperare le modifiche apportate precedentemente. rpmconf è uno strumento che aiuta in questa operazione:

$ sudo rpmconf -a

Pulizia dai vecchi pacchetti

You can see list of packages with broken dependencies like this:

$ sudo dnf repoquery --unsatisfied

Ideally there should be none. If there are some, consider removing them, because they are not likely to work properly anyway.

You can see duplicated packages (packages with multiple versions installed) like this:

$ sudo dnf repoquery --duplicated

For ordinary packages, just the latest version should be installed. But there can be exceptions to the rule, only remove what you are sure you no longer need.

Some packages might stay on your system while they have been removed from the repositories. See them using:

$ sudo dnf list extras

If you don't use these, you can consider removing them. Please note that this list is only valid if you have a fully updated system. Otherwise you'll see all installed packages which are no longer in the repositories, because there is a newer update available. So before acting on these, make sure you have run sudo dnf update and generate the list of extra packages again. Also, this list might contain packages installed from third-party repositories for which an updated repository hasn't been published yet. This often involves e.g. RPM Fusion or Dropbox.

You can remove no-longer-needed packages using:

$ sudo dnf autoremove

Please note that dnf decides that a package is no longer needed if you haven't explicitly asked to install it and nothing else requires it. That doesn't mean that package is not useful or that you don't use it. Only remove what you know you don't need. Please note that there's a known bug in PackageKit which doesn't mark packages as user-installed, see bug 1259865. If you use PackageKit (or GNOME Software, Apper, etc) for installation, this output might list even important apps and system packages, so beware.

Resolving post-upgrade issues

Only follow up these steps if you have troubles with your upgraded system. It should not be needed in the vast majority of upgrades.

Rebuilding RPM database

If you see warnings when working with RPM/DNF tools, your database might have gotten corrupted for some reason. It is possible to rebuild it and see if resolves your issues. Always back up /var/lib/rpm/ first. To rebuild the database, run:

$ sudo rpm --rebuilddb

Using distro-sync to resolve dependency issues

The system upgrade tool uses distro-sync method by default. If your system stayed partly unupgraded or you see some package dependency issues, you might try to fix it by running another distro-sync manually. This tries to make your installed packages exactly the same version as in currently enabled repositories, even if it meant downgrading some packages:

$ sudo dnf distro-sync

A stronger variant also allows to remove package for which package dependencies can't be satisfied. Always carefully review which packages are going to be removed before confirming this:

$ sudo dnf distro-sync --allowerasing

Relabel files with latest SELinux policy

If you see warnings that some actions were not allowed because of current SELinux policy, it might be a case of having some files incorrectly label with SELinux permissions. This might happen in case of some bug or if you had SELinux disabled in some point of time in the past. You can relabel the whole system by running:

$ sudo touch /.autorelabel

and rebooting. The next boot will take a long time and will check and fix all SELinux labels on all your files.