Recovering from aborted Fedora 24 upgrade... dnf --installroot...
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2013
    Location
    My house.
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Recovering from aborted Fedora 24 upgrade... dnf --installroot...

    My laptop either died or lost power when I was running dnf system-upgrade download --releasever=24.

    I've now got a mix of F23 and F24 packages on it. It doesn't run, because it is looking for a F24 package that isn't yet installed.

    I'm have F24 live running on the laptop with network access. How do I get it cleaned up ?

    I mounted the laptop hard drive partitions so I have root, boot and home properly set up.

    I know about dnf --installroot=<laptop hard drive root>

    What do I do to clean up my installation ?

  2. #2
    Join Date
    Jul 2013
    Location
    My house.
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from aborted Fedora 24 upgrade... dnf --installroot...

    dnf --installroot=<root> --releasever=24 distrosync got all the packages installed.

    However, it boots to the command line.

    systemctl start gdm allows me to login. Gnome runs. KDE does.

    Another thing, it only shows F23 kernels and it is booting an F23 kernel. An F24 kernel is installed. Why isn't grub showing it and/or booting it ?

    dnf --releasever=24 distro-sync says there is nothing to do.

  3. #3
    Join Date
    Oct 2011
    Posts
    1,917
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from aborted Fedora 24 upgrade... dnf --installroot...

    It would be way easier to just reinstall from scratch. If you decide to repair it here are some tips:

    - chroot from live cd to hard drive install
    - use "dnf repoquery --duplicated" to check which packages are duplicate, save that list and remove either newer or older version of packages by specifying full package name with version numbers
    - repair packages by reinstalling (dnf reinstall) all packages from previous list


    See also: http://forums.fedoraforum.org/showthread.php?p=1766325, http://forums.fedoraforum.org/showthread.php?t=309646

  4. #4
    Join Date
    Jul 2013
    Location
    My house.
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from aborted Fedora 24 upgrade... dnf --installroot...

    My installation isn't as messed up as that.
    dnf repoquery --duplicated
    Last metadata expiration check: 0:52:18 ago on Tue Aug 9 14:23:32 2016.

    It is running gnome just fine with an F23 kernel.

    Why isn't it booting the F24 kernel ? I'm guessing that is why KDE won't run. Grub doesn't even let me select it, yet dnf says that it is installed ?

    ## dnf list kernel
    Last metadata expiration check: 0:55:59 ago on Tue Aug 9 14:23:32 2016.
    Installed Packages
    kernel.x86_64 4.6.4-201.fc23 @updates
    kernel.x86_64 4.6.5-200.fc23 @System
    kernel.x86_64 4.6.5-300.fc24 @System

  5. #5
    Join Date
    Oct 2011
    Posts
    1,917
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from aborted Fedora 24 upgrade... dnf --installroot...

    Glad to hear that.

    Quote Originally Posted by linuxguy123
    ## dnf list kernel
    Last metadata expiration check: 0:55:59 ago on Tue Aug 9 14:23:32 2016.
    Installed Packages
    kernel.x86_64 4.6.4-201.fc23 @updates
    kernel.x86_64 4.6.5-200.fc23 @System
    kernel.x86_64 4.6.5-300.fc24 @System
    If you mean this with "mix of F23 and F24 packages" then that is pretty normal. Dnf keeps last three kernels installed in case the newest ones doesn't boot. Since you've just upgraded there were no F24 kernels, it left Fedora 23 ones.

    By not seeing it in grub menu might mean that it didn't get a chance to rebuild grub, and who knows what else. Reinstalling the kernel should fix all of it.

    Code:
    $ sudo dnf reinstall kernel kernel-core kernel-modules

  6. #6
    Join Date
    Dec 2007
    Location
    Australia
    Posts
    1,891
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from aborted Fedora 24 upgrade... dnf --installroot...

    If grub is not showing the kernels in the grub menu, but the kernels are installed, then you could try and run the config again with one of the following depending on where your .cfg file is:
    Code:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    
    grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

  7. #7
    Join Date
    Oct 2011
    Posts
    1,917
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from aborted Fedora 24 upgrade... dnf --installroot...

    This is what installing package kernel does I believe and much more. Except scripts are using grubby instead.
    Code:
    # This macro defines a %%posttrans script for a kernel package.
    #	%%kernel_variant_posttrans [<subpackage>]
    # More text can follow to go at the end of this variant's %%post.
    #
    %define kernel_variant_posttrans() \
    %{expand:%%posttrans %{?1:%{1}-}core}\
    /bin/kernel-install add %{KVERREL}%{?1:+%{1}} /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz || exit $?\
    %{nil}
    Take a look at /bin/kernel-install and /sbin/new-kernel-pkg scripts.


    EDIT: But it seems grubby works a little bit differently by only patching grub2.cfg with necessary modifications for the kernel being installed, not regenerating it as a whole like grub2-mkconfig command does.
    https://fedoraproject.org/wiki/GRUB_...n_BIOS_systems

    So if this doesn't work it might be good idea to give grub2-mkconfig a shot also.
    Last edited by srakitnican; 10th August 2016 at 12:19 PM.

  8. #8
    Join Date
    Jul 2013
    Location
    My house.
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recovering from aborted Fedora 24 upgrade... dnf --installroot...

    Quote Originally Posted by nsnbm
    If grub is not showing the kernels in the grub menu, but the kernels are installed, then you could try and run the config again with one of the following depending on where your .cfg file is:
    Code:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    
    grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
    This fixed it. Thanks for the help.

    The entire installation now seems to work fine.

    I've had a couple botched installations over the years. I've never had to reinstall. The tools in dnf and the later versions of yum are excellent With a bit of patience you can recover even the most messed up situation.

Similar Threads

  1. Aborted upgrade to F22
    By hbar271 in forum Installation, Upgrades and Live Media
    Replies: 3
    Last Post: 12th March 2016, 12:01 AM
  2. Need help recovering after interrupted upgrade to 22
    By Chrushev in forum Installation, Upgrades and Live Media
    Replies: 2
    Last Post: 7th January 2016, 10:23 PM
  3. Need help recovering from failed Fedora 16 upgrade
    By bswilson in forum Installation, Upgrades and Live Media
    Replies: 1
    Last Post: 4th December 2011, 04:12 AM
  4. Yum + installroot option
    By Gandilf in forum Using Fedora
    Replies: 0
    Last Post: 10th June 2006, 12:13 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •