cannot find a valid baseurl for repo: extra/7/x86_64 - centos

I've set up a fresh VM(CeotOS7) in vmware. However, I failed to update yum.
It returns cannot find a valid baseurl for repo: extra/7/x86_64.
I've tried all the solutions on the Internet and still can't fix it.
I can ping google.com, curl http://mirrorlist.centos.org/?release=7&arch=i386&repo=os returns <'http><'head><'title>Firewall Authentication <'/title>
I've also tried to modify CentOS-Base.repo hundreds of times.
Firewall and SELinux both disabled.

You might have already solved problem. It might help other.
I run following commands
[root#myserver]# ONBOOT=no
[root#myserver]# dhclient
[root#myserver]# yum update

Related

amazon linux on premise: yum update fails

I Just installed amazon linux on my windows 10 hypervisor using aws provided image from amazon. I am able to login successfully. However when I do yum install anything it just fails with error "Could not resolve host: cdn.amazonlinux.com". Following is the full snippet
[root#cloudimg yum]# yum install curl
Loaded plugins: langpacks, priorities, update-motd
https://cdn.amazonlinux.com/2/core/2.0/x86_64/f5ab60d117aab318ddc588ab7dbac074cc20ddf36a924287c55fbd593496ae79/repodata/repomd.xml?instance_id=fail&region=URLError: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
Trying other mirror.
https://cdn.amazonlinux.com/2/extras/docker/18.09.9/x86_64/6f06d82b5b1fa3d35af7a537bd9f3fa1d95d238361558bbb1e6a47c219c3adb2/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
Trying other mirror.
amzn2extra-docker/2/x86_64/pri FAILED
https://cdn.amazonlinux.com/2/extras/docker/18.09.9/x86_64/6f06d82b5b1fa3d35af7a537bd9f3fa1d95d238361558bbb1e6a47c219c3adb2/repodata/primary.sqlite.gz: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
Trying other mirror.
https://cdn.amazonlinux.com/2/extras/docker/18.09.9/x86_64/6f06d82b5b1fa3d35af7a537bd9f3fa1d95d238361558bbb1e6a47c219c3adb2/repodata/primary.sqlite.gz: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
Trying other mirror.
One of the configured repositories failed (Amazon Extras repo for docker),
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=amzn2extra-docker ...
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 amzn2extra-docker
or
subscription-manager repos --disable=amzn2extra-docker
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=amzn2extra-docker.skip_if_unavailable=true
failure: repodata/primary.sqlite.gz from amzn2extra-docker: [Errno 256] No more mirrors to try.
https://cdn.amazonlinux.com/2/extras/docker/18.09.9/x86_64/6f06d82b5b1fa3d35af7a537bd9f3fa1d95d238361558bbb1e6a47c219c3adb2/repodata/primary.sqlite.gz: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
[root#cloudimg yum]#
I have tried pinging cdn.amazonlinux.com and it works just fine. Looking at the attempted URL it looks like passed instance_id and region are wrong. They may have worked within aws but with on premises install they wouldn't have any value. I have no clue where to set default values for these parameters which are attempted by yum.
Any pointer to solve this problem will be much appreciated. My need is to try something on aws linux on my local system before I plan anything on AWS itself. Local development R&D on my laptop hosted aws linux image is much faster for my needs.
Unfortunately this isn't an answer, but I don't have enough reputation in order to comment. (unintended consequences, stackoverflow)
Although you can ping the cdn.amazonlinux.com address, I don't think you can access files there without authentication. If you access any path, you'll get an XML message that states "Access Denied" which is probably not well displayed as a part of the yum tool output.
I have been doing a bit of digging around for the publicly available package repo address for amazon linux packages so I can run a VM on my computer, but have not found a resolution. Amazon doesn't seem to make this available and nobody seems to be mirroring it externally.
Tons of search results for "adding a repo to your amazon linux instance" including EPEL and others, but no results for anyone saying "Add the Amazon Linux repo to your on-prem or outside-of-aws vm"

Errno 256 No more mirrors to try centos 6.6

I am trying to install metasploit on crentos 6.6 server
now when i tried to yum install or wget or even git any bundle i got errors
then after alot of search i found that it is a problem in the DNS so i tried to edit /etc/resolv.conf
and add 8.8.8.8 as name server it worked fine but after server reboot or even eth0 restart it keeps returning without the modifications i made
this is my /etc/resolv.conf content
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
is there any solution for this problem
I remember I got similar errors with CentOS.
Problem was: No internet connection.
First check a network connection:
#ping google.com
If there is no connection. You have to debug this first.
You are getting your networking configuration from DHCP but your DHCP server is failing to give you any DNS server addresses.
Did you try doing what that file tells you to do? Because that will "fix" your problem for you (assuming you don't choose to get your DHCP server fixed to provide you with DNS servers correctly).
Check location /etc/yum.repos.d/mongodb-org-3.2.repo
Delete all the irrelevent repositories in that location but be careful at that. Ex:- delete datastax repo which may be present
Run yum clean all
Run yum update

CentOS x11 Forwarding issue

I am on a Windows7 machine and I'm trying to get graphic view on the centOS machine to be displayed on my current screen. When typing xclock, gedit... in terminal, I am getting the following error
-bash: xclock: command not found
and This the result of # vi /etc/ssh/sshd_config command
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
#tewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
Also Xming is running on server:0.0 and I turned X11 forwarding on on putty
So what's the problem ?
sudo yum install xorg-x11-apps
Should cover it!
Do you have an .Xauthority file in your home directory?
I've recently found the answer for my issue, which might be similar to yours. I've seen quite a few open questions about this topic without resolution. You may have a few more things to work through, but SELinux settings ended up being my final hurdle. This among many other steps are covered here: ssh X11 forwarding won't work
That aside, you may need to change the Xming settings to match the default DisplayOffset of 10 for Centos. And after any changes to sshd_config, you'll need to restart the service via
/etc/init.d/sshd restart
I would like to emphasize that my situation is a non-critical operation within a (hopefully!) securely-managed intranet. I would NOT suggest turning off SELinux at work, or at home if you're hoping to open ports or configure VPN for your home network. Please consider: http://securityblog.org/2006/05/21/software-not-working-disable-selinux/

missing mysqld.sock and mysqld in /etc/init.d

I tried today to connect to MySQL server and saw that I did'nt have any mysqld.sock anymore, nowhere.
I tried several ways to get it back, but unsuccessfull. I tried to execut a
./mysqld.start in /etc/init.d, but it's also missing.
Should I reinstall mysql, or is there a way to get a socket back ?
try using following command
service mysql start
This will work.
#Nueva, if that doesn't work, reboot the system. I just had an Ubuntu build on EC2 lose its mysqld.sock file, and a simple reboot solved the problem.
Failing that, I've also heard that forcing the connection via tcp instead of localhost has worked for some people. I tried that, but got nothing.

wget giving error when downloading certain files

I am facing a problem in downloading some documents programmatically.
For example this link
https://www-950.ibm.com/events/wwe/grp/grp019.nsf/vLookupPDFs/Introduction_to_Storwize_V7000_Unified_T3/$file/Introduction_to_Storwize_V7000_Unified_T3.pdf
can be downloaded from browser, but when I try to get it from wget it doesn't work.
I have tried
wget https://www-950.ibm.com/events/wwe/grp/grp004.nsf/vLookupPDFs/3-Mobile%20Platform%20--%20Truty%20--%20March%208%202012/\$file/3-Mobile%20Platform%20--%20Truty%20--%20March%208%202012.pdf
It gave me this output
--2012-04-18 17:09:42--
https://www-950.ibm.com/events/wwe/grp/grp004.nsf/vLookupPDFs/3-Mobile%20Platform%20--%20Truty%20--%20March%208%202012/$file/3-Mobile%20Platform%20--%20Truty%20--%20March%208%202012.pdf
Resolving www-950.ibm.com... 216.208.176.98
Connecting to www-950.ibm.com|216.208.176.98|:443... connected.
Unable to establish SSL connection.
Can any one help me solve this problem. Thanks in advance.
Add the --no-check-certificate to your original wget command.
Plus you need to ensure that you are using a proxy.
On Linux:
export http_proxy=http://myproxyserver.com:8080
On Windows:
set http_proxy=http://myproxyserver.com:8080
I also found that on windows, because this is a https request, that in order to make it work, I also had to set https_proxy. So
set https_proxy=http://myproxyserver.com:8080
Obviously, change the proxy settings to suite your particular situation.