# "Unauthenticated packages" error when trying to install dotnet-runtime-2.2 package

**URL:** <https://travis-ci.community/t/unauthenticated-packages-error-when-trying-to-install-dotnet-runtime-2-2-package/6572>\
**Category:** C#\
**Created:** [December 20, 2019, 1:21pm UTC](https://travis-ci.community/t/unauthenticated-packages-error-when-trying-to-install-dotnet-runtime-2-2-package/6572 "2019-12-20T13:21:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![airbreather](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/airbreather/32/3401_2.png) [@airbreather](https://travis-ci.community/u/airbreather)\
**Post date:** [December 20, 2019, 1:21pm UTC](https://travis-ci.community/t/unauthenticated-packages-error-when-trying-to-install-dotnet-runtime-2-2-package/6572/1 "2019-12-20T13:21:01Z")

</div>

We use the .NET Core 3.0 SDK for building most of our project, but our tests actually run on `netcoreapp2.2` since it works with Visual Studio 2017 and we haven’t needed anything newer.

In order to make this work in Travis-CI, we use `dotnet: 3.0` in our YAML, with a `before_install` step that installs the `dotnet-runtime-2.2` package. This has worked for a long time.

We just recently ran into a failure in our `before_install` step, complaining that the following dependencies could not be authenticated: `liburcu4`, `liblttng-ust-ctl2`, and `liblttng-ust0`.

I hesitate to add `--allow-unauthenticated` to our `before_install` step, since I worry that this could be a sign that something’s wrong with those packages. Any advice?

Last success that worked this way: [https://travis-ci.org/NetTopologySuite/NetTopologySuite/builds/626071321](https://travis-ci.org/NetTopologySuite/NetTopologySuite/builds/626071321)

First failure: [https://travis-ci.org/NetTopologySuite/NetTopologySuite/builds/627705291](https://travis-ci.org/NetTopologySuite/NetTopologySuite/builds/627705291)

FYI, the boilerplate at the top of all our build logs says to post here and cc @ three people, but only one of them seems to resolve in the preview window, and I get an error message when trying to @ all three, so:

cc @joshua-anderson @akoeplinger @\nterry

---

<div class="post-metadata">

**Author:** ![airbreather](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/airbreather/32/3401_2.png) [@airbreather](https://travis-ci.community/u/airbreather)\
**Post date:** [December 21, 2019, 1:22pm UTC](https://travis-ci.community/t/unauthenticated-packages-error-when-trying-to-install-dotnet-runtime-2-2-package/6572/2 "2019-12-21T13:22:35Z")

</div>

Seems to be resolved now.

First success after the last failure: [https://travis-ci.org/NetTopologySuite/NetTopologySuite/builds/627705291](https://travis-ci.org/NetTopologySuite/NetTopologySuite/builds/627705291)

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [December 21, 2019, 6:34pm UTC](https://travis-ci.community/t/unauthenticated-packages-error-when-trying-to-install-dotnet-runtime-2-2-package/6572/3 "2019-12-21T18:34:30Z")

</div>

I don’t see any errors that you refer to in the logs you supplied. Neither does looking at the project’s build list show any streaks of failures.

---

<div class="post-metadata">

**Author:** ![airbreather](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/airbreather/32/3401_2.png) [@airbreather](https://travis-ci.community/u/airbreather)\
**Post date:** [December 21, 2019, 6:51pm UTC](https://travis-ci.community/t/unauthenticated-packages-error-when-trying-to-install-dotnet-runtime-2-2-package/6572/4 "2019-12-21T18:51:11Z")

</div>

Oh how horrible, apparently clicking “restart build” discards the entire failed build, instead of creating a new one and changing “build #804” to point to that new one. I just wanted to get rid of the red “X” on the GitHub commit’s status…

The original error looked like this:

```auto
$ sudo apt-get install -y dotnet-runtime-2.2
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  dotnet-hostfxr-2.2 dotnet-runtime-deps-2.2 liblttng-ust-ctl2 liblttng-ust0
  liburcu4
The following NEW packages will be installed:
  dotnet-hostfxr-2.2 dotnet-runtime-2.2 dotnet-runtime-deps-2.2
  liblttng-ust-ctl2 liblttng-ust0 liburcu4
0 upgraded, 6 newly installed, 0 to remove and 264 not upgraded.
Need to get 21.1 MB of archives.
After this operation, 71.9 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  liburcu4 liblttng-ust-ctl2 liblttng-ust0
E: There were unauthenticated packages and -y was used without --allow-unauthenticated

```

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [December 21, 2019, 9:21pm UTC](https://travis-ci.community/t/unauthenticated-packages-error-when-trying-to-install-dotnet-runtime-2-2-package/6572/5 "2019-12-21T21:21:33Z")

</div>

[https://askubuntu.com/questions/75565/why-am-i-getting-authentication-errors-for-packages-from-an-ubuntu-repository](https://askubuntu.com/questions/75565/why-am-i-getting-authentication-errors-for-packages-from-an-ubuntu-repository) says that this happens if you don’t have keys corresponding to those packages. It suggests running `sudo apt-key update && sudo apt-get update` before installing.

Since Travis logic doesn’t run `sudo apt-key update` but runs `sudo apt-get update` and the problem went away, it looks like there was indeed a problem with those packages – e.g. new versions were pushed that weren’t signed with an appropriate key.
