软件更新程序。软件包系统已损坏。14.04

软件更新程序。软件包系统已损坏。14.04

错误信息 :

Check if you are using third party repositories. If so disable them, since they are a  common source of problems.
Furthermore run the following command in a Terminal: apt-get install -f

所以我运行:

sudo apt-get install -f

它给了我这个:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  cups cups-bsd cups-client cups-common cups-core-drivers cups-daemon
  cups-server-common libc-bin libc-dev-bin libc6-dbg libc6-dev libcups2
  libcupscgi1 libcupsimage2 libcupsmime1 libcupsppdc1
Suggested packages:
  cups-pdf xpp glibc-doc
The following NEW packages will be installed:
  libc-bin
The following packages will be upgraded:
  cups cups-bsd cups-client cups-common cups-core-drivers cups-daemon
  cups-server-common libc-dev-bin libc6-dbg libc6-dev libcups2 libcupscgi1
  libcupsimage2 libcupsmime1 libcupsppdc1
15 upgraded, 1 newly installed, 0 to remove and 112 not upgraded.  
Need to get 0 B/8,246 kB of archives.
After this operation, 3,509 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y

我选择 Y,得到以下结果:

Can't exec "locale": No such file or directory at /usr/share/perl5/Debcon/Encoding.pm line 16.
Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17.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.
Preconfiguring packages ...
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
N: Ignoring file 'ia32-libs-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'steam.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'ia32-libs-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'steam.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Sub-process /usr/bin/dpkg returned an error code (2)

Preconfiguring packages ...
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
N: Ignoring file 'ia32-libs-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'steam.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'ia32-libs-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'steam.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Sub-process /usr/bin/dpkg returned an error code (2)

我需要做什么 ?

答案1

关于这个问题

"dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin"

看起来你需要仔细检查/etc/sudoers以下条目是否与下面完全相同

Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

(要编辑 /etc/sudores,您可以使用 sudo visudo

然后还执行以下操作

sudo cd /etc/apt/sources.list.d/
sudo mv ia32-libs-raring.list.disable ia32-libs-raring.list.BAK
sudo mv steam.list.disable steam.list.BAK
sudo mv ia32-libs-raring.list.disable ia32-libs-raring.list.BAK
sudo mv steam.list.disable steam.list.BAK
sudo apt-get update

相关内容