is there a way to tell puppet to install a package from a specific repository?
I'd like to do something like 'aptitude -t testing install vim' in puppet.
The reason why I want to do this is that I want to install specific packages from debian 'testing' repository, but by default only use 'stable'.
Currently I have the 'testing' repository pinned with a priority of -10, so apt won't install packages from it without me explicitly telling it to do so:
Package: *
Pin: release a=stable
Pin-Priority: 990
Package: *
Pin: release a=testing
Pin-Priority: -10
I'm using puppet 2.6.2 on debian-based systems.
Try the puppetlabs-apt module and use apt::force
Related
I've a special/very slim version of debian. I want to install a custom version av zlib and I only want one zlib version on my system. Let's say I update zlib, then I also need to recompile and update (for example) openssh since it has zlib as one of its dependencies. Do I need to list those dependencies manually or is there a tool that will recompile all packages with reverse dependencies (something like bitbake does for yocto). How does upstream debian developer handle those cases?
If you install it as a .deb file via dpkg, I'd expect you'll be fine since those other packages are linked to the zlib package ... unless there are items you're removing that other packages will fail upon not getting. If that's the case, you probably want Alpine Linux or some other minimalist distro.
I'm a bit rusty, but I believe the process is something like this:
$ apt source zlib
$ cd zlib*/debian
[ make your changes in new diffs in the `patches` subdirectory]
$ dpkg-buildpackage -rfakeroot
This creates a .deb file and IIRC also installs it. If it doesn't also install it, then you can do that with a command like dpkg -i zlib*.deb
See also Debian's Building the Package documentation.
If all you need is a newer version of a particular package, you can add it from Debian Testing or Unstable in three steps:
1. Edit /etc/apt/sources.list or something in /etc/apt/sources.list.d/ to include
deb http://deb.debian.org/debian/ testing main non-free contrib
2. Edit /etc/apt/preferences or something in /etc/apt/preferences.d/ to include
Explanation: Don't use testing by default
Package: *
Pin: release a=testing
Pin-Priority: 1
3a. Install it manually:
$ sudo apt install -t testing zlib1g
3b. Alternatively, ensure it always installs from testing with another preferences stanza:
Explanation: Use zlib from testing
Package: zlib1g
Pin: release a=testing
Pin-Priority: 500
I am currently trying to find a way to install the package openjdk8 on a FreeBSD 9.2.
To do that I used :
sudo pkg install openjdk8
It worked without any problem. However, this has also updated the perl package to the version 5.24. We have many scripts that work only with perl 5.16.3 so I would like to keep this version of perl.
I already tried to uninstall the perl 5.24 package and to reinstall perl 5.16.3 and it worked. So I am convinced openjdk doesn't really need to update this package. I already tried to lock the package perl 5.16.3 but openjdk8 refuse to install himself. I have this message :
perl 5.16.3 is locked and may not be modified
The installation ends and my package is not installed. Also, for specific reasons I don't want to use the port method. I absolutely want to use the pkg method.
So my question is this one : Is there a way to complete my installation of openjdk8 and to prohibit perl to update ?
Thanks for your help.
I finally found an answer to my question. By installing my package offline, it installs the minimum of dependencies. It's not a very popular way to install packages on FreeBSD but it works very well.
Just follow this :
sudo pkg install -F openjdk8
This command allow you to just fetch your packages and its dependencies. Once it's done, you have to find the location of the packages you just fetched.
sudo find / -n *.txz -print
For me the result was
/var/cache/pkg/openjdk8-8.112.16_1-1baeb24a94.txz
Then I go to this directory with :
cd /var/cache/pkg
Now you just have to use :
sudo pkg-static add openjdk8
That's all. It will extract the package and the minimum of dependencies.
Probably you are updating other packages and therefore is updating Perl, when installing openjdk8 no other dependencies are fetched also there is no perl dependency in the port Makefile.
This is the output when installing only openjdk8:
# pkg install openjdk8
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
openjdk8: 8.152.16
Number of packages to be installed: 1
The process will require 165 MiB more space.
Indeed you can install the package without having Perl.
What you can do is install openjdk8 and then install the version of Perl that you require, at the end, it should not modify/affect the openjdk8 package.
Also, this could be useful,
pkg install --dry openjdk8
This will check what will be installed.
And in case there is a dependency (let's say you don't have perl) this you could try this:
pkg install --ignore-missing openjdk8
I am trying to install sqlite dev and other libraries in a centos machine with cpanel, to be able to compile an application.
I am more acquainted with debian than centos, and I know the libraries I need are:
libsqlite3-dev
libkrb5-dev
libssl-dev
libcurl3-dev
libboost-all-dev
For what I could find online, the corresponding package in centos for libsqlite3-dev is sqlite-dev.
However, when I run yum install sqlite-devel I get the following message:
No package sqlite-devel available
I don't know if this is related to cpanel, if repositories are missing from the installation, and since my experience with yum is far lesser than with apt, I am quite lost here.
I have searched for the package yum search sqlite and all I get is this:
cpanel-perl-522-DBD-SQLite.x86_64 : CPAN module - Self Contained SQLite RDBMS in a DBI Driver
cpanel-perl-522-DBD-SQLite2.x86_64 : CPAN module - Self Contained RDBMS in a DBI Driver (sqlite 2.x)
ea-apr-util-sqlite.x86_64 : APR utility library SQLite DBD driver
freeradius-sqlite.x86_64 : SQLite support for freeradius
golang-googlecode-sqlite-devel.x86_64 : Trivial sqlite3 binding for Go
perl-DBD-SQLite.x86_64 : SQLite DBI Driver
cpanel-perl-522-CPAN-SQLite.x86_64 : CPAN module - maintain and search a minimal CPAN database
sqlite.x86_64 : Library that implements an embeddable SQL database engine
Also, this is the output of yum repolist
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 208.100.0.204
* base: repo.us.bigstepcloud.com
* epel: mirror.steadfast.net
* extras: mirror.eboundhost.com
* updates: centos.firehosted.com
repo id repo name status
EA4/7/x86_64 EA4 ( EasyApache 4 ) 23703
base/7/x86_64 CentOS-7 - Base 9319+44
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 10524+779
extras/7/x86_64 CentOS-7 - Extras 266
updates/7/x86_64 CentOS-7 - Updates 1086
repolist: 44898
As an additional detail, this server is not managed or owned by me, so I don't know much information about it.
What I know is that I have several centos + cpanel servers, and I just did a yum search sqlite-devel in another one, and it shows the package in the base repo.
I have also noticed that the offending server is not updated. Can this be a reason?
Any other hints?
Late response, but perhaps this might help others who eventually stumble on this question looking for the same answer.
The sqlite3 development package can be found in the epel repo. EPEL
Easy to install on CentOS -> yum install epel-release
$ yum list | grep sqlite
libsqlite3x-devel.x86_64 20071018-20.el7 #epel
Similar list/grep can be done for the other libraries you are looking to install, although the names are most likely just slightly different (list edited for clarity).
$ yum list | grep boost
boost-devel.x86_64 1.53.0-26.el7 base
For my case, I had to do yum install libsqlite3x-devel.x86_64
For Centos and Fedora with dnf package manager you can use "dnf search" followed by a keyword to search, in this case "sqlite"
dnf search sqlite | grep devel
For RPM based systems(Redhat / CentOS / Fedora) "-devel" is the suffice used to identify package with development files, usually refered as development tools, so I use grep to filter the result list.
These commands return me:
qlite-devel.x86_64 : Development tools for the sqlite3 embeddable SQL database engine
If you don't see the 3 explicit neither in the name or description you can get the info that confirm you this with "dnf info" followed by the package name:
dnf info sqlite-devel
which return more info like the version, license, etc.
Note:
Of course for Fedora is possible that sqlite package comes available due to the fact that fedora has it in its repo otherwise you would have to enable Epel repository as described by Eric in Epel
References:
https://docs.fedoraproject.org/en-US/Fedora/24/html/System_Administrators_Guide/sec-Displaying_Package_Information.html
https://en.wikipedia.org/wiki/RPM_Package_Manager
Aim: Install latest docker (v1.12) in rhel 7 in offline mode
I got dependency error while installing docker 1.12 in rhel 7, and I
tried to find those dependencies in internet but didn't found those
dependencies except selinux-policy rpm.
I tried to install after yum update.
I found dependencies of docker 1.7 on internet, installed in rhel 6.7
but could not make same way for docker 1.12 in rhel 7
I tried below things
Installed docker 1.12 when system(test machine) is connected to internet and after installing docker 1.12 all dependencies will cache in /var/cahce/yum/rhel7/ location and search for above dependencies but didn't found.
Crated local yum repo and mounted iso file and then did yum update
and tried to install docker but still give same dependencies error.
I'm not sure how above steps are correct or right procedure, I just tired but anything didn't work.
my production environment does not have internet connection and it has only intranet connection only.
Can some one provide or advice me how to solve this and how to proceed this kind of problems?
Thanks in advance!
I'm kind of surprised you can't find at least the non-docker packages here as these come from standard CentOS repositories. In general, I'd use something like:
# yum provides "*/<filename>"
e.g.
# yum provides "*/libsystemd.so.*"
This obviously won't help if you've not configured the repositories on your target system, but it's pretty easy to run a Vagrant VM and see what's required there.
$ vagrant init bento/centos-7.2
$ vagrant ssh
then follow the docs at https://docs.docker.com/engine/installation/linux/centos/:
$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
and install it:
$ sudo yum install docker-engine
On mine, this gives:
[vagrant#localhost ~]$ sudo yum install docker-engine
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.ukhost4u.com
* extras: mirror.vorboss.net
* updates: mirror.vorboss.net
Resolving Dependencies
--> Running transaction check
---> Package docker-engine.x86_64 0:1.12.1-1.el7.centos will be installed
--> Processing Dependency: docker-engine-selinux >= 1.12.1-1.el7.centos for package: docker-engine-1.12.1-1.el7.centos.x86_64
--> Processing Dependency: libseccomp.so.2()(64bit) for package: docker-engine-1.12.1-1.el7.centos.x86_64
--> Processing Dependency: libltdl.so.7()(64bit) for package: docker-engine-1.12.1-1.el7.centos.x86_64
--> Running transaction check
---> Package docker-engine-selinux.noarch 0:1.12.1-1.el7.centos will be installed
---> Package libseccomp.x86_64 0:2.2.1-1.el7 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-21.el7_2 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================
Package Arch Version Repository Size ============================================================================================================
Installing:
docker-engine x86_64 1.12.1-1.el7.centos dockerrepo 19 M Installing for dependencies:
docker-engine-selinux noarch 1.12.1-1.el7.centos dockerrepo 28 k libseccomp x86_64 2.2.1-1.el7 base 49 k libtool-ltdl x86_64 2.4.2-21.el7_2 updates 49 k
Transaction Summary
============================================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 19 M
Installed size: 79 M
Running that yum provides command I gave above shows you that e.g. libsystemd.so* is in the systemd-libs package and available in the "updates" repo .. see http://mirror.centos.org/centos/7/updates/x86_64/Packages/
Try this command:
yum install libtool-ltdl
After this re-run installation command.
This will be done automatically, if you have "docker-ce" repository.
Good luck!
i am just leaning ansible and so far i was able to ping the servers.
My main aim now is to install following modules like apache , git and if its already installed then should should not do anything.
I am not able to find how can i start with that
Use the packaging modules. For example:
# Install the package "foo"
- apt: pkg=foo state=present
As to "if its already installed", all ansible packages are idempotent and (whenever possible) do not re-do work that is already done.