Install ansible off-line from binaries [duplicate] - linux

This question already has answers here:
How to install packages offline?
(12 answers)
Closed 2 years ago.
we have rhel linux machine without network access
and we want to install ansible on that machine
but we want to install the ansible from binaries ( not like pip/yum install ) , because we want to avoid any pip dependencies issues
is any approach that is relevant ?
example of the legacy way
Step 1: Update your Control Node
Any time you are installing new software, it is a good idea to ensure your existing operating system software is up to date. Let’s start with that task first.
yum update
Step 2: Install the EPEL Repository
Installing Ansible is pretty straightforward. First, we’ll need to install the CentOS 7 EPEL repository.
yum install epel-release
Step 3: Install Ansible
Next, we install the Ansible package from the EPEL repository.
yum install ansible

Perhaps not ideal, but you can just run from source. I've done it that way for years without any problems. I just put the initialization routine in my .bashrc file, so it's always ready to use.
Running Ansible from source (devel)
Once you pull from git on a machine that has internet access, sneakernet it over to the machine you want it on.

As mentioned in the official documentation you can use rpm available in official release repo. Since you dont have internet access you will have to download it somewhere else & copy it over to control node.
RPMs for currently supported versions of RHEL, CentOS, and Fedora are available from EPEL as well as releases.ansible.com.
Or
You can also build an RPM yourself. From the root of a checkout or tarball, use the make rpm command to build an RPM you can distribute and install
However I would not recommend Running Ansible from source (devel) because as already mentioned in the doc, this could be unstable.
Note
You should only run Ansible from devel if you are actively developing content for Ansible. This is a rapidly changing source of code and can become unstable at any point.
If you would like to build rpm on your own, you should probably use the tagged releases.
Available both in github & Ansible releases

Related

openSUSE 15.4 zypper error installing postgreSQL

I am new to Linux,
I installed openSUSE Leap 15.4, and made the root directory ext4, I then followed these steps to install postgreSQL 13 on my system
1.sudo zypper ref && sudo zypper update
sudo zypper addrepo https://download.postgresql.org/pub/repos/zypp/repo/pgdg-sles-15-pg13.repo
But after this, I sudo zypper ref again and it shows an error saying:
Retrieving repository 'PostgreSQL 13 SLES 15.4 - x86_64' metadata .....................................[error]
Repository 'PostgreSQL 13 SLES 15.4 - x86_64' is invalid.
[pgdg-13|https://download.postgresql.org/pub/repos/zypp/13/suse/sles-15.4-x86_64] Valid metadata not found at specified URL
History:
- [pgdg-13|https://download.postgresql.org/pub/repos/zypp/13/suse/sles-15.4-x86_64] Repository type can't be determined.
what can I do to install postgreSQL
I can't say precisely why your zypper command failed, but it might have to do with the fact that the repositories from your link are intended for SUSE Linux Enterprise 15 SP4, not for openSUSE Leap 15.4, which is what you're using. So even if you did get these repositories to work, you might run into other compatibility problems later.
To install postgresql, there is always the option to search for your package on software.opensuse.org. (I strongly recommend you bookmark this page – it's the place to look for openSUSE packages.) For postgresql13, there is indeed an official experimental package available for openSUSE 15.4, namely here, which you can install via 1-Click-Install. However, the newer version postgresql14 is already out for quite a while, so I would only advise for using the older postgresql13 if you have a very strong reason to do so. The newer postgresql14 also has an official experimental package available for openSUSE 15.4, namely here; this is the one I would recommend currently.
first check if repo is enabled zypper repos -d
check /etc/zypp/repos.d/pgdg-13.repo file
If you open the added repo file all set sles. but i think the main problem is the type=rpm-md. In any case you dont need add third part repo to install postgress. the package is already in the main repos and is called postgresql-server.
So remove the https://download.postgresql.org/pub/repos/zypp/repo/pgdg-sles-15-pg13.repo to prevent any other issues and package conflicts
zypper lr # to list the repos and find the number for the `https://download.postgresql.org/pub/repos/zypp/repo/pgdg-sles-15-pg13.repo`
zypper rr <number>
Then just install postgresql-server
Btw when you refresh the packages you dont need to run update

Linux Installation libX11-devel

I am trying to build QT4 (porting from Redhat 5 to 7 with an upgraded gcc compiler) in RedHat 7 and I was getting an error saying X11/Xlib.h can't be found. Anyways, after doing some research most people said to install libX11-devel to get those x11 libraries. Since I am using an offline machine I can't do "apt-get" type commands and have to manually install RPMs. So, I went to my RH-7 installation DVD and got "libX11-devel-1.6.3-3.el7.x86-64" (I have 64 bit OS) and tried to install using "yum install libX11-devel-1.6.3-3.el7.x86_64" and I am getting dependencies errors. It's saying
...Requires: pkgconfig(kbproto)
...Required: pkgconfig(xcb)
...Requires: pkgconfig(xproto)
...Requires: pkgconfig(xcb) >= 1.1.92
So, here are my questions.
1) when it says "pkgconfig(kbproto)", is it saying find the "kbproto....RPM" and do a "yum install". In my dvd I only have "xorg-x11-proto-devel-7.7.13.el7.noarch.rpm". Do I have to somehow find "xorg-x11-proto......x86_64.rpm" since it's a 64 bit machine?
2) Is there a difference between "yum install" and pkgconfig "install"? Are there any other installation variants in Linux?
3)For an offline machine, Is there anyway I can get all the dependencies and install everything at once ?
4) Why is it saying "xcb" requires twice. If I just get a xcb...rpm version above 1.1.92 can I just install it once?
Before actually answering the questions, I am going to suggest to see if you can get the latest version of the packages. The packages on the installation DVD may be really out of date and contain known vulernabilities, and other bugs. Can you use yumdownloader - in an online environment - to download the latest version onto a separate DVD and use that as the installation source? See https://access.redhat.com/solutions/10154 for more information.
To answer the questions themselves:
Requires: foo can refer to a package foo or a "feature" foo. pkgconfig(kbproto) is a "feature" (or virtual requires). You can use yum/rpm to see what provides this. On my Fedora box, for example, rpm -q --provides xorg-x11-proto-devel shows that this package indeed provides pkgconfig(kbproto).
As for x86_64 vs noarch, it doesn't matter. noarch packages work everywhere. Other packages are restricted to the platform. So x86_64 only works on intel/amd x86 64-bit machines. Installing noarch should be fine in your case. If you only had a i686 package, though, that wouldn't be sufficient. You would have to find a x86_64 or noarch package.
Yes, there's a big difference between yum and pkg-config. They do completely different things. One is a system tool for installing RPM packages. The other is a tool for developers for using the right headers and compiler flags. If your concern is finding/installing RPMs, do not use pkg-config directly.
Do you have access to an online machine that can access the RHEL 7 yum repositories? On that machine, do something like this:
mkdir rhel7-packages
cd rhel7-packages
yum provides '*/X11/Xlib.h' # make a note of the package that provides this file. it's libX11-devel on Fedora here
yumdownloader --resolve libX11-devel # download libX11-devel and all dependencies not installed on the system
Then copy/install the RPMs on the machine without internet access.
It's probably printing out xcb twice because it's two different requirements. The unversioned requirement will be satisfied if you install any verison of xcb. The versioned requirement will only be satisfied if you install 1.1.92. If you install 1.1.92, it will satisified both the requirements.
1.
You have to resolve the dependency on the system where you are building your package. This means you need to have those dependencies installed, inclusing libX11-devel. To do that, download the RPMs manually from EL7 repos to local disk and run this:
$ mkdir -p /tmp/libX11_dep_rpms && cd /tmp/libX11_dep_rpms
# Download all dependencies from here. All your packages should be available here:
# http://mirror.centos.org/centos-7/7/os/x86_64/Packages/
# Then install
$ yum localinstall *.rpm
# After this you should be able to build your qt4 package, provided all dependencies are resolved. Otherwise, repeat the procedure for all dependencies
# If you can't download packages, then you need to create a FULL DVD ISO that will contain all packages.
2.
pkgconfig ensures that a requirement is coming from a particular build that provides a particular version of the library. Here are some detail.
3.
Get the Everything ISO from EL7.
4.
This has to do with the pkgconfig and library versions.

Installing Debian 8 packages & dependencies to a specified fs directory

I am new to Debian 8, and still very much a Linux beginner. I am currently running Debian 8 Oracle VM Virtualbox in Windows 10, for reference.
For a project I am working on, my task is installing Debian 8 packages from the source package to a specified rootfs folder. After getting the source files (.tar.gz, .diff.gz, .dsc) and extracting them, I run:
dpkg-source -x <package>.dsc
Which extracts the source to the working directory.
The issue I'm having is generating the .deb files from the extracted. The standard way to do it is to let apt handle the installation of the dependencies from the online repository via:
apt-get build-dep <package>
then generate the .deb files via:
dpkg-buildpackage -b
But this will install the dependencies to my rootfs. In addition, since I downloaded the majority of the packages to my local machine, I'd like to be able to manually install each dependency from my local source packages rather than online.
From my understanding, I was tasked this to avoid polluting the specified fs with documentation and non-essential files, since the number of Debian 8 packages that will be added to this fs is >700.
If there are any mistakes / misunderstandings with my knowledge of Linux & Debian 8, please let me know.
You can create a docker container and install your dependencies in there and do all your work in there. You can configure docker to put the docker containers on any filesystem you like.
Any approach that does not use containers is unlikely to work because AFAIK most Linux distributions, including Debian, do not support dependency relocation. Nix is an exception. So containers are a way around that.

What is a repository in CentOS?

What is a repository in Centos and what does it contain. I I remove all the .repo files from the system. What will be its implications. Will it remove the packages as well and will hinder normal operations or will package just not get auto-updated?
"Repositories" are locations where you can download software.
".repo" files are definition files for repositories you might wish to use.
Deleting a .repo file will not affect any packages you already have installed - it will just prevent you from updating it (assuming the package in question is available only from that one repository).
You can learn more here:
https://www.centos.org/docs/5/html/yum/sn-yum-maintenance.html
https://www.digitalocean.com/community/tutorials/how-to-set-up-and-use-yum-repositories-on-a-centos-6-vps
Repositories in CentOS are collections of software that the server administrator can easily install.
For instance, should you choose to install Firefox, the following command will query all configured repositories, and if one of the repos has Firefox then yum will download and install it:
$ sudo yum install firefox
Additionally, you can search for software without installing it:
$ yum provides firefox
Therefore, repositories (or repos) are online collections of software which yum may query and download from.

Linux - /usr/local/nagios/bin/nagios file couldnt create

I am trying to install nagios 4.0.6 and nagios -plugins-2.0.2 on fedora 17.
I have followed steps which is mentioned in sourceforge documentation.
http://nagios.sourceforge.net/docs/3_0/quickstart-fedora.html
unfortunately /usr/local/nagios/bin/nagios this file isnt created I mean even bin folder haven't created. so that I am unable to start nagios service.
What should I do?
You can install Nagios right from the Fedora repositories.
yum install nagios nagios-plugins
You can also see a list of Nagios-related packages with: yum search nagios.
I suggest you always install apps from the repositories, since the package manager will take care of the dependencies as well as the installation, and the packages there have been already revised and tested for the version of your OS. Use only 3rd party source builds or install/build the packages manually as a last resort.

Resources