3

While installing octave or wxmaxima, I see this error in the terminal

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 cups : Depends: cups-daemon (>= 2.1.3-4ubuntu0.2)
 cups-core-drivers : Depends: cups-daemon (>= 2.1.3-4ubuntu0.2)
 cups-daemon : Depends: libcups2 (= 2.1.3-4) but 2.1.3-4ubuntu0.2 is to 
be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Zanna
  • 70,465

2 Answers2

5

I think someone made a mistake packaging the updates. I filed a bug here: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1676621

If it affects you, there is a link at the top "This bug affects you", which will confirm the bug so devs can start looking at it.

Update: The end of that bug suggested this which worked for me:

sudo apt-get install libcups2=2.1.3-4 cups libcupscgi1=2.1.3-4 libcupsimage2=2.1.3-4 libcupsmime1=2.1.3-4 libcupsppdc1=2.1.3-4 cups-core-drivers cups-daemon ghostscript cups-client=2.1.3-4 cups-ppdc cups-filters printer-driver-gutenprint cups-filters
Michael Cole
  • 853
  • 8
  • 22
  • 1
    I think so too, got affected last night while using sudo apt full-upgrade. 'apt-get -f install' removes a few packages and I can't print anymore. The system doesn't complain about unmet dependencies any more though, but I can't reinstall the packages due to You have held broken packages. – mook765 Mar 28 '17 at 05:53
1

To resolve depency-issues we should take a look at the log-files

/var/log/apt/term.log
/var/log/apt/history.log

Also it is helpful to use apt-get with the -s(simulate)-option:

sudo apt-get -s -f install

will show us what would happen without actually changing anything in the system.

I ran sudo apt update and sudo apt full-upgrade to get the exact same error message.

From /var/log/apt/term.log

Log started: 2017-03-28  01:26:44
(Reading database ... 
(Reading database ... 100%
(Reading database ... 314704 files and directories currently installed.)
Preparing to unpack .../libcupsppdc1_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking libcupsppdc1:amd64 (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../libcupsmime1_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking libcupsmime1:amd64 (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../libcupsimage2_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking libcupsimage2:amd64 (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../libcupscgi1_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking libcupscgi1:amd64 (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../cups-core-drivers_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking cups-core-drivers (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../cups-server-common_2.1.3-4ubuntu0.2_all.deb ...
Unpacking cups-server-common (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../cups-common_2.1.3-4ubuntu0.2_all.deb ...
Unpacking cups-common (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../cups-ppdc_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking cups-ppdc (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../cups-daemon_2.1.3-4ubuntu0.2_amd64.deb ...
Job for cups.service canceled.
invoke-rc.d: initscript cups, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Job for cups.service canceled.
invoke-rc.d: initscript cups, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/cups-daemon_2.1.3-4ubuntu0.2_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Preparing to unpack .../cups-bsd_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking cups-bsd (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../cups-client_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking cups-client (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../libcups2_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking libcups2:amd64 (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Preparing to unpack .../cups_2.1.3-4ubuntu0.2_amd64.deb ...
Unpacking cups (2.1.3-4ubuntu0.2) over (2.1.3-4) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for doc-base (0.10.7) ...
Processing 1 changed doc-base file...
Registering documents with scrollkeeper...
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/cups-daemon_2.1.3-4ubuntu0.2_amd64.deb
Log ended: 2017-03-28  01:28:00

Seem to be a problem with the cpus-package. Gathering information about this package I found from https://launchpad.net/ubuntu/+source/cups

2.1.3-4             release (main)
2.1.3-4ubuntu0.2    proposed (main)

To get rid of the unmmet dependencies I ran sudo apt-get -f install.

From /var/log/apt/term.log

Log started: 2017-03-28  10:16:05
(Reading database ... 
(Reading database ... 100%
(Reading database ... 314703 files and directories currently installed.)
Removing printer-driver-splix (2.0.0+svn315-4fakesync1) ...
Removing printer-driver-postscript-hp (3.16.3+repack0-1) ...
Removing hplip (3.16.3+repack0-1) ...
Removing printer-driver-hpcups (3.16.3+repack0-1) ...
Removing bluez-cups (5.37-0ubuntu5) ...
Removing printer-driver-gutenprint (5.2.11-1) ...
Removing cups (2.1.3-4ubuntu0.2) ...
Removing cups-core-drivers (2.1.3-4ubuntu0.2) ...
Removing cups-daemon (2.1.3-4) ...
Warning: Stopping cups.service, but it can still be activated by:
  cups.socket
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for dbus (1.10.6-1ubuntu3.3) ...
Setting up libcups2:amd64 (2.1.3-4ubuntu0.2) ...
Setting up libcupsimage2:amd64 (2.1.3-4ubuntu0.2) ...
Setting up cups-server-common (2.1.3-4ubuntu0.2) ...
Setting up cups-common (2.1.3-4ubuntu0.2) ...
Setting up cups-client (2.1.3-4ubuntu0.2) ...
Setting up libcupsppdc1:amd64 (2.1.3-4ubuntu0.2) ...
Setting up cups-ppdc (2.1.3-4ubuntu0.2) ...
Setting up libcupscgi1:amd64 (2.1.3-4ubuntu0.2) ...
Setting up libcupsmime1:amd64 (2.1.3-4ubuntu0.2) ...
Setting up cups-bsd (2.1.3-4ubuntu0.2) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Log ended: 2017-03-28  10:16:16

From /var/log/apt/history.log

Start-Date: 2017-03-28  10:16:05
Commandline: apt-get -f install
Requested-By: mook (1000)
Remove: printer-driver-splix:amd64 (2.0.0+svn315-4fakesync1), bluez-cups:amd64 (5.37-0ubuntu5), printer-driver-hpcups:amd64 (3.16.3+repack0-1), printer-driver-postscript-hp:amd64 (3.16.3+repack0-1), hplip:amd64 (3.16.3+repack0-1), printer-driver-gutenprint:amd64 (5.2.11-1), cups-core-drivers:amd64 (2.1.3-4ubuntu0.2), cups-daemon:amd64 (2.1.3-4), cups:amd64 (2.1.3-4ubuntu0.2)
End-Date: 2017-03-28  10:16:16

The unmet dependecies are history now, but a few packages have been removed and I reinstalled them, the problematic package cups first whith proposed updates enabled.

I enabled proposed updates and run sudo apt update

!!!DO NOT RUN sudo apt upgrade NOW!!!

I reinstalled cups with sudo apt install cups

Installed: printer-driver-gutenprint:amd64 (5.2.11-1, automatic), cups-core-drivers:amd64 (2.1.3-4ubuntu0.2, automatic), cups-daemon:amd64 (2.1.3-4ubuntu0.2, automatic), cups:amd64 (2.1.3-4ubuntu0.2)

I disabled proposed updates and run sudo apt update

We can see that some of the packages removed before are reinstalled now, but not all of them. I installed the missing packages with

sudo apt install hplip
   Installed: printer-driver-hpcups:amd64 (3.16.3+repack0-1, automatic), printer-driver-postscript-hp:amd64 (3.16.3+repack0-1, automatic), hplip:amd64 (3.16.3+repack0-1)
sudo apt install printer-driver-splix
   Installed: printer-driver-splix:amd64 (2.0.0+svn315-4fakesync1)
sudo apt install bluez-cups
   Installed: bluez-cups:amd64 (5.37-0ubuntu5)

All packages are installed now and printers is working again.

How to enable/disable proposed updates:

https://www.hiroom2.com/2016/05/23/ubuntu-16-04-install-xenial-proposed-package/

https://wiki.ubuntu.com/Testing/EnableProposed

Enable proposed updates:

$ sudo sh -c "echo 'deb http://archive.ubuntu.com/ubuntu/ \
xenial-proposed restricted main multiverse universe' \
> /etc/apt/sources.list.d/xenial-proposed.list"

Disable proposed updates:

$ sudo rm /etc/apt/sources.list.d/xenial-proposed.list"

or use the Software & Updates program and check/uncheck preleased updates(xenial-proposed) in the Dev-tab.

Note

I run UbuntuStudio 16.04.2 with kernel 4.4.0-70-lowlatency.

The OP's log-files may look slightly different from mine as the OP used a different command to get the error. Also the files removed from executing sudo apt-get -f install might differ, this depends on the drivers installed for different printers.

Just for safety, disabling automatic updates temporary to perform the described steps is not the worst idea.

I'm not very smart when it comes to dependency-issues (love my independence), there might be a much more elegant way to solve that.

mook765
  • 15,925