Failed to enable Livepatch: failed to read machine-id

Asked by ANUPAM MITRA on 2020-09-22

Livepatch couldn't be enabled with the reason "failed to read machine-id". How to remove the impasse?

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Manfred Hampl
Last query:
Last reply:

This question was reopened

What is the output of:

lsb_release -a; uname -a


ANUPAM MITRA (anupammitra) said : #2

Thanks. The output is as under.

anupam@anupam-ubuntu:~$ lsb_release -a; uname -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
Linux anupam-ubuntu 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

There is a section giving your error......

Manfred Hampl (m-hampl) said : #5

The error message "failed to read machine-id" is slightly different from "this machine ID is already enabled with a different key or is non-unique"

But the proposed solution should help also in this case.

ANUPAM MITRA (anupammitra) said : #7

Inadvertently I pressed the SOLVED button which I sincerely regret. But I do not know how to set it right under this situation. However, I tried all the commands, but terminal is still open since last half-an-hours. Did I commit any mistake this time?

Manfred Hampl (m-hampl) said : #8

Which command was the last one that you started in the terminal (and which seems to be still running)?

ANUPAM MITRA (anupammitra) said : #9

I'm giving below the outcome of the Terminal.

> Initializing machine ID from D-Bus machine ID
cat /etc/machine-id

Manfred Hampl (m-hampl) said : #10

Is there a prompt visible in the terminal at the beginning of the last line (something like "anup@anup-pc:~$")?

ANUPAM MITRA (anupammitra) said : #11

No, nothing like that.

Manfred Hampl (m-hampl) said : #12

How did you start the terminal?

What happens if you abort the running commands and the terminal and try again?

ANUPAM MITRA (anupammitra) said : #13

cp /etc/machine-id /etc/machine-id.original
cp: cannot stat '/etc/machine-id': No such file or directory

cp /var/lib/dbus/machine-id /var/lib/dbus/machine-id.original
cp: cannot stat '/var/lib/dbus/machine-id': No such file or directory

After giving third command, i.e. "nano /etc/machine-id new" (without quote) new window opened in Terminal. At top "GNU nano 4.8" and in the middle "/etc/machine-id" could be seen.

If I put fourth command "systemd-machine-id-setup" in the Terminal, then "Modified" comes at the top right hand side.

I aborted and closed the Terminal. I again tried with those commands but result is same, as narrated above. If I preferred to close the Terminal at this stage, warning message is popping up with "There is still a process running in this terminal. Closing the terminal will kill it.

Best Manfred Hampl (m-hampl) said : #14

You are using the wrong commands.

open a terminal

issue the command


wait for a response and a new command prompt

issue the command

cat /etc/machine-id

What happens?

ANUPAM MITRA (anupammitra) said : #15

Thanks for your continuous support. The outcome is as under.

anupam@anupam-ubuntu:~$ systemd-machine-id-setup
Cannot open /etc/machine-id: No such file or directory
anupam@anupam-ubuntu:~$ cat /etc/machine-id
cat: /etc/machine-id: No such file or directory

Manfred Hampl (m-hampl) said : #16

Then try the commands

sudo touch /etc/machine-id
sudo systemd-machine-id-setup
cat /etc/machine-id

and report the results

ANUPAM MITRA (anupammitra) said : #17

Thanks a lot Manfred Hampl. This time everything is okay. Livepatch recognised the machine id and now it is working as usual. However, the outcome is as under.

anupam@anupam-ubuntu:~$ sudo touch /etc/machine-id
[sudo] password for anupam:
anupam@anupam-ubuntu:~$ sudo systemd-machine-id-setup
Initializing machine ID from random generator.
anupam@anupam-ubuntu:~$ cat /etc/machine-id

Thanks again.

ANUPAM MITRA (anupammitra) said : #18

Thanks Manfred Hampl, that solved my question.

Thank you so much Manfred Hampl... It solved my problem too.. take love..

leeh (backey) said : #21

Thanks Manfred Hampl