美文网首页
Fedora系统升级

Fedora系统升级

作者: 布谷李 | 来源:发表于2018-07-20 17:18 被阅读205次

    根据官方指南,每次建议只升级1个版本,至多每次只能升级2个版本。

    查看当前系统版本

    $ uname -a
    Linux localhost.localdomain 4.1.13-100.fc21.x86_64 #1 SMP Tue Nov 10 13:13:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    

    Fedora 21升级Fedora 27

    Fedora 21先升级Fedora 22

    耗时很长,建议在较好的网络环境下进行

    $ sudo dnf upgrade --refresh
    $ sudo dnf install dnf-plugin-system-upgrade
    $ sudo dnf system-upgrade download --refresh --releasever=22 --allowerasing --setopt=keepcache=1
    

    经常遇到的问题之一:提示GPG-KEY缺失

    Install     257 Packages
    Upgrade    1646 Packages
    Remove        7 Packages
    Downgrade     4 Packages
    Total download size: 1.4 G
    
    warning: /var/lib/dnf/system-upgrade/geos-3.4.2-3.fc22.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8e1431d5: NOKEY
    Curl error (37): Couldn't read a file:// file for file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64 [Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64]
    

    下载RPM-GPG-KEY,下载links

    $ sudo rpm --import '/home/brian/Downloads/RPM-GPG-KEY-rpmfusion-free-fedora-22'
    $ sudo rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-22
    

    更名:

    $ sudo cp RPM-GPG-KEY-fedora-22-x86_64 RPM-GPG-KEY-fedora-x86_64
    

    重新安装

    $ sudo dnf system-upgrade download --refresh --releasever=22 --allowerasing --setopt=keepcache=1
    

    根据提示导入key

    warning: /var/lib/dnf/system-upgrade/geos-3.4.2-3.fc22.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8e1431d5: NOKEY
    Importing GPG key 0x8E1431D5:
     Userid     : "Fedora (22) <fedora@fedoraproject.org>"
     Fingerprint: C527 EA07 A934 9B58 9C35 E1BF 11AD C094 8E14 31D5
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64
    Is this ok [y/N]: y
    Key imported successfully
    ...
    

    启动安装事务,需要很长的时间,请耐心等待。
    更新+重启动

    $ sudo dnf system-upgrade reboot
    

    Fedora 22再升级Fedora 23

    Fedora 22升级Fedora 23,四步即可,等待时间比较长

    sudo dnf update --refresh
    sudo dnf install dnf-plugin-system-upgrade
    sudo dnf system-upgrade download --releasever=23
    sudo dnf system-upgrade reboot
    

    Fedora 23再升级Fedora 25

    更新key,升级,重新启动:

    $ sudo cp RPM-GPG-KEY-fedora-25-x86_64 RPM-GPG-KEY-fedora-x86_64
    
    $ sudo dnf system-upgrade download --refresh --releasever=25 --allowerasing --setopt=keepcache=1
    
    $ sudo dnf system-upgrade reboot
    

    解决错误事务检查错误

    Error: Transaction check error:
      file /usr/share/man/man1/vim.1.gz from install of vim-minimal-2:8.0.617-1.fc24.x86_64 conflicts with file from package vim-common-2:7.4.1868-1.fc22.x86_64
      file /usr/lib64/gstreamer-1.0/libgstopus.so from install of gstreamer1-plugins-base-1.8.3-2.fc24.x86_64 conflicts with file from package gstreamer1-plugins-bad-free-1.6.4-1.fc23.x86_64
    

    删除vim和gstreamer

    $ sudo dnf remove vim
    # dnf remove gstreamer
    

    解决conflicts with file from错误

    # yum -y remove gstreamer1-plugins-bad-free-1.6.4-1.fc23.x86_64
    

    继续下载更新所需库:

    $ sudo dnf system-upgrade download --refresh --releasever=25 --allowerasing --setopt=keepcache=1
    

    启动更新:

    # dnf system-upgrade reboot
    

    查看当前系统版本:

    $ uname -a
    Linux localhost.localdomain 4.13.16-100.fc25.x86_64 #1 SMP Mon Nov 27 19:52:46 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
    

    Fedora 25再升级Fedora 27

    经测试,支持跨版本更新哦。

    $ uname -a
    Linux localhost.localdomain 4.15.15-300.fc27.x86_64 #1 SMP Mon Apr 2 23:14:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
    

    相关文章

      网友评论

          本文标题:Fedora系统升级

          本文链接:https://www.haomeiwen.com/subject/aleqmftx.html