How to remove system localesHow do I add locale to ubuntu server?How to remove unnecessary localesLocales and encodinglanguage locales configuration fileLocale reverts to old locale after exiting root?How to remove unnecessary localesReinstall locales?What is krb5-locales?How can I fix my locale?How can I set locales in /etc/defaults/locale?Very strange behaviour of the Compose KeyFixing missing locales

Why is my 401k manager recommending me to save more?

What is the meaning of "it" in "as luck would have it"?

Do electrons really perform instantaneous quantum leaps?

Identifying positions of the last TRUEs in a sequence of TRUEs and FALSEs

What are the children of two Muggle-borns called?

Why was Pan Am Flight 103 flying over Lockerbie?

What verb goes with "coup"?

What happens if a caster is surprised while casting a spell with a long casting time?

Why are examinees often not allowed to leave during the start and end of an exam?

Having to constantly redo everything because I don't know how to do it

Russian equivalents of 能骗就骗 (if you can cheat, then cheat)

What's the lunar calendar of two moons

My mom helped me cosign a car and now she wants to take it

Why are symbols not written in words?

iMac 2019: Can I mix the old modules with the new ones when upgrading RAM?

Is it possible to alias a column based on the result of a select+where?

What was the first science fiction or fantasy multiple choice book?

Does "boire un jus" tend to mean "coffee" or "juice of fruit"?

Why doesn't SpaceX land boosters in Africa?

What was the point of separating stdout and stderr?

Active wildlife outside the window- Good or Bad for Cat psychology?

Multiple tests with effects all in same direction but only few significant

How is it possible for tall trees to pull water to heights more than 10m?

What could a Medieval society do with excess animal blood?



How to remove system locales


How do I add locale to ubuntu server?How to remove unnecessary localesLocales and encodinglanguage locales configuration fileLocale reverts to old locale after exiting root?How to remove unnecessary localesReinstall locales?What is krb5-locales?How can I fix my locale?How can I set locales in /etc/defaults/locale?Very strange behaviour of the Compose KeyFixing missing locales













1















How to remove system locales, as oppose to package locales as asked in How to remove unnecessary locales?



I'm getting the following errors recently:



locale: Cannot set LC_ALL to default locale: No such file or directory


I have en_US locale in my system:



$ grep en /var/lib/locales/supported.d/local
en_US ISO-8859-1
en_US.UTF-8 UTF-8

$ locale -a | grep en
en_US
en_US.iso88591
en_US.utf8


but not en, as complained by perl:



perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "",
LC_ALL = (unset),
LC_MEASUREMENT = "en",
LC_PAPER = "en",
LC_MONETARY = "en",
LC_NAME = "en",
LC_ADDRESS = "en",
LC_NUMERIC = "en",
LC_TELEPHONE = "en",
LC_IDENTIFICATION = "en",
LC_TIME = "en",
LANG = "C"


So I add the locale en by:



% locale-gen en
Generating locales (this might take a while)...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8...^C


I don't want any of above locales (only en_US), but now I can't get rid of them -- I followed the steps in
https://serverfault.com/questions/394610/remove-a-locale-in-ubuntu



But when it comes to the last step, I'm still getting:



% locale-gen
Generating locales (this might take a while)...
en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8...^C


How to remove all above locales and keep only en_US?



Conclusion & Supplement



Thanks to Gunnar's answer, it is indeed caused by entries in /etc/locale.gen, for those extra locales. Just FTR, this is what locale-gen en has changed in /etc/locale.gen:



$ sed '/^#/d; /en/p;' /etc/locale.gen


en_AG UTF-8
en_AG UTF-8
en_AU.UTF-8 UTF-8
en_AU.UTF-8 UTF-8
en_BW.UTF-8 UTF-8
en_BW.UTF-8 UTF-8
en_CA.UTF-8 UTF-8
en_CA.UTF-8 UTF-8
en_DK.UTF-8 UTF-8
en_DK.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
en_HK.UTF-8 UTF-8
en_HK.UTF-8 UTF-8
en_IE.UTF-8 UTF-8
en_IE.UTF-8 UTF-8
en_IL UTF-8
en_IL UTF-8
en_IN UTF-8
en_IN UTF-8
en_NG UTF-8
en_NG UTF-8
en_NZ.UTF-8 UTF-8
en_NZ.UTF-8 UTF-8
en_PH.UTF-8 UTF-8
en_PH.UTF-8 UTF-8
en_SC.UTF-8 UTF-8
en_SC.UTF-8 UTF-8
en_SG.UTF-8 UTF-8
en_SG.UTF-8 UTF-8
en_US.UTF-8 UTF-8
en_US.UTF-8 UTF-8
en_ZA.UTF-8 UTF-8
en_ZA.UTF-8 UTF-8
en_ZM UTF-8
en_ZM UTF-8
en_ZW.UTF-8 UTF-8
en_ZW.UTF-8 UTF-8


As a comparison, here is what the default looks like (i.e., without any of the above extra locales):



$ sed '/^#/d;' /etc/locale.gen; echo ---


---









share|improve this question




























    1















    How to remove system locales, as oppose to package locales as asked in How to remove unnecessary locales?



    I'm getting the following errors recently:



    locale: Cannot set LC_ALL to default locale: No such file or directory


    I have en_US locale in my system:



    $ grep en /var/lib/locales/supported.d/local
    en_US ISO-8859-1
    en_US.UTF-8 UTF-8

    $ locale -a | grep en
    en_US
    en_US.iso88591
    en_US.utf8


    but not en, as complained by perl:



    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    LANGUAGE = "",
    LC_ALL = (unset),
    LC_MEASUREMENT = "en",
    LC_PAPER = "en",
    LC_MONETARY = "en",
    LC_NAME = "en",
    LC_ADDRESS = "en",
    LC_NUMERIC = "en",
    LC_TELEPHONE = "en",
    LC_IDENTIFICATION = "en",
    LC_TIME = "en",
    LANG = "C"


    So I add the locale en by:



    % locale-gen en
    Generating locales (this might take a while)...
    en_AG.UTF-8... done
    en_AU.UTF-8... done
    en_BW.UTF-8... done
    en_CA.UTF-8... done
    en_DK.UTF-8...^C


    I don't want any of above locales (only en_US), but now I can't get rid of them -- I followed the steps in
    https://serverfault.com/questions/394610/remove-a-locale-in-ubuntu



    But when it comes to the last step, I'm still getting:



    % locale-gen
    Generating locales (this might take a while)...
    en_AG.UTF-8... done
    en_AU.UTF-8... done
    en_BW.UTF-8... done
    en_CA.UTF-8... done
    en_DK.UTF-8...^C


    How to remove all above locales and keep only en_US?



    Conclusion & Supplement



    Thanks to Gunnar's answer, it is indeed caused by entries in /etc/locale.gen, for those extra locales. Just FTR, this is what locale-gen en has changed in /etc/locale.gen:



    $ sed '/^#/d; /en/p;' /etc/locale.gen


    en_AG UTF-8
    en_AG UTF-8
    en_AU.UTF-8 UTF-8
    en_AU.UTF-8 UTF-8
    en_BW.UTF-8 UTF-8
    en_BW.UTF-8 UTF-8
    en_CA.UTF-8 UTF-8
    en_CA.UTF-8 UTF-8
    en_DK.UTF-8 UTF-8
    en_DK.UTF-8 UTF-8
    en_GB.UTF-8 UTF-8
    en_GB.UTF-8 UTF-8
    en_HK.UTF-8 UTF-8
    en_HK.UTF-8 UTF-8
    en_IE.UTF-8 UTF-8
    en_IE.UTF-8 UTF-8
    en_IL UTF-8
    en_IL UTF-8
    en_IN UTF-8
    en_IN UTF-8
    en_NG UTF-8
    en_NG UTF-8
    en_NZ.UTF-8 UTF-8
    en_NZ.UTF-8 UTF-8
    en_PH.UTF-8 UTF-8
    en_PH.UTF-8 UTF-8
    en_SC.UTF-8 UTF-8
    en_SC.UTF-8 UTF-8
    en_SG.UTF-8 UTF-8
    en_SG.UTF-8 UTF-8
    en_US.UTF-8 UTF-8
    en_US.UTF-8 UTF-8
    en_ZA.UTF-8 UTF-8
    en_ZA.UTF-8 UTF-8
    en_ZM UTF-8
    en_ZM UTF-8
    en_ZW.UTF-8 UTF-8
    en_ZW.UTF-8 UTF-8


    As a comparison, here is what the default looks like (i.e., without any of the above extra locales):



    $ sed '/^#/d;' /etc/locale.gen; echo ---


    ---









    share|improve this question


























      1












      1








      1








      How to remove system locales, as oppose to package locales as asked in How to remove unnecessary locales?



      I'm getting the following errors recently:



      locale: Cannot set LC_ALL to default locale: No such file or directory


      I have en_US locale in my system:



      $ grep en /var/lib/locales/supported.d/local
      en_US ISO-8859-1
      en_US.UTF-8 UTF-8

      $ locale -a | grep en
      en_US
      en_US.iso88591
      en_US.utf8


      but not en, as complained by perl:



      perl: warning: Setting locale failed.
      perl: warning: Please check that your locale settings:
      LANGUAGE = "",
      LC_ALL = (unset),
      LC_MEASUREMENT = "en",
      LC_PAPER = "en",
      LC_MONETARY = "en",
      LC_NAME = "en",
      LC_ADDRESS = "en",
      LC_NUMERIC = "en",
      LC_TELEPHONE = "en",
      LC_IDENTIFICATION = "en",
      LC_TIME = "en",
      LANG = "C"


      So I add the locale en by:



      % locale-gen en
      Generating locales (this might take a while)...
      en_AG.UTF-8... done
      en_AU.UTF-8... done
      en_BW.UTF-8... done
      en_CA.UTF-8... done
      en_DK.UTF-8...^C


      I don't want any of above locales (only en_US), but now I can't get rid of them -- I followed the steps in
      https://serverfault.com/questions/394610/remove-a-locale-in-ubuntu



      But when it comes to the last step, I'm still getting:



      % locale-gen
      Generating locales (this might take a while)...
      en_AG.UTF-8... done
      en_AU.UTF-8... done
      en_BW.UTF-8... done
      en_CA.UTF-8... done
      en_DK.UTF-8...^C


      How to remove all above locales and keep only en_US?



      Conclusion & Supplement



      Thanks to Gunnar's answer, it is indeed caused by entries in /etc/locale.gen, for those extra locales. Just FTR, this is what locale-gen en has changed in /etc/locale.gen:



      $ sed '/^#/d; /en/p;' /etc/locale.gen


      en_AG UTF-8
      en_AG UTF-8
      en_AU.UTF-8 UTF-8
      en_AU.UTF-8 UTF-8
      en_BW.UTF-8 UTF-8
      en_BW.UTF-8 UTF-8
      en_CA.UTF-8 UTF-8
      en_CA.UTF-8 UTF-8
      en_DK.UTF-8 UTF-8
      en_DK.UTF-8 UTF-8
      en_GB.UTF-8 UTF-8
      en_GB.UTF-8 UTF-8
      en_HK.UTF-8 UTF-8
      en_HK.UTF-8 UTF-8
      en_IE.UTF-8 UTF-8
      en_IE.UTF-8 UTF-8
      en_IL UTF-8
      en_IL UTF-8
      en_IN UTF-8
      en_IN UTF-8
      en_NG UTF-8
      en_NG UTF-8
      en_NZ.UTF-8 UTF-8
      en_NZ.UTF-8 UTF-8
      en_PH.UTF-8 UTF-8
      en_PH.UTF-8 UTF-8
      en_SC.UTF-8 UTF-8
      en_SC.UTF-8 UTF-8
      en_SG.UTF-8 UTF-8
      en_SG.UTF-8 UTF-8
      en_US.UTF-8 UTF-8
      en_US.UTF-8 UTF-8
      en_ZA.UTF-8 UTF-8
      en_ZA.UTF-8 UTF-8
      en_ZM UTF-8
      en_ZM UTF-8
      en_ZW.UTF-8 UTF-8
      en_ZW.UTF-8 UTF-8


      As a comparison, here is what the default looks like (i.e., without any of the above extra locales):



      $ sed '/^#/d;' /etc/locale.gen; echo ---


      ---









      share|improve this question
















      How to remove system locales, as oppose to package locales as asked in How to remove unnecessary locales?



      I'm getting the following errors recently:



      locale: Cannot set LC_ALL to default locale: No such file or directory


      I have en_US locale in my system:



      $ grep en /var/lib/locales/supported.d/local
      en_US ISO-8859-1
      en_US.UTF-8 UTF-8

      $ locale -a | grep en
      en_US
      en_US.iso88591
      en_US.utf8


      but not en, as complained by perl:



      perl: warning: Setting locale failed.
      perl: warning: Please check that your locale settings:
      LANGUAGE = "",
      LC_ALL = (unset),
      LC_MEASUREMENT = "en",
      LC_PAPER = "en",
      LC_MONETARY = "en",
      LC_NAME = "en",
      LC_ADDRESS = "en",
      LC_NUMERIC = "en",
      LC_TELEPHONE = "en",
      LC_IDENTIFICATION = "en",
      LC_TIME = "en",
      LANG = "C"


      So I add the locale en by:



      % locale-gen en
      Generating locales (this might take a while)...
      en_AG.UTF-8... done
      en_AU.UTF-8... done
      en_BW.UTF-8... done
      en_CA.UTF-8... done
      en_DK.UTF-8...^C


      I don't want any of above locales (only en_US), but now I can't get rid of them -- I followed the steps in
      https://serverfault.com/questions/394610/remove-a-locale-in-ubuntu



      But when it comes to the last step, I'm still getting:



      % locale-gen
      Generating locales (this might take a while)...
      en_AG.UTF-8... done
      en_AU.UTF-8... done
      en_BW.UTF-8... done
      en_CA.UTF-8... done
      en_DK.UTF-8...^C


      How to remove all above locales and keep only en_US?



      Conclusion & Supplement



      Thanks to Gunnar's answer, it is indeed caused by entries in /etc/locale.gen, for those extra locales. Just FTR, this is what locale-gen en has changed in /etc/locale.gen:



      $ sed '/^#/d; /en/p;' /etc/locale.gen


      en_AG UTF-8
      en_AG UTF-8
      en_AU.UTF-8 UTF-8
      en_AU.UTF-8 UTF-8
      en_BW.UTF-8 UTF-8
      en_BW.UTF-8 UTF-8
      en_CA.UTF-8 UTF-8
      en_CA.UTF-8 UTF-8
      en_DK.UTF-8 UTF-8
      en_DK.UTF-8 UTF-8
      en_GB.UTF-8 UTF-8
      en_GB.UTF-8 UTF-8
      en_HK.UTF-8 UTF-8
      en_HK.UTF-8 UTF-8
      en_IE.UTF-8 UTF-8
      en_IE.UTF-8 UTF-8
      en_IL UTF-8
      en_IL UTF-8
      en_IN UTF-8
      en_IN UTF-8
      en_NG UTF-8
      en_NG UTF-8
      en_NZ.UTF-8 UTF-8
      en_NZ.UTF-8 UTF-8
      en_PH.UTF-8 UTF-8
      en_PH.UTF-8 UTF-8
      en_SC.UTF-8 UTF-8
      en_SC.UTF-8 UTF-8
      en_SG.UTF-8 UTF-8
      en_SG.UTF-8 UTF-8
      en_US.UTF-8 UTF-8
      en_US.UTF-8 UTF-8
      en_ZA.UTF-8 UTF-8
      en_ZA.UTF-8 UTF-8
      en_ZM UTF-8
      en_ZM UTF-8
      en_ZW.UTF-8 UTF-8
      en_ZW.UTF-8 UTF-8


      As a comparison, here is what the default looks like (i.e., without any of the above extra locales):



      $ sed '/^#/d;' /etc/locale.gen; echo ---


      ---






      configuration system locale removing






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago







      xpt

















      asked 10 hours ago









      xptxpt

      2311 silver badge10 bronze badges




      2311 silver badge10 bronze badges




















          1 Answer
          1






          active

          oldest

          votes


















          3














          You should edit /etc/locale.gen and comment the locales you don't want. Then run



          sudo locale-gen


          There does not exist any locale with the name en. The one you probably want to use is en_US.UTF-8 and not en_US. (The latter enables latin1 encoding.)






          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%2f1154895%2fhow-to-remove-system-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









            3














            You should edit /etc/locale.gen and comment the locales you don't want. Then run



            sudo locale-gen


            There does not exist any locale with the name en. The one you probably want to use is en_US.UTF-8 and not en_US. (The latter enables latin1 encoding.)






            share|improve this answer



























              3














              You should edit /etc/locale.gen and comment the locales you don't want. Then run



              sudo locale-gen


              There does not exist any locale with the name en. The one you probably want to use is en_US.UTF-8 and not en_US. (The latter enables latin1 encoding.)






              share|improve this answer

























                3












                3








                3







                You should edit /etc/locale.gen and comment the locales you don't want. Then run



                sudo locale-gen


                There does not exist any locale with the name en. The one you probably want to use is en_US.UTF-8 and not en_US. (The latter enables latin1 encoding.)






                share|improve this answer













                You should edit /etc/locale.gen and comment the locales you don't want. Then run



                sudo locale-gen


                There does not exist any locale with the name en. The one you probably want to use is en_US.UTF-8 and not en_US. (The latter enables latin1 encoding.)







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 9 hours ago









                Gunnar HjalmarssonGunnar Hjalmarsson

                20.5k2 gold badges35 silver badges63 bronze badges




                20.5k2 gold badges35 silver badges63 bronze badges



























                    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%2f1154895%2fhow-to-remove-system-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

                    Sahara Skak | Bilen | Luke uk diar | NawigatsjuunCommonskategorii: SaharaWikivoyage raisfeerer: Sahara26° N, 13° O

                    The fall designs the understood secretary. Looking glass Science Shock Discovery Hot Everybody Loves Raymond Smile 곳 서비스 성실하다 Defas Kaloolon Definition: To combine or impregnate with sulphur or any of its compounds as to sulphurize caoutchouc in vulcanizing Flame colored Reason Useful Thin Help 갖다 유명하다 낙엽 장례식 Country Iron Definition: A fencer a gladiator one who exhibits his skill in the use of the sword Definition: The American black throated bunting Spiza Americana Nostalgic Needy Method to my madness 시키다 평가되다 전부 소설가 우아하다 Argument Tin Feeling Representative Gym Music Gaur Chicken 일쑤 코치 편 학생증 The harbor values the sugar. Vasagle Yammoe Enstatite Definition: Capable of being limited Road Neighborly Five Refer Built Kangaroo 비비다 Degree Release Bargain Horse 하루 형님 유교 석 동부 괴롭히다 경제력

                    19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу