CentOS - error while using yum - centos

I get this error when I try to use yum,
http://iredmail.org/yum/rpms/6/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: iRedMail. Please verify its path and try again
I tried the below but the error persists.
yum clean all
rm /var/lib/rpm/__db*
rpm --rebuilddb
yum update
Please let me know how to fix this, appreciate your help.

Create repo.disabled inside /etc/yum.repos.d
[root#centos ~]# mkdir /etc/yum.repos.d/repo.disabled
[root#centos ~]# ls /etc/yum.repos.d/
centos.repo centos.repo centos-updates.repo centos-updates-testing.repo
repo.disabled
Then move all these 3 repo files into repo.disabled folder :
[root#centos ~]# mv /etc/yum.repos.d/centos.repo/etc/yum.repos.d/repo.disabled
[root#centos ~]# mv /etc/yum.repos.d/centos-updates.repo/etc/yum.repos.d/repo.disabled
[root#centos ~]# mv /etc/yum.repos.d/centos-updates-testing.repo/etc/yum.repos.d/repo.disabled
List out the updated files and folders inside /etc/yum.repos.d :
[root#centos ~]# ls -l /etc/yum.repos.d/
total 8
-rw-r--r--. 1 root root 92 Aug 18 00:09 centos.repo
drwxr-xr-x. 2 root root 4096 Aug 18 11:27 repo.disabled
NOTE : Only file centos.repo and the folder repo.disabled should exist.
Now you gotta run yum clean all to clear the cache and everything should work just fine.
[root#centos ~]# yum clean all

Related

HowTo: Completely Uninstall Postgresql14 from MacOs Catalina If I've used the EnterpriseDB.com GUI installer

I've been trying to get this to work by following the answers in these questions:
How to uninstall postgresql on my Mac (running Snow Leopard)
Completely uninstall PostgreSQL 9.0.4 from Mac OSX Lion?
...but they're not working. So, here's what I have tried instead/in addition...
.
me#myMac:~$ cd /Library/PostgreSQL/14
me#myMac:/Library/PostgreSQL/14$ ./uninstall-postgresql.app/
-bash: ./uninstall-postgresql.app/: is a directory
me#myMac:/Library/PostgreSQL/14$ open ./uninstall-postgresql.app/
LSOpenURLsWithRole() failed with error -10810 for the file /Library/PostgreSQL/14/uninstall-postgresql.app.
me#myMac:/Library/PostgreSQL/14$ open -a ./uninstall-postgresql.app/
Unable to find application named './uninstall-postgresql.app/'
me#myMac:/Library/PostgreSQL/14$ open -a uninstall-postgresql.app/
Unable to find application named 'uninstall-postgresql.app/'
me#myMac:/Library/PostgreSQL/14$ sudo open uninstall-postgresql.app/
Password:
LSOpenURLsWithRole() failed with error -10810 for the file /Library/PostgreSQL/14/uninstall-postgresql.app.
me#myMac:/Library/PostgreSQL/14$ cd /Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS/
me#myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ install
install install_name_tool installvst
install-info installer
me#myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ installer
Usage: installer [-help] [-dominfo] [-volinfo] [-pkginfo] [-allowUntrusted] [-dumplog]
[-verbose | -verboseR] [-vers] [-config] [-plist]
[-file <pathToFile>] [-lang <ISOLanguageCode>] [-listiso]
[-showChoicesXML] [-applyChoiceChangesXML <pathToFile>]
[-showChoicesAfterApplyingChangesXML <pathtoFile>]
-pkg <pathToPackage>
-target <[DomainKey|MountPoint]>
me#myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ installbuilder.sh
-bash: installbuilder.sh: command not found
SINCE I couldn't run/find installbuilder.sh using the following command...
me#myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ installbuilder.sh
-bash: installbuilder.sh: command not found
...as the other answers in my OP suggest, I went on to try the steps below:
me#myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ ls -la
total 3112
drwxr-xr-x 5 root daemon 160 Sep 23 10:48 ./
drwxr-xr-x 5 root daemon 160 Sep 23 09:18 ../
-rwxr-xr-x 1 root daemon 673 Sep 23 10:48 installbuilder.sh*
-rwxr-xr-x 1 root daemon 1449456 Sep 23 10:07 osx-x86_64*
-rwxr-xr-x 1 root daemon 135216 Jul 14 11:21 uninstall-postgresql*
me#myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ ./installbuilder.sh
Unable to initialize installer
me#myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ ./uninstall-postgresql
Usage: ./uninstall-postgresql installerName [args ...]
me#myMac:/Library/PostgreSQL/14/uninstall-postgresql.app/Contents/MacOS$ ./uninstall-postgresql osx-x86_64
and VOILA!!!
This launched the uninstall GUI
Choose UNINSTALL ALL / REMOVE ENTIRE INSTALLATION
The uninstaller will do its thing and then prompt you with this:
At this point you'll want to follow the steps provided in this PREVIOUS StackOverflow ANSWER - steps 3 through 6 of #user1181328's answer. I'll list them here for convenience:
Remove the PostgreSQL and data folders. The Wizard will notify you that these were not removed.
sudo rm -rf /Library/PostgreSQL
Remove the ini file:
sudo rm /etc/postgres-reg.ini
Remove the PostgreSQL user:
using System Preferences -> Users & Groups.
Unlock the settings panel by clicking on the padlock and entering your password.
Select the PostgreSQL user and click on the minus button.
Restore your shared memory settings:
sudo rm /etc/sysctl.conf
That should be all! The uninstall wizard would have removed all icons and start-up applications files so you don't have to worry about those.

How to make RPM not to overwrite files when installing new packages?

Engineer Engelbert, a fierce OpenSuSE 11-sp4 user, is in possession of two RPM packages with the same contents:
rpm -qlp ~/onemy_ls_0.0.1_x86_64.rpm | tee a
/.osc/_apiurl
/.osc/_files
/.osc/_meta
/.osc/_osclib_version
/.osc/_package
/.osc/_project
/my_ls/my_ls.sh
rpm -qlp ~/my_ls_0.0.1_x86_64.rpm | tee b
/.osc/_apiurl
/.osc/_files
/.osc/_meta
/.osc/_osclib_version
/.osc/_package
/.osc/_project
/my_ls/my_ls.sh
diff a b | wc
0 0 0
Engineer Engelbert has realized that he can install both packages with no warning from RPM:
rpm -e my_ls-0.0.1-1 ; rpm -i ~/my_ls_0.0.1_x86_64.rpm
rpm -e onemy_ls-0.0.1-1 ; rpm -i ~/onemy_ls_0.0.1_x86_64.rpm
Engineer Engelbert is self-assured about his choices. He knows that's probably a good design choice from rpm developers. So, he checked the man page, certain that there would be an option for not allowing rpm packages to overwrite files in the system. But all the install options he found were:
install-options
[--aid] [--allfiles] [--badreloc] [--excludepath OLDPATH]
[--excludedocs] [--force] [-h,--hash]
[--ignoresize] [--ignorearch] [--ignoreos]
[--includedocs] [--justdb] [--nodeps]
[--nodigest] [--nosignature] [--nosuggest]
[--noorder] [--noscripts] [--notriggers]
[--oldpackage] [--percent] [--prefix NEWPATH]
[--relocate OLDPATH=NEWPATH]
[--repackage] [--replacefiles] [--replacepkgs]
[--test]
He hesitated and found strange that there is --replacefiles, but not --keepfiles. That suggested him that keep would be the default behavior. So, he created an script:
rpm -e onemy_ls-0.0.1-1
rpm -e my_ls-0.0.1-1
rm -rf /my_ls/
rpm -i ~/my_ls_0.0.1_x86_64.rpm
ls -lh /my_ls -d
sleep 120
rpm -i ~/onemy_ls_0.0.1_x86_64.rpm
ls -lh /my_ls -d
That showed that the files were actually overwritten:
drwxr-xr-x 2 root root 4.0K Aug 16 17:07 /my_ls
drwxr-xr-x 2 root root 4.0K Aug 16 17:09 /my_ls
After a research, Engineer Engelbert couldn't still find the answer.Now he is in the middle of a flamewar about packaging systems, and, as asked by somebody, he needs your help:
How to make rpm not to overwrite files when installing new packages?
Note - Engineer Engelbert knows that he should create better rpm packages with conflicts management, you don't need to explain him that. He is mostly worried about being sure that his packages won't conflict with other proprietary unpublished packages racing for the same paths in the system.
Note - using fpm, you can regenerate Engineer Engelbert's RPMs:
mkdir -p first_pkg/my_ls/
echo ls > first_pkg/my_ls/my_ls.sh
fpm -s dir -t rpm -n onemy_ls -v 0.0.1 -C first_pkg/ -p onemy_ls_VERSION_ARCH.rpm
fpm -s dir -t rpm -n my_ls -v 0.0.1 -C first_pkg/ -p my_ls_VERSION_ARCH.rpm
Yes: rpm will overwrite all files contained in a *.rpm that are not marked with %config and there is no option to disable that behavior.

Cannot remove file or Directory

I have root on the server in question.
OS: Solaris 10 sparc
When I ls the audit_old directory I get:
root#z10801 audit_old # ls
qm2_ora_24871_1c.aud.gz
ls -al results in:
root#z10801 audit_old # ls -al
total 250658
drwxr-x--- 2 oraqm2 dba 128261632 Mar 6 21:55 .
drwxr-x--- 17 oraqm2 dba 512 Mar 6 20:55 ..
rm gives me:
root#z10801 audit_old # rm qm2_ora_24871_1c.aud.gz
qm2_ora_24871_1c.aud.gz: No such file or directory
rm -rf the dir gives me:
root#z10801 rdbms # rm -rf audit_old/
rm: Unable to remove directory audit_old/: File exists
Any help would be great!
Thanks!
This behavior may be due to a file currently open by a separate process.
Even though you have removed it, the file is not truly removed by the OS until the process closes the file.
Try to find out the process that has the file open by using:
$ fuser .
In the directory which has the problem.
This command will print the process Id's which have files currently in use.

PostgreSQL: Permission denied + has wrong ownership loop?

I'm trying to run postgresql on my local machine like I usually do, however it's putting me in a situation where I can't fix. I installed postgresql91 with macports.
These are the three commands I usually have to run to get it running:
sudo sysctl -w kern.sysv.shmall=4096
sudo sysctl -w kern.sysv.shmmax=16777216
sudo su postgres -c "/opt/local/lib/postgresql91/bin/postgres -D /opt/local/var/db/postgresql91/defaultdb -p 55432"
However, it's giving me this error today:
Nets-Mac-Pro:~ emai$ sudo sysctl -w kern.sysv.shmall=4096
Password:
kern.sysv.shmall: 4096 -> 4096
Nets-Mac-Pro:~ emai$ sudo sysctl -w kern.sysv.shmmax=16777216
kern.sysv.shmmax: 16777216 -> 16777216
Nets-Mac-Pro:~ emai$ sudo su postgres -c "/opt/local/lib/postgresql91/bin/postgres -D /opt/local/var/db/postgresql91/defaultdb -p 55432"
postgres cannot access the server configuration file "/opt/local/var/db/postgresql91/defaultdb/postgresql.conf": Permission denied
When I go to /opt/local/var/db/postgresql91/ and do an ls -l this is what comes up:
drwx------ 18 root wheel 612 Jun 28 12:44 defaultdb
So I decided to add the postgres user to the wheel group, and then chmod defaultdb to 770.
drwxrwx--- 18 root wheel 612 Jun 28 12:44 defaultdb
I still get the error:
FATAL: could not open configuration file "/opt/local/var/db/postgresql91/defaultdb/postgresql.conf": Permission denied
And so I change the file rights from:
-rw------- 1 root wheel 19170 Jan 7 11:52 postgresql.conf
to:
-rw-rw---- 1 root wheel 19170 Jan 7 11:52 postgresql.conf
And now it complains that when I run the command again:
Nets-Mac-Pro:~ emai$ sudo su postgres -c "/opt/local/lib/postgresql91/bin/postgres -D /opt/local/var/db/postgresql91/defaultdb -p 55432"
FATAL: data directory "/opt/local/var/db/postgresql91/defaultdb" has wrong ownership
HINT: The server must be started by the user that owns the data directory.
I have no clue how I used to run the postgres server considering the file permissions of the files. Where do I find the data folder that it is hinting me about? Is there a better way to fix this?
Postgres should be owner, and the only user capable of writing to, data directory.
So, do:
sudo chown -Rf postgres:postgres /opt/local/var/db/postgresql91/defaultdb
sudo chmod 700 /opt/local/var/db/postgresql91/defaultdb
and it should be fine.

Install mongodb php driver on mediatemple dv 4.0

By following the official instructions http://www.mongodb.org/display/DOCS/Quickstart+Unix and this post http://blog.phy5ics.com/2010/03/27/installing-mongodb-on-mediatemple-dv/ I've just about managed to get mongodb installed on MediaTemples DV 4.0 server (I think).
I am however having problems installing the PHP driver http://www.mongodb.org/display/DOCS/PHP+Language+Center
In SSH I get this:
[root#xxx]# cd /var/tmp
[root#xxx]# pecl install mongo
downloading mongo-1.1.4.tgz ...
Starting to download mongo-1.1.4.tgz (68,924 bytes)
.................done: 68,924 bytes
18 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
/usr/bin/phpize: /var/tmp/mongo/build/shtool: /bin/sh: bad interpreter: Permission denied
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
ERROR: `phpize' failed
I am logged in as the root user - I don't understand why it's failing and what steps I need to take to install the PHP driver?
Thanks
Run the following commands on your server's command line:
$ mkdir /root/tmp
$ mount --bind /root/tmp /tmp
$ umount /tmp; umount /var/tmp
$ pecl install mongo
A few things:
/root/tmp is just an arbitrary temp directory. You can use whatever you want, provided it exists.
Some instructions say to use --host instead of --bind. On RHEL/CentOS mount says --host is an unrecognized option.
If you're on a VM, it's likely that you'll have to do this each time you restart your VM/Container.
For Media Temple customers, I can confirm that this works on both (dv) and (ve) servers with CentOS 5 and 6.
From media temple support: Need to create a temporary directory (/root/tmpz):
$ mkdir /root/tmpz
$ mount --host /root/tmpz /tmp
$ umount /tmp; umount /var/tmp
$ pecl install mongo
Build complete.
Don't forget to run 'make test'.
running: make INSTALL_ROOT="/var/tmp/pear-build-root/install-mongo-1.1.4" install
Installing shared extensions: /var/tmp/pear-build-root/install-mongo-1.1.4/usr/lib64/php /modules/
running: find "/var/tmp/pear-build-root/install-mongo-1.1.4" | xargs ls -dils
69094140 4 drwxr-xr-x 3 root root 4096 Feb 22 13:40 /var/tmp/pear-build-root/install-mongo-1.1.4
69275176 4 drwxr-xr-x 3 root root 4096 Feb 22 13:40 /var/tmp/pear-build-root/install-mongo-1.1.4/usr
69275177 4 drwxr-xr-x 3 root root 4096 Feb 22 13:40 /var/tmp/pear-build-root/install-mongo-1.1.4/usr/lib64
69290445 4 drwxr-xr-x 3 root root 4096 Feb 22 13:40 /var/tmp/pear-build-root/install-mongo-1.1.4/usr/lib64/php
69290447 4 drwxr-xr-x 2 root root 4096 Feb 22 13:40 /var/tmp/pear-build-root/install-mongo-1.1.4/usr/lib64/php/modules
69290448 676 -rwxr-xr-x 1 root root 684126 Feb 22 13:40 /var/tmp/pear-build-root/install-mongo-1.1.4/usr/lib64/php/modules/mongo.so
Build process completed successfully
Installing '/usr/lib64/php/modules/mongo.so'
install ok: channel://pecl.php.net/mongo-1.1.4
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
Do you have php-dev installed? phpize is basically "compiling" the MongoDB driver, but unless you have the -dev installed, this may not work.