3

I've built 2 fresh VMs of Ubuntu server. One is from the 18.04.1 ISO and the other is from an older 18.04 ISO. The issue I'm having is that 'apt get install ansible' doesn't work on the 18.04.1 VM whereas it will work on the 18.04 VM. (I should note that even if I add the ppa:ansible/ansible to the 18.04.1 VM it still doesn't work because it needs the sshpass module which also doesn't appear accessible on 18.04.1.)

So, digging into the differences between the two VMs I noticed that the 18.04 VM has 10 or so repositories (not including deb-src lines) in its /etc/apt/source.list file whereas the 18.04.1 only has 4.

I didn't see any notes in the 18.04.1 readme to indicate that the sources.list file would be different. So, what am I doing wrong here?

1

3 Answers 3

1

Had the same problem after installing this particular image.

only 3 sources were in /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

I had to add 7 other common sources manually with the help of these instructions on GitHub.

In short, the contents of the file should be as below. Use sudo nano or your favourite text editor to change the contents to this.

#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
0
0

Same issue here, there seems to be a bug and I haven’t found yet a clue how to fix it.

This is my sources.list:

deb http://archive.ubuntu.com/ubuntu bionic main 
deb http://archive.ubuntu.com/ubuntu bionic-security main 
deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

My Ubuntu Server version:

Ubuntu 18.04.1 LTS \n \l

And the error:

sudo apt-get install ansible
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ansible : Depends: sshpass but it is not installable
E: Unable to correct problems, you have held broken packages.

FOUND A FIX:

I don’t really understand why the default install of Ubuntu 18.04.1 doesn’t include more sources in /etc/apt/sources.list by default it only includes:

deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

The way that I fix the missing packages was to add this:

https://gist.github.com/jackw1111/d31140946901fab417131ff4d9ae92e3

3
  • Updating my /etc/apt/sources.list with the list found in the gist also fixed my ability to install ansible after running a 'sudo apt-get update'. Thanks!
    – James Eby
    Aug 24, 2018 at 4:57
  • Please do not post answers depending on external links. Put the relevant part into your answer (or post the link as a comment to the question once you have enough reputation). See How to Answer for details.
    – Melebius
    Sep 6, 2018 at 13:34
  • 1
    And the reason that @Melebius mentioned, is that external links will often fail to work...like now. That link doesn't exist
    – Gerrat
    May 21, 2019 at 14:41
0

Had the same problem with the version you get by default when downloading the server version. This uses the new Subiquity installer, which is a bit different and apparently gives a slightly different result. Seems more geared towards the cloud...

Read the text and downloaded the alternative installer version, which is the good old installer... The sources.list is as one would expect with this version.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .