Some Bits: Nelson's log

5 posts in January 2020

Can’t upgrade Ubuntu 18.10 to 19.10

(Major update: see this blog post for a workaround to upgrade from 18.10.)

I’ve got an Ubuntu 18.10 (cosmic) system. I want to upgrade it to the latest (19.10, eoan). I understand I probably have to upgrade it to 19.04 (disco) first, that’s fine.

Except I can’t.

# do-release-upgrade
Checking for a new Ubuntu release
Your Ubuntu release is not supported anymore.
...
An upgrade from 'cosmic' to 'eoan' is not supported with this tool.

That’s it. No options to help. I get it, 18.10 isn’t supported anymore. But it’s only 15 months old. Surely the old upgrader files are lying around somewhere?

So off to the cargo cult Internet I go.

First thing that looks promising is “How to install software or upgrade from an old unsupported release?” They advise using the old-releases sources as a way to get, well, old releases. That seems promising except following the advice about updating sources.list and running apt update doesn’t work

# apt update
Err:9 http://old-releases.ubuntu.com/ubuntu cosmic Release
  404  Not Found [IP: 91.189.88.153 80]
E: The repository 'http://old-releases.ubuntu.com/ubuntu cosmic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

So something about the source repo directory structure doesn’t match what apt wants? Or did Ubuntu somehow screw up the release signatures? Beats me.

So I went in to sources.list and tried hacking them all to include [trusted=yes], to ignore this error. Yeah, that’s a scary idea. Doesn’t work though. Or rather “apt update” seems to run an O(n^2) update on 124 different URLs, for ~15,000 separate updates. Or something, I dunno, it’s clearly wrong.

I’m stuck. I understand Ubuntu’s support window, or I thought I did. I didn’t realize that being just a few months out of date left you out in the cold forever. I think a full reinstall is my only option.

Update

I tried asking on FreeNode #ubuntu. No one there knew an answer. Got some suggestions on things to try though. By far the best solution is a full reinstall, but I really hope not to do that. The other suggestion is sort of documented here: basically you just hack your sources list and rely on apt-get dist-upgrade to correctly upgrade the system, bypassing the do-release-upgrade script entirely.

My concern is that do-release-upgrade does some extra thing, like modifying config files, that the dist-upgrade won’t do. But after talking about it I think that’s not true, apt really should be able to do the job. I also remember now I had trouble with do-release-upgrade once before and relied on apt to finish an upgrade for me and it worked fine. It may be it’s OK not to run that script.

Update 2

I updated a different system from 19.04 to 19.10 using do-release-upgrade. It sure didn’t look like that script was doing much other than setting up sources and running apt. I think doing this by hand for my 18.10 system (to 19.04 first, then 19.10) is OK.

Update 3

I went a little further down the rabbit hole of “what does do-release-upgrade” actually do. Useful resources: this old Stack question, this gist essay.

A key thing it does is download an updater from a metadata file and presumably run it. (There’s a shell script named “disco”). It might work to do that by hand, or else you can inspect it to try to figure it out. It’s a lot of code though.

I downloaded the disco updater (which is for 18.10 -> 19.04) and took a quick look. A specific thing to inspect is DistUpgradeQuirks.py. The disco updater has a couple of quirks. IT checks if you’re on an i386 and refuses to run. And it runs a function called _replaceDebsWithSnaps(), which is sort of self explanatory. I didn’t bother trying to figure out which debs were involved. There’s also a list of demoted packages which I imagine is a way to remove obsolete stuff. The powerpc build chain features prominently in the disco version.

So anyway, I now know that do-release-upgrade is doing more than just setting up sources and running apt. But it’s not doing a lot more, at least than I can see, and ignoring that stuff may be safe.

Cyberpower pwrstatd revisited

Eight years ago I wrote a blog post about the Linux software for my UPS. I was pretty negative about it. What’s funny is now 8 years later I’d forgotten about that post and re-installed that software and thought “hey, that’s not so bad”. Mostly because they publish a dpkg which just works. But revisiting my post I see my complaints still apply: requires root, no source code, aggressive shut down options. They’ve even added a thing now where it schedules the whole UPS to turn itself off 10 minutes after the outage. WTF?

Anyway, reconfiguring the daemon so that it never shuts anything down itself, it’s OK software. Not great, not bad. Mostly what I want is the munin plugin for monitoring the thing. I put one in my blog post; someone picked it up, improved it, and has it on Github now. Open source works!

OTA digital TV notes

Did you know TV shows are broadcast for free over the airwaves? It’s amazing; no need to pay the cableman or satellitelady their rent. At least, if you want to watch ad supported non-premium programming.

OTA digital TV has gotten pretty simple. Basically there’s just MPEG-2 streams floating around at ~600MHz for the taking. I just got a tuner and antenna to pick them up. An HDHomeRun Connect Duo for the tuner and a Clearstream Eclipse antenna. Total cost: $100 to $150. There’s other options, see Wirecutter.

So far so good; without any effort to set up the antenna right, in San Francisco I can get 46 channels. Really it’s 12 channels, but there’s multiplexing so where channel 2.1 is KTVU in HD, channel 2.2 is KTVU-SD and channel 2.3 is a random movies channel.

The diversity of channels is pretty neat. I’m enthralled by channel 60.5 PJKFNX which is showing First Nations Experience, a whole channel of indigenous peoples programming. I think YouTube is the only other place I could find content like that.

Devices

The antenna is nothing exciting. Some flat piece of floppy vinyl with some very stiff coax cable coming out. This particular Eclipse antenna has a 20 dB amplifier attached to it. No idea if the amplification is necessary, or if more would be better.

I like the HomeRun tuner. It takes power and antenna in, has ethernet out. That’s it. The device serves MPEG streams and some diagnostic info via a web interface. Very simple and hackable.

Software

I’m currently watching via the HDHomeRun Windows app. It’s a fine bare-bones viewer, backed with some sort of program guide. They run a DVR service too; I wonder if they even bother recording anything or if it’s more of a Sling-like setup. There’s mobile apps too and I think a new Roku app.

The HDHomeRun includes a basic HTTP API for programmatically getting a list of channels and watching MPEG-TS streams. This caveat is fascinating

The client will have a slightly different concept of how long one second is due to slight differences in the client clock timebase vs the broadcaster clock timebase. The client must adjust its concept of real time to match the incoming video stream

No one watches live TV anymore though. I bought this in part because I finally got a Plex Pass and one of the value-adds for that is Plex has DVR software. Setup of the Plex DVR was easy, the program guide is good, and it seems to record OK. Recording seems to run a transcoder stream at 150% CPU on my system which is odd, I have both commercial skipping and transcoding compression disabled. Maybe it’s just having to collect and assemble the chunks. The final output is a .ts container that has what looks like the broadcast MPEG-2 and AC3 streams in it. I’ve set up recording a show regularly, we’ll see how it does.

One thing I’ve noticed is a lot of the older video I’m seeing is interlaced. And I guess decombing isn’t a standard feature. It’s ugly.

Update the DVR seems to work great. I also enabled commercials skipping and transcoding for smaller storage. It seems to work OK. Commercials skipped even in a live news broadcast, which suggests they’re doing some live detection mechanism and not relying on a content database.

Transcoded to 6Mbps 720p (H.264) using about 1.5 CPU cores out of my system’s 8, so the impact isn’t too bad. Resulting file is 3GB/hour for 720p, which is not great, but for a fast transcode it’s not bad. You can see the settings they’re using here; as the commenter points out, a lower CRF would be a nice space / quality tradeoff. Right now it’s not configurable.

Channel availability

I’m currently getting channels 2, 4, 5, 7, 9, 38, 42, 44, 50, 54, 60, and 66 (with many variants). That’s the major “broadcast” networks (ABC, CBS, NBC, and regretfully FOX) plus a bunch of other random stuff. Most channels have 99%+ signal quality, but 60.5 is only 84%. Still looks fine to watch. Note this testing is being done right before the FCC repack when stations get renumbered to free up some bandwidth.

There’s several sites that’ll let you check what channels you should expect. Results below. To simplify things I’m assuming if I get one channel I get all the other related multiplexed ones.

Note each test has a different list of stations. I think what my antenna auto-detected is a strict subset of all of those. What these online sites tell me is I can probably get a few more channels with better antenna placement. I will note I did a second scan and got the exact same result of 46 channels, so at least it’s stable.

AntennaWeb: 2, 4, 5, 7, 9, 11, 12, 22, 38, 42, 44, 45, 50, 52, 54, 60, 66

FCC: 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 14, 22, 26, 28, 36, 38, 44, 48, 54, 60, 65, 66, 68

TabloTV: 2, 3, 4, 5, 7, 9, 11, 12, 38, 42, 44, 45, 48, 50, 52, 54, 60, 65, 66

TVFool: see picture below. I’m not sure their database is current, but I love this nerdy visualization.

Facial recognition for the public: Yandex

You can use Yandex Image Search right now as a pretty good facial recognition system for anyone who has labelled photos on the Web. I believe this is the first generally accessible facial recognition system with a large database. Yandex isn’t designed for this purpose. The trick is to upload photos cropped to a face and it’ll work more or less to find similar faces.

This post was inspired by Bellingcat’s recent post on image search which noted Yandex’s image search as something particularly good and particularly called out the facial recognition. I’m just elaborating on what he found.

Update: see this article about ClearView, a company doing facial recognition with scraped photos from Facebook, etc. Also this Dec 2019 video reporting about Yandex facial recognition. The Daily Mail also published an article based on this blog post.

Demonstration with a selfie

Here’s a selfie I took today. It’s never been on the web before this post and appears in no databases as I do these searches. This is a good clear photo of me, which makes the results better, but it works with less good photos too.

Now pretend you didn’t know my name. Put the image in to Yandex. Here’s the result you get.

The first two images are me. Click on either of them and the web page it takes you to has my name on it. Now you know who I am!

It’s not perfect; there’s no name provided directly, someone has to read the linked page to find one. And a person still has to sift through the near-matches of faces. But it’s pretty good. The only limit is Yandex’s database. That’s kind of “the whole web”, but their index is nowhere as comprehensive as Google.

Demonstration with Andrew Yang

Recognizing myself is easy. How about a stranger? I used this today to identify who the “Yang” was in this image from CNBC. It’s supposed to be Andrew Yang, the presidential candidate, but it is not.

Crop the image to Yang’s face, put it in Yandex, and you get this

All five of the first images look like our guy. The first result on the Yandex result page also leads directly to his home page: Geoff Yang. Some CNBC intern is gonna be in so much trouble! (This post is not an endorsement of Andrew Yang.)

Facial recognition vs image search

The new thing here is that Yandex is working not just as a reverse image search tool; it seems to be doing facial matching. None of the images it finds look much like the original image; different aspect ratio, different background, different details. But the faces match. It even matches my selfie both to a much younger version of me without a beard and to a version of me holding a box up obscuring part of my face. That’s pretty wild.

FWIW, here’s what other image search engines do with my selfie. I tested Google, Baidu, Bing, and TinEye. TinEye returned 0 results.

Google
Baidu
Bing

Look at all the beardy white guys with some yellow in the image! None of them are me. It’s not a bad guess; I gave it a head shot, it found me similar head shots. But it didn’t find my face. Yandex finds my face. (Arguably TinEye’s 0 results is the right answer for this query; this image does not exist online.)

Why this matters

We’re on the cusp of a major change in day to day privacy with facial recognition algorithms. AI has now gotten good enough that it can do excellent facial recognition; modern software can take a blurry photo of half a face and match it to other faces of the same person. It’s a pretty scary future, particularly as already put into place by authoritarian governments like in Xinjiang, but it is inevitable and unstoppable.

Right now an ordinary person still can’t, for free, take a random photo of a stranger and find the name for him or her. But with Yandex they can. Yandex has been around a long time and is one of the few companies in the world that is competitive to Google. Their index is heavily biased to Eastern European data, but they have enough global data to find me and Andrew Yang.

If you use Google Photos or Facebook you’ve probably encountered their facial recognition. It’s magic, the matching works great. It’s also very limited. Facebook seems to only show you names for faces that people you have some sort of Facebook connection to. Google Photos similarly doesn’t volunteer random names. They could do more; Facebook could match a face to any Facebook user, for instance. But both services seem to have made a deliberate decision not to be a general purpose facial recognition service to identify strangers.

There is at least one public recognition service out there: FindClone (hat tip to Brad F). You can read more about FindClone here. (It used to be known a FindFace, and SearchFace.) However it’s limited to photos from VKontakte, the Facebook for the Russian speaking world. It’s a big dataset. But it’s not international like the Yandex search engine is.

I imagine within a few years this “look up a name from a face” will become as common as “look up a name from a phone number”. Not quite ubiquitous because everyone finds it creepy, but easy enough to access if you need it.

Update December 2022

Microsoft / Bing now has Who Is That which does facial recognition, but only for famous people. It does not work with my image.

Yandex seems to have dialed back or removed the facial recognition. Searching my image above now gives a bunch of generic portraits, no longer me.

Update September 2023

See A Face Search Engine Anyone Can Use Is Alarmingly Accurate, about PimEyes.