I am trying to implement the latest version of varnish server using Puppet with APT module, however, I am getting some errors. I need to use "--force-yes". How do I go about doing that. Can anyone suggest me what I maybe doing wrong or point me to an example. Thanks
Here's what I'm trying to do
This is what I have done so far.
class profile::varnish {
notify{'Provisioning varnish server': }
include apt
apt::key {'apt-key':
id => 'E98C6BBBA1CBC5C3EB2DF21C60E7C096C4DEFFEB',
source => 'https://repo.varnish-cache.org/GPG-key.txt'
}
apt::source {'varnish':
location => 'https://repo.varnish-cache.org/ubuntu/',
release => 'trusty',
repos => 'varnish-4.1',
require => Apt::Key['apt-key']
}
package {'varnish':
ensure => installed,
require => Apt::Source['varnish']
}
}
Here's the error, I am getting with Puppet agent.
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install varnish' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
gcc gcc-4.8 libasan0 libatomic1 libc-dev-bin libc6-dev libgcc-4.8-dev
libitm1 libjemalloc1 libquadmath0 libtsan0 libvarnishapi1 linux-libc-dev
manpages-dev
Suggested packages:
gcc-multilib make autoconf automake1.9 libtool flex bison gdb gcc-doc
gcc-4.8-multilib gcc-4.8-doc gcc-4.8-locales libgcc1-dbg libgomp1-dbg
libitm1-dbg libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg
glibc-doc varnish-doc
The following NEW packages will be installed:
gcc gcc-4.8 libasan0 libatomic1 libc-dev-bin libc6-dev libgcc-4.8-dev
libitm1 libjemalloc1 libquadmath0 libtsan0 libvarnishapi1 linux-libc-dev
manpages-dev varnish
0 upgraded, 15 newly installed, 0 to remove and 2 not upgraded.
Need to get 585 kB/12.3 MB of archives.
After this operation, 43.4 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
libvarnishapi1 varnish
E: There are problems and -y was used without --force-yes
Error: /Stage[main]/Profile::Varnish/Package[varnish]/ensure: change from absent to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install varnish' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
gcc gcc-4.8 libasan0 libatomic1 libc-dev-bin libc6-dev libgcc-4.8-dev
libitm1 libjemalloc1 libquadmath0 libtsan0 libvarnishapi1 linux-libc-dev
manpages-dev
Suggested packages:
gcc-multilib make autoconf automake1.9 libtool flex bison gdb gcc-doc
gcc-4.8-multilib gcc-4.8-doc gcc-4.8-locales libgcc1-dbg libgomp1-dbg
libitm1-dbg libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg
glibc-doc varnish-doc
The following NEW packages will be installed:
gcc gcc-4.8 libasan0 libatomic1 libc-dev-bin libc6-dev libgcc-4.8-dev
libitm1 libjemalloc1 libquadmath0 libtsan0 libvarnishapi1 linux-libc-dev
manpages-dev varnish
0 upgraded, 15 newly installed, 0 to remove and 2 not upgraded.
Need to get 585 kB/12.3 MB of archives.
After this operation, 43.4 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
libvarnishapi1 varnish
E: There are problems and -y was used without --force-yes
Update:
Those of you who are wondering how I have managed to get the apt::key ID, I have used the following command
gpg --with-fingerprint your-gpg-key.txt
You will want the key fingerprint output, without the spaces. I thought I share this with you, because it took me awhile to figure it out.
Don't know if it is the right approach, however, I have managed to solve this problem by adding the following lines in the profile::varnish class.
exec { 'apt-update':
command => "/usr/bin/apt-get update",
logoutput => "on_failure",
path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin:/usr/local/sbin:/sbin",
}
exec { 'apt-upgrade':
command => "/usr/bin/apt-get --quiet --yes --fix-broken upgrade",
logoutput => "on_failure",
path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin:/usr/local/sbin:/sbin",
require => Exec['apt-update'],
}
You can add gpg keys with the apt module too https://forge.puppetlabs.com/puppetlabs/apt#add-gpg-keys
apt::key { 'puppetlabs':
id => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30',
server => 'pgp.mit.edu',
options => 'http-proxy="http://proxyuser:proxypass#example.org:3128"',
}
Related
I'm trying to install according to the instructions.
Error when trying to install:
# sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
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:
containerd.io : Depends: libseccomp2 (>= 2.5.0) but 2.4.3-1ubuntu3.18.04.3 is to be installed
E: Unable to correct problems, you have held broken packages.
OS:
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
# apt-get upgrade && apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Docker repo:
# cat /etc/apt/sources.list.d/docker.list
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu bionic stable
I tried to find information on how to update libseccomp2 for Ubuntu 18.04 but didn't find anything. Has anyone encountered such a problem?
I encountered the same issue and built it from source.
Uncomment the deb-src lines from /etc/apt/sources.list, then:
mkdir foo && cd foo
sudo apt-get update
sudo apt build-dep libseccomp2
apt-get source --compile libseccomp2
sudo dpkg -i libseccomp2_*.deb
It runs a lot of tests after the build which is time consuming. To skip those you add this before the apt-get source step:
export DEB_BUILD_OPTIONS=nocheck
After that, I was able to install Docker.
i am running Feren Os a branch of Ubuntu and I have a new problem while installing Winehq
the system is up to date and all packages upgrade except for one .
$ sudo apt list --upgradable
Listing... Done
vkd3d-compiler/hirsute 1.2~hirsute-1 i386 [upgradable from: 1.2~focal-1]
N: There is 1 additional version. Please use the '-a' switch to see it
system info
wine Problem
$ sudo apt install --install-recommends winehq-stable
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:
winehq-stable : Depends: wine-stable (= 6.0.2~hirsute-1)
E: Unable to correct problems, you have held broken packages.
I have tried
$ sudo dpkg --force depends -P wine-stable
dpkg: warning: ignoring request to remove wine-stable which isn't installed
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
You have mixed Feren Os based on Ubuntu Focal with Ubuntu Hirsute leading to the unmet dependencies error.
To fix this problem, you need to remove hirsute from /etc/apt/sources.list and the files under /etc/apt/sources.list.d/ dir.
To install winehq see the documentation and use the focal codename.
If you have an issue with vkd3d, it can be installed from Cybermax PPA..
Synaptic -> removed all wine repositories
sudo dpkg --add-architecture i386
sudo apt update
Removing previous WineHQ repository:
sudo apt-add-repository -r 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
Adding other repositories:
wget -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key -O Release.key -O- | sudo apt-key add -
sudo apt-add-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/ ./'
sudo apt-get update
But!
The final suggested step with wine-stable:
sudo apt install --install-recommends **winehq-devel**
.. This worked for me on kali after having trouble installing wine
I'm trying to install minimal ansible 2.9.x on Ubuntu Bionic (18.04 LTS).
The final goal is to build new disk image (using packer) on every commit and want the process to be as fast as possible.
Using default Ubuntu ansible
Default ansible in bionic is 2.5.x.
This is too old, all ansible scripts are written for 2.9+.
Using official PPA
Using recommended way to install suggests adding following line to /etc/apt/sources.list:
deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main
and running following commands:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
$ sudo apt update
$ sudo apt install ansible
but it still requires python2 packages:
$ sudo apt install ansible
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-asn1crypto
python-cffi-backend python-crypto python-cryptography python-enum34 python-httplib2
python-idna python-ipaddress python-jinja2 python-markupsafe python-minimal
python-paramiko python-pkg-resources python-pyasn1 python-setuptools python-six
python-yaml python2.7 python2.7-minimal sshpass
Suggested packages:
python-doc python-tk python-crypto-doc python-cryptography-doc
python-cryptography-vectors python-enum34-doc python-jinja2-doc python-gssapi
python-setuptools-doc python2.7-doc binutils binfmt-support
The following NEW packages will be installed:
ansible libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python
python-asn1crypto python-cffi-backend python-crypto python-cryptography python-enum34
python-httplib2 python-idna python-ipaddress python-jinja2 python-markupsafe
python-minimal python-paramiko python-pkg-resources python-pyasn1 python-setuptools
python-six python-yaml python2.7 python2.7-minimal sshpass
0 upgraded, 25 newly installed, 0 to remove and 33 not upgraded.
Need to get 11.3 MB of archives.
After this operation, 83.3 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Using pip
This is my current approach but installing pip3 and then installing ansible via pip is another extra step:
$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-7 dh-python dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gcc-7-base libalgorithm-diff-perl
libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libdpkg-perl libexpat1-dev libfakeroot
libfile-fcntllock-perl libgcc-7-dev libgomp1 libisl19 libitm1 liblsan0 libmpc3 libmpx2 libpython3-dev libpython3.6-dev libquadmath0 libstdc++-7-dev libtsan0 libubsan0
linux-libc-dev make manpages-dev python-pip-whl python3-crypto python3-dev python3-distutils python3-keyring python3-keyrings.alt python3-lib2to3
python3-secretstorage python3-setuptools python3-wheel python3-xdg python3.6-dev
Suggested packages:
binutils-doc cpp-doc gcc-7-locales debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg gcc-multilib autoconf automake libtool flex bison gdb gcc-doc
gcc-7-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg
glibc-doc bzr libstdc++-7-doc make-doc python-crypto-doc gnome-keyring libkf5wallet-bin gir1.2-gnomekeyring-1.0 python-secretstorage-doc python-setuptools-doc
The following NEW packages will be installed:
binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-7 dh-python dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gcc-7-base libalgorithm-diff-perl
libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libdpkg-perl libexpat1-dev libfakeroot
libfile-fcntllock-perl libgcc-7-dev libgomp1 libisl19 libitm1 liblsan0 libmpc3 libmpx2 libpython3-dev libpython3.6-dev libquadmath0 libstdc++-7-dev libtsan0 libubsan0
linux-libc-dev make manpages-dev python-pip-whl python3-crypto python3-dev python3-distutils python3-keyring python3-keyrings.alt python3-lib2to3 python3-pip
python3-secretstorage python3-setuptools python3-wheel python3-xdg python3.6-dev
0 upgraded, 57 newly installed, 0 to remove and 33 not upgraded.
Need to get 85.3 MB of archives.
After this operation, 248 MB of additional disk space will be used.
Do you want to continue? [Y/n]
...which adds unnecessary time to the packer process :(
Any hints?
Ubuntu 18.04 comes with python3 already installed and ansible can be easily configured to use python3.
Does anyone know a way how to install ansible 2.9 without the need to install python2 or pip3?
I've had the same problem. In my case was mandatory to be in 2.9.+ because of AWX requirements ... If you are in Ubuntu 18.04 you can follow these steps:
$ sudo apt install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt update
$ sudo apt install ansible
That's it.
$ ansible --version
|___ ansible 2.9.7
Note: I recommend you to ask this kind of questions in Unix & Linux
As mentioned on the issue, it is currently recommended for Ubuntu users to use the Debian repository. You can download it directly here, and install the downloaded deb package using
sudo apt-get install ./ansible_x.y.z_all.deb
This will install ansible without installing python2.
I have successfully tested this on Ubuntu 19.10.
I hit the same issue. When I used
sudo apt install ansible
ansible was installed with Python 2.7.x
I uninstalled everything and installed ansible using pip. Now, when I do ansible --version I get
ansible 2.9.11
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]
I have recompiled the focal version of ansible (which uses python3) against bionic and published that in my PPA. There were only minimal changes necessary. You can use only the package in question instead of enabling the entire PPA. You will end up with ansible 2.9.6.
I've been attempting to install the package r-base on Ubuntu Trusty Tahr and there's a package dependency that became broken in the last week.
My commands are as follows:
apt-get update -y
apt-get dist-upgrade -y
apt-get install -y r-base-dev
...
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main libpng12-dev amd64 1.2.50-1ubuntu2.14.04.1
404 Not Found [IP: 91.189.91.23 80]
Fetched 92.8 MB in 28s (3262 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-dev_1.2.50-1ubuntu2.14.04.1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c sudo apt-get install -y r-base-dev' returned a non-zero code: 100
I have attempted to pass --fix-missing and --ignore-missing but it still fails.
It appears that the package was removed on Jan 8, 2016 due to a security patch: https://launchpad.net/ubuntu/+archive/primary/+sourcepub/5711916/+listing-archive-extra
Looking at http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/ confirms that the ubuntu2.14.04.1 file is not there but 1.2.50-1ubuntu2.14.04.2 is present.
How do I fix that?
My goal is to get r-base to install.
If I could somehow make it use the version "2" file instead of "1" it would presumably find the file and proceed happily, but I'm not sure how to make apt-get do that.
Alternatively, maybe it's possible to update the dependency list on my side? Or is it up to the r-base maintainers to do so?
Or third, is it possible to add a repository that still has the old package? I'm not running on an AMD processor, so I shouldn't need this particular package at runtime anyway.
Update:
The solution that worked for me was to explicitly remove the package with the broken dependency, download the updated version, and re-install it before running apt-get update.
$ apt-get remove -y libpng12-0
$ curl -O http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.50-1ubuntu2.14.04.2_amd64.deb
$ dpkg -i libpng12-0_1.2.50-1ubuntu2.14.04.2_amd64.deb
$ apt-get update -y
The problem apparently doesn't have much to do with the r-base or r-base-dev packages, even though r-base-dev incidentally depends on libpng12.
In my opinion this problem will probably fix itself in a couple of days. However if you can't wait, here's what you can do.
First, find out which version of libpng the package you want to install depends on.
$ apt-cache depends r-base
r-base
Depends: r-base-core
Depends: r-recommended
Recommends: r-base-html
Recommends: r-doc-html
Suggests: ess
|Suggests: r-doc-info
Suggests: r-doc-pdf
r-base itself does not depend on libpng but r-base-core probably does.
$ apt-cache depends r-base-core | grep png
Depends: libpng12-0
Now we want to know which specific version of libpng
$ apt-cache show r-base-core
... libpng12-0 (>= 1.2.13-4) ...
If you locate this package in Ubuntu's repositories, you can
download it and try to install it manually.
$ wget <url>
$ sudo dpkg -i <filename>
and then install r-base with apt-get install r-base. However if dpkg
refuses to install libpng you should not force it, because it means the
package is not installable and it would break other dependencies.
I'm trying to run a C program in Linux Mint 15, but without success.
Here is my code:
#include<stdio.h>
#include<conio.h>
int main()
{
printf("Hello World");
}
I compile with gcc:
gcc -o hw hw.c
But, I get the following error:
hw.c:1:18: fatal error: stdio.h: No such file or directory
compilation terminated.
I researched the problem and found some solutions that say to install build-essential, so I did:
sudo apt-get install build-essential
But I get the following error:
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:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
Depends: dpkg-dev (>= 1.13.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
How do I resolve this and make my program run correctly?
EDIT:
The result of locate stdio.h is:
/usr/lib/perl/5.14.2/CORE/nostdio.h
/usr/lib/syslinux/com32/include/stdio.h
I was having the same problem, and simply installed the g++ package and that fixed the missing include file.
sudo apt-get install g++
The package name for the C standard library is libc6. Its header files are in the development package: libc6-dev. Some Linux distributions do not have the development package installed. You need to install it yourself:
sudo apt-get install libc6-dev
Why the installation of build-essentials does not resolve the dependencies I don't know. But I think the question wasn't about the installation of build-essentials and maybe it isn't needed at all.
References:
https://packages.debian.org/en/sid/libc6
https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-sharedlibs-dev
https://en.wikipedia.org/wiki/GNU_C_Library#A_temporary_fork
I had this situation before:
rleclerc#fvrwbp01:~# gcc -o tokens tokens.c
tokens.c:1:19: fatal error: stdio.h: No such file or directory
compilation terminated.
You wrote:
sudo apt-get install build-essintial
There's a typo. Try this instead (I guess you already did something similar):
sudo apt-get install --no-install-recommends gcc
and:
sudo apt-get install --no-install-recommends build-essential
Sometimes, proof-reading makes some difference:
The following NEW packages will be installed:
build-essential dpkg-dev g++ g++-4.7 libc-dev-bin libc6-dev libdpkg-perl libstdc++6-4.7-dev libtimedate-perl linux-libc-dev make
(...)
This fixed the error.
FWIW, Mint 17 just needs build-essential to compile C programs:
# apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
dpkg-dev g++ g++-4.8 libc-dev-bin libc6-dev libstdc++-4.8-dev
Suggested packages:
debian-keyring g++-multilib g++-4.8-multilib gcc-4.8-doc libstdc++6-4.8-dbg
glibc-doc libstdc++-4.8-doc
Recommended packages:
libalgorithm-merge-perl
The following NEW packages will be installed:
build-essential dpkg-dev g++ g++-4.8 libc-dev-bin libc6-dev
libstdc++-4.8-dev
0 upgraded, 7 newly installed, 0 to remove and 1 not upgraded.
This problem may come when you are trying from wrong directory...
I suggest you to check for directory.
Update the OS by: sudo apt-get update.
The final option is to remove the exixting gcc compiler and install the new one.
You can also try this:
g++ -o [fileName] [executable name]