All posts by ENDLESSL00P

Giuseppe Casutt, Dipl.-HTL-Ing. bei A-Enterprise GmbH. Blog Author zu den Themen, Windows, VMware, Synology, Fortinet und Open Source. Tutorials und HowTos zu Problemlösungen und System Integration.

Set system locale on Linux

How to set Linux system language using localectl set-locale

Set system locale on Linux

Locales consist of a set of environment variables to define language, country, and character encoding for applications and shell sessions on a Linux system. These environment variables are used by system libraries and country-specific applications on the system.

The locale affects the time and date format, first day of the week, numbers, currency, and many other values formatted according to the language or region (country) set on a Linux system.

Show system locale

The locale and localectl utility provides information about the currently installed locale and changes it when needed.

$ locale
LANG=en_US. UTF-8
LC_CTYPE="en_US. UTF-8"
LC_NUMERIC="en_US. UTF-8"
LC_TIME="en_US. UTF-8"
LC_COLLATE="en_US. UTF-8"
LC_MONETARY="en_US. UTF-8"
LC_MESSAGES="en_US. UTF-8"
LC_PAPER="en_US. UTF-8"
LC_NAME="en_US. UTF-8"
LC_ADDRESS="en_US. UTF-8"
LC_TELEPHONE="en_US. UTF-8"
LC_MEASUREMENT="en_US. UTF-8"
LC_IDENTIFICATION="en_US. UTF-8"
LC_ALL=

Output a list of all available locales.

$ locale -a
C
C.UTF-8
en_US.utf8
POSIX

Change locale using localectl set-locale

If you want to change the locale, the update-locale and localectl command is used. The LANG variable can be used to set the locale for the entire system.

The following command sets LANG to de_DE.UTF-8

$ sudo localectl set-locale LANG=de_DE.UTF-8

Set language settings for user only

To set a locale for a single user, you can simply open the file ~/.bash_profile and add the following lines.

$ LANG = "de_DE.utf8"
Export LANG

Set locale using dpkg-reconfigure locales

For Debian 10 and Debian 11, the dpkg-reconfigure service program is a good way to set the system locale.

$ sudo dpkg-reconfigure locales

The locale settings are located in the following files.

  • /etc/default/locale – Ubuntu/Debian
  • /etc/locale.conf – CentOS/RHEL

These files can also be edited manually using a preferred command line editor, such as Vim or Nano, to configure the system locale.

  The next relevant post might also be helpful. This post How to Set Linux Time Zone in Console shows how to query and set the time zone in the command line.

Further help can be found in the man pages.

$ man locale
$ man update-locale
$ man localectl

Conclusion

This tutorial shows how to change and set a locale in Linux using localectl. Each locale consists of a set of environment variables to define the language, country and character encoding for applications and shell sessions on a Linux system.

The localectl utility can be used to query all the necessary information and make settings to set the locale and the appropriate keyboard layout. This is necessary when, for example, incorrect settings were made during installation and/or the default settings were lost due to updates or software installations. localectl is pre-installed on most Linux systems and is only operated via the terminal.

PDF Reader thumbnail preview in Windows Explorer

How to enable PDF Reader preview and file icons in Windows Explorer

Sumatra PDF is a small, fast and flexible PDF viewer kept in minimalist design. The free software can be installed on Windows and is alternatively available as portable software, which can also be used for operation with a USB stick.

this is how it is done

Figure: Windows Explorer PDF Preview

Enable PDF preview in Windows Explorer with Sumatra PDF

The Sumatra PDF tool allows thumbnail preview in Windows Explorer. With the option enabled during installation, with options open, and “Windows should preview PDF documents” be enabled.

The Sumatra PDF Reader can be downloaded here.

In Windows Explorer, you activate the preview window in the ribbon under View, and for the file icons in the Layout – Large Symbols or Extra Large Symbols box.

Figure: Windows Explorer – View – Preview Window

Adobe Reader PDF thumbnail preview in Windows Explorer

For Adobe users, activation is in the menu under Edit – Settings – General – Enable with Hacking in Checkbox at “PDF Miniature Preview in Windows Explorer”.

Illustration: Adobe Reader Settings

Foxit Reader Windows Explorer PDF Preview

There is no preview setting for the Foxit Reader, Foxit is also free, the preview handler is automatically activated during installation in Windows Explorer.