Java8 in LXC or LXC and add-apt-repository

add-apt-repository isn’t gonna work on Ubuntu LXC right off the bat. Why? Because it’s not there. 🙂 Thanks Frogu for clarification. To have it (for example to install Java 8 on a container) you need to install software-properties-common (on Ubuntu 14.04 that should be enough) and perhaps also python-software-properties on other versions.

Then you can add Java 8:

sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer
# optionally, for making it default if you prefer this to `update-java-alternatives`
sudo apt-get install oracle-java8-set-default

Advertisements

3 Comments

  1. I can’t sleep, somebody’s wrong on the Internet.

    add-apt-repository works on Ubuntu LXC. You just have to install it, as you’ve stated it.

    add-apt-repository is a part of software-properties-common.

    » apt-file search add-apt-repository
    software-properties-common: /usr/bin/add-apt-repository
    software-properties-common: /usr/share/man/man1/add-apt-repository.1.gz

    python-software-porperties is a direct dependency of software-properties-common and python-apt, so it will be installed for you when you install either software-properties-common or python-apt.

    In the same way less “doesn’t work”, because it is not included in the minimal template.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s