Ubuntu Trusty to Ubuntu Xenial Migration Guide

As of August, 13th 2019, we’ve switched the default Linux distribution on Travis CI from Ubuntu Trusty 14.04 LTS to Ubuntu Xenial 16.04. Here are the most common issues our customers ran into and how you can fix them.

If you’d like to stay on Ubuntu Trusty or need more time to set up your repository with Ubuntu Trusty, please explicitly set dist: trusty in your .travis.yml file as soon as possible.

What does this mean for your projects? #

Repositories without an explicit dist: YAML key in their .travis.yml file will be routed to Xenial instead of Trusty.

Repositories without an explicit operating system os: key in their travis.yml file will use Linux Ubuntu Xenial 16.04.

There are three important changes to take into account when updating to Xenial from our Trusty build environment:

1. Services support #

Services like MySQL or PostgreSQL are not started by default. To start any service, such as MySQL, add it to the services key in your config:

  services:
    - mysql

When you are trying to run PostgreSQL and you are facing a memory problem, i.e. running sudo df -h and getting output from the mount points;

none            768M  768M     0 100% /var/ramfs

try to add the following line of code to your .travis.yml:

before_install: sudo mount -o remount,size=50% /var/ramfs

2. Third-party APT sources #

Sources from third-party APT repositories have been removed. During the Xenial image provision, third-party APT repositories are used to pre-install services like redis-server. These packages are available during build time, but to reduce the risk of sporadic apt-get update failures, the repositories are removed after the packages are installed.

For example, to update the git-lfs version, you’d need to explicitly specify the source in your config:

You can find the full list of sources that have been used and to install packages and then were removed here.

addons:
  apt:
    sources:
    	- github-git-lfs-xenial
    packages:
    	- git-lfs

3. Headless browser testing #

To use headless browser testing, you now start xvfb via the services key, like this:

services:
  - xvfb

If you had configured xvfb manually in your trusty builds, please replace it with the services key above, which is also easier to maintain!

To recap! #

The default build environment is Ubuntu Xenial 16.04. You can identify if your repository is now running on Xenial by checking your build log, under Operating System Details like:

OS details

Jobs run on Xenial, display Operating System Details, Description: Ubuntu 16.04.5 LTS You can find the specific versions of what’s pre-installed in the Xenial Reference docs.

If your build depends on a different Ubuntu distribution like Ubuntu Trusty 14.04, you can explicitly specify dist: trusty to ensure your build will use it.

Need Help? #

Please feel free to contact us via our support email address, or create a forum topic.