How to make locale “de_DE.CP1252” available for “dpkg-reconfigure locales”?












0















Im using UB 16.04 LTS Server and today a new version of the locales-package has been released and installed:



Start-Date: 2019-02-21  09:44:05
Commandline: /usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold dist-upgrade
Upgrade: [...], locales:amd64 (2.23-0ubuntu10, 2.23-0ubuntu11), [...]
End-Date: 2019-02-21 09:44:45


I'm additionally using PostgreSQL 11 with databases relying on the character set windows-1252 for historical reasons:



Name  |  Owner   | Encoding |   Collate    |    Ctype     |   Access[...]
------+----------+----------+--------------+--------------+--------------
[...] | postgres | WIN1252 | de_DE.CP1252 | de_DE.CP1252 |


To make that available, the following command is used:



localedef -f CP1252 -i /usr/share/i18n/locales/de_DE /usr/lib/locale/de_DE.CP1252


Using locale-gen instead gives the following error:



locale-gen de_DE.CP1252
Error: 'de_DE.CP1252' is not a supported language or locale


The problem now is that most likely after the new locales-package has been installed, my manually added one was removed automatically and access to the databases relying on that locale failed:



2019-02-21 09:42:45.109 CET [27039] FATAL:  Datenbank-Locale ist inkompatibel mit Betriebssystem
2019-02-21 09:42:45.109 CET [27039] DETAIL: Die Datenbank wurde mit LC_COLLATE »de_DE.CP1252« initialisiert, was von setlocale() nicht erkannt wird.


From my understanding, all locales which were recognized and enabled by dpkg-reconfigure locales have been kept and my custom locale is not listed there.



I guess that app provides all locales from the file /usr/share/i18n/SUPPORTED? Do I need to add my custom locale there manually as well? Something like the following doesn't seem to work, the new line is not shown:



de_DE.CP1252 CP1252
de_DE.UTF-8 UTF-8









share|improve this question





























    0















    Im using UB 16.04 LTS Server and today a new version of the locales-package has been released and installed:



    Start-Date: 2019-02-21  09:44:05
    Commandline: /usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold dist-upgrade
    Upgrade: [...], locales:amd64 (2.23-0ubuntu10, 2.23-0ubuntu11), [...]
    End-Date: 2019-02-21 09:44:45


    I'm additionally using PostgreSQL 11 with databases relying on the character set windows-1252 for historical reasons:



    Name  |  Owner   | Encoding |   Collate    |    Ctype     |   Access[...]
    ------+----------+----------+--------------+--------------+--------------
    [...] | postgres | WIN1252 | de_DE.CP1252 | de_DE.CP1252 |


    To make that available, the following command is used:



    localedef -f CP1252 -i /usr/share/i18n/locales/de_DE /usr/lib/locale/de_DE.CP1252


    Using locale-gen instead gives the following error:



    locale-gen de_DE.CP1252
    Error: 'de_DE.CP1252' is not a supported language or locale


    The problem now is that most likely after the new locales-package has been installed, my manually added one was removed automatically and access to the databases relying on that locale failed:



    2019-02-21 09:42:45.109 CET [27039] FATAL:  Datenbank-Locale ist inkompatibel mit Betriebssystem
    2019-02-21 09:42:45.109 CET [27039] DETAIL: Die Datenbank wurde mit LC_COLLATE »de_DE.CP1252« initialisiert, was von setlocale() nicht erkannt wird.


    From my understanding, all locales which were recognized and enabled by dpkg-reconfigure locales have been kept and my custom locale is not listed there.



    I guess that app provides all locales from the file /usr/share/i18n/SUPPORTED? Do I need to add my custom locale there manually as well? Something like the following doesn't seem to work, the new line is not shown:



    de_DE.CP1252 CP1252
    de_DE.UTF-8 UTF-8









    share|improve this question



























      0












      0








      0








      Im using UB 16.04 LTS Server and today a new version of the locales-package has been released and installed:



      Start-Date: 2019-02-21  09:44:05
      Commandline: /usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold dist-upgrade
      Upgrade: [...], locales:amd64 (2.23-0ubuntu10, 2.23-0ubuntu11), [...]
      End-Date: 2019-02-21 09:44:45


      I'm additionally using PostgreSQL 11 with databases relying on the character set windows-1252 for historical reasons:



      Name  |  Owner   | Encoding |   Collate    |    Ctype     |   Access[...]
      ------+----------+----------+--------------+--------------+--------------
      [...] | postgres | WIN1252 | de_DE.CP1252 | de_DE.CP1252 |


      To make that available, the following command is used:



      localedef -f CP1252 -i /usr/share/i18n/locales/de_DE /usr/lib/locale/de_DE.CP1252


      Using locale-gen instead gives the following error:



      locale-gen de_DE.CP1252
      Error: 'de_DE.CP1252' is not a supported language or locale


      The problem now is that most likely after the new locales-package has been installed, my manually added one was removed automatically and access to the databases relying on that locale failed:



      2019-02-21 09:42:45.109 CET [27039] FATAL:  Datenbank-Locale ist inkompatibel mit Betriebssystem
      2019-02-21 09:42:45.109 CET [27039] DETAIL: Die Datenbank wurde mit LC_COLLATE »de_DE.CP1252« initialisiert, was von setlocale() nicht erkannt wird.


      From my understanding, all locales which were recognized and enabled by dpkg-reconfigure locales have been kept and my custom locale is not listed there.



      I guess that app provides all locales from the file /usr/share/i18n/SUPPORTED? Do I need to add my custom locale there manually as well? Something like the following doesn't seem to work, the new line is not shown:



      de_DE.CP1252 CP1252
      de_DE.UTF-8 UTF-8









      share|improve this question
















      Im using UB 16.04 LTS Server and today a new version of the locales-package has been released and installed:



      Start-Date: 2019-02-21  09:44:05
      Commandline: /usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold dist-upgrade
      Upgrade: [...], locales:amd64 (2.23-0ubuntu10, 2.23-0ubuntu11), [...]
      End-Date: 2019-02-21 09:44:45


      I'm additionally using PostgreSQL 11 with databases relying on the character set windows-1252 for historical reasons:



      Name  |  Owner   | Encoding |   Collate    |    Ctype     |   Access[...]
      ------+----------+----------+--------------+--------------+--------------
      [...] | postgres | WIN1252 | de_DE.CP1252 | de_DE.CP1252 |


      To make that available, the following command is used:



      localedef -f CP1252 -i /usr/share/i18n/locales/de_DE /usr/lib/locale/de_DE.CP1252


      Using locale-gen instead gives the following error:



      locale-gen de_DE.CP1252
      Error: 'de_DE.CP1252' is not a supported language or locale


      The problem now is that most likely after the new locales-package has been installed, my manually added one was removed automatically and access to the databases relying on that locale failed:



      2019-02-21 09:42:45.109 CET [27039] FATAL:  Datenbank-Locale ist inkompatibel mit Betriebssystem
      2019-02-21 09:42:45.109 CET [27039] DETAIL: Die Datenbank wurde mit LC_COLLATE »de_DE.CP1252« initialisiert, was von setlocale() nicht erkannt wird.


      From my understanding, all locales which were recognized and enabled by dpkg-reconfigure locales have been kept and my custom locale is not listed there.



      I guess that app provides all locales from the file /usr/share/i18n/SUPPORTED? Do I need to add my custom locale there manually as well? Something like the following doesn't seem to work, the new line is not shown:



      de_DE.CP1252 CP1252
      de_DE.UTF-8 UTF-8






      apt package-management dpkg locale






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 25 at 8:20







      Thorsten Schöning

















      asked Feb 21 at 15:07









      Thorsten SchöningThorsten Schöning

      1015




      1015






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Actually, my questions consists of two parts: The ultimate goal is to not need to apply localedef more often than necessary and I thought that making my locale recognized by dpkg-reconfigure locales solves that. Sadly, that doesn't seem to be the case.



          dpkg-reconfigure locales



          The following description is ONLY to make some locale available to dpkg-reconfigure locales, it doesn't solve my problem entirely, which I address in another question. The directory created by localedef /usr/share/i18n/locales/de_DE /usr/lib/locale/de_DE.CP1252 still gets deleted whenever dpkg-reconfigure locales is executed after I did the following described steps.



          Another answer brought the file /etc/locale.gen to my attention, which contains the following docs:



          # This file lists locales that you wish to have built. You can find a list
          # of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add
          # user defined locales to /usr/local/share/i18n/SUPPORTED. If you change
          # this file, you need to rerun locale-gen.


          So I created /usr/local/share/i18n/SUPPORTED with the following entry and dpkg-reconfigure locales contained the locale I'm interested in:



          de_DE.CP1252 CP1252


          enter image description here



          The file /etc/locale.gen afterwards contained my locale as the last line as well:



          # zu_ZA.UTF-8 UTF-8
          de_DE.CP1252 CP1252


          And with all other lines in that file, disabling my locale using dpkg-reconfigure locales changes the line to become a comment as well:



          # zu_ZA.UTF-8 UTF-8
          # de_DE.CP1252 CP1252


          So, the important thing seems to be making the locale available in the file /usr/local/share/i18n/SUPPORTED instead of the package default at /usr/share/i18n/SUPPORTED.






          share|improve this answer


























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120150%2fhow-to-make-locale-de-de-cp1252-available-for-dpkg-reconfigure-locales%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Actually, my questions consists of two parts: The ultimate goal is to not need to apply localedef more often than necessary and I thought that making my locale recognized by dpkg-reconfigure locales solves that. Sadly, that doesn't seem to be the case.



            dpkg-reconfigure locales



            The following description is ONLY to make some locale available to dpkg-reconfigure locales, it doesn't solve my problem entirely, which I address in another question. The directory created by localedef /usr/share/i18n/locales/de_DE /usr/lib/locale/de_DE.CP1252 still gets deleted whenever dpkg-reconfigure locales is executed after I did the following described steps.



            Another answer brought the file /etc/locale.gen to my attention, which contains the following docs:



            # This file lists locales that you wish to have built. You can find a list
            # of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add
            # user defined locales to /usr/local/share/i18n/SUPPORTED. If you change
            # this file, you need to rerun locale-gen.


            So I created /usr/local/share/i18n/SUPPORTED with the following entry and dpkg-reconfigure locales contained the locale I'm interested in:



            de_DE.CP1252 CP1252


            enter image description here



            The file /etc/locale.gen afterwards contained my locale as the last line as well:



            # zu_ZA.UTF-8 UTF-8
            de_DE.CP1252 CP1252


            And with all other lines in that file, disabling my locale using dpkg-reconfigure locales changes the line to become a comment as well:



            # zu_ZA.UTF-8 UTF-8
            # de_DE.CP1252 CP1252


            So, the important thing seems to be making the locale available in the file /usr/local/share/i18n/SUPPORTED instead of the package default at /usr/share/i18n/SUPPORTED.






            share|improve this answer






























              0














              Actually, my questions consists of two parts: The ultimate goal is to not need to apply localedef more often than necessary and I thought that making my locale recognized by dpkg-reconfigure locales solves that. Sadly, that doesn't seem to be the case.



              dpkg-reconfigure locales



              The following description is ONLY to make some locale available to dpkg-reconfigure locales, it doesn't solve my problem entirely, which I address in another question. The directory created by localedef /usr/share/i18n/locales/de_DE /usr/lib/locale/de_DE.CP1252 still gets deleted whenever dpkg-reconfigure locales is executed after I did the following described steps.



              Another answer brought the file /etc/locale.gen to my attention, which contains the following docs:



              # This file lists locales that you wish to have built. You can find a list
              # of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add
              # user defined locales to /usr/local/share/i18n/SUPPORTED. If you change
              # this file, you need to rerun locale-gen.


              So I created /usr/local/share/i18n/SUPPORTED with the following entry and dpkg-reconfigure locales contained the locale I'm interested in:



              de_DE.CP1252 CP1252


              enter image description here



              The file /etc/locale.gen afterwards contained my locale as the last line as well:



              # zu_ZA.UTF-8 UTF-8
              de_DE.CP1252 CP1252


              And with all other lines in that file, disabling my locale using dpkg-reconfigure locales changes the line to become a comment as well:



              # zu_ZA.UTF-8 UTF-8
              # de_DE.CP1252 CP1252


              So, the important thing seems to be making the locale available in the file /usr/local/share/i18n/SUPPORTED instead of the package default at /usr/share/i18n/SUPPORTED.






              share|improve this answer




























                0












                0








                0







                Actually, my questions consists of two parts: The ultimate goal is to not need to apply localedef more often than necessary and I thought that making my locale recognized by dpkg-reconfigure locales solves that. Sadly, that doesn't seem to be the case.



                dpkg-reconfigure locales



                The following description is ONLY to make some locale available to dpkg-reconfigure locales, it doesn't solve my problem entirely, which I address in another question. The directory created by localedef /usr/share/i18n/locales/de_DE /usr/lib/locale/de_DE.CP1252 still gets deleted whenever dpkg-reconfigure locales is executed after I did the following described steps.



                Another answer brought the file /etc/locale.gen to my attention, which contains the following docs:



                # This file lists locales that you wish to have built. You can find a list
                # of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add
                # user defined locales to /usr/local/share/i18n/SUPPORTED. If you change
                # this file, you need to rerun locale-gen.


                So I created /usr/local/share/i18n/SUPPORTED with the following entry and dpkg-reconfigure locales contained the locale I'm interested in:



                de_DE.CP1252 CP1252


                enter image description here



                The file /etc/locale.gen afterwards contained my locale as the last line as well:



                # zu_ZA.UTF-8 UTF-8
                de_DE.CP1252 CP1252


                And with all other lines in that file, disabling my locale using dpkg-reconfigure locales changes the line to become a comment as well:



                # zu_ZA.UTF-8 UTF-8
                # de_DE.CP1252 CP1252


                So, the important thing seems to be making the locale available in the file /usr/local/share/i18n/SUPPORTED instead of the package default at /usr/share/i18n/SUPPORTED.






                share|improve this answer















                Actually, my questions consists of two parts: The ultimate goal is to not need to apply localedef more often than necessary and I thought that making my locale recognized by dpkg-reconfigure locales solves that. Sadly, that doesn't seem to be the case.



                dpkg-reconfigure locales



                The following description is ONLY to make some locale available to dpkg-reconfigure locales, it doesn't solve my problem entirely, which I address in another question. The directory created by localedef /usr/share/i18n/locales/de_DE /usr/lib/locale/de_DE.CP1252 still gets deleted whenever dpkg-reconfigure locales is executed after I did the following described steps.



                Another answer brought the file /etc/locale.gen to my attention, which contains the following docs:



                # This file lists locales that you wish to have built. You can find a list
                # of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add
                # user defined locales to /usr/local/share/i18n/SUPPORTED. If you change
                # this file, you need to rerun locale-gen.


                So I created /usr/local/share/i18n/SUPPORTED with the following entry and dpkg-reconfigure locales contained the locale I'm interested in:



                de_DE.CP1252 CP1252


                enter image description here



                The file /etc/locale.gen afterwards contained my locale as the last line as well:



                # zu_ZA.UTF-8 UTF-8
                de_DE.CP1252 CP1252


                And with all other lines in that file, disabling my locale using dpkg-reconfigure locales changes the line to become a comment as well:



                # zu_ZA.UTF-8 UTF-8
                # de_DE.CP1252 CP1252


                So, the important thing seems to be making the locale available in the file /usr/local/share/i18n/SUPPORTED instead of the package default at /usr/share/i18n/SUPPORTED.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Feb 25 at 8:23

























                answered Feb 22 at 14:12









                Thorsten SchöningThorsten Schöning

                1015




                1015






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120150%2fhow-to-make-locale-de-de-cp1252-available-for-dpkg-reconfigure-locales%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                    is 'sed' thread safe

                    How to make a Squid Proxy server?