Home / Alt manpages / loadunimap(8)

  • loadunimap(8)
  • Admin command
  • linux

Use Legacy loadunimap Safely on a Linux Virtual Console

You will finish with a reversible way to load a Unicode-to-font map on a Linux virtual console, while knowing why this old command is usually the wrong first choice. The examples match the installed kbd 2.6.4 package and its loadunimap 2.6.4 binary.

Allow about ten minutes. You need a real Linux virtual terminal, the kbd package, and administrator access for the command that changes the kernel console state. A terminal emulator or an SSH session is not a useful target for this tool. The check and discovery steps below are ordinary commands; only the map operation needs elevated privileges.

1. Confirm what is installed

Start with read-only checks. The installed command supports the long options shown here, although the local manpage documents the short forms:

$ command -v loadunimap
/usr/bin/loadunimap
$ loadunimap --version
loadunimap from kbd 2.6.4
$ dpkg-query -W -f='${Package} ${Version}\n' kbd
kbd 2.6.4-2ubuntu2

Checkpoint: if the command is missing, install the distribution's kbd package before continuing. Do not copy a map from an unrelated system and assume its format is interchangeable.

2. Understand the boundary before changing it

loadunimap loads a selected map into the kernel's Unicode-to-font mapping table. It is not a general keyboard-layout command, and it does not install a persistent configuration. The map affects the selected console while that console is using the changed kernel state.

The command is obsolete. Its function is built into setfont, which can load a font and its Unicode map together. Prefer setfont for new console setup unless you are maintaining an old script or specifically need this separate operation. This is a compatibility workflow, not a recommendation to add loadunimap to new boot configuration.

Its basic shape is:

loadunimap [-C CONSOLE] [-o OLDMAP] [MAP]

With no map argument, the documented default is def. The default filename extension is .uni. The documented default directory is /usr/share/unimaps, with /usr/share/unimaps/def.uni as the default map.

3. Check the map file and target console

Before using administrator access, check both the documented default and the device you intend to target:

$ ls -l /usr/share/unimaps/def.uni
$ tty
/dev/tty1

The exact output depends on the host. On this installed system the documented map directory is not present, so the default map cannot be loaded until a valid map file is supplied by the system's console setup. Treat a missing file as a stop sign, not as a reason to guess another path.

-C selects a console device and is supported on Linux 2.6.1 and later. Use the actual virtual console you mean to change. If tty reports a pseudo-terminal such as /dev/pts/3, switch to a virtual terminal first or leave the target selection to a known console-management procedure. Do not point this command at a device merely because it exists.

4. Save the old map and load a named map

Loading a map changes console behaviour immediately. It may make characters render unexpectedly, so save the current map first. This example assumes you have already verified both /usr/share/unimaps/example.uni and /dev/tty1 on your host:

$ sudo loadunimap -C /dev/tty1 -o /tmp/tty1-before.uni /usr/share/unimaps/example.uni

The -o option writes the old map to the file you name before the new map is loaded. The map argument may omit its .uni extension when using the command's normal map lookup. An absolute path makes the example's input explicit, but it still must name a map that exists and is readable.

There is no harmless dry run for the map operation. Do not test it on a production console during an incident, and do not overwrite an existing backup without checking it first. The command changes live kernel state, but this example does not edit a service file or make the change persistent across a reboot.

Checkpoint: if the command reports that it cannot open the console or map, stop and fix that specific input. Do not remove the -C option just to hide a device-selection problem.

5. Restore the saved map

If the display is wrong, restore the map you captured. This is another live console change and needs administrator access:

$ sudo loadunimap -C /dev/tty1 /tmp/tty1-before.uni

Use the same console device in both commands. Keep the backup until you have verified the restored output. The file in /tmp is not durable storage, so copy it to a suitably protected location only if you need it beyond the current session. A map can reveal details about the console configuration, so do not make the backup world-readable.

6. Prefer setfont for a maintained setup

For a new or maintained console configuration, inspect the installed setfont documentation and use its Unicode-map support instead:

$ man 8 setfont
$ setfont --help

The local setfont(8) page describes -u for loading an explicit Unicode map and -ou for saving the previous one. That combines the font and map workflow and is the supported replacement described by the loadunimap(8) page. Check the exact font, map and console requirements on your distribution before applying it. Do not replace a working boot or login configuration solely because this command is obsolete.

Done means

  • You confirmed the installed kbd and loadunimap versions.
  • You checked that the map file exists and selected a real virtual console.
  • You saved the old map before making a live change.
  • You know the restore command and kept the backup until verification.
  • You will use setfont for new configuration unless compatibility requires loadunimap.