0

I am experiencing an error while I try to install or upgrade anything in a Debian 9.0 server.

That is what the terminal returns to me.

root@engelmar:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cdebconf : Depends: libdebian-installer4 (>= 0.110) but it is not installed
            Depends: libtextwrap1 but it is not installed
 libc-bin : Depends: libc6 (< 2.25) but 2.28-10 is installed
 libc-dev-bin : Depends: libc6 (< 2.25) but 2.28-10 is installed
 libc6-dev : Depends: libc6 (= 2.24-11+deb9u4) but 2.28-10 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
root@engelmar:~# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-libc-dev python-all sysstat
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libdebian-installer4 libtextwrap1
The following packages will be REMOVED:
  build-essential g++ g++-6 libc-bin libc-dev-bin libc6-dev libexpat1-dev libpython-all-dev libpython-dev libpython2.7-dev libstdc++-6-dev python-all-dev python-dev
  python2.7-dev
The following NEW packages will be installed:
  libdebian-installer4 libtextwrap1
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  libc-bin
0 upgraded, 2 newly installed, 14 to remove and 0 not upgraded.
5 not fully installed or removed.
Need to get 0 B/201 kB of archives.
After this operation, 102 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?] Yes, do as I say!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "pt_BR:pt:en",
        LC_ALL = (unset),
        LANG = "pt_BR.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: Arquivo ou diretório não encontrado
debconf: delaying package configuration, since apt-utils is not installed
dpkg: error processing package debconf (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 debconf
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@engelmar:~#

Does someone know how to fix it?

2

I am sorry to say but your system is probably broken beyond reasonable repair. Trying to work backwards to determine what has happened, you say that you are running a Debian 9 system, but you have the libc6 package installed from Debian 10 (2.28). This is often caused by attempting to mix use repositories from multiple versions of Debian or from Debian derivatives such as Ubuntu. Debian's wiki has some words to say on the topic:

Don't make a FrankenDebian

Debian Stable should not be combined with other releases. If you're trying to install software that isn't available in the current Debian Stable release, it's not a good idea to add repositories for other Debian releases. The problems might not happen right away, but the next time you install updates.

The reason things can break is because the software packaged for one Debian release is built to be compatible with the rest of the software for that release. For example, installing packages from buster on a stretch system could also install newer versions of core libraries including libc6. This results in a system that is not testing or stable but a broken mix of the two.

At this stage your best bet is probably to back up your data and reinstall the operating system, this time making sure no repositories are trying to pull from repositories that aren't intended for Debian 9.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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