need help - failed dist upgrade to stretch

If none of the more specific forums is the right place to ask

need help - failed dist upgrade to stretch

Postby 0-0 » 2019-08-07 17:32

The error:

While running `$ sudo apt install -f` I get:
│ You are running a kernel (version 3.16.0-7-amd64) and attempting to remove the same │
│ version. │
│ │
│ This can make the system unbootable as it will remove /boot/vmlinuz-3.16.0-7-amd64 and all │
│ modules under the directory /lib/modules/3.16.0-7-amd64. This can only be fixed with a │
│ copy of the kernel image and the corresponding modules.



A simple `apt upgrade` fails with:
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
linux-image-3.16.0-7-amd64 : Depends: initramfs-tools (>= 0.110~) but it is not installable or
linux-initramfs-tool


I was attempting to follow https://www.debian.org/releases/stable/ ... ng.en.html to upgrade from jessie to stretch. I modified the apt/sources.list to point to stretch main, did an `apt update` followed by `apt upgrade` which resulted in the above issue describing an unmet dependency.

My sources.list is the following:
$ cat /etc/apt/sources.list
#

# deb cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 NETINST Binary-1 20170116-10:57]/ jessie main

#deb cdrom:[Debian GNU/Linux 8.7.1 _Jessie_ - Official amd64 NETINST Binary-1 20170116-10:57]/ jessie main

deb https://debian.csail.mit.edu/debian/ stretch main
deb-src http://debian.csail.mit.edu/debian/ stretch main

deb http://security.debian.org/ stretch/updates main
deb-src http://security.debian.org/ stretch/updates main

deb https://download.virtualbox.org/virtualbox/debian stretch contrib

#raid monitoring
deb http://hwraid.le-vert.net/debian stretch main

Any help on moving forward would be very appreciated. The first error has made me nervous as I have several TB of data on this system and would prefer to not get into an unbootable state where Im trying to manually reinstall a kernel.
0-0
 
Posts: 5
Joined: 2019-08-07 17:13

Re: need help - failed dist upgrade to stretch

Postby ruwolf » 2019-08-07 17:59

Last edited by ruwolf on 2019-08-07 18:39, edited 1 time in total.
User avatar
ruwolf
 
Posts: 357
Joined: 2008-02-18 05:04
Location: Slovakia, Banovce nad Bebravou, Matice slovenskej 1260/4-7

Re: need help - failed dist upgrade to stretch

Postby 0-0 » 2019-08-07 18:03

Thank you, I was not able to find details on upgrading from Jessie to Stretch hence why I was using the "upgrade from stretch" document. I'll read through this and see how far I can get.

Is there a way to backtrack from my apt upgrade? Would it be wise to change my sources.list back to jessie, update, clean, autoremove, upgrade before attemping the upgrade again?
0-0
 
Posts: 5
Joined: 2019-08-07 17:13

Re: need help - failed dist upgrade to stretch

Postby ruwolf » 2019-08-07 18:38

I would try to have both distributions together temporarily to resolve your situation.
But maybe someone here knows another (better?) solution?
Last edited by ruwolf on 2019-08-07 18:59, edited 1 time in total.
User avatar
ruwolf
 
Posts: 357
Joined: 2008-02-18 05:04
Location: Slovakia, Banovce nad Bebravou, Matice slovenskej 1260/4-7

Re: need help - failed dist upgrade to stretch

Postby L_V » 2019-08-07 18:52

-- message deleted to avoid interference with other proposals and confusion to 0-0 --
Last edited by L_V on 2019-08-07 19:47, edited 1 time in total.
L_V
 
Posts: 1032
Joined: 2007-03-19 09:04

Re: need help - failed dist upgrade to stretch

Postby Head_on_a_Stick » 2019-08-07 19:39

0-0 wrote:Is there a way to backtrack from my apt upgrade?

Restore your backup.

0-0 wrote:Would it be wise to change my sources.list back to jessie, update, clean, autoremove, upgrade before attemping the upgrade again?

You can't "upgrade" to a previous release. Well not without some wierd-ass pinning anyway.

FWIW, the jessie → stretch release notes advise
Code: Select all
# apt-get dist-upgrade

But the stretch → buster guide says to use
Code: Select all
# apt full-upgrade
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: need help - failed dist upgrade to stretch

Postby 0-0 » 2019-08-08 04:20

well fun... ok heres an update

I reverted the changes I made to sources.list, did a apt clean, update, upgrade and that seemed to go over well. I rebooted without an issue. So now armed with the correct release notes I took another shot at upgrading to stretch.

Reapplied changes to sources.list, apt update, followed by apt dist-upgrade. It chooched by for awhile and all seemed well. It succeeded.



Then I rebooted.

Dropped into a grub rescue shell with the error "attempt to read or write outside of disk 'hd0'"

...sigh...

grub rescue> ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

ls on everything except (hd0,gpt2) results in filesystem unknown so Im thinking gpt2 is what we want...
grub rescue> ls (hd0,gpt2)
(hd0,gpt2): Filesystem is ext2.
grub rescue> set root=(hd0,gpt2)
grub rescue> set prefix=(hd0,gpt2)/boot/grub
grub rescue> insmod normal
error: attempt to read or write outside of disk 'hd0'


:(
0-0
 
Posts: 5
Joined: 2019-08-07 17:13

Re: need help - failed dist upgrade to stretch

Postby Head_on_a_Stick » 2019-08-08 07:13

That error can be caused by a defective disk and/or cable and/or connector or by a filesystem problem.

You can try using rescue mode in the Debian ISO image from where you can get a root shell in the system to reinstall GRUB and if that doesn't work then try using fsck on the system partitions from the live environment.

If that doesn't fix things then post back with the output of this command from the live system:
Code: Select all
# parted --list
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: need help - failed dist upgrade to stretch

Postby 0-0 » 2019-08-08 12:49

I booted into a live install and from rescue mode the filesystem and partitions looked ok. Reinstalled grub and made a little progress. For whatever reason, grub still did not boot into the system, but the reinstall did land me in a normal grub shell instead of the rescue one. From there I was able to successfully set the image / initrd and boot into the system. Next step is to check over the grub config. I suspect as soon as I restart, I'll end up in a grub shell again.
0-0
 
Posts: 5
Joined: 2019-08-07 17:13

Re: need help - failed dist upgrade to stretch

Postby Head_on_a_Stick » 2019-08-09 08:29

Use update-grub to reconfigure GRUB.
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: need help - failed dist upgrade to stretch

Postby 0-0 » 2019-08-10 02:48

Head_on_a_Stick wrote:Use update-grub to reconfigure GRUB.


yep thank you, and thank you everyone else for all the pointers working through this. Im on stretch and the grub config is fixed up. Everything looks ok at this point.
0-0
 
Posts: 5
Joined: 2019-08-07 17:13


Return to General Questions

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable