Repositories links not working yum.conf in CentOS 6 - gcc

I am running a linux server using RedHat and Centos 6.4
I need to install gcc onto the server, so I have been trying to use yum to install gcc for me, however I seem to have a bit of an issue with installing and updating packages using yum due to the yum.conf file.
If I open my current yum.conf file, I see the following code:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
[base]
name=Red Hat Linux $releasever - $basearch - Base
baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/$releasever/$basearch/
[updates]
name=Red Hat Linux $releasever - Updates
baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/updates/$releasever/
and whenever I try to run a yum command - for example, "yum update" I get the following errors in my terminal:
[root#SERVER etc]# yum update
Gathering header information file(s) from server(s)
Server: Red Hat Linux 6 - x86_64 - Base
retrygrab() failed for:
http://mirror.dulug.duke.edu/pub/yum-repository/redhat/6/x86_64/headers/header.info
Executing failover method
failover: out of servers to try
Error getting file http://mirror.dulug.duke.edu/pub/yum-repository/redhat/6/x86_64/headers/header.info
[Errno 4] IOError: <urlopen error >
[root#SERVER etc]#
I believe this is due to some old yum mirrors being down, however I cannot find any reference to a proper set of repositories to use in my yum.conf file which would work on CentOS 6.4
The question is: does anybody know where I can find a set of repositories that will work in this scenario? I know that the Yum website is now found at http://yum.baseurl.org/ however I cannot see anything clear with regard to what repositories I should be putting in my yum.conf file..
I am obviously a linux newbie, so if I am missing something important, flame me gently...

Looks like you have a mix of CentOS and RedHat bits. Delete whatever you added. CentOS is easy (examples below). For RedHat if you aren't a registered machine you'll want to use the DVD ISO as source (baseurl=file:///media) or maybe attach to a public EPEL.
Here's a CentOS /etc/yum.conf.
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release
And then you should have a few repos that already exist in /etc/yum.repos.d (base/debuginfo/media/vault). Hers's /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Related

Error: No such file or directory # rb_sysopen - C:/ProgramData/hashicorp/vagrant-vmware-desktop/certificates/vagrant-utility.client.crt

In my windows 10, after I installed
​vagrant plugin install vagrant-vmware-desktop
then i execute vagrant up I get error:1
>vagrant up
Vagrant encountered an error while attempting to load the utility
service key file. This error can occur if the Vagrant VMware Utility
has not yet been installed, or if it was installed incorrectly. If
this error persists after running the Vagrant VMware Utility installer
again, please contact support at: support#hashicorp.com
Information about the Vagrant VMware Utility, including installation
instruction, can be found here:
https://www.vagrantup.com/docs/vmware/vagrant-vmware-utility.html
Path: C:/ProgramData/hashicorp/vagrant-vmware-desktop/certificates/vagrant-utility.client.crt
Error: No such file or directory # rb_sysopen - C:/ProgramData/hashicorp/vagrant-vmware-desktop/certificates/vagrant-utility.client.crt
It seems the Vagrant Vmware utility is missing, you can run the following command and check if the Vmware utility service is running or not
net start vagrant-vmware-utility
If it is not present, install it from here for windows. you can look for other links for different platforms.
Once installed re-install the utility -
vagrant plugin install vagrant-vmware-desktop
After installation is complete you should have a folder similar to this:
C:\HashiCorp\VagrantVMwareUtility

RUN yum install inside Dockerfile throwing error in Mac

Step 20/29 : RUN yum install -y docker-engine-18.09.8.ol-1.0.4.el7
---> Running in 9aa3b53a6171
Loaded plugins: ovl
https://artifactory.xxx.com/io-ol7-addons-yum-local/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized."
Trying other mirror.
One of the configured repositories failed (io-ol7-addons-yum-local),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=io-ol7-addons-yum-local ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable io-ol7-addons-yum-local
or
subscription-manager repos --disable=io-ol7-addons-yum-local
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=io-ol7-addons-yum-local.skip_if_unavailable=true
failure: repodata/repomd.xml from io-ol7-addons-yum-local: [Errno 256] No more mirrors to try.
https://artifactory.xxx.com/io-ol7-addons-yum-local/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized."
The command '/bin/sh -c yum install -y docker-engine-18.09.8.ol-1.0.4.el7' returned a non-zero code: 1
People working in linux sometimes faced the problem, and solved it by downloading the repo config and keeping it in path /etc/yum.repos.d/. But how to solve this in Mac where YUM is not used?
P.S. There is a proxy server and I have added the proxy settings properly in docker prefernces proxy setup.

How to fix docker vulnerabilities (USN-4048-1) in ubuntu 18.08 LTS

I have AWS EC2 ubuntu 18.04 LTS machine. I want to fix the docker vulnerabilities (USN-4048-1).
Installed package : docker.io_17.03.2-0ubuntu7~ppa1
Fixed package : docker.io_18.09.7-0ubuntu1~18.04.3
How can i do that ? What's the steps to fix it ?
The simple way is to follow below step:
If the update-notifier-common package is installed, Ubuntu will alert you about pending updates via the message of the day (motd) upon console or remote login.
After logging in, you can check for and apply new updates with:
When performing an update, first review what apt is going to do, then confirm that you want to apply the updates (this is particularly true when running the development release).
If you would prefer to have updates applied automatically, make sure the unattended-upgrades package is installed, then run 'sudo dpkg-reconfigure unattended-upgrades'. Please note that updates may restart services on your server, so this may not be appropriate for all environments.
$ sudo apt-get update
$ sudo apt-get dist-upgrade
source : https://wiki.ubuntu.com/Security/Upgrades?_ga=2.36307296.1783287754.1567592268-1506938917.1567592268

[Ansible][Fedora 24] DNF Module Requires python2-dnf but it is Already Installed

I have computers on an internal network that is not connected to the internet, and have copied the relevant rpm packages into my local dnf repository. I'm trying to get ansible's DNF module to install a program on another computer but it pops up an error message stating that python2-dnf is not installed. But when I try to install the program it is already installed. Anyone have an idea whats going wrong?
I've placed the error code below.
Background:
Ansible Control machine: Fedora 24 4.5.5-300.fc24.x86_64 GNU/LINUX
Ansible Client machine: Fedora 24 4.5.5-300.fc24.x86_64 GNU/LINUX
yum/dnf local repository: Centos 7 3.10.0-327.28.3.el7.x86_64 GNU/LINUX
[root#localhost ansible]# ansible all -m dnf -a "name=vim state=present"
192.168.10.10 | FAILED! => {
"changed": false,
"failed": true
, "msg": "python2-dnf is not installed, but it is required for the Ansible dnf module."
}
[root#localhost ansible]# yum install python2-dnf
Yum command has been deprecated, redirecting to '/usr/bin/dnf install python2-dnf'.
See 'man dnf' and 'man yum2dnf' for more information.
To transfer transaction metadata from yum to DNF, run:
'dnf install python-dnf-plugins-extras-migrate && dnf-2 migrate'
Last metadata expiration check: 0:12:08 ago on Tue Oct 18 04:57:11 2016.
Package python2-dnf-1.1.9-2.fc24.noarch is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
As pointed out by #GUIDO you need python2-dnf on the target host.
Ansible module documentation states:
Requirements (on host that executes module)
python >= 2.6
python-dnf
on host that executes module means in the context of Ansible the target host of the play, not the control host.

lxc-attach failed to enter the namespace - EC2 Instances

For some reason I cannot enter a docker container using Lxc-attach only on EC2 instances. This works on my local machine and on Digital Ocean (KVM) droplets but not on Amazon EC2 xen-paravirtualized Ubuntu12.04 instance. Here are the steps/errors:
root#ip-172-31-46-202:~/scalar/project/docker# lxc-ls
4074ebf985cfe09b2880a9eabbc7ad3e59283f425f64cfaa72f59f1f23661d18
root#ip-172-31-46-202:~/scalar/project/docker# lxc-attach -n 4074ebf985cfe09b2880a9eabbc7ad3e59283f425f64cfaa72f59f1f23661d18
lxc-attach: No such file or directory - failed to open '/proc/19731/ns/pid'
lxc-attach: failed to enter the namespace
Does anyone know if there is a way to resolve this issue? Here are my docker version details:
Client version: 0.7.6
Go version (client): go1.2
Git commit (client): bc3b2ec
Server version: 0.7.6
Git commit (server): bc3b2ec
Go version (server): go1.2
Last stable version: 0.7.6
Also:
lxc version: 0.7.5
What is your kernel version?
lxc-attach requires features that are not present in the native 12.04 kernel (3.5). You need at least 3.8 which IIRC is available in the backport.
As Creac suggested, the kernel was not of a high enough version. (and if I try re-deploying an AWS ubuntu image it still uses kernel 3.2)
To fix this issue, I ran the following command to get 3.8:
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
or you can run the following command to get 3.5
sudo apt-get install linux-image-generic-lts-quantal linux-headers-generic-lts-quantal
Please note that these commands are Ubuntu specific (as per the question) and will install the "generic" kernel rather than the "virtual" kernel, but should work. [source]
Note that I tried to update Creac's original answer with this additional information but the edit was rejected so I felt the need to create a new answer for others to use if they want.
source of where I found the commands

Resources