Cups 缺少 /etc/init.d/cups,无法更新

Cups 缺少 /etc/init.d/cups,无法更新

cups 包需要更新,但是 /etc/init.d/cups 之前已被删除。现在我们无法安装它。

root@server:~# touch /etc/init.d/cups
root@server:~# env LC_MESSAGES=EN apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  cups
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
8 not fully installed or removed.
Need to get 0 B/1285 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Do you want to continue [Y/n]? y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_MESSAGES = "EN",
    LANG = "hu_HU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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 ...
(Reading database ... 517102 files and directories currently installed.)
Preparing to replace cups 1.5.3-0ubuntu8.6 (using .../cups_1.5.3-0ubuntu8.7_i386.deb) ...
update-rc.d: /etc/init.d/cups exists during rc.d purge (use -f to force)
dpkg: error processing /var/cache/apt/archives/cups_1.5.3-0ubuntu8.7_i386.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                          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
Errors were encountered while processing:
 /var/cache/apt/archives/cups_1.5.3-0ubuntu8.7_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@server:~# 

root@server:~# env LC_MESSAGES=EN dpkg --force-all -i /var/cache/apt/archives/cups_1.5.3-0ubuntu8.7_i386.deb
(Reading database ... 517102 files and directories currently installed.)
Preparing to replace cups 1.5.3-0ubuntu8.6 (using .../cups_1.5.3-0ubuntu8.7_i386.deb) ...
update-rc.d: /etc/init.d/cups exists during rc.d purge (use -f to force)
dpkg: error processing /var/cache/apt/archives/cups_1.5.3-0ubuntu8.7_i386.deb (--install):
 subprocess new pre-installation script returned error exit status 1
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
Errors were encountered while processing:
 /var/cache/apt/archives/cups_1.5.3-0ubuntu8.7_i386.deb
root@server:~# 

问题:我该如何更新 cups?使用 Ubuntu 12.04。

更新:

root@server:~# env LC_MESSAGES=EN apt-get install --reinstall cups
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  cups-pdf smbclient
The following packages will be upgraded:
  cups
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1285 kB of archives.
After this operation, 1024 B of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_MESSAGES = "EN",
    LANG = "hu_HU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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 ...
(Reading database ... 517102 files and directories currently installed.)
Preparing to replace cups 1.5.3-0ubuntu8.6 (using .../cups_1.5.3-0ubuntu8.7_i386.deb) ...
update-rc.d: /etc/init.d/cups exists during rc.d purge (use -f to force)
dpkg: error processing /var/cache/apt/archives/cups_1.5.3-0ubuntu8.7_i386.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
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
Errors were encountered while processing:
 /var/cache/apt/archives/cups_1.5.3-0ubuntu8.7_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@server:~# 

答案1

您的安装卡在更换缺失的部件上cups。要解决此问题,请先强制移除旧杯子:

sudo apt-get purge -f cups

然后重新安装

sudo apt-get install cups

相关内容