how to enable repo with yum-config-manager --enable<repo> - yum

During the try to install yum-utils, I ran into the problem that there seems to be no enabled repos. How can I enable yum-config-manager, when I seem to need him to do so.
[root#spectrumscale ~]# yum install yum-utils
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable <repo>

To install specific package from specific repo you can use
yum install --enablerepo=name-of-repo name-of-package
Say there can be conflict between version, consider example of installing mariadb 5.5.66, in my case I got 2 repo mariadb-5 and mariadb-10, suppose if I wish to install from mariadb-5 repo then I use
yum install --disablerepo=mariadb-10 --enablerepo=mariadb-5 MariaDB-server MariaDB-client
To enable enable specific repo, you can use
yum-config-manager --enable name-of-repo
Here is example on Centos 7.7
[root#localhost server-setup]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root#localhost server-setup]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.piconets.webwerks.in
* epel: mirror.poliwangi.ac.id
* extras: mirrors.piconets.webwerks.in
* remi-safe: mirror.innosol.asia
* updates: mirrors.piconets.webwerks.in
repo id repo name status
CodeIT/x86_64 CodeIT repo 369
base/7/x86_64 CentOS-7 - Base 10,097
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,453
extras/7/x86_64 CentOS-7 - Extras 305
ius/x86_64 IUS for Enterprise Linux 7 - x86_64 641
mariadb-10 MariaDB 94
mariadb-5 MariaDB 39
remi-safe Safe Remi's RPM repository for Enterprise Linux 7 - x86_64 3,621
updates/7/x86_64 CentOS-7 - Updates 711
repolist: 29,330
To Disable
[root#localhost server-setup]# yum-config-manager --disable mariadb-5
After Disabling
[root#localhost server-setup]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.piconets.webwerks.in
* epel: mirror.poliwangi.ac.id
* extras: mirrors.piconets.webwerks.in
* remi-safe: mirror.innosol.asia
* updates: mirrors.piconets.webwerks.in
repo id repo name status
CodeIT/x86_64 CodeIT repo 369
base/7/x86_64 CentOS-7 - Base 10,097
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,453
extras/7/x86_64 CentOS-7 - Extras 305
ius/x86_64 IUS for Enterprise Linux 7 - x86_64 641
mariadb-10 MariaDB 94
remi-safe Safe Remi's RPM repository for Enterprise Linux 7 - x86_64 3,621
updates/7/x86_64 CentOS-7 - Updates 711
repolist: 29,291
What it actually does ???
I got MariaDB.repo file at /etc/yum.repos.d/, when you use --enable <repo-name> or --disable <repo-name>, it will change the value of enabled = to 0 or 1, based on this, yum repolist will show you repositories.
[root#localhost server-setup]# cat /etc/yum.repos.d/MariaDB.repo
[mariadb-10]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4.10/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
[mariadb-5]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5.66/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
enabled = 1

Related

Install Remi repository on CentOS Linux release 8.5.2111 (not CentOS 8 stream)

I want to update to PHP 8.1 in my old Centos 8.5.2111 server. But I'm unable to install Remi repository. I get the following:
othing provides (redhat-release >= 8.7 or centos-stream-release >= 8) needed by remi-release-8.7-2.el8.remi.noarch
[xxxxx#yyyy ~]$ cat /etc/redhat-release
CentOS Linux release 8.5.2111
[xxxxx#yyyy ~]$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-8.noarch.rpm
Last metadata expiration check: 0:36:51 ago on XXX yy Feb 2023 12:07:52 AM CET.
epel-release-latest-8.noarch.rpm 53 kB/s | 24 kB 00:00
epel-next-release-latest-8.noarch.rpm 30 kB/s | 11 kB 00:00
Package epel-release-8-18.el8.noarch is already installed.
Package epel-next-release-8-18.el8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[xxxxx#yyyy ~]$ sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Last metadata expiration check: 0:37:07 ago on XXX yy Feb 2023 12:07:52 AM CET.
remi-release-8.rpm 247 kB/s | 31 kB 00:00
Error:
Problem: conflicting requests
- nothing provides (redhat-release >= 8.7 or centos-stream-release >= 8) needed by remi-release-8.7-2.el8.remi.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
Maybe I missing something?
The message seems clear.
You need to update to the latest version of the OS, as explained in the FAQ. Older versions are insecure and unsupported, and their support in 3rd party repository is not sustainable.
You can choose to switch to
CentOS Stream 8, see https://www.centos.org/centos-stream/ with migration tools
RHEL 8.7, see https://www.redhat.com/en/blog/new-year-new-red-hat-enterprise-linux-programs-easier-ways-access-rhel
Alma Linux 8.7 see https://almalinux.org/ with migration tools
Rocky Linux 8.7 https://rockylinux.org/ with migration tools
Any other RHEL clone

How is the correct syntax/call to get the sls-file working - salt

I'm trying to build a reactor sls file, which starts running when an event occurs.
The content of the sls file should be as the following cli commands:
sudo salt minion git.add /srv/salt .
sudo salt minion git.commit /srv/salt test
sudo salt minion git.push /srv/salt origin master identity=/home/autogit/.ssh/id_rsa
If i run the code bellow triggered by the reactor. I get the following error message.
[DEBUG ] Reactor is populating module client cache
[ERROR ] An un-handled exception from the multiprocessing process 'Reactor-9:1' was caught:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/process.py", line 765, in _run
return self._original_run()
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 271, in run
self.call_reactions(chunks)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 228, in call_reactions
self.wrap.run(chunk)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 330, in run
self.populate_client_cache(low)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 324, in populate_client_cache
self.reaction_class[reaction_type](self.opts['conf_file'])
KeyError: u'module'
[CRITICAL] Engine 'reactor' could not be started!
I've tried different syntax (old style and new style) but couldn't figure out what the problem is. Always getting an KeyError: u'module' or u'git'.
Also tried it with runner function to run it locally on the master.
git pull:
module.run:
- git.pull:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- identity: /home/autogit/.ssh/id_rsa
- git.add:
- cwd: /srv/salt
- filename: .
- git.commit:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- git.push:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- identity: /home/autogit/.ssh/id_rsa
salt --versions-report
Salt Version:
Salt: 2019.2.0
Dependency Versions:
cffi: Not Installed
cherrypy: unknown
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.3
gitpython: 2.1.8
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
python-gnupg: 0.4.1
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 2.0.3
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.5
System Versions:
dist: Ubuntu 18.04 bionic
locale: UTF-8
machine: x86_64
release: 4.15.0-46-generic
system: Linux
version: Ubuntu 18.04 bionic
Since i'm quite new to Salt, hopefully you can give me a hint what i'm doing wrong:
You didn't provide the master config.
About module.run confusion: add in your settings (minion and maybe to master since I don't know your use-case)
use_superseded:
- module.run
That will enable your syntax, more doc about this here: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html#salt.states.module.run
In general: you are executing execution modules from the place that state modules are allowed only (the term module is heavily overused in salt...)
You didn't provide the full Master config. Reactor requires dedicated config to match events to sls files:
https://docs.saltstack.com/en/latest/ref/configuration/master.html#master-reactor-settings
You can also check the doc I've written some time ago about events and reactors:
https://github.com/kiemlicz/util/wiki/Salt-Events-and-Reactor
Assuming you've configured your events-to-sls-files-matching in master config, your provided sls:
git pull:
module.run:
- git.pull:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/
...
will not work.
Mind that reaction happens on Salt Master thus the reaction sls file need to provide type of reaction (local, runner etc.) since it's no longer 'view of one minion' but possibly of tons of minions!
First create runner reaction type (which delegates to some orchestration sls file which will contain your logic wrapped with (I think) salt.function )
Help yourself with aforementioned github link to my attempt of explaining Reactor.
Refer to official doc as well: https://docs.saltstack.com/en/latest/topics/reactor/index.html

Error when trying to update Mono (no Release file on CD)

From Mono v4.6.2 on Debian v9.5 (with Debian install CD in the drive)
After adding the correct repositories for Debian 9 (following instructions at https://www.mono-project.com/download/stable/#download-lin-debian):
apt update
Ign:1 cdrom://[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20180714-10:25] stretch InRelease
Err:2 cdrom://[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20180714-10:25] stretch Release
Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update can not be used to add new CD-ROMs
Ign:3 http://ftp.us.debian.org/debian stretch InRelease
Hit:4 http://security.debian.org/debian-security stretch/updates InRelease
Hit:5 http://ftp.us.debian.org/debian stretch-updates InRelease
Hit:6 http://ftp.us.debian.org/debian stretch Release
Hit:7 http://linux.teamviewer.com/deb stable InRelease
Hit:9 http://linux.teamviewer.com/deb preview InRelease
Hit:10 https://download.mono-project.com/repo/debian stable-stretch InRelease
Ign:8 http://cdn-fastly.deb.debian.org/debian jessie InRelease
Hit:11 http://cdn-fastly.deb.debian.org/debian jessie Release
Reading package lists... Done
E: The repository 'cdrom://[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20180714-10:25] stretch Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I tried:
apt-cdrom add
Using CD-ROM mount point /media/cdrom/
Unmounting CD-ROM...
Waiting for disc...
Please insert a Disc in the drive and press [Enter]
Mounting CD-ROM...
Identifying... [411e6cc38c8dd1371217e68c34e1ecd0-2]
Scanning disc for index files...
Found 1 package indexes, 0 source indexes, 1 translation indexes and 0 signaturs
This disc is called:
'Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20180714-10:25'
Reading Package Indexes... Done
Reading Translation Indexes... Done
Writing new source list
Source list entries for this disc are:
deb cdrom:[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20180714-10:25]/ stretch main
Unmounting CD-ROM...
Repeat this process for the rest of the CDs in your set.
But I still get the same error with apt update.
OK, ejected CD from drive (per Lex Li). In the meantime I have discovered that I need to pin my repo package to v5.0.1, so have modified the update instructions to the following:
echo "deb download.mono-project.com/repo/debian stable-stretch/snapshots/5.0.1 main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
then re-run apt update
But am getting this output:
Ign:1 cdrom://[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20180714-10:25] stretch InRelease
Err:2 cdrom://[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20180714-10:25] stretch Release
Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Hit:3 http://security.debian.org/debian-security stretch/updates InRelease
Ign:4 http://ftp.us.debian.org/debian stretch InRelease
Hit:5 http://ftp.us.debian.org/debian stretch-updates InRelease
Hit:6 http://linux.teamviewer.com/deb stable InRelease
Hit:7 http://linux.teamviewer.com/deb preview InRelease
Hit:9 http://ftp.us.debian.org/debian stretch Release
Ign:8 http://cdn-fastly.deb.debian.org/debian jessie InRelease
Hit:10 http://cdn-fastly.deb.debian.org/debian jessie Release
Ign:11 https://download.mono-project.com/repo/debian stable-stretch/snapshots/5.0.1 InRelease
Err:12 https://download.mono-project.com/repo/debian stable-stretch/snapshots/5.0.1 Release
404 Not Found
Reading package lists... Done
E: The repository 'cdrom://[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20180714-10:25] stretch Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://download.mono-project.com/repo/debian stable-stretch/snapshots/5.0.1 Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

yum update httpd failed on CentOS 7

I am trying to update Cent OS 7.2 box for compliance activities. It is failing with error "error: unpacking of archive failed on file /usr/sbin/suexec;5a02e28f: cpio: cap_set_file" as below,
15-186 ~# yum update httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.scalabledns.com
* epel: mirror.oss.ou.edu
* extras: ftp.usf.edu
* updates: ftp.usf.edu
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-40.el7.centos will be updated
---> Package httpd.x86_64 0:2.4.6-67.el7.centos.6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================
Updating:
httpd x86_64 2.4.6-67.el7.centos.6 updates 2.7 M
Transaction Summary
==============================================================================================================================================================================================================================================
Upgrade 1 Package
Total download size: 2.7 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
httpd-2.4.6-67.el7.centos.6.x86_64.rpm | 2.7 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : httpd-2.4.6-67.el7.centos.6.x86_64 1/2
Error unpacking rpm package httpd-2.4.6-67.el7.centos.6.x86_64
error: unpacking of archive failed on file /usr/sbin/suexec;5a02e28f: cpio: cap_set_file
httpd-2.4.6-40.el7.centos.x86_64 was supposed to be removed but is not!
Verifying : httpd-2.4.6-40.el7.centos.x86_64 1/2
Verifying : httpd-2.4.6-67.el7.centos.6.x86_64 2/2
Failed:
httpd.x86_64 0:2.4.6-40.el7.centos httpd.x86_64 0:2.4.6-67.el7.centos.6
Complete!
It worked on another similar box. Checked many blogs and redhat bugzilla but no way out. Anybody has any clue whats happening here?
It's a moby issue - https://github.com/moby/moby/issues/6980. Try to change docker storage driver/host OS.

Can't compile 64bit redis-server

I'm trying to compile the latest stable (2.8.19) version of Redis. Build is successfull as well as all tests, but unexpectedly server runs on 32bit arch.
Log entries:
# Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with 'noeviction' policy now.
Redis 2.8.19 (00000000/0) 32 bit
Running in stand alone mode
Port: 6582
PID: 2381
Redis-cli INFO display arch_bits:32. Previous instance (version 2.4.6) works well on arch_bits 64, but I don't know which way it was installed.
OS version info:
root:~# uname -a
Linux localhost 2.6.32-5-amd64 #1 SMP Tue Mar 8 22:49:26 UTC 2011 x86_64 GNU/Linux
root:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.1 (squeeze)
Release: 6.0.1
Codename: squeeze
root:~# arch
x86_64
What are the ways to fix this issue and run latest redis as 64bit?
UPD
Despite above commands output, dpkg --print-architecture returns i386 and all packages in system are all or i386. Only redis-server 2.4.*, installed as a package, is strangely ia64.
What can I do in this situation? The server was setup long time ago by another person, and I is still too newbie in Unix.
It seems, my server needs a full migration from 32 to 64-bit architeture.
Current task solved by downloading compiled 64-bit DEB-package and installing it manually.