setupcon
Set up the console using specified configuration
SYNOPSIS
setupcon [OPTION...]
PARAMETERS
-k, --kbd
Set up only the keyboard configuration.
-f, --font
Set up only the console font.
-v, --verbose
Be verbose during operation, showing more details about the setup process.
-q, --quiet
Suppress all output messages, running silently.
-n, --noclear
Do not clear the screen before applying new console settings.
-C, --condev=DEVICE
Specify the console device to configure (e.g., /dev/tty0).
-h, --help
Display a help message and exit.
-V, --version
Display version information and exit.
DESCRIPTION
setupcon is a Linux command-line utility used to configure the console's appearance and behavior. Its primary function is to set the console font (typeface) and the keyboard map (layout). It is often invoked during system boot to ensure the console is properly configured for the user's locale and preferences.
setupcon reads its configuration from files like /etc/default/console-setup or /etc/console-setup.conf, which store settings such as font family, font size, keyboard layout, and console colors. It acts as a high-level wrapper, internally calling lower-level utilities such as setfont to apply font settings and loadkeys to apply keyboard layout changes.
This command is crucial for internationalization, allowing users to input and view characters correctly in various languages directly on the console, even before a graphical environment starts. It provides an easy way to manage console settings without directly interacting with the underlying low-level commands.
CAVEATS
Changes made by setupcon are typically for the current console session or until reboot, depending on how it's integrated with system initialization scripts. It primarily affects virtual consoles (like tty1-tty6), not graphical terminals (such as xterm, gnome-terminal, or Konsole). Root privileges are required to modify console settings.
CONFIGURATION FILES
The command often reads its configuration from files such as /etc/default/console-setup or /etc/console-setup.conf. These files contain variables defining the desired keyboard layout, font, and other console preferences. Administrators can edit these files to make persistent changes to the console setup.
SYSTEM INTEGRATION
On many modern Linux distributions, setupcon is automatically executed during the boot process, often via an init script or a systemd service (e.g., console-setup.service). This ensures that the console is configured correctly from the moment the system starts, providing the correct character sets and keyboard layouts for the user's locale.
HISTORY
setupcon is part of the kbd package, which provides various utilities for configuring the Linux console. It emerged to simplify the complex process of manually configuring console fonts and keymaps, especially with the growing need for internationalization support in Linux. Its role has remained consistent, providing a high-level interface to setfont and loadkeys, abstracting the underlying complexities for users and system administrators.