Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hey there :) Some days ago i tried to install git on my Debian system. The instalation aborted and since this moment i get a locales error everytime i try do install/remove something via apt -.-

apt-get remove git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
0 upgraded, 0 newly installed, 1 to remove and 75 not upgraded.
18 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "de_DE",
LANG = "de_DE@euro"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Kann LC_ALL nicht auf die Standard-Lokale einstellen: Datei oder Verzeichnis nicht gefunden
dpkg: error processing git (--remove):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

i tried to reconfigure locales but i get the same error... how can i fix this?


share|improve this question
Try dpkg-reconfigure locales, make sure your locale is generated. – Zoredache Mar 24 '11 at 18:43
as is wrote i already tried this – soupdiver Mar 24 '11 at 19:09

the locale warning doesn't have anything to do with the git problem. following the instructions, you would want to try apt-get install --reinstall git or aptitude reinstall git, then try removing it again. If you have the git package in /var/cache/apt/archives, you could also try reinstalling with somehting like dpkg -i /var/cache/apt/archives/git_....deb (the exact filename would vary based on arch and version of git)

share|improve this answer here is the output... i dont really know what to do ^^ – soupdiver Mar 24 '11 at 19:08
this is saying that apt can't find the git package (anymore?). Did you originally install this package using apt? – stew Mar 24 '11 at 19:11
yeah as i said... i tried installing git via apt some days ago and then i got the error with locale the first time – soupdiver Mar 24 '11 at 19:15
does the .deb exist in /var/cache/apt/archives ? if so, try installing it with dpkg -i – stew Mar 24 '11 at 21:06

18 not fully installed or removed.

You have 18 packages in an intermediate state, you should resolve that first. There's a chance that the git issue is due to that, and it's very likely that Perl's complaints about the locales are due to that. Specifically, the Perl complaint is probably due to the locales package being in a non-functional state that dpkg --configure locales (not dpkg-reconfigure) or apt-get -f install would fix.

Run apt-get -f install. If this doesn't fix the problem, post the error messages that apt-get -f install spews out.

share|improve this answer

I had the same issue recently and the following fixed the locale warnings

locale-gen en_US.UTF-8

change en_US.UTF-8 to whatever locale you want to use! I'm afraid i can't help you with the git issue. :/ maybe you will be able to reinstall it after the locale is fixed (just guessing)

share|improve this answer
Here it's probably just the locale package not being configured that's causing the Perl warning. That's subtly different from locales not being set up properly, which locale-gen would fix. – Gilles Apr 29 '11 at 23:49
Yes but i had the same warnings as described and this fixed it. I thought it would be worth the try. – gino Apr 30 '11 at 12:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.