In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the overview and configuration method of yum source". In the daily operation, I believe that many people have doubts about the overview and configuration method of yum source. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "overview and configuration method of yum source". Next, please follow the editor to study!
Overview of yum feeds
Yum requires a yum library, which is the yum source. By default, CentOS has a yum source. There are some default configuration files in the / etc/yum.repos.d/ directory (you can move them to / opt or rename them directly under yum.repos.d/).
First find a yum library (source), and then make sure that there is a local client (the yum command is the client), and the yum program connects to the server. The way you connect is determined by the configuration file. You can modify the settings by editing the / etc/yum.repos.d/CentOS-Base.repo file.
When you open the CentOS-Base.repo file, you can see that the url path is the yum source of CentOS's official website, http://mirrorlist.centos.org/?release=releasever&arch=releasever&arch=basearch&repo=os. You can comment out the mirrorlist, and then set the baseurl to the domestic Ali Cloud source http://mirrors.aliyun.com/repo/Centos-6.repo, or you can set it to your own local file system (mount directory) for a large number of rpm packages. You need to remove the CentOS-Base.repo file and edit the CentOS-Media.repo file.
Name=Description# a description, at will. Baseurl=# sets the address of the repository. You can write Aliyun or your own yum ftp:// http:// file:///enabled={1|0}#enabled=1 to enable the local update mode gpgcheck= {1 | 0} # gpgcheck=1 to check; if you don't check the key; checked by gpgcheck=0gpgkey=#, you don't have to write this line.
[centos] yum software repository unique identifier to avoid conflicts with other repositories
Name=centos yum software repository name description, easy to identify the use of the warehouse
The methods provided by baseurl= file:///mnt include FTP (ftp://..), HTTP (http://...), and file:///...).
Gpgcheck=0 sets whether this source verifies the file; 1 is a check, 0 is not a check.
Enabled sets whether this source is available; 1 is available and 0 is disabled.
Centos multiple yum sources, how does the system choose?
Yum profile:
/ etc/yum.conf
Pkgpolicy: the policy of the package. There are two options, newest and last, this function is that if you set up multiple repository and the same software exists in different repository at the same time, which yum should install, and if it is newest, yum will install the latest version. In the case of last, yum alphabetically sorts the server id and selects the software installation on the last server. Newest is usually chosen.
If the package is in both yum sources, it will be in the following file in order:
/ var/cache/yum/x86_64/6/timedhosts.txt
There are two ways to configure yum sources:
Configuration method 1: (local mount directory) local mount
Configuration method 2 (remote mount directory) network mount (common Ali cloud source) 1. Yum change domestic source
Cd / etc/yum.repos.d/ # switch to / etc/yum.repos.d/
Rm-f dvd.repos # Delete dvd.repos
Wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
Or
Curl-O http://mirrors.163.com/.helpo/CentOS7-Base-163.repo #
Yum list # Source for installing CentOS7-Base-163.repo
Example:
Use cp.. / yum.repos.d.bak/*. , copy back the previous one, CentOS-Base.repo is the yum source.
Install and download domestic sources use vim to view installed sources, use yum list to view
Install zlib
Yum installation failed, rebuild the cache, and after executing the commands in the drawing, use the yum clean all and yum install zsh commands.
Clean up all caches.
Check which warehouses are available.
Download wget
FAQ: the reason for reporting an error may be that the dev.repo was not deleted
2. Download the rpm package for yum
Yum install-y package name-- downloaonly # download only, not install
Ls / var/cache/yum/x86-64amp 7 / # View the download location
Yum list-y package name-- downloaonly-- downloaddir= path #
Yum reinstall-y package name-- downloaonly-- downloaddir= path # reinstall to the specified download directory
Use yum list to see if it is installed, and then use yum install to install it.
Specify the rpm package to download
Specify the download directory as / tmp/, and use ls / tmp/ to view it.
Note: if you are using a local Yum source, it really does not support downloading. You have to use the source of the network.
3. Source package installation
Install the extended source epel
Yum install-y epel-release # installs the source epel-release. After the installation is complete, use yum list to check
Yum list | grep epel # View source epel
Source package installation
1.cd / usr/local/src/ # change to the / usr/local/src/ directory and put the source code package in the / usr/local/src/ directory
2.wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz # download the zip file
3.tar zxvf httpd-2.2.32.tar.gz # decompress httpd-2.2.32.tar.gz
4.cd httpd-2.2.32 # switch to httpd-2.2.32 and then use the ls command to have a file called INSTALL, use more INSTALL to view
5. / configure-- prefix=/usr/local/apache2 # specify the installation path
(2) make #
(3) make install #
To uninstall is to delete the installed files.
Source package download address: r.aminglinux.com
Download the httpd-2.2.32.tar.gz package
5. / configure-- prefix=/usr/local/apache2 # specify the installation path
If the result is No, it is not installed. Use the command
Solution: you download a package, compile and install: yum-y install pcre-devel, just compile, and then make,make & & make install
Installation apr-util reported an error. Just install a dependency package, command:
Yum install expat-devel
It should not be a big problem to compile successfully and then install.
This is the compiled display (parameters), followed by make&&make install
Installation is complete.
Two versions compiled by apr\ apr-util: 1. / configure-- prefix=/usr/local/apache-- with-included-apr
2. / configure-prefix=/usr/local/apache2-with-apr=/usr/local/apr-with-apr-util=/usr/local/apr-util
If it still doesn't work, unzip the apr and apr-util source packages you downloaded to the srclib directory under httpd, rename them to apr and apr-util, and unzip the apr and apr-util packages to this directory.
Look for the srclib directory in the httpd directory in the package and recompile it in the source package.
Make prompts an error. It depends on the wrong directory.
Install the directory and unzip it to the current directory. The installation specifies the directory. Src directory
Disable proxy when compiling. Command:. / configure-- prefix=/usr/local/apache2-- disable-proxy
Httpd with 2.4.33 cannot be installed, try to install httpd with 2.4.29
Httpd 2.4.33 version of this error, after the compilation and installation of apr and apr-util, in the compilation time to specify the path can also be solved. #. / configure-prefix=/usr/local/apache4-with-apr=/usr/local/apr-with-apr-util=/usr/local/apr
Grammatical error. Use vi to edit and view, line 30.
Solution / reason: at the end of the version, switch to python or change the first line of yum to / usr/bin/python2
Or a grammatical error.
Fixed the solution that yum could not be used correctly after CentOS7 upgraded Python to version 3.6
Http://www.jb51.net/article/133730.htm?utm_source=debugrun&utm_medium=referral
Show 404, write the wrong address.
Use the command echo $? Check to see if the previous command is wrong. If the result is not zero, then it is wrong.
Use yum install gcc to install packages that are not installed, and then run the command. / configure-- prefix=/usr/local/apache2 view
Then use the command echo $? Check to see if the previous command is correct.
(2)。 Execute the make command
Then use echo $? Command to check, the result is 0, which means that is correct.
(3). Make install puts the compiled binary directory into the specified files directory and uses echo $? Command to detect
Use the command ls / usr/local/apache2/ to check
Frequently asked questions, execute the yum install glibc-static command.
At this point, the study on "Overview and configuration of yum sources" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.