Ubuntu 16.04无法安装任何软件

Ubuntu 16.04无法安装任何软件

我无法在运行 Ubuntu 16.04 的笔记本电脑上安装任何软件。

以下是我的日志:

lenovo@vvdn:~$ sudo apt-get install meld
[sudo] lenovo 的密码:
正在读取软件包列表...完成
构建依赖关系树       
正在读取状态信息...完成
以下软件包已自动安装并且不再需要:
  Linux-headers-4.15.0-30 Linux-headers-4.15.0-30-通用 Linux-headers-4.15.0-33 Linux-headers-4.15.0-33-通用 Linux-headers-4.15.0-38
  linux-headers-4.15.0-38-通用 linux-headers-4.4.0-134 linux-headers-4.4.0-134-通用 linux-headers-4.4.0-139
  linux-headers-4.4.0-139-通用 linux-image-4.15.0-30-通用 linux-image-4.15.0-33-通用 linux-image-4.15.0-38-通用
  linux-image-4.4.0-134-通用 linux-image-4.4.0-139-通用 linux-image-extra-4.4.0-134-通用 linux-image-extra-4.4.0-139-通用
  linux-模块-4.15.0-30-通用 linux-模块-4.15.0-33-通用 linux-模块-4.15.0-38-通用 linux-模块-extra-4.15.0-33-通用
  Linux 模块-额外-4.15.0-38-通用
使用“sudo apt autoremove”来删除它们。
将会安装以下附加软件包:
  python python-cairo python-gi python-gi-cairo
建议的软件包:
  python-doc python-tk
将会安装以下新软件包:
  融合 python python-cairo python-gi python-gi-cairo
升级了 0 个,新安装了 5 个,删除了 0 个,并且未升级 73 个。
1 未完全安装或删除。
需要获取 0 B/835 kB 的档案。
此操作后,将使用4,523 kB的额外磁盘空间。
您想继续吗?[Y/n] Y
设置 python-minimal (2.7.12-1~16.04) ...
回溯(最近一次调用最后一次):
  文件“/usr/lib/python2.7/site.py”,第 563 行,位于
    主要的()
  文件“/usr/lib/python2.7/site.py”,第 545 行,在主文件中
    已知路径 = 添加用户站点包 (已知路径)
  文件“/usr/lib/python2.7/site.py”,第 272 行,位于 addusersitepackages 中
    用户站点 = 获取用户站点包()
  文件“/usr/lib/python2.7/site.py”,第 247 行,位于 getusersitepackages 中
    user_base = getuserbase() # 这也会设置 USER_BASE
  文件“/usr/lib/python2.7/site.py”,第 237 行,位于 getuserbase 中
    USER_BASE = 获取配置变量('用户库')
  文件“/usr/lib/python2.7/sysconfig.py”,第 582 行,位于 get_config_var 中
    返回 get_config_vars().get(name)
  文件“/usr/lib/python2.7/sysconfig.py”,第 528 行,位于 get_config_vars 中
    _init_posix(_CONFIG_VARS)
  文件“/usr/lib/python2.7/sysconfig.py”,第 412 行,位于 _init_posix
    从 _sysconfigdata 导入 build_time_vars
  文件“/usr/lib/python2.7/_sysconfigdata.py”,第 6 行,位于
    从 _sysconfigdata_nd 导入 *
ImportError:没有名为 _sysconfigdata_nd 的模块
dpkg: 处理软件包 python-minimal (--configure) 时出错:
 子进程安装后安装脚本返回错误退出状态 1
处理时遇到错误:
 python-minimal
E: 子进程 /usr/bin/dpkg 返回错误代码 (1)

– ‘sudo apt autoremove’ 命令的日志:

lenovo@vvdn:~$ sudo apt autoremove
[sudo] password for lenovo: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-4.15.0-30 linux-headers-4.15.0-30-generic linux-headers-4.15.0-33 linux-headers-4.15.0-33-generic linux-headers-4.15.0-38
  linux-headers-4.15.0-38-generic linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic linux-headers-4.4.0-139
  linux-headers-4.4.0-139-generic linux-image-4.15.0-30-generic linux-image-4.15.0-33-generic linux-image-4.15.0-38-generic
  linux-image-4.4.0-134-generic linux-image-4.4.0-139-generic linux-image-extra-4.4.0-134-generic linux-image-extra-4.4.0-139-generic
  linux-modules-4.15.0-30-generic linux-modules-4.15.0-33-generic linux-modules-4.15.0-38-generic linux-modules-extra-4.15.0-33-generic
  linux-modules-extra-4.15.0-38-generic
0 upgraded, 0 newly installed, 22 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 1,442 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 483487 files and directories currently installed.)
Removing linux-headers-4.15.0-30-generic (4.15.0-30.32~16.04.1) ...
Removing linux-headers-4.15.0-30 (4.15.0-30.32~16.04.1) ...
Removing linux-headers-4.15.0-33-generic (4.15.0-33.36~16.04.1) ...
Removing linux-headers-4.15.0-33 (4.15.0-33.36~16.04.1) ...
Removing linux-headers-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Removing linux-headers-4.15.0-38 (4.15.0-38.41~16.04.1) ...
Removing linux-headers-4.4.0-134-generic (4.4.0-134.160) ...
Removing linux-headers-4.4.0-134 (4.4.0-134.160) ...
Removing linux-headers-4.4.0-139-generic (4.4.0-139.165) ...
Removing linux-headers-4.4.0-139 (4.4.0-139.165) ...
Removing linux-image-4.15.0-30-generic (4.15.0-30.32~16.04.1) ...
/etc/kernel/prerm.d/dkms:
dkms: removing: virtualbox 5.1.38 (4.15.0-30-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 5.1.38
Kernel:  4.15.0-30-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-30-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-30-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-30-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-30-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod......

DKMS: uninstall completed.
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-30-generic
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-43-generic
Found initrd image: /boot/initrd.img-4.15.0-43-generic
Found linux image: /boot/vmlinuz-4.15.0-42-generic
Found initrd image: /boot/initrd.img-4.15.0-42-generic
Found linux image: /boot/vmlinuz-4.15.0-38-generic
Found initrd image: /boot/initrd.img-4.15.0-38-generic
Found linux image: /boot/vmlinuz-4.15.0-33-generic
Found initrd image: /boot/initrd.img-4.15.0-33-generic
Found linux image: /boot/vmlinuz-4.4.0-141-generic
Found initrd image: /boot/initrd.img-4.4.0-141-generic
Found linux image: /boot/vmlinuz-4.4.0-139-generic
Found initrd image: /boot/initrd.img-4.4.0-139-generic
Found linux image: /boot/vmlinuz-4.4.0-134-generic
Found initrd image: /boot/initrd.img-4.4.0-134-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found FreeDOS on /dev/sda1
done
Removing linux-modules-extra-4.15.0-33-generic (4.15.0-33.36~16.04.1) ...
Removing linux-image-4.15.0-33-generic (4.15.0-33.36~16.04.1) ...
/etc/kernel/prerm.d/dkms:
dkms: removing: virtualbox 5.1.38 (4.15.0-33-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 5.1.38
Kernel:  4.15.0-33-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-33-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-33-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-33-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-33-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-33-generic
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-43-generic
Found initrd image: /boot/initrd.img-4.15.0-43-generic
Found linux image: /boot/vmlinuz-4.15.0-42-generic
Found initrd image: /boot/initrd.img-4.15.0-42-generic
Found linux image: /boot/vmlinuz-4.15.0-38-generic
Found initrd image: /boot/initrd.img-4.15.0-38-generic
Found linux image: /boot/vmlinuz-4.4.0-141-generic
Found initrd image: /boot/initrd.img-4.4.0-141-generic
Found linux image: /boot/vmlinuz-4.4.0-139-generic
Found initrd image: /boot/initrd.img-4.4.0-139-generic
Found linux image: /boot/vmlinuz-4.4.0-134-generic
Found initrd image: /boot/initrd.img-4.4.0-134-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found FreeDOS on /dev/sda1
done
Removing linux-modules-extra-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Removing linux-image-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
/etc/kernel/prerm.d/dkms:
dkms: removing: virtualbox 5.1.38 (4.15.0-38-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 5.1.38
Kernel:  4.15.0-38-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-38-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-38-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-38-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-38-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-38-generic
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-43-generic
Found initrd image: /boot/initrd.img-4.15.0-43-generic
Found linux image: /boot/vmlinuz-4.15.0-42-generic
Found initrd image: /boot/initrd.img-4.15.0-42-generic
Found linux image: /boot/vmlinuz-4.4.0-141-generic
Found initrd image: /boot/initrd.img-4.4.0-141-generic
Found linux image: /boot/vmlinuz-4.4.0-139-generic
Found initrd image: /boot/initrd.img-4.4.0-139-generic
Found linux image: /boot/vmlinuz-4.4.0-134-generic
Found initrd image: /boot/initrd.img-4.4.0-134-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found FreeDOS on /dev/sda1
done
Removing linux-image-extra-4.4.0-134-generic (4.4.0-134.160) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
Error! Your kernel headers for kernel 4.4.0-134-generic cannot be found.
Please install the linux-headers-4.4.0-134-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-134-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-43-generic
Found initrd image: /boot/initrd.img-4.15.0-43-generic
Found linux image: /boot/vmlinuz-4.15.0-42-generic
Found initrd image: /boot/initrd.img-4.15.0-42-generic
Found linux image: /boot/vmlinuz-4.4.0-141-generic
Found initrd image: /boot/initrd.img-4.4.0-141-generic
Found linux image: /boot/vmlinuz-4.4.0-139-generic
Found initrd image: /boot/initrd.img-4.4.0-139-generic
Found linux image: /boot/vmlinuz-4.4.0-134-generic
Found initrd image: /boot/initrd.img-4.4.0-134-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found FreeDOS on /dev/sda1
done
Removing linux-image-4.4.0-134-generic (4.4.0-134.160) ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-134-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-134-generic /boot/vmlinuz-4.4.0-134-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-43-generic
Found initrd image: /boot/initrd.img-4.15.0-43-generic
Found linux image: /boot/vmlinuz-4.15.0-42-generic
Found initrd image: /boot/initrd.img-4.15.0-42-generic
Found linux image: /boot/vmlinuz-4.4.0-141-generic
Found initrd image: /boot/initrd.img-4.4.0-141-generic
Found linux image: /boot/vmlinuz-4.4.0-139-generic
Found initrd image: /boot/initrd.img-4.4.0-139-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found FreeDOS on /dev/sda1
done
Removing linux-image-extra-4.4.0-139-generic (4.4.0-139.165) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-43-generic
Found initrd image: /boot/initrd.img-4.15.0-43-generic
Found linux image: /boot/vmlinuz-4.15.0-42-generic
Found initrd image: /boot/initrd.img-4.15.0-42-generic
Found linux image: /boot/vmlinuz-4.4.0-141-generic
Found initrd image: /boot/initrd.img-4.4.0-141-generic
Found linux image: /boot/vmlinuz-4.4.0-139-generic
Found initrd image: /boot/initrd.img-4.4.0-139-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found FreeDOS on /dev/sda1
done
Removing linux-image-4.4.0-139-generic (4.4.0-139.165) ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
dkms: removing: virtualbox 5.1.38 (4.4.0-139-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 5.1.38
Kernel:  4.4.0-139-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-139-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-139-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-139-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-139-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-139-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-43-generic
Found initrd image: /boot/initrd.img-4.15.0-43-generic
Found linux image: /boot/vmlinuz-4.15.0-42-generic
Found initrd image: /boot/initrd.img-4.15.0-42-generic
Found linux image: /boot/vmlinuz-4.4.0-141-generic    
Found initrd image: /boot/initrd.img-4.4.0-141-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found FreeDOS on /dev/sda1
done    
Removing linux-modules-4.15.0-30-generic (4.15.0-30.32~16.04.1) ...
Removing linux-modules-4.15.0-33-generic (4.15.0-33.36~16.04.1) ...
Removing linux-modules-4.15.0-38-generic (4.15.0-38.41~16.04.1) ...
Setting up python-minimal (2.7.12-1~16.04) ...
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 563, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 545, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 237, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 582, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 528, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 412, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
dpkg: error processing package python-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 python-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
lenovo@vvdn:~$ 
lenovo@vvdn:~$ 

-- 'sudo apt install --reinstall python-minimal' 命令的日志:

lenovo@vvdn:~$ 
lenovo@vvdn:~$ sudo apt install --reinstall python-minimal
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded.
Need to get 28.1 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 python-minimal amd64 2.7.12-1~16.04 [28.1 kB]
Fetched 28.1 kB in 16s (1,676 B/s)        
dpkg: warning: files list file for package 'python-minimal' missing; assuming package has no files currently installed
(Reading database ... 317140 files and directories currently installed.)
Preparing to unpack .../python-minimal_2.7.12-1~16.04_amd64.deb ...
Unpacking python-minimal (2.7.12-1~16.04) over (2.7.12-1~16.04) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up python-minimal (2.7.12-1~16.04) ...
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 563, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 545, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 237, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 582, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 528, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 412, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
dpkg: error processing package python-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 python-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
lenovo@vvdn:~$ 
lenovo@vvdn:~$    

--‘sudo apt-get update’和‘sudo apt-get upgrade’命令的日志:

lenovo@vvdn:~$ sudo apt-get update
[sudo] password for lenovo: 
Hit:1 https://repo.skype.com/deb stable InRelease                                                                                             
Hit:2 https://download.sublimetext.com apt/stable/     InRelease                                                                                  
Hit:3 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial     InRelease                                                                         
Hit:4 http://in.archive.ubuntu.com/ubuntu xenial     InRelease                                                                                    
Ign:5 http://archive.ubuntu.com/ubuntu trusty     InRelease                                                                                       
Ign:6 http://old-releases.ubuntu.com/ubuntu raring     InRelease                                                                                  
Ign:7 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                  
Hit:8 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease                                                                           
Hit:9 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease                                                                            
Hit:10 http://archive.ubuntu.com/ubuntu trusty     Release                                                                                            
Hit:11 http://old-releases.ubuntu.com/ubuntu raring Release                                                                                   
Hit:12 http://dl.google.com/linux/chrome/deb stable Release                                                                               
Hit:13 http://package.perforce.com/apt/ubuntu trusty InRelease                                                       
Hit:14 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease   
Hit:15 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial InRelease
Hit:18 http://in.archive.ubuntu.com/ubuntu xenial-security InRelease                                
Hit:20 http://ppa.launchpad.net/mc3man/xerus-media/ubuntu xenial InRelease                        
Hit:21 http://ppa.launchpad.net/team-gcc-arm-embedded/ppa/ubuntu xenial InRelease
Reading package lists... Done 
lenovo@vvdn:~$ 
lenovo@vvdn:~$ 
lenovo@vvdn:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  ubuntu-minimal
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
lenovo@vvdn:~$     

答案1

你可以从 dpkg status 中删除该条目,要做到这一点,请转到vim /var/lib/dpkg/状态并删除创建文件的错误。然后只需使用配置您的 dpkg ,sudo dpkg --configure -a 然后使用sudo apt-get -f install,您的安装将从停止的地方恢复。希望这对您解决问题有所帮助。

相关内容