我正在尝试为我的打印机安装驱动程序,但发生了这种情况......
$ sudo dpkg -i openprinting-gutenprint_5.2.7-1lsb3.2_amd64.deb
(Reading database ... 204753 files and directories currently installed.)
Preparing to unpack openprinting-gutenprint_5.2.7-1lsb3.2_amd64.deb ...
Unpacking openprinting-gutenprint (5.2.7-1lsb3.2) ...
dpkg: dependency problems prevent configuration of openprinting-gutenprint:
openprinting-gutenprint depends on lsb (>= 3.2); however:
Package lsb is not installed.
dpkg: error processing package openprinting-gutenprint (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
openprinting-gutenprint
之后我尝试安装 lsb。
$ sudo apt-get install lsb
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:
lsb : Depends: lsb-core (>= 9.20170808ubuntu1)
Depends: lsb-printing (>= 9.20170808ubuntu1) but it is not going to be installed
Depends: libjpeg62 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
最后我尝试安装 lsb-core,但是......
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
java-wrappers
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
alien at autoconf automake autopoint autotools-dev debhelper debugedit dh-autoreconf
dh-strip-nondeterminism libarchive-cpio-perl libfile-stripnondeterminism-perl libgsasl7
libjpeg62 libkyotocabinet16v5 libltdl-dev libmail-sendmail-perl libmailutils5
libmysqlclient20 libntlm0 librpm8 librpmbuild8 librpmio8 librpmsign8 libsigsegv2
libsys-hostname-long-perl libtool lsb lsb-core lsb-invalid-mta lsb-printing lsb-security m4
mailutils mailutils-common mysql-common ncurses-term pax po-debconf rpm rpm-common rpm2cpio
Suggested packages:
autoconf-archive gnu-standards autoconf-doc dh-make dwz rpm-i18n libtool-doc gfortran
| fortran95-compiler gcj-jdk m4-doc mailutils-mh mailutils-doc libmail-box-perl elfutils
rpmlint rpm2html
The following NEW packages will be installed:
alien at autoconf automake autopoint autotools-dev debhelper debugedit dh-autoreconf
dh-strip-nondeterminism libarchive-cpio-perl libfile-stripnondeterminism-perl libgsasl7
libjpeg62 libkyotocabinet16v5 libltdl-dev libmail-sendmail-perl libmailutils5
libmysqlclient20 libntlm0 librpm8 librpmbuild8 librpmio8 librpmsign8 libsigsegv2
libsys-hostname-long-perl libtool lsb lsb-core lsb-invalid-mta lsb-printing lsb-security m4
mailutils mailutils-common mysql-common ncurses-term pax po-debconf rpm rpm-common rpm2cpio
0 upgraded, 42 newly installed, 0 to remove and 8 not upgraded.
2 not fully installed or removed.
Need to get 0 B/6,208 kB of archives.
After this operation, 27.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Extracting templates from packages: 100%
Setting up install-info (6.5.0.dfsg.1-2) ...
/usr/sbin/update-info-dir: 2: /etc/environment: k9d0^1: not found
dpkg: error processing package install-info (--configure):
installed install-info package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)
我的 /etc/environment 文件中的内容如下:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/bin/"
答案1
正如上面的评论中链接的帖子所建议的那样,运行:
sudo mv /var/lib/dpkg/info/install-info.postinst /var/lib/dpkg/info/install-info.postinst.bad
如果不能解决您的问题,请通过以下方式恢复
sudo mv /var/lib/dpkg/info/install-info.postinst.bad /var/lib/dpkg/info/install-info.postinst
答案2
刚刚跑
sudo apt --fix-broken install
并工作