Apt-upgrade and apt-get clean broken

I’m running Ubuntu Mate on an Odroid XU4, sort of an upscale RasPi3 on steroids. All packages were up to date until just before apt-upgrade broke a few days ago.

drew@drew:~$ sudo apt-get update
… Looks normal no errors reported

drew@drew:~$ sudo apt-get upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages will be upgraded:
avahi-dnsconfd
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/13.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database … 259676 files and directories currently installed.)
Preparing to unpack …/avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2.1_armhf.deb …
Job for avahi-daemon.socket canceled.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead …
Job for avahi-daemon.socket canceled.
dpkg: error processing archive /var/cache/apt/archives/avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2.1_armhf.deb (–unpack):
subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2.1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
<//>

Hmm. Sometime the cache gets screwed up and the follown helps.

drew@drew:~$ sudo apt-get clean
W: Problem unlinking the file apt-fast - Clean (21: Is a directory)

But, not this time!

Wanted to remove and reinstall the avahi-dnsconfd package, but the following scared me away.

drew@drew:~$ sudo apt-get remove avahi-dnsconfd
[sudo] password for drew:
Sorry, try again.
[sudo] password for drew:
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
avahi-dnsconfd ubuntu-mate-core ubuntu-mate-desktop
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 122 kB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.

I vaguely remember an incantation for removing a package, but leaving it’s dependencies in place, but I’ve been googling, reading man pages, and can’t find it.

Hello Drew_Einhorn,
I don’t know anything about your hardware but here’s a link to a classic web page which may contain the command(s) you are looking for: What to do when apt-get fails - on Linux.com - by Bruce Byfield.

Hi @Drew_Einhorn,

see also:

I hope it helps. :smiley:

Hi Drew. I am sorry to bother you on a side issue. But, I would be very interested to hear your views on using the Odroid as a streaming media device with Ubuntu Mate as the on-board OS for services such as BBC Iplayer, Netflix, 4oD, Youtube etc. I have been wondering about the feasibility of sticking one next to my TV in my lounge for the purpose. At the moment, I have a big old fat desktop machine running there and it is coming to end of life.

Is the Odroid up to the job?

Steve,

  • I have not yet tried that.
  • I have been thinking about it.
  • But, I probably won’t get to it anytime soon.
  • Folks do that on the Raspberry Pi platform.
  • The Odroid XU4 is about 5 or 6 times as powerful as Raspberry Pi.
  • See the benchmarks in the XU4 product description.
  • So, I would be very surprised if you have problems.
  • You might want to have an extra XU4 if you plan on doing a lot of transcoding.

First, try the following:

sudo apt-get update && sudo apt-get dist-upgrade

It’s possible that the updated package has new dependancies and upgrade wouldn’t install them; dist-upgrade would.

Did you install avahi-dnsconfd or was it preinstalled on your version of Ubuntu MATE?

  • I have not used the eMMC drives Odroid sell
  • I have /boot on sdcard.
  • It’s not used after boot is finished.
  • I have been using cheap Sabrent cases for with USB3.0 <-> SATA bridge for external drives about $10.
  • Root is on a small 120GB SSD in a Sabrent case
  • Have 1Tb HDD in a Sabrent case
  • USB3.0 is backward compatible with USB2.0 at slower speeds.
  • Being able to easily move a USB drive to another computer is a big plus.

I thought I replied a while ago.

I don’t see an apt-get dist-upgrade in your messages, only apt-get upgrade.

This might be slightly better @terzag, simply because of the “force” option on the end?:

sudo apt-get update && sudo apt-get dist-upgrade -f

Not sure it would be a good idea to force the update. Probably better to run it without specific options and see what happens.

The “Force” option is to make sure that the missing dependencies (if any) get installed, it won’t hurt the system as I have used the command many times over the years!. :smiley:

Oh, sorry, I misread your message, I thought that you wanted to use the force (–force-yes) option, which can be dangerous, but -f is --fix-broken. So, yeah, @Drew_Einhorn can try dist-upgrade with -f though it would likely have no effect judging by the output in the first message.

I’m not sure, I think that the “–force-yes” and the “-f” are the same thing???. :smiley:

No, --force-yes has no shortcut.

1 Like

I thought I replied to this thread a while ago.

  • I was unsuccessfully trying some of the above advice from the command line.

  • Every so often, a cron job would notice there were unapplied upda* tes

  • Then a popup would ask if I want to update now.

  • I’d say yes because I thought maybe the automated tool knew more about error recovery than me.

  • It would fail with similar results.

  • Then one time the automated tool succeeded and applied the update.

  • I don’t know how the automated tool fixed it.

  • It wasn’t a normal dependency problem.

  • apt-get update would print a useless generic error message and die before reporting andy dependency issues.

    • The apt-get clean issue persists but I found a work around. Just delete the directory it complains about before running apt-get clean

Anyway, things are working well enough now so I’m not worrying about this problem anymore.

I saw that apt-get update was ok but it only reloads the list of sources. The important part of my message is the second part, the apt-get dist-upgrade which updates the packages and installs missing dependancies (the first part, the apt-get update was there just to be sure that the sources are up to date when you run it). In your original message, you did and apt-get upgrade which is basically the same except that if new dependancies have to be installed, they won’t be.

As APT reported that there was 3 packages not fully installed/updated, it’s worth giving it a try, in case that’s what triggers the issues with the cached package.

I was trying both uprade and dist-upgrade with similar results. Apt never reached a point where it reported anything regarding dependencies. It would just say little more than error and exit.

It’s working now. I’m not going to worry about it aslong as it keeps working.