0

I don't remember installing anything recently but when I pulled my laptop out of standby today I got the following notification:

enter image description here

In words: An error occurred, please run Package Manager from the right-click menu or apt-get in a terminal to see what is wrong. The error message was: Error: Opening the cache (E:Couldn't create temporary file to work with /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu__dists__bionic__InRelease - mkstemp (2: No such file or directory), E:The package lists or status file could not be parsed or opened.)'. This usually means that your installed packages have unmet dependencies (Side question: Is there a log file somewhere to copy the text from?)

I don't know what the right-click menu is. When I click on preferences, Software & Updates opens up, but I'm unsure what to do there.

running apt-get check diplays

Reading package lists... Error! E: Couldn't create temporary file to work with /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic_InRelease - mkstemp (2: No such file or directory) E: The package lists or status file could not be parsed or opened.

I have since tried: per https://sillycodes.com/quick-tip-couldnt-create-temporary-file/:

sudo apt-get clean sudo mv /var/lib/apt/lists /tmp sudo mkdir -p /var/lib/apt/lists/partial sudo apt-get clean sudo apt-get update reverted with sudo mv /tmp /var/lib/apt/lists

There were error messages for several repositories, examplary: W: GPG error: http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease: Couldn't create temporary file /tmp/apt.conf.tiVq7R for passing config to apt-key E: The repository 'http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default.

user2740
  • 1,087
  • 1
  • 13
  • 23
  • As suggested here https://askubuntu.com/questions/1059217/getting-release-is-not-valid-yet-while-updating-ubuntu-docker-container, restart fixed the problem. – user2740 Jun 12 '20 at 17:52

2 Answers2

0

This same error happened with my Ubuntu 18.04. Then I reboot twice until it didn't start more. Instead, the boot initramfs started.

Then, I run the 3 commands:

(initramfs) exit
...
(initramfs) fsck /dev/mapper/ubuntu–vg-root -y
...
(initramfs) reboot
...

PS.: I guess that had occurred any disk error after the last upgrade kernel. This already occurred in recent past two or three times.

0

Rebooting the computer solved the problem this time, however the Error: Opening the cache (E:Couldn't create a temporary file to work with /var/lib/apt/lists/) indicates that there may be an underlying problem with bad blocks on your standby laptop's hard drive. In that case sudo badblocks -s /dev/sdX where X is replaced by Device's letter in the Disks application will probably also report that there are bad blocks. To fix bad blocks boot from the same Ubuntu live USB/DVD that you used to install Ubuntu and run fsck to check and optionally repair the filesystem by following the instructions in this answer.

Before performing a live check, you can do a test run with fsck. Pass the -N option to the fsck command to perform a test: source

sudo fsck -N /dev/sdX

The output prints what would happen, but does not perform any actions.

karel
  • 114,770