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.