What to do if you get an error saying Cannot find a valid baseurl for repo when you use yum -y install docker in a udemy course using CentOS7

Status

udemy Docker starting with Linux commands-BE A FIRST PENGUIN AND GROW AS WHALE https://www.udemy.com/course/linuxdocker-be-a-first-penguin-and-grow-as-whale/learn/lecture/16684274#questions/12224904 Section 3-15

After installing CentOS

# yum -y install docker

When you do

Cannot find a valid baseurl for repo

I got an error. If you install CentOS as it is, you may not be able to use the yum command. At least that was the case with the CentOS 7.8.2003 I used.

environment

Install Linux (CentOS7.8.2003) on VirtualBox on mac Performed all operations as root user

After installing CentOS, I got an error when trying to install docker

# yum -y install docker

スクリーンショット 2020-09-05 23.55.35.png

1. Change the description of ONBOOT and set DNS

Open the following.

# vi /etc/sysconfig/network-scripts/ifcfg-???

??? is

# cd /etc/sysconfig/network-scripts
# ls

Please check your directory and enter it. In my case, there were two, ifcfg-enp0s3 and ifcfg-enp0s8, but only ifcfg-enp0s3 is used.

Change the description of ONBOOT from "no" to "yes" at the opened destination, and describe the DNS settings.

ONBOOT=yes

DNS1=8.8.8.8
DNS2=8.8.4.4

2. Reboot

After completing the settings, restart.

# systemctl restart network

If all else fails, try restarting Linux.

3. Confirmation

I will check the operation just in case. I tried to update it.

# yum update

It worked properly. スクリーンショット 2020-09-08 12.47.56.png

4. Install Docker

# yum -y install docker

I was able to download it safely. スクリーンショット 2020-09-08 13.16.13.png

If it doesn't work, rewrite the baseurl

If it still doesn't work as expected, there may be a problem with the baseurl.

# vi /etc/yum.repos.d/CentOS-Base.repo

initial state スクリーンショット 2020-09-05 23.57.15.png

Change all baseurls to the following description.

#baseurl=http://ftp-srv2.kddilabs.jp/Linux/packages/CentOS/7.8.2003/os/x86_64/

After editing スクリーンショット 2020-09-05 23.59.45.png

Please set with the URL of the version you are using. I am from the following site https://blog.77jp.net/linux-iso%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8-%E3%81%AE%E3%83%80%E3%82%A6%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89%E3%82%B5%E3%82%A4%E3%83%88%E5%9B%BD%E5%86%85%E3%83%9F%E3%83%A9%E3%83%BC

http://ftp-srv2.kddilabs.jp/Linux/packages/CentOS/ Open My version ➡︎ os / ➡︎ x86_64 / And the opened URL is set to baseurl.

reference

https://mebee.info/2020/03/21/post-7689/ https://qiita.com/ntkgcj/items/fd8588dcd65a42c34875

Recommended Posts

What to do if you get an error saying Cannot find a valid baseurl for repo when you use yum -y install docker in a udemy course using CentOS7
What to do if you get a gcc error in Docker
What to do if you get an error saying "Please enter a valid value" when getting with Rails datetime_field
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
[Rails] What to do if you get an error saying "Could not find a JavaScript runtime." When executing the rails s command on Catalina
What to do if you get a "Cannot Pull Container Error" when starting ECS ​​Fargate
What to do if you get a DISPLAY error in gym.render ()
<Dot installation> What to do if you cannot proceed due to an error when building a development environment for Rails learning.
What to do if you get a JNI shared library error when trying to build in Eclipse
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
What to do if you get an error when you hit Heroku logs
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
What to do if you get an "A server is already running." Error when you try to start the rails server
What to do if you get a wrong number of arguments error in binding.pry
What to do if you get the error Couldn't find Item without an ID
What to do if you get a port error when docker-compose up on Mac
What to do if you get a java.io.IOException in GlassFish
What to do if you get a "302" error in your controller unit test code in Rails
What to do if you get an error in Basic authentication during Rails test code
What to do if you get a "Mysql2 :: Error: Operand should contain 1 column (s)" error in Rails
What to do if an error occurs when doing npm install axios in React + Typescript project
What to do if you get ActiveRecord :: StatementInvalid: Mysql2 :: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near when you try to reset Heroku
What to do if you get a groovy warning in Thymeleaf Layout
What to do if you get an error during rails db: reset
What to do if you get an uninitialized constant Likes Controller error
What to do and how to install when an error occurs in DXRuby 1.4.7
What to do if an error occurs when nokogiri enters when bundle install
What to do if an error occurs in VS Code when importing a django module or your own module installed by pip install
What to do if you get a SQLite3 :: BusyException: database is locked error
What to do if you get an error on heroku rake db: migrate
How to translate the error message into Japanese (What to do if you cannot log in for some reason)
What to do if you get an Argument Error: wrong number of arguments (given 2, expected 0) in your RSpec test
[Solution] What to do if you get a Docker error'ERROR: Cannot connect to the Docker daemon at unix: ///var/run/docker.sock. Is the docker daemon running?'
What to do if you can't get the text of an element in Selenium
What to do if you get a NoClassDefFoundError when trying to run eclipse on Java9
What to do when a could not find driver appears when connecting to a DB in a Docker environment
What to do if a SAX Parser error occurs when using Liferay 7 / DXP on AWS
[Rails] What to do if you can't get an error message with the errors method
What to do if mysql2 gets a bundle install error
What to do if you get "Changes not staged for commit:" when you git status after git add.
What to do when an UnsupportedCharsetException occurs in a lightweight JRE
What to do if you get angry with OpenSSL with pyenv install
What to do if you forget the root password in CentOS7
What to do if you should have installed Rails but an error occurs with rails -v (for beginners)
What to do if Operation not permitted is displayed when you execute a command in the terminal
Add gem'rails-i18n','~> 6.0.0' and what to do if bundle install gives an error
[Composer] [Laravel] What to do if you cannot install due to insufficient memory
What to do if you get a MiniMagick vulnerability alert on GitHub
What to do if you get a javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake in the IBM JDK
What to do if you have enabled Use the WSL2 based engine in Docker Desktop with insufficient WSL2 installation
What to do if you get Could not save master table to file after importing a project in Eclipse
What to do if you get the error message "Don't try to install it manually: your package manager does it automatically. However, a different version of webpack was detected higher up in the tree:" when you do "npm start" Law
What to do if you install Ubuntu
I get an error when I try to use "^" or "$" in ruby ​​regular expression
What to do if you get the error message unrecognized selector send to instance "***"
When you want to notify an error somewhere when using graphql-spring-boot in Spring Boot
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
What to do if ffi installation fails when launching an application in Rails
[Ubuntu] What to do when MongoDB cannot be started due to a SocketException error
[Rails] What to do when you want to generate an error that cannot be destory when foreign key restrictions are applied
What to do if you get angry with "ERROR: There are no scenarios; must have at least one" even though you should have entered yarn in Docker