0

I did something horrible and hopefully didnt destroy my Debian 9 Strech... I googled like 2 Hours to fix this but nothing has helped...

What I Did: my ClamAV was outdated, and I added a testing source into /etc/apt/sources.list manually and typed "apt-get install clamav" into terminal, now some Libs are Broken... Moreover I deleted the testing source again and tried to restore the state, but not successfully. The Command suggested to use "apt --fix-broken install" and I did.

Now it seems that my locale is completely gone and some librarys too: Everytime I try to upgrade / Install something I get this:

Click for better readability (error Message)

> apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.
Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17.
Setting up linux-image-4.9.0-8-amd64 (4.9.144-3.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.9.0-8-amd64
WARNING: no ldd around - install libc-bin
update-initramfs: failed for /boot/initrd.img-4.9.0-8-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-4.9.0-8-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.9.0-8-amd64
> 
> 

Another Error message I get when I use "sudo apt-get install --reinstall libc-bin"

> 
> Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
> 
> The following packages have unmet dependencies:
 libc-bin : Depends: libc6 (< 2.25) but 2.28-6 is to be installed
E: Unable to correct problems, you have held broken packages.

(Sorry for this horrible quote of the commandline I wanted to post a Image, but I dont have enough reputations yet. I posted a link where you can find a better readable version.)

I tried to fix this by using these commands:

> sudo locale-gen "en_US.UTF-8"`
-> locale-gen: command not found
> 
> update-locale LANG=de_DE.UTF-8
-> update-locale: command not found

I also tried to follow this instruction:https://itsfoss.com/fix-exec-locale-file-directory/

Didn´t help either.

Im so frustrated, cause I have no backup I can restore. Thanks for your help

wurtel
  • 3,806
  • 12
  • 15
  • `you have held broken packages` is probably the biggest cause of the problems. I would try to run apt-get with the `--allow-change-held-packages` option. If you have aptitude, or manage to get aptitude installed, you can use aptitude to interactively try to fix your system. You may need to add the testing source again, and upgrade the rest of your system to testing. Downgrading is always painful. BTW the locale errors are the least of your problems and shouldn't interfere with package updates besides the error messages themselves. – wurtel Feb 25 '19 at 10:53

1 Answers1

0

Whenever someone tells you to add sources from unstable or testing onto your stable system, you should ignore them and keep looking for another option. This is the #1 most common way Debian systems get broken.

It might be possible to fix the system with a dist-upgrade. First remove all the testing sources, ensuring that every apt source is on stable (or oldstable if that's what you are running) and then:

apt-get update
apt-get dist-upgrade

As wurtel said in a comment, you could also change all your sources to testing, and then dist-upgrade to testing.

But keep in mind that your system is so damaged, that this may not even fix it, and your last option will be to reinstall the OS.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940