amazon linux on premise: yum update fails - amazon-linux

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"

Related

raspberry pi openvpn: ERROR: Cannot open TUN/TAP

I'm getting the above error when trying to connect to vpn given a .ovpn file. Usually this bug happens after an upgrade occurs and you haven't restarted yet. But I already did and the error still exists. I have tried reinstalling the openvpn (I'm using 2.4.7 on debian) and would not like to use this on docker.
Since getting this error when executing the command sudo openvpn file.ovpn often returns vague errors such as the one above, you can produce a more specific error when trying to import the ovpn file into NetworkManager instead.
After installing network-manager of course:
nmcli con import type openvpn vpn file.ovpn
Connect to the profile:
nmcli con up id vpn
Running this command would immediately show you a clearer error that is something along the lines of the org freedesktop networkmanager vpn plugin being unknown. Which is then solvable by installing the said plugin.
sudo apt install network-manager-openvpn
And that should do it.

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

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

Error 422 after installing gitlab on centos 7

I got into trouble after installing Gitlab on CentOs7. For the first time I was redirected to the admin password creation page and after the password for the admin user, the server sent error.
422
The change you requested was rejected.
I had set the url value based on the site guide.
Set the external_url in /etc/gitlab/gitlab.rb:
external_url "https://example.com/gitlab"
I checked the links below for similar situations. I didn't find the right answer. My server was in the local area and had no internet access.
Error 422 after installing gitlab on Ubuntu 18.04
After Update Error: "422 The change you requested was rejected."
Error 422 after installing Gitlab on Ubuntu 16.04
I made a mistake when installing Gitlab. In the /etc/gitlab/gitlab.rb file I put the local gitlab address with https but due to the local server setup there was no "let's encrypt" service and I did not intend to access the site via ssl. I modified the address in the file and turne "https" to "http". After modifying the following commands, the problem was fixed.
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

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

Gitlab was unable to access your Gitolite system

I installed GitLab on Ubuntu server 12.
I followed this steps: http://blog.compunet.co.za/gitlab-installation-on-ubuntu-server-12-04/
Everything seems to be right... but when I try to create a new project, I get the error message:
Gitlab was unable to access your Gitolite system.
I ran the diagnostic tool ("bundle exec rake gitlab:app:status RAILS_ENV=production")
(in /home/gitlab/gitlab) Starting diagnostic
config/database.yml.............exists
config/gitlab.yml.............exists
/home/git/repositories/...........exists
/home/git/repositories/ is writable?........YES
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (8/8), done.
Receiving objects: 100% (12/12), 1.12KiB, done.
Resolving deltas: 100% (1/1), done.
remote:Total 12 (delta 1), reused 0 (delta 0)
Can clone gitolite-admin?..............YES
UMASK for .gitolite.rc is 0007?............YES
/home/git/share/gitolite/hooks/common/post-receive exists?............YES
Finished
The log on admin area only shows:
ERROR -> /home/gitlab/gitlab/tmp/gitlabhq-gitolite-1348050652/gitolite
The config/gitlab.yml file is ok.
The permissions on repositories are just like the tutorial (section 3 - permissions).
I even tried to remove the lock...
What would you advise to troubleshoot this?
If it helps, I had a very similar situation happen, except in my gitlab log I had the following error:
ERROR -> Pull error -> unable to clone gitolite-admin repo
I had compared the commit of the gitolite fork metioned, and found that the changes there were already in place in my version of gitlab.
I ended up stopping the gitlab related services, deleting the contents of the gitlab tmp directory, then restarted the gitlab related services.
Afterwards, everything appeared to be working fine.
If the issue comes from permission regex fixed in this commit of this gitolite fork, you can have a look at "GitHub Tip: download commits as patches":
Your commit can be downloaded by adding a .patch at the end of its url: patch.
That way, you can apply it to your current gitolite source (without even using git itself, just by using the patch command)
I was able to resolve this issue on my server by following the installation instructions section titled "Disable StrictHostKeyChecking for localhost and your domain" and adding a new section for my gitolite host, which was set to the IP address of the server rather than localhost. Open:
/etc/ssh/ssh_config
And add the lines:
Host [gitolite hostname/IP here]
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
(replace the bracketed part with the appropriate hostname/IP)
It's already in the setup steps, but I had skipped it earlier because I didn't understand what it was suggesting. Otherwise, the SSH client tries to show the yes/no prompt to accept a new hostname and the Ruby backend interprets that as a failure to connect to gitolite.