Ubuntu Server 18.04 apt-get Fails
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
My Ubuntu Server 18.04 system, while it continues to work, has become unable to apply any updates. I'm not aware of any system change that I made that could be the culprit.
What can I do to fix this? I've tried autoremove, purge, etc.
Here is typical output but any apt command produces a similar error:
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
linux-image-4.15.0-22-generic
The following packages will be upgraded:
libcephfs2 librados2 ssh-import-id
3 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/3,065 kB of archives.
After this operation, 8,281 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 149817 files and directories currently installed.)
Removing linux-image-4.15.0-22-generic (4.15.0-22.24) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-22-generic
/etc/kernel/postrm.d/x-grub-legacy-ec2:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ...
Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/update-grub-legacy-ec2: line 1101: read:
read error: 0: Bad file descriptor
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 1
dpkg: error processing package linux-image-4.15.0-22-generic (--remove):
installed linux-image-4.15.0-22-generic package post-removal script
subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-22-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thanks to all for the responses. Followed suggestions below. Can't seem to clean it up via apt / dpkg. Here is output:
# sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-22-generic
Found initrd image: /boot/initrd.img-4.15.0-22-generic
Found linux image: /boot/vmlinuz-4.15.0-20-generic
Found initrd image: /boot/initrd.img-4.15.0-20-generic
done
# sudo dpkg --purge linux-image-4.15.0-22-generic
dpkg: dependency problems prevent removal of linux-image-4.15.0-22-generic:
linux-image-generic depends on linux-image-4.15.0-22-generic.
linux-modules-extra-4.15.0-22-generic depends on linux-image-4.15.0-22-generic | linux-image-unsigned-4.15.0-22-generic; however:
Package linux-image-4.15.0-22-generic is to be removed.
Package linux-image-unsigned-4.15.0-22-generic is not installed.
dpkg: error processing package linux-image-4.15.0-22-generic (--purge):
dependency problems - not removing
Errors were encountered while processing:
linux-image-4.15.0-22-generic
apt grub2 package-management
add a comment |Â
up vote
0
down vote
favorite
My Ubuntu Server 18.04 system, while it continues to work, has become unable to apply any updates. I'm not aware of any system change that I made that could be the culprit.
What can I do to fix this? I've tried autoremove, purge, etc.
Here is typical output but any apt command produces a similar error:
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
linux-image-4.15.0-22-generic
The following packages will be upgraded:
libcephfs2 librados2 ssh-import-id
3 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/3,065 kB of archives.
After this operation, 8,281 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 149817 files and directories currently installed.)
Removing linux-image-4.15.0-22-generic (4.15.0-22.24) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-22-generic
/etc/kernel/postrm.d/x-grub-legacy-ec2:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ...
Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/update-grub-legacy-ec2: line 1101: read:
read error: 0: Bad file descriptor
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 1
dpkg: error processing package linux-image-4.15.0-22-generic (--remove):
installed linux-image-4.15.0-22-generic package post-removal script
subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-22-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thanks to all for the responses. Followed suggestions below. Can't seem to clean it up via apt / dpkg. Here is output:
# sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-22-generic
Found initrd image: /boot/initrd.img-4.15.0-22-generic
Found linux image: /boot/vmlinuz-4.15.0-20-generic
Found initrd image: /boot/initrd.img-4.15.0-20-generic
done
# sudo dpkg --purge linux-image-4.15.0-22-generic
dpkg: dependency problems prevent removal of linux-image-4.15.0-22-generic:
linux-image-generic depends on linux-image-4.15.0-22-generic.
linux-modules-extra-4.15.0-22-generic depends on linux-image-4.15.0-22-generic | linux-image-unsigned-4.15.0-22-generic; however:
Package linux-image-4.15.0-22-generic is to be removed.
Package linux-image-unsigned-4.15.0-22-generic is not installed.
dpkg: error processing package linux-image-4.15.0-22-generic (--purge):
dependency problems - not removing
Errors were encountered while processing:
linux-image-4.15.0-22-generic
apt grub2 package-management
Have you made any changes to grub or its data files?
â Organic Marble
May 27 at 22:41
1
Welcome to Ask Ubuntu! Could you please try to remove the package individually withsudo dpkg --purge linux-image-4.15.0-22-generic
. If that fails, could you please runsudo update-grub
and try again? If that still fails please edit your question to include the output of both. Thanks.
â David Foerster
May 27 at 22:53
Made no changes to grub prior to this problem, at least none that I am aware of. The server's purpose is primarily as a Samba server, and a hypervisor for other VMs, so the usual maintenance activity is simply applying updates.
â SDT2000USA
May 29 at 14:26
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
My Ubuntu Server 18.04 system, while it continues to work, has become unable to apply any updates. I'm not aware of any system change that I made that could be the culprit.
What can I do to fix this? I've tried autoremove, purge, etc.
Here is typical output but any apt command produces a similar error:
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
linux-image-4.15.0-22-generic
The following packages will be upgraded:
libcephfs2 librados2 ssh-import-id
3 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/3,065 kB of archives.
After this operation, 8,281 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 149817 files and directories currently installed.)
Removing linux-image-4.15.0-22-generic (4.15.0-22.24) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-22-generic
/etc/kernel/postrm.d/x-grub-legacy-ec2:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ...
Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/update-grub-legacy-ec2: line 1101: read:
read error: 0: Bad file descriptor
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 1
dpkg: error processing package linux-image-4.15.0-22-generic (--remove):
installed linux-image-4.15.0-22-generic package post-removal script
subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-22-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thanks to all for the responses. Followed suggestions below. Can't seem to clean it up via apt / dpkg. Here is output:
# sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-22-generic
Found initrd image: /boot/initrd.img-4.15.0-22-generic
Found linux image: /boot/vmlinuz-4.15.0-20-generic
Found initrd image: /boot/initrd.img-4.15.0-20-generic
done
# sudo dpkg --purge linux-image-4.15.0-22-generic
dpkg: dependency problems prevent removal of linux-image-4.15.0-22-generic:
linux-image-generic depends on linux-image-4.15.0-22-generic.
linux-modules-extra-4.15.0-22-generic depends on linux-image-4.15.0-22-generic | linux-image-unsigned-4.15.0-22-generic; however:
Package linux-image-4.15.0-22-generic is to be removed.
Package linux-image-unsigned-4.15.0-22-generic is not installed.
dpkg: error processing package linux-image-4.15.0-22-generic (--purge):
dependency problems - not removing
Errors were encountered while processing:
linux-image-4.15.0-22-generic
apt grub2 package-management
My Ubuntu Server 18.04 system, while it continues to work, has become unable to apply any updates. I'm not aware of any system change that I made that could be the culprit.
What can I do to fix this? I've tried autoremove, purge, etc.
Here is typical output but any apt command produces a similar error:
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
linux-image-4.15.0-22-generic
The following packages will be upgraded:
libcephfs2 librados2 ssh-import-id
3 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/3,065 kB of archives.
After this operation, 8,281 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 149817 files and directories currently installed.)
Removing linux-image-4.15.0-22-generic (4.15.0-22.24) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-22-generic
/etc/kernel/postrm.d/x-grub-legacy-ec2:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ...
Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/update-grub-legacy-ec2: line 1101: read:
read error: 0: Bad file descriptor
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 1
dpkg: error processing package linux-image-4.15.0-22-generic (--remove):
installed linux-image-4.15.0-22-generic package post-removal script
subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-22-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thanks to all for the responses. Followed suggestions below. Can't seem to clean it up via apt / dpkg. Here is output:
# sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-22-generic
Found initrd image: /boot/initrd.img-4.15.0-22-generic
Found linux image: /boot/vmlinuz-4.15.0-20-generic
Found initrd image: /boot/initrd.img-4.15.0-20-generic
done
# sudo dpkg --purge linux-image-4.15.0-22-generic
dpkg: dependency problems prevent removal of linux-image-4.15.0-22-generic:
linux-image-generic depends on linux-image-4.15.0-22-generic.
linux-modules-extra-4.15.0-22-generic depends on linux-image-4.15.0-22-generic | linux-image-unsigned-4.15.0-22-generic; however:
Package linux-image-4.15.0-22-generic is to be removed.
Package linux-image-unsigned-4.15.0-22-generic is not installed.
dpkg: error processing package linux-image-4.15.0-22-generic (--purge):
dependency problems - not removing
Errors were encountered while processing:
linux-image-4.15.0-22-generic
apt grub2 package-management
edited May 28 at 21:01
asked May 27 at 19:08
SDT2000USA
214
214
Have you made any changes to grub or its data files?
â Organic Marble
May 27 at 22:41
1
Welcome to Ask Ubuntu! Could you please try to remove the package individually withsudo dpkg --purge linux-image-4.15.0-22-generic
. If that fails, could you please runsudo update-grub
and try again? If that still fails please edit your question to include the output of both. Thanks.
â David Foerster
May 27 at 22:53
Made no changes to grub prior to this problem, at least none that I am aware of. The server's purpose is primarily as a Samba server, and a hypervisor for other VMs, so the usual maintenance activity is simply applying updates.
â SDT2000USA
May 29 at 14:26
add a comment |Â
Have you made any changes to grub or its data files?
â Organic Marble
May 27 at 22:41
1
Welcome to Ask Ubuntu! Could you please try to remove the package individually withsudo dpkg --purge linux-image-4.15.0-22-generic
. If that fails, could you please runsudo update-grub
and try again? If that still fails please edit your question to include the output of both. Thanks.
â David Foerster
May 27 at 22:53
Made no changes to grub prior to this problem, at least none that I am aware of. The server's purpose is primarily as a Samba server, and a hypervisor for other VMs, so the usual maintenance activity is simply applying updates.
â SDT2000USA
May 29 at 14:26
Have you made any changes to grub or its data files?
â Organic Marble
May 27 at 22:41
Have you made any changes to grub or its data files?
â Organic Marble
May 27 at 22:41
1
1
Welcome to Ask Ubuntu! Could you please try to remove the package individually with
sudo dpkg --purge linux-image-4.15.0-22-generic
. If that fails, could you please run sudo update-grub
and try again? If that still fails please edit your question to include the output of both. Thanks.â David Foerster
May 27 at 22:53
Welcome to Ask Ubuntu! Could you please try to remove the package individually with
sudo dpkg --purge linux-image-4.15.0-22-generic
. If that fails, could you please run sudo update-grub
and try again? If that still fails please edit your question to include the output of both. Thanks.â David Foerster
May 27 at 22:53
Made no changes to grub prior to this problem, at least none that I am aware of. The server's purpose is primarily as a Samba server, and a hypervisor for other VMs, so the usual maintenance activity is simply applying updates.
â SDT2000USA
May 29 at 14:26
Made no changes to grub prior to this problem, at least none that I am aware of. The server's purpose is primarily as a Samba server, and a hypervisor for other VMs, so the usual maintenance activity is simply applying updates.
â SDT2000USA
May 29 at 14:26
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
I am still unclear on why I experienced this issue, but it seems a missing grub /boot/grub/menu.lst file was causing apt / dpkg updates to fail. So I created an empty file.
sudo touch /boot/grub/menu.lst
sudo update-grub2
All good. Then proceed with updating the system:
apt update
apt upgrade
apt autoremove --purge
Along the way, there will be a warning that the current menu.lst file is different than the package maintainer's version. Select the option to install the package maintainer's version, and then the rest of the update and cleanup completes successfully. Will see how the next kernel upgrade goes, but problem is solved for now.
Thank you to all who contributed suggestions and help!
You should accept your own answer
â Oussema
Jun 5 at 4:27
add a comment |Â
up vote
1
down vote
I know this should be a comment but I don't have enough reputation.
But I want to let you know I had a similar problem yesterday.
If this answer doesn't work for you, you can contact @videonauth . He's the super nice guy who helped me with this issue.
I will copypaste from his answer the part that will hopefully help you:
First remove the removable packages after having run an update to get
the proper package archives updated:sudo apt update
sudo apt autoremove --purge
This should remove all removable packages so far except the one which
managed to get messed up which we can then remove then by installing
it and then removing it properly:cd /var/cache/apt/archives
sudo dpkg -i linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
sudo dpkg -r linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
(Note from Oussema: ^This command was used based on the fact that my system's architecture is amd64. You can see yours using the command uname -a
"i386", "i486", "i586" and "i686" and "athlon" all mean 32 bit.
"x86_64" means 64 bit (Opteron or Athlon-64). "i686-64" means 32-bit
operation with 64-bit address space (Intel 686 with the new memory
mechanism). )
Now cleaning up the archives by running:
sudo apt clean
And now we can reinstall the packages properly after having run an
complete update process:sudo apt update
sudo apt dist-upgrade
with the following line:
sudo apt install --reinstall linux-generic
Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
â SDT2000USA
May 29 at 14:27
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
I am still unclear on why I experienced this issue, but it seems a missing grub /boot/grub/menu.lst file was causing apt / dpkg updates to fail. So I created an empty file.
sudo touch /boot/grub/menu.lst
sudo update-grub2
All good. Then proceed with updating the system:
apt update
apt upgrade
apt autoremove --purge
Along the way, there will be a warning that the current menu.lst file is different than the package maintainer's version. Select the option to install the package maintainer's version, and then the rest of the update and cleanup completes successfully. Will see how the next kernel upgrade goes, but problem is solved for now.
Thank you to all who contributed suggestions and help!
You should accept your own answer
â Oussema
Jun 5 at 4:27
add a comment |Â
up vote
2
down vote
accepted
I am still unclear on why I experienced this issue, but it seems a missing grub /boot/grub/menu.lst file was causing apt / dpkg updates to fail. So I created an empty file.
sudo touch /boot/grub/menu.lst
sudo update-grub2
All good. Then proceed with updating the system:
apt update
apt upgrade
apt autoremove --purge
Along the way, there will be a warning that the current menu.lst file is different than the package maintainer's version. Select the option to install the package maintainer's version, and then the rest of the update and cleanup completes successfully. Will see how the next kernel upgrade goes, but problem is solved for now.
Thank you to all who contributed suggestions and help!
You should accept your own answer
â Oussema
Jun 5 at 4:27
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
I am still unclear on why I experienced this issue, but it seems a missing grub /boot/grub/menu.lst file was causing apt / dpkg updates to fail. So I created an empty file.
sudo touch /boot/grub/menu.lst
sudo update-grub2
All good. Then proceed with updating the system:
apt update
apt upgrade
apt autoremove --purge
Along the way, there will be a warning that the current menu.lst file is different than the package maintainer's version. Select the option to install the package maintainer's version, and then the rest of the update and cleanup completes successfully. Will see how the next kernel upgrade goes, but problem is solved for now.
Thank you to all who contributed suggestions and help!
I am still unclear on why I experienced this issue, but it seems a missing grub /boot/grub/menu.lst file was causing apt / dpkg updates to fail. So I created an empty file.
sudo touch /boot/grub/menu.lst
sudo update-grub2
All good. Then proceed with updating the system:
apt update
apt upgrade
apt autoremove --purge
Along the way, there will be a warning that the current menu.lst file is different than the package maintainer's version. Select the option to install the package maintainer's version, and then the rest of the update and cleanup completes successfully. Will see how the next kernel upgrade goes, but problem is solved for now.
Thank you to all who contributed suggestions and help!
answered May 31 at 14:46
SDT2000USA
214
214
You should accept your own answer
â Oussema
Jun 5 at 4:27
add a comment |Â
You should accept your own answer
â Oussema
Jun 5 at 4:27
You should accept your own answer
â Oussema
Jun 5 at 4:27
You should accept your own answer
â Oussema
Jun 5 at 4:27
add a comment |Â
up vote
1
down vote
I know this should be a comment but I don't have enough reputation.
But I want to let you know I had a similar problem yesterday.
If this answer doesn't work for you, you can contact @videonauth . He's the super nice guy who helped me with this issue.
I will copypaste from his answer the part that will hopefully help you:
First remove the removable packages after having run an update to get
the proper package archives updated:sudo apt update
sudo apt autoremove --purge
This should remove all removable packages so far except the one which
managed to get messed up which we can then remove then by installing
it and then removing it properly:cd /var/cache/apt/archives
sudo dpkg -i linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
sudo dpkg -r linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
(Note from Oussema: ^This command was used based on the fact that my system's architecture is amd64. You can see yours using the command uname -a
"i386", "i486", "i586" and "i686" and "athlon" all mean 32 bit.
"x86_64" means 64 bit (Opteron or Athlon-64). "i686-64" means 32-bit
operation with 64-bit address space (Intel 686 with the new memory
mechanism). )
Now cleaning up the archives by running:
sudo apt clean
And now we can reinstall the packages properly after having run an
complete update process:sudo apt update
sudo apt dist-upgrade
with the following line:
sudo apt install --reinstall linux-generic
Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
â SDT2000USA
May 29 at 14:27
add a comment |Â
up vote
1
down vote
I know this should be a comment but I don't have enough reputation.
But I want to let you know I had a similar problem yesterday.
If this answer doesn't work for you, you can contact @videonauth . He's the super nice guy who helped me with this issue.
I will copypaste from his answer the part that will hopefully help you:
First remove the removable packages after having run an update to get
the proper package archives updated:sudo apt update
sudo apt autoremove --purge
This should remove all removable packages so far except the one which
managed to get messed up which we can then remove then by installing
it and then removing it properly:cd /var/cache/apt/archives
sudo dpkg -i linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
sudo dpkg -r linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
(Note from Oussema: ^This command was used based on the fact that my system's architecture is amd64. You can see yours using the command uname -a
"i386", "i486", "i586" and "i686" and "athlon" all mean 32 bit.
"x86_64" means 64 bit (Opteron or Athlon-64). "i686-64" means 32-bit
operation with 64-bit address space (Intel 686 with the new memory
mechanism). )
Now cleaning up the archives by running:
sudo apt clean
And now we can reinstall the packages properly after having run an
complete update process:sudo apt update
sudo apt dist-upgrade
with the following line:
sudo apt install --reinstall linux-generic
Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
â SDT2000USA
May 29 at 14:27
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I know this should be a comment but I don't have enough reputation.
But I want to let you know I had a similar problem yesterday.
If this answer doesn't work for you, you can contact @videonauth . He's the super nice guy who helped me with this issue.
I will copypaste from his answer the part that will hopefully help you:
First remove the removable packages after having run an update to get
the proper package archives updated:sudo apt update
sudo apt autoremove --purge
This should remove all removable packages so far except the one which
managed to get messed up which we can then remove then by installing
it and then removing it properly:cd /var/cache/apt/archives
sudo dpkg -i linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
sudo dpkg -r linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
(Note from Oussema: ^This command was used based on the fact that my system's architecture is amd64. You can see yours using the command uname -a
"i386", "i486", "i586" and "i686" and "athlon" all mean 32 bit.
"x86_64" means 64 bit (Opteron or Athlon-64). "i686-64" means 32-bit
operation with 64-bit address space (Intel 686 with the new memory
mechanism). )
Now cleaning up the archives by running:
sudo apt clean
And now we can reinstall the packages properly after having run an
complete update process:sudo apt update
sudo apt dist-upgrade
with the following line:
sudo apt install --reinstall linux-generic
I know this should be a comment but I don't have enough reputation.
But I want to let you know I had a similar problem yesterday.
If this answer doesn't work for you, you can contact @videonauth . He's the super nice guy who helped me with this issue.
I will copypaste from his answer the part that will hopefully help you:
First remove the removable packages after having run an update to get
the proper package archives updated:sudo apt update
sudo apt autoremove --purge
This should remove all removable packages so far except the one which
managed to get messed up which we can then remove then by installing
it and then removing it properly:cd /var/cache/apt/archives
sudo dpkg -i linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
sudo dpkg -r linux-modules-4.15.0-22-generic_4.15.0-22.24_amd64.deb
(Note from Oussema: ^This command was used based on the fact that my system's architecture is amd64. You can see yours using the command uname -a
"i386", "i486", "i586" and "i686" and "athlon" all mean 32 bit.
"x86_64" means 64 bit (Opteron or Athlon-64). "i686-64" means 32-bit
operation with 64-bit address space (Intel 686 with the new memory
mechanism). )
Now cleaning up the archives by running:
sudo apt clean
And now we can reinstall the packages properly after having run an
complete update process:sudo apt update
sudo apt dist-upgrade
with the following line:
sudo apt install --reinstall linux-generic
edited May 27 at 22:21
![](https://i.stack.imgur.com/idNpq.jpg?s=32&g=1)
![](https://i.stack.imgur.com/idNpq.jpg?s=32&g=1)
Videonauth
21.6k116495
21.6k116495
answered May 27 at 22:04
Oussema
7411
7411
Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
â SDT2000USA
May 29 at 14:27
add a comment |Â
Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
â SDT2000USA
May 29 at 14:27
Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
â SDT2000USA
May 29 at 14:27
Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
â SDT2000USA
May 29 at 14:27
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1040974%2fubuntu-server-18-04-apt-get-fails%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Have you made any changes to grub or its data files?
â Organic Marble
May 27 at 22:41
1
Welcome to Ask Ubuntu! Could you please try to remove the package individually with
sudo dpkg --purge linux-image-4.15.0-22-generic
. If that fails, could you please runsudo update-grub
and try again? If that still fails please edit your question to include the output of both. Thanks.â David Foerster
May 27 at 22:53
Made no changes to grub prior to this problem, at least none that I am aware of. The server's purpose is primarily as a Samba server, and a hypervisor for other VMs, so the usual maintenance activity is simply applying updates.
â SDT2000USA
May 29 at 14:26