# Consistent error when using apt on Ubuntu 20.04

**URL:** <https://discuss.bitrise.io/t/consistent-error-when-using-apt-on-ubuntu-20-04/18152>\
**Category:** Builds\
**Tags:** android, linux\
**Created:** [September 30, 2021, 6:04pm UTC](https://discuss.bitrise.io/t/consistent-error-when-using-apt-on-ubuntu-20-04/18152 "2021-09-30T18:04:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vince.delricco](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/vince.delricco/32/1146_2.png) [@vince.delricco](https://discuss.bitrise.io/u/vince.delricco)\
**Post date:** [September 30, 2021, 6:04pm UTC](https://discuss.bitrise.io/t/consistent-error-when-using-apt-on-ubuntu-20-04/18152/1 "2021-09-30T18:04:26Z")

</div>

# Bitrise Build Issue Report template

## Description of the issue

Every build fails when trying to use apt to install a package or add a ppa repo;

```auto
+ add-apt-repository --yes ppa:rpardini/adoptopenjdk
Ign:1 https://deb.nodesource.com/node_12.x focal InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:3 https://download.docker.com/linux/ubuntu focal InRelease
Err:4 https://deb.nodesource.com/node_12.x focal Release
Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 104.124.58.145 443]
Get:5 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]
Get:6 http://packages.cloud.google.com/apt cloud-sdk InRelease [6,739 B]
Hit:7 http://archive.ubuntu.com/ubuntu focal InRelease
Get:9 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:10 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu focal InRelease
Get:11 https://dl.yarnpkg.com/debian stable/main all Packages [10.5 kB]
Get:12 http://packages.cloud.google.com/apt cloud-sdk/main i386 Packages [153 kB]
Get:13 https://dl.yarnpkg.com/debian stable/main i386 Packages [10.5 kB]
Get:14 https://dl.yarnpkg.com/debian stable/main amd64 Packages [10.5 kB]
Get:15 http://packages.cloud.google.com/apt cloud-sdk/main amd64 Packages [190 kB]
Get:16 http://ppa.launchpad.net/rpardini/adoptopenjdk/ubuntu focal InRelease [18.1 kB]
Get:17 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [580 kB]
Get:8 https://packagecloud.io/github/git-lfs/ubuntu focal InRelease [24.4 kB]
Get:18 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [794 kB]
Get:19 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1,133 kB]
Get:20 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [358 kB]
Get:21 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages [628 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:22 https://packagecloud.io/github/git-lfs/ubuntu focal/main amd64 Packages [2,012 B]
Get:24 https://packagecloud.io/github/git-lfs/ubuntu focal/main i386 Packages [1,986 B]
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [630 kB]
Get:26 http://ppa.launchpad.net/rpardini/adoptopenjdk/ubuntu focal/main amd64 Packages [11.1 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1,082 kB]
Get:28 http://archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [794 kB]
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [681 kB]
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,580 kB]
Reading package lists...
E: The repository 'https://deb.nodesource.com/node_12.x focal Release' no longer has a Release file.

```

## Environment:

Android / Ubuntu 20.04

**Which build Step causes the issue and which version of the step?**

Either the apt-get install “step”, or invoked apt in a “script” step

## Reproducibility

- _Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build)_ : NO
- _Does a rebuild without caches help? (You can remove the `Cache:Pull` and `Cache:Push` steps temporarily to not to use the cache, or [you can delete all the caches on the `Settings` tab of the app](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)._ : NO
- _Does the issue happen sporadically, or every time?_ : Every Time
- _Does upgrading the build Step to the latest version help?_ : NO
- _When did the issue start?_ : Sep 30th

### Local reproduction

_Can it be reproduced on your own Mac/PC by following our [local debug guide](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392)? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what [bitrise.io](http://bitrise.io) will get when it does a git clone in the clean environment! If possible please note which sections you tried._

### Local reproduction: Linux / Android (docker based) stack builds

_Can it be reproduced by running the build locally, after doing a new git clone of the repository into the `/tmp` directory and running the build from there with the Bitrise CLI ( [Bitrise CLI](https://www.bitrise.io/cli) )? If no, can it be reproduced with Docker (using the same docker images / environment we use on [bitrise.io](http://bitrise.io))? Related guide: [Running your build locally in Docker](http://devcenter.bitrise.io/docker/run-your-build-locally-in-docker/) ._

## Build log

> **[Log in - Bitrise](https://app.bitrise.io/users/sign_in)**
>
> Bringing back the joy of iOS & Android development through automating build, testing and support cycles.

---

<div class="post-metadata">

**Author:** ![vince.delricco](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/vince.delricco/32/1146_2.png) [@vince.delricco](https://discuss.bitrise.io/u/vince.delricco)\
**Post date:** [September 30, 2021, 6:51pm UTC](https://discuss.bitrise.io/t/consistent-error-when-using-apt-on-ubuntu-20-04/18152/2 "2021-09-30T18:51:10Z")

</div>

Interestingly, I am able to remote into the box and run the apt command successfully. The system requires you to use sudo. I confirmed using sudo in our build script doesn’t change the failure.

---

<div class="post-metadata">

**Author:** ![vince.delricco](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/vince.delricco/32/1146_2.png) [@vince.delricco](https://discuss.bitrise.io/u/vince.delricco)\
**Post date:** [September 30, 2021, 7:26pm UTC](https://discuss.bitrise.io/t/consistent-error-when-using-apt-on-ubuntu-20-04/18152/3 "2021-09-30T19:26:18Z")

</div>

The solution mentioned in this thread worked for us in the meantime until a proper solution is applied: [The certificate for deb.nodesource seems to be expired · Issue #1266 · nodesource/distributions · GitHub](https://github.com/nodesource/distributions/issues/1266#issuecomment-931582523)

```auto
sudo rm /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
sudo update-ca-certificates

```

---

<div class="post-metadata">

**Author:** ![don.phillips](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@don.phillips](https://discuss.bitrise.io/u/don.phillips)\
**Post date:** [September 30, 2021, 8:17pm UTC](https://discuss.bitrise.io/t/consistent-error-when-using-apt-on-ubuntu-20-04/18152/4 "2021-09-30T20:17:58Z")

</div>

Can confirm the workaround works. But I think the proper solution is that Bitrise needs to roll an updated Ubuntu docker image with an updated ca-certificates package.

---

<div class="post-metadata">

**Author:** ![NinoQ42](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@NinoQ42](https://discuss.bitrise.io/u/NinoQ42)\
**Post date:** [October 5, 2021, 8:37am UTC](https://discuss.bitrise.io/t/consistent-error-when-using-apt-on-ubuntu-20-04/18152/5 "2021-10-05T08:37:16Z")

</div>

Issue seems resolved, workaround can be removed

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [November 4, 2021, 8:37am UTC](https://discuss.bitrise.io/t/consistent-error-when-using-apt-on-ubuntu-20-04/18152/6 "2021-11-04T08:37:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
