unable to install puppetserver on ec2 ubuntu instance error: Some packages could not be installed

unable to install puppetserver on ec2 ubuntu instance error: Some packages could not be installed

我正在尝试在 EC2 Ubuntu 实例上安装 Puppet 服务器:

ubuntu@ip-172-31-43-240:~$ sudo apt-get install puppetserver
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:
 puppetserver : Depends: puppet-common (>= 3.7.3-1puppetlabs1) but 3.7.0-1puppetlabs1 is to be installed
                Depends: puppet (>= 3.7.3-1puppetlabs1) but 3.7.0-1puppetlabs1 is to be installed
E: Unable to correct problems, you have held broken packages.
ubuntu@ip-172-31-43-240:~$

如果我尝试安装 puppet-common:

ubuntu@ip-172-31-43-240:~$ sudo apt-get install puppet-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
puppet-common is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
ubuntu@ip-172-31-43-240:~$

我尝试清除 puppet-common 并重新安装它。我也试过 sudo apt-get upgrade.

如有任何帮助,我们将不胜感激。谢谢。

您是否启用了 PuppetLabs package repositories?根据你的 Ubuntu 版本,你应该这样做:

curl https://apt.puppetlabs.com/puppetlabs-release-trusty.deb > /tmp/puppetlabs-release-trusty.deb
dpkg -i /tmp/puppetlabs-release-trusty.deb
apt-get update
apt-get -y install puppetserver

我刚刚建立了一个干净的 Trusty 服务器并且 运行 这个脚本对我有用:

root@trustytest:~# bash install_puppet_server.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7384  100  7384    0     0   126k      0 --:--:-- --:--:-- --:--:--  128k
(Reading database ... 153167 files and directories currently installed.)
Preparing to unpack .../puppetlabs-release-trusty.deb ...
Unpacking puppetlabs-release (1.0-11) over (1.0-11) ...
Setting up puppetlabs-release (1.0-11) ...
Ign http://apt.puppetlabs.com trusty InRelease
...trimmed for text limit
Ign http://mirrors.digitalocean.com trusty/main Translation-en_US
Ign http://mirrors.digitalocean.com trusty/multiverse Translation-en_US
Ign http://mirrors.digitalocean.com trusty/restricted Translation-en_US
Ign http://mirrors.digitalocean.com trusty/universe Translation-en_US
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-57 linux-headers-3.13.0-57-generic
  linux-headers-3.13.0-61 linux-headers-3.13.0-61-generic
  linux-image-3.13.0-57-generic linux-image-3.13.0-61-generic
  linux-image-extra-3.13.0-57-generic linux-image-extra-3.13.0-61-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  augeas-lenses ca-certificates-java debconf-utils facter fontconfig-config
  fonts-dejavu-core hiera java-common libasyncns0 libaugeas-ruby libaugeas0
  libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libflac8
  libfontconfig1 libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3
  libnss3-nssdb libogg0 libpulse0 libruby1.9.1 libsctp1 libsndfile1
  libvorbis0a libvorbisenc2 lksctp-tools openjdk-7-jre-headless puppet
  puppet-common ruby ruby-augeas ruby-json ruby-shadow ruby1.9.1 tzdata-java
  virt-what
Suggested packages:
  augeas-doc default-jre equivs augeas-tools cups-common liblcms2-utils
  pulseaudio icedtea-7-jre-jamvm libnss-mdns sun-java6-fonts
  fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho
  ttf-wqy-microhei ttf-wqy-zenhei ttf-indic-fonts-core ttf-telugu-fonts
  ttf-oriya-fonts ttf-kannada-fonts ttf-bengali-fonts puppet-el vim-puppet
  ruby-selinux libselinux-ruby1.8 librrd-ruby1.9.1 librrd-ruby1.8 ri ruby-dev
  ruby1.9.1-examples ri1.9.1 graphviz ruby1.9.1-dev
Recommended packages:
  rdoc
The following NEW packages will be installed:
  augeas-lenses ca-certificates-java debconf-utils facter fontconfig-config
  fonts-dejavu-core hiera java-common libasyncns0 libaugeas-ruby libaugeas0
  libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libflac8
  libfontconfig1 libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3
  libnss3-nssdb libogg0 libpulse0 libruby1.9.1 libsctp1 libsndfile1
  libvorbis0a libvorbisenc2 lksctp-tools openjdk-7-jre-headless puppet
  puppet-common puppetserver ruby ruby-augeas ruby-json ruby-shadow ruby1.9.1
  tzdata-java virt-what
0 upgraded, 42 newly installed, 0 to remove and 67 not upgraded.
Need to get 89.8 MB of archives.
After this operation, 143 MB of additional disk space will be used.
Get:1 http://apt.puppetlabs.com/ trusty/main facter all 2.4.6-1puppetlabs1 [73.3 kB]
Get:2 http://apt.puppetlabs.com/ trusty/main hiera all 1.3.4-1puppetlabs1 [12.0 kB]
Get:3 http://apt.puppetlabs.com/ trusty/main puppet-common all 3.8.6-1puppetlabs1 [1,269 kB]
Get:4 http://apt.puppetlabs.com/ trusty/main puppet all 3.8.6-1puppetlabs1 [9,310 B]
Get:5 http://apt.puppetlabs.com/ trusty/main puppetserver all 1.1.3-1puppetlabs1 [41.7 MB]
Get:6 http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/ trusty/main libruby1.9.1 amd64 1:1.9.3.551-2bbox1~trusty1 [2,962 kB]
Get:7 http://mirrors.digitalocean.com/ubuntu/ trusty/main libasyncns0 amd64 0.8-4ubuntu2 [11.9 kB]
Get:8 http://mirrors.digitalocean.com/ubuntu/ trusty/main libavahi-common-data amd64 0.6.31-4ubuntu1 [21.2 kB]
Get:9 http://mirrors.digitalocean.com/ubuntu/ trusty/main libavahi-common3 amd64 0.6.31-4ubuntu1 [21.7 kB]
Get:10 http://mirrors.digitalocean.com/ubuntu/ trusty/main libavahi-client3 amd64 0.6.31-4ubuntu1 [25.1 kB]
Get:11 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main libcups2 amd64 1.7.2-0ubuntu1.7 [179 kB]
Get:12 http://mirrors.digitalocean.com/ubuntu/ trusty/main libogg0 amd64 1.3.1-1ubuntu1 [17.0 kB]
Get:13 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main libflac8 amd64 1.3.0-2ubuntu0.14.04.1 [80.2 kB]
Get:14 http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu/ trusty/main ruby1.9.1 amd64 1:1.9.3.551-2bbox1~trusty1 [236 kB]
Get:15 http://mirrors.digitalocean.com/ubuntu/ trusty/main fonts-dejavu-core all 2.34-1ubuntu1 [1,024 kB]
Get:16 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main fontconfig-config all 2.11.0-0ubuntu4.1 [47.4 kB]
   ...trimmed for text limit
Processing triggers for ureadahead (0.100.0-16) ...

嗨,很快,已安装!

root@trustytest:~# puppetserver --version
puppetserver version: 1.1.3