由于在debian系统引用了kali的源,然后使用了autoremove的操作,导致系统依赖崩溃,在安装docker.io的时候出现下面的提示

or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 g++ : Depends: cpp (= 4:8.3.0-1) but 4:10.2.1-1 is to be installed
       Depends: gcc (= 4:8.3.0-1) but 4:10.2.1-1 is to be installed
       Depends: g++-8 (>= 8.3.0-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

解决办法

使用aptitude安装需要安装的软件即可

apt install aptitude 
aptitude install g++
sudo aptitude install docker.io

执行效果

root@l:~/Python-3.8.2# docker ps -a
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@l:~/Python-3.8.2# systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
root@l:~/Python-3.8.2# ap g++
apache2                       apm_available                 apt                           apt-config                    apt-get                       apt-sortpkgs                  aptitude-curses
apache2ctl                    applygnupgdefaults            apt-cache                     apt-extracttemplates          apt-key                       aptitude                      aptitude-run-state-bundle
apachectl                     apropos                       apt-cdrom                     apt-ftparchive                apt-mark                      aptitude-create-state-bundle  
root@l:~/Python-3.8.2# apt g++
apt                           apt-cdrom                     apt-extracttemplates          apt-get                       apt-mark                      aptitude                      aptitude-curses
apt-cache                     apt-config                    apt-ftparchive                apt-key                       apt-sortpkgs                  aptitude-create-state-bundle  aptitude-run-state-bundle
root@l:~/Python-3.8.2# aptitude install g++
Warning: Invalid locale (please review locale settings, this might lead to problems later):
  locale::facet::_S_create_c_locale name not valid
The following NEW packages will be installed:
  g++{b} g++-8{a} libc-dev-bin{ab} libc6-dev{ab} libstdc++-8-dev{a} 
0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 275 kB/14.3 MB of archives. After unpacking 64.6 MB will be used.
The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.28-10) but 2.31-17 is installed
 g++ : Depends: cpp (= 4:8.3.0-1) but 4:10.2.1-1 is installed
       Depends: gcc (= 4:8.3.0-1) but 4:10.2.1-1 is installed
 libc-dev-bin : Depends: libc6 (< 2.29) but 2.31-17 is installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     g++ [Not Installed]                                
2)     g++-8 [Not Installed]                              
3)     libc-dev-bin [Not Installed]                       
4)     libc6-dev [Not Installed]                          
5)     libstdc++-8-dev [Not Installed]                    



Accept this solution? [Y/n/q/?] y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
perl: warning: Setting locale failed.    
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.utf8",
        LC_ALL = (unset),
        LANG = "en_US.utf8"
    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: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
                                         
root@l:~/Python-3.8.2# aptitude install g++
Warning: Invalid locale (please review locale settings, this might lead to problems later):
  locale::facet::_S_create_c_locale name not valid
The following NEW packages will be installed:
  g++{b} g++-8{a} libc-dev-bin{ab} libc6-dev{ab} libstdc++-8-dev{a} 
0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 275 kB/14.3 MB of archives. After unpacking 64.6 MB will be used.
The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.28-10) but 2.31-17 is installed
 g++ : Depends: cpp (= 4:8.3.0-1) but 4:10.2.1-1 is installed
       Depends: gcc (= 4:8.3.0-1) but 4:10.2.1-1 is installed
 libc-dev-bin : Depends: libc6 (< 2.29) but 2.31-17 is installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     g++ [Not Installed]                                
2)     g++-8 [Not Installed]                              
3)     libc-dev-bin [Not Installed]                       
4)     libc6-dev [Not Installed]                          
5)     libstdc++-8-dev [Not Installed]                    



Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

      Remove the following packages:                                        
1)      libperl5.32 [5.32.1-5 (now)]                                        
2)      perl-modules-5.32 [5.32.1-5 (now)]                                  

      Install the following packages:                                       
3)      libperl5.28 [5.28.1-6+deb10u1 (oldstable)]                          

      Downgrade the following packages:                                     
4)      cpp [4:10.2.1-1 (now) -> 4:8.3.0-1 (oldstable)]                     
5)      gcc [4:10.2.1-1 (now) -> 4:8.3.0-1 (oldstable)]                     
6)      libalgorithm-diff-xs-perl [0.04-6+b1 (now) -> 0.04-5+b1 (oldstable)]
7)      libbrotli1 [1.0.9-2+b2 (now) -> 1.0.7-2+deb10u1 (oldstable)]        
8)      libc-bin [2.31-17 (now) -> 2.28-10 (oldstable)]                     
9)      libc6 [2.31-17 (now) -> 2.28-10 (oldstable)]                        
10)     libfile-fcntllock-perl [0.22-3+b7 (now) -> 0.22-3+b5 (oldstable)]   
11)     liblocale-gettext-perl [1.07-4+b1 (now) -> 1.07-3+b4 (oldstable)]   
12)     libtext-charwidth-perl [0.04-10+b1 (now) -> 0.04-7.1+b1 (oldstable)]
13)     libtext-iconv-perl [1.7-7+b1 (now) -> 1.7-5+b7 (oldstable)]         
14)     locales [2.31-17 (now) -> 2.28-10 (oldstable)]                      
15)     perl [5.32.1-5 (now) -> 5.28.1-6+deb10u1 (oldstable)]               
16)     perl-base [5.32.1-5 (now) -> 5.28.1-6+deb10u1 (oldstable)]          
17)     pigz [2.6-1 (now) -> 2.4-1 (oldstable)]                             

      Leave the following dependencies unresolved:                          
18)     perl-modules-5.32 recommends perl (>= 5.32.1-1)                     



Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
  cpp gcc libalgorithm-diff-xs-perl libbrotli1 libc-bin libc6 libfile-fcntllock-perl liblocale-gettext-perl libtext-charwidth-perl libtext-iconv-perl locales perl perl-base pigz 
The following NEW packages will be installed:
  g++ g++-8{a} libc-dev-bin{a} libc6-dev{a} libperl5.28{a} libstdc++-8-dev{a} 
The following packages will be REMOVED:
  libperl5.32{a} perl-modules-5.32{a} 
0 packages upgraded, 6 newly installed, 14 downgraded, 2 to remove and 0 not upgraded.
Need to get 14.0 MB/28.0 MB of archives. After unpacking 47.0 MB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://mirrors.ustc.edu.cn/debian buster/main amd64 pigz amd64 2.4-1 [57.8 kB]
Get: 2 http://mirrors.ustc.edu.cn/debian buster/main amd64 libperl5.28 amd64 5.28.1-6+deb10u1 [3894 kB]
Get: 3 http://mirrors.ustc.edu.cn/debian buster/main amd64 perl amd64 5.28.1-6+deb10u1 [204 kB]
Get: 4 http://mirrors.ustc.edu.cn/debian buster/main amd64 libtext-iconv-perl amd64 1.7-5+b7 [15.4 kB]
Get: 5 http://mirrors.ustc.edu.cn/debian buster/main amd64 libtext-charwidth-perl amd64 0.04-7.1+b1 [10.0 kB]
Get: 6 http://mirrors.ustc.edu.cn/debian buster/main amd64 perl-base amd64 5.28.1-6+deb10u1 [1514 kB]
Get: 7 http://mirrors.ustc.edu.cn/debian buster/main amd64 liblocale-gettext-perl amd64 1.07-3+b4 [18.9 kB]
Get: 8 http://mirrors.ustc.edu.cn/debian buster/main amd64 libc6 amd64 2.28-10 [2867 kB]
Get: 9 http://mirrors.ustc.edu.cn/debian buster/main amd64 libc-bin amd64 2.28-10 [789 kB]
Get: 10 http://mirrors.ustc.edu.cn/debian buster/main amd64 libbrotli1 amd64 1.0.7-2+deb10u1 [269 kB]
Get: 11 http://mirrors.ustc.edu.cn/debian buster/main amd64 locales all 2.28-10 [4060 kB]
Get: 12 http://mirrors.ustc.edu.cn/debian buster/main amd64 gcc amd64 4:8.3.0-1 [5196 B]
Get: 13 http://mirrors.ustc.edu.cn/debian buster/main amd64 cpp amd64 4:8.3.0-1 [19.4 kB]
Get: 14 http://mirrors.ustc.edu.cn/debian buster/main amd64 libc-dev-bin amd64 2.28-10 [275 kB]
Fetched 14.0 MB in 1s (12.2 MB/s)  
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.utf8",
        LC_ALL = (unset),
        LANG = "en_US.utf8"
    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: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
dpkg: warning: downgrading pigz from 2.6-1 to 2.4-1
(Reading database ... 54919 files and directories currently installed.)
Preparing to unpack .../archives/pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) over (2.6-1) ...
Selecting previously unselected package libperl5.28:amd64.
Preparing to unpack .../libperl5.28_5.28.1-6+deb10u1_amd64.deb ...
Unpacking libperl5.28:amd64 (5.28.1-6+deb10u1) ...
dpkg: warning: downgrading libalgorithm-diff-xs-perl from 0.04-6+b1 to 0.04-5+b1
Preparing to unpack .../libalgorithm-diff-xs-perl_0.04-5+b1_amd64.deb ...
Unpacking libalgorithm-diff-xs-perl (0.04-5+b1) over (0.04-6+b1) ...
dpkg: warning: downgrading libfile-fcntllock-perl from 0.22-3+b7 to 0.22-3+b5
Preparing to unpack .../libfile-fcntllock-perl_0.22-3+b5_amd64.deb ...
Unpacking libfile-fcntllock-perl (0.22-3+b5) over (0.22-3+b7) ...
dpkg: warning: downgrading perl from 5.32.1-5 to 5.28.1-6+deb10u1
Preparing to unpack .../perl_5.28.1-6+deb10u1_amd64.deb ...
Unpacking perl (5.28.1-6+deb10u1) over (5.32.1-5) ...
(Reading database ... 55418 files and directories currently installed.)
Removing libperl5.32:amd64 (5.32.1-5) ...
Removing perl-modules-5.32 (5.32.1-5) ...
dpkg: warning: downgrading libtext-iconv-perl from 1.7-7+b1 to 1.7-5+b7
(Reading database ... 53527 files and directories currently installed.)
Preparing to unpack .../libtext-iconv-perl_1.7-5+b7_amd64.deb ...
Unpacking libtext-iconv-perl (1.7-5+b7) over (1.7-7+b1) ...
dpkg: warning: downgrading libtext-charwidth-perl from 0.04-10+b1 to 0.04-7.1+b1
Preparing to unpack .../libtext-charwidth-perl_0.04-7.1+b1_amd64.deb ...
Unpacking libtext-charwidth-perl (0.04-7.1+b1) over (0.04-10+b1) ...
dpkg: warning: downgrading perl-base from 5.32.1-5 to 5.28.1-6+deb10u1
Preparing to unpack .../perl-base_5.28.1-6+deb10u1_amd64.deb ...
Unpacking perl-base (5.28.1-6+deb10u1) over (5.32.1-5) ...
Setting up perl-base (5.28.1-6+deb10u1) ...
dpkg: warning: downgrading liblocale-gettext-perl from 1.07-4+b1 to 1.07-3+b4
(Reading database ... 53461 files and directories currently installed.)
Preparing to unpack .../liblocale-gettext-perl_1.07-3+b4_amd64.deb ...
Unpacking liblocale-gettext-perl (1.07-3+b4) over (1.07-4+b1) ...
dpkg: warning: downgrading libc6:amd64 from 2.31-17 to 2.28-10
Preparing to unpack .../libc6_2.28-10_amd64.deb ...
Unpacking libc6:amd64 (2.28-10) over (2.31-17) ...
Replaced by files in installed package libcrypt1:amd64 (1:4.4.25-2) ...
Setting up libc6:amd64 (2.28-10) ...
dpkg: warning: downgrading libc-bin from 2.31-17 to 2.28-10
(Reading database ... 53464 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.28-10_amd64.deb ...
Unpacking libc-bin (2.28-10) over (2.31-17) ...
Setting up libc-bin (2.28-10) ...
dpkg: warning: downgrading libbrotli1:amd64 from 1.0.9-2+b2 to 1.0.7-2+deb10u1
(Reading database ... 53464 files and directories currently installed.)
Preparing to unpack .../0-libbrotli1_1.0.7-2+deb10u1_amd64.deb ...
Unpacking libbrotli1:amd64 (1.0.7-2+deb10u1) over (1.0.9-2+b2) ...
dpkg: warning: downgrading locales from 2.31-17 to 2.28-10
Preparing to unpack .../1-locales_2.28-10_all.deb ...
Unpacking locales (2.28-10) over (2.31-17) ...
dpkg: warning: downgrading gcc from 4:10.2.1-1 to 4:8.3.0-1
Preparing to unpack .../2-gcc_4%3a8.3.0-1_amd64.deb ...
Unpacking gcc (4:8.3.0-1) over (4:10.2.1-1) ...
dpkg: warning: downgrading cpp from 4:10.2.1-1 to 4:8.3.0-1
Preparing to unpack .../3-cpp_4%3a8.3.0-1_amd64.deb ...
Unpacking cpp (4:8.3.0-1) over (4:10.2.1-1) ...
Selecting previously unselected package libc-dev-bin.
Preparing to unpack .../4-libc-dev-bin_2.28-10_amd64.deb ...
Unpacking libc-dev-bin (2.28-10) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../5-libc6-dev_2.28-10_amd64.deb ...
Unpacking libc6-dev:amd64 (2.28-10) ...
Selecting previously unselected package libstdc++-8-dev:amd64.
Preparing to unpack .../6-libstdc++-8-dev_8.3.0-6_amd64.deb ...
Unpacking libstdc++-8-dev:amd64 (8.3.0-6) ...
Selecting previously unselected package g++-8.
Preparing to unpack .../7-g++-8_8.3.0-6_amd64.deb ...
Unpacking g++-8 (8.3.0-6) ...
Selecting previously unselected package g++.
Preparing to unpack .../8-g++_4%3a8.3.0-1_amd64.deb ...
Unpacking g++ (4:8.3.0-1) ...
Setting up libtext-iconv-perl (1.7-5+b7) ...
Setting up libtext-charwidth-perl (0.04-7.1+b1) ...
Setting up libbrotli1:amd64 (1.0.7-2+deb10u1) ...
Setting up locales (2.28-10) ...
Installing new version of config file /etc/locale.alias ...
Generating locales (this might take a while)...
  en_HK.UTF-8... done
Generation complete.
Setting up libperl5.28:amd64 (5.28.1-6+deb10u1) ...
Setting up pigz (2.4-1) ...
Setting up cpp (4:8.3.0-1) ...
Setting up libc-dev-bin (2.28-10) ...
Setting up liblocale-gettext-perl (1.07-3+b4) ...
Setting up gcc (4:8.3.0-1) ...
Setting up perl (5.28.1-6+deb10u1) ...
Setting up libc6-dev:amd64 (2.28-10) ...
Setting up libalgorithm-diff-xs-perl (0.04-5+b1) ...
Setting up libstdc++-8-dev:amd64 (8.3.0-6) ...
Setting up libfile-fcntllock-perl (0.22-3+b5) ...
Setting up g++-8 (8.3.0-6) ...
Setting up g++ (4:8.3.0-1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10) ...
                                         
root@l:~/Python-3.8.2# aptitude install g++
Warning: Invalid locale (please review locale settings, this might lead to problems later):
  locale::facet::_S_create_c_locale name not valid
g++ is already installed at the requested version (4:8.3.0-1)
g++ is already installed at the requested version (4:8.3.0-1)
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
perl: warning: Setting locale failed.    
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.utf8",
        LC_ALL = (unset),
        LANG = "en_US.utf8"
    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: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
                                         
root@l:~/Python-3.8.2# aptitude install g++^C
root@l:~/Python-3.8.2# systemctl res
rescue        reset-failed  restart       
root@l:~/Python-3.8.2# systemctl restart docker
root@l:~/Python-3.8.2# docker start halo 
halo
root@l:~/Python-3.8.2# docker ps -a
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                  PORTS                  NAMES
a5ec51d3e232        halohub/halo:latest   "/bin/sh -c 'java -X…"   About an hour ago   Up 10 minutes           0.0.0.0:80->8090/tcp   halo
5bce293c749b        wordpress             "docker-entrypoint.s…"   2 weeks ago         Exited (0) 2 days ago                          wordpress