rpm install scripts not executing - centos

I'm working in ClearOS5.3, with rpm 4.4 installed. I'm using rpm to distribute a module I created, however the %post script in my spec file isn't executed when I install the package.
I'm using the command rpmbuild -ba mypackage.spec
to build the rpm, and the command rpm -ivh mypackage-version-release.rpm to install the package.
Installation is performed manually (not using make) in the %install script. All the files seem to be installed in the correct places, however none of the install scripts run (specifically %post and %preun, in the case of my package). Testing with other install scripts (%pre) showed those sections didn't work either.
From what I can tell based on installing the package in debug mode, the %pretrans and %posttrans scripts are run. Additionally, when building the package, it recognizes the the install scripts and lists their dependencies (/bin/sh).
Does anyone have an idea as to why these install scripts might not be running and have suggestions to fix the issue?

Related

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!!!

Installing Params::Validate with cpan - Unable to start 'Build'

I'm trying to install Bugzilla for demo purposes on my Win8 PC using cygwin. I'm stuck at installing Perl modules, more specifically Params::Validate.
I've tried
install-module.pl Params::Validate
and with cpan:
install Params::Validate
The error message I get is following (in short):
Running Build install
Unable to start 'Build': There is no application associated with the given file name extension.
DROLSKY/Params-Validate-1.13.tar.gz
sudo ./Build install -- NOT OK
Failed during this command:
DROLSKY/Params-Validate-1.13.tar.gz : install NO
The error message is quite simple and clear, but I have absolutely no clue where to find an application which should be associated with the 'Build'-file. Google couldn't help me either. Anyone of you can?
PS. Avast moved some files to quarantine earlier during the installation. I disabled the file monitoring from Avast and re-ran the installation of those modules (at least Module::Runtime) and got response that it went OK.
Download Params-Validate-1.13.tar.gz and extract the contents to a temporary directory. Open the command line in that temporary directory and type:
perl Build.PL
This generates a file called Build. Now to actually build the module run:
./Build
Hopefully you don't get any nasty-sounding error messages. Before installing the module, let's test it works:
./Build test
Hopefully the test suite passes. Now you can install the module. You will need to run this as a user who has write permission over your Perl library directories. (On Linux/Unix machines, that might involve using sudo.) To install the module, run:
./Build install
All done.

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.

How can I install the postgresql-contrib module in an existing database?

I'm using postgresql 9.1.6 on CentOS. I would like to install the postgresql-contrib module using a binary file, but I can't find it online. I'm unsure if I can install this after already installing postgresql. Is it possible to do this?
I installed postgresql in the following way:
wget http://ftp.postgresql.org/pub/source/v9.1.6/postgresql-9.1.6.tar.gz
tar -xzf postgresql-9.1.6.tar.gz
cd postgresql-9.1.6./configure --prefix=$HOME
make
make install
I am currently using the databases within this install and would prefer not to reinstall it (if possible).
I understand that once I install this I can use a function in the following way:
create extension tablefunc ;
EDIT: If I followed the instructions from here, does gmake and gmake install affect an existing database?
You might be hard pressed to find the contrib modules as binary distributions; however, the very page you linked has explicit instructions on how to build the contrib modules:
When building from the source distribution, these modules are not built automatically. You can build and install all of them by running
gmake
gmake install
in the contrib directory of a configured source tree; or to build and install just one selected module, do the same in that module's subdirectory.
Alternatively, you could try using yum (the package is postgresql-contrib.x86_64), but I can't vouch for the results of this if you installed Postgres from source.

Use Options When Installing Through yum

I'm having an error. And the solution seems to be to install ImageMagick with the following configuration options:
./configure -–disable-openmp -–enable-shared
but I'm using yum to install things (On Red Hat), so I don't know how to do these command line configure options.
Does anyone know how to get yum to install and configure with command line arguments like these?
Thanks in advance,
--d
configure is run at the command line when you are building from source. If the binary rpm is not built the way that you need, then you have to download the source tarball and rebuild it. Instructions for doing this will be in a file called INSTALL when you unpack the tarball. This also means you need the compiler and other development tools.