DBUS-UUIDGEN(1)
๐ซ dbus-uuidgen โ the UUID generator (user commands, bestie) ๐ซ
okay so real talk, this is dbus-uuidgen, and honestly? it's giving "small but mighty" โจ she generates or reads a universally unique ID, that's the whole job, and she does it well. ๐
๐ธ SYNOPSIS ๐ธ
dbus-uuidgen [--version] [--ensure [=FILENAME]] [--get [=FILENAME]]
๐ฆ DESCRIPTION ๐ฆ
dbus-uuidgen generates or reads a universally unique ID. that's it. that's the vibe. ๐
okay important disclaimer first bestie, don't skip this: the D-Bus UUID has no relationship to RFC 4122 and does not generate UUIDs compatible with that spec ๐ญ. many systems have a separate command for that (often called uuidgen โ yes the name is confusingly similar, i know, i know, not my fault). so if you need RFC 4122 UUIDs, go to that other girl. ๐
for more info about D-Bus, see https://www.freedesktop.org/wiki/Software/dbus/. ๐ซถ
the primary usage of dbus-uuidgen is to run in the post-install script of a D-Bus package, like this:
dbus-uuidgen --ensure
this will ensure that /var/lib/dbus/machine-id exists and has the uuid in it โจ. it won't overwrite an existing uuid, because this id should remain fixed for a single machine until the next reboot at least. no cap. ๐ฅ
the important properties of the machine UUID are, and i quote:
- it remains unchanged until the next reboot
- it is different for any two running instances of the OS kernel
that is, if two processes see the same UUID, they should also see the same shared memory, UNIX domain sockets, local X displays, localhost.localdomain resolution, process IDs, and so forth. it's an everything matches situation. iykyk. ๐
if you run dbus-uuidgen with no options it just prints a new uuid made up out of thin air โจ literally conjured. main character energy.
if you run it with --get, it prints the machine UUID by default, or the UUID in the specified file if you specify a file.
โ ๏ธ okay lowkey serious warning time: if you try to change an existing machine-id on a running system, it will probably result in bad things happening ๐ญ do not try to change this file. and also don't make it the same on two different systems โ it needs to be different anytime there are two different kernels running. periodt.
the UUID should be different on two different virtual machines, because there are two different kernels. so no, you can't just copy-paste your machine-id into your VM and call it a day ๐.
โจ OPTIONS โจ
the following options are supported, bestie:
--get[=FILENAME]โ if you don't give a filename, it defaults tolocalstatedir/lib/dbus/machine-id(localstatediris usually/var). if this file exists and is valid, the uuid in the file gets printed onstdout๐. otherwise, the command exits with a nonzero status. sad girl hours. ๐ญ--ensure[=FILENAME]โ if you don't give a filename, it defaults tolocalstatedir/lib/dbus/machine-id(localstatediris usually/var). if this file exists then it will be validated, and a failure code returned if it contains the wrong thing ๐จ. if the file does not exist, it will be created with a new uuid in it. on success, prints no output โ silent, mysterious, iconic. ๐--versionโ print the version ofdbus-uuidgen. that's it, she just tells you her age. ๐
๐ AUTHOR ๐
see https://dbus.freedesktop.org/doc/AUTHORS for the whole crew ๐ซถ
๐ BUGS ๐
please send bug reports to the D-Bus mailing list or bug tracker, see https://www.freedesktop.org/wiki/Software/dbus/ โ they genuinely wanna hear from you, no gatekeeping. ๐
and that's the page, bestie!! brought to you by D-Bus 1.16.2, dated 03/03/2025 โ DBUS-UUIDGEN(1), slay, periodt, go forth and generate responsibly ๐ฆโจ
๐ฆ where this page comes from
- alpine 3.22: dbus-doc 1.16.2-r1 ยท AFL-2.1 OR GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms