Install MongoDB on CentOs 7 without YUM. have rpm files but not tgz - mongodb

I'm fairly new to Linux and am running CentOS 7. I can do the basics of navigating, creating dirctories, permissions, unzip applications and make SL to the apps but I have no idea what to do with an "rpm" file.
The system that I am trying to install MongoDB 4.2.x on does not have an outside connection. I have the individual rpm files for MongoDB but not the tgz which some article I read said I should use.
There is no way for me to get the tgz over to the machine unless I wait several days.
With only the .rpm files, how do I install MongoDB?
[https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/][1]
The instructions in the above link say to create the .repo file but that makes a reference to the external URL which the system does not have access to.
[mongodb-org-4.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/
*
Again, with only the .rpm files, how do I install MongoDB?
*

You do need some kind of access to the outside world; you need to get the rpm files on your machine...
you can just manually download the rpm files you need from https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.2/x86_64/RPMS/, copy them to your machine, and then run
yum install /path/to/downloaded/mongodb*rpm

Related

How to avoid centos-release rpm installing yum repo files via spacewalk

We have a Spacewalk server we use to distribute updates to our CentOS 6 and 7 client systems. None of the client systems have internet access. Only the spacewalk server has restricted access to complete repo sync updates.
We have an issue when it comes time to push out the centos-release rpms. this rpm installs repo config files like /etc/yum.repo.d/CentOS-Base.repo. Since the client system can't get out to the internet, any subsequent yum command displays an error about not enough mirrors.
Does any one know of a way to have either Spacewalk or yum exclude the /etc/yum.repos.d/ directory on install of the centos-release package.
It has to be an automated or configurable method as I currently run a manual command on each of the affected systems when I know that rpm is being pushed out. (/bin/rm /etc/yum.repo.d/CentOS-*.repo). I considered a cron job, but that just didn't seem like the best option.
Thanks in advance.
You can tell yum not to use a certain repository:
yum install --disablerepo=centos-base
or you can tell him to only use your repository by disabling all others:
yum install --disablerepo=* --enablerepo=myrepo
The solution I have seen in the past is to configure yum to not use the default location, but instead a different one. For example, /etc/yum.internal.repos.d/. Then anything that happens in the default location doesn't matter.

Completely uninstall Eclipse 4.7 version in RHEL 7.4 Maipo

I'm trying to uninstall the current version of Eclipse IDE in my RHEL machine by simply deleting all the files like:
sudo rm -rf ~/.eclipse
sudo rm -rf ~/eclipse-workspace
I also tried
sudo yum remove 'eclipse*'
However, these didn't seem to solve the purpose.
Any help will be appreciated, thanks!
Applications on Linux systems are most often installed using so-called packages, which are managed by a package management system. In the case of RHEL, packages use the RPM format, and the package manager of choice is a tool called yum.
Both installation and removal of software (packages) should be done using yum, so as to allow the package management system keep track of all installed files and current status. Therefore, you shouldn't try to remove software by simply deleting files from the file system. Instead, use the yum command. See the RHEL System Admin Guide for a detailed explanation of how to use yum to search, install, upgrade, and remove packages: Working with Packages.
You have tried the correct command (yum remove <package-name>), but you need to use the correct package name. On RHEL 7.4, the latest version of Eclipse is available as a part of the DevTools channel, and the package name is rh-eclipse47 (see Enabling the Red Hat Developer Tools Repositories). Note that you may have also installed an older version, which would be, for example, rh-eclipse46.
To find out what is the name of the package you have installed, you can run, for example, the following command:
yum list installed | grep eclipse
There is also the possibility that you installed the software not from an RPM package but manually, e.g. from a .tar.gz file distrubuted from eclipse.org. If that's the case, you will need to use the uninstaller program supplied with that distribution of the software.
Write command as:
rpm -qa|grep eclipse
This will give a list of installed packages. Remove all the packages by giving below command:
rpm -e *package-name*
Done!!!

Can I install postgresql without pgAdmin4?

I was packaging an windows application installer by NSIS.
An postgresql binary file was included in this install package.
But the official binary file is too large 172MB.
The zip archive is download from
https://www.enterprisedb.com/download-postgresql-binaries
The inside structure is like
pgsql
bin
doc
include
lib
pgAdmin4
share
StackBuilder
symbols
In my opinion, pgAdmin4 is no need for my installer.
There are only CRUD operations in between application and SQL.
If I remove this directory, the binary zip can down to 41MB.
So could I simply remove directory pgAdmin4 and re-compress
to achieve this?
So could I simply remove directory pgAdmin4 and re-compress to achieve this?
Yes, and you can remove StackBuilder too if you want. Also symbols if you don't want to do in-place debugging if the postgres server crashes.
Please, please install your bundled PostgreSQL on a non-default port (not 5432) and if you run it as a service use a name associated with your application, so users know where it came from. See Installation of postgresql with NSIS . Put the PostgreSQL install directory within your app install directory.

How to migrate virtualenv

I have a relatively big project that has many dependencies, and I would like to distribute this project around, but installing these dependencies where a bit of a pain, and takes a very long time (pip install takes quite some time). So I was wondering if it was possible to migrate a whole virtualenv to another machine and have it running.
I tried copying the whole virtualenv, but whenever I try running something, this virtualenv still uses the path of my old machine. For instance when I run
source activate
pserve development.ini
I get
bash: ../bin/pserve: /home/sshum/backend/bin/python: bad interpreter: No such file or directory
This is my old directory. So is there a way to have virtualenv reconfigure this path with a new path?
I tried sed -i 's/sshum/dev1/g' * in the bin directory and it solved that issue. However, I'm getting a different issue now, my guess is that this sed changed something.
I've confirmed that I have libssl-dev installed but when I run python I get:
E: Unable to locate package libssl.so.1.0.0
E: Couldn't find any package by regex 'libssl.so.1.0.0'
But when I run aptitude search libssl and I see:
i A libssl-dev - SSL development libraries, header files and documentation
I also tried virtualenv --relocatable backend but no go.
Export virtualenvironment
from within the virtual environment:
pip freeze > requirements.txt
as example, here is for myproject virtual environment:
once in the new machine & environment, copy the requirements.txt into the new project folder in the new machine and run the terminal command:
sudo pip install -r requirements.txt
then you should have all the packages previously available in the old virtual environment.
When you create a new virtualenv it is configured for the computer it is running on. I even think that it is configured for that specific directory it is created in. So I think you should always create a fresh virtualenv when you move you code. What might work is copying the lib/Pythonx.x/site-packages in your virtualenv directory, but I don't think that is a particularly good solution.
What may be a better solution is using the pip download cache. This will at least speed up the download part of pip install. Have a look at this thread: How do I install from a local cache with pip?
The clean way seems to be with virtualenv --relocatable.
Alternatively, you can do it manually by editing the VIRTUAL_ENV path in bin/activate to reflect the changes. If you choose to do so, you must also edit the first line (#) of bin/pserve which indicates the interpreter path.

Install with pecl to local dir on shared hosting

I'd like to install a PHP extension on a bluehost shared site; specifically the MongoDB driver. Since pecl is unable to write to the primary server directory that has all the installed extensions, I'd like to install the mongo.so file to a directory I specify under my home. The closest article I found on the web was:
http://www.site5.com/blog/programming/php/how-to-setup-your-own-php-pear-environment/20090624/
However, after following the steps when I use the "pecl install mongo" command, it still keeps trying to install to bluehost's central directory on the server.
According to my web host's technical support team, utilising the pecl installer attempts to install the extension server-wide rather than under your account only. My web host doesn't allow server-wide installations in their shared environment for security reasons and because they want to keep their fleet universally the same across the board. I suspect your host is the same.
However, they did suggest I download, configure and install the pecl package (pecl_http) in my account only (rather than server-wide) via the following manual process:
$ cd ~/
$ wget http://pecl.php.net/get/pecl_http
$ tar -zxvf pecl_http.tar.gz
$ cd pecl_http
$ phpize
$ ./configure --prefix=~/bin
$ make
$ make test
$ make install
A successful install will have created extname.so and put it into the
PHP extensions directory. You'll need to edit php.ini (in my case,
this was a copy of the standard php.ini file that I placed in the same
folder as the script using the extension) and add an
extension=extname.so line (in my case, extension=http.so) before you can use the extension.
http://www.php.net/manual/en/install.pecl.phpize.php
Note that the tilde character (~) in the above code refers to the home directory of the current user (e.g. /home/username on my host's server).
Issues you may run into
When using the tar command, a "cannot open: not a directory" error
appeared as pecl_http had been downloaded without a file extension.
This was easily corrected:
mv pecl_http pecl_http.tar.gz
When using the make install command, a "cp: cannot create regular
file...: Permission denied" errror appeared. I resolved this issue
by changing the ext_dir for pecl...
pecl config-set ext_dir /home/username/bin/extensions
...and re-running make install. I also had to copy the http.so extension to /home/username/bin/extensions and then reference that location in my php.ini file:
extension_dir = "/home/username/bin/extensions"
this sounds like you don't have root access to your server. if your need to compile anything you must be have root access permission to server, or maybe you must be one of the sudoers.