Ubuntu Server 18.04 apt-get Fails

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








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







share|improve this question






















  • 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 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














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







share|improve this question






















  • 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 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












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







share|improve this question














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









share|improve this question













share|improve this question




share|improve this question








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 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
















  • 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 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















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










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!






share|improve this answer




















  • You should accept your own answer
    – Oussema
    Jun 5 at 4:27

















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






share|improve this answer






















  • Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
    – SDT2000USA
    May 29 at 14:27










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















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






























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!






share|improve this answer




















  • You should accept your own answer
    – Oussema
    Jun 5 at 4:27














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!






share|improve this answer




















  • You should accept your own answer
    – Oussema
    Jun 5 at 4:27












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!






share|improve this answer












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!







share|improve this answer












share|improve this answer



share|improve this answer










answered May 31 at 14:46









SDT2000USA

214




214











  • 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




You should accept your own answer
– Oussema
Jun 5 at 4:27












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






share|improve this answer






















  • Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
    – SDT2000USA
    May 29 at 14:27














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






share|improve this answer






















  • Thanks for the suggestions. Unfortunately, the apt commands all fail similarly to the orgiginal error.
    – SDT2000USA
    May 29 at 14:27












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






share|improve this answer














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







share|improve this answer














share|improve this answer



share|improve this answer








edited May 27 at 22:21









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
















  • 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












 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491