search

what is linux repo

Mar 25, 2023 am 09:08 AM
linuxrepo

linux repo refers to "repository", indicating the location of the installation file. At the same time, repo is also the name of the toolkit required to develop the android host environment in the linux environment and is used for version control; the repo file refers to Fedora The configuration file of the yum source. Usually a repo file defines the details of one or more software repositories.

what is linux repo

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

What is linux repo?

In the linux operating system, repo=repository indicates the location of the installation file. At the same time, repo is also used to develop android hosts in the linux environment. The name of the toolkit required by the environment for version control. REPO is a script written by Google using a python script to call Git. It is mainly used to download and manage the software warehouse of the android project.

Detailed explanation of the configuration file repo file of linux yum

repo file:

The repo file is the yum source (software) in Fedora Warehouse) configuration file, usually a repo file defines the details of one or more software warehouses, such as where we will download software packages that need to be installed or upgraded. The settings in the repo file will be read and applied by yum!

The working principle of YUM is not complicated. The dependencies of each RPM software will be recorded in the header. If the contents of the header can be recorded and analyzed, you can know each What additional basic software needs to be installed before the software is installed. That is to say, first use the analysis tool to analyze all RPM files on the server, and then record the analysis. As long as the recorded files are queried when installing or upgrading, you can know all the associated software. So the basic workflow of YUM is as follows:

Server side: All RPM software packages are stored on the server, and then the dependencies of each RPM file are analyzed using relevant functions, and these data are recorded into files. Stored in a specific directory on the server.

Client: If you need to install a certain software, first download the dependency file recorded on the server (can be through WWW or FTP), analyze the record data downloaded by the server, and then obtain all All relevant software can be downloaded and installed at once.

vi /etc/yum.conf
[main]
cachedir=/var/cache/yum
#cachedir:yum缓存的目录,yum在此存储下载的rpm包和数据库,一般是/var/cache/yum。
debuglevel=2
#debuglevel:除错级别,0──10,默认是2 貌似只记录安装和删除记录
logfile=/var/log/yum.log
pkgpolicy=newest

#pkgpolicy: Package policy. There are two options, newest and last. This function is if you set up multiple repositories, and the same software exists in different repositories at the same time, which one yum should install. If it is newest, yum will install the latest version. . If it is last, yum will sort the server IDs alphabetically and select the last one to install the software on the server. Generally choose the newest.

distroverpkg=centos-release

#Specify a software package, and yum will determine your release version based on this package. The default is redhat-release, or it can be any installed version for your own release. rpm package.

tolerant=1

#tolerent, there are also two options, 1 and 0, indicating whether yum tolerates errors related to software packages on the command line. For example, if you want to install 1, 2, 3 packages, and 3 of them have been installed before. If you set it to 1, yum will not show an error message. The default is 0.

exactarch=1
#exactarch,有两个选项1和0,代表是否只升级和你安装软件包cpu体系一致的包,如果设为1,则如你安装了一个i386的rpm,则yum不会用1686的包来升级。
retries=20
#retries,网络连接发生错误后的重试次数,如果设为0,则会无限重试。
obsoletes=1
gpgcheck=1
#gpgchkeck= 有1和0两个选择,分别代表是否是否进行gpg校验,如果没有这一项,默认是检查的。
reposdir=/etc/yy.rm #默认是 /etc/yum.repos.d/ 低下的 xx.repo后缀文件

#It will be included by default. That is to say, /etc/yum.repos.d/xx.repo no matter how many configuration files there are and how many [name] there are in each, they will all be integrated into one in the end. It can be seen that the repeated [name] behind it overwrites the previous

exclude=xxx

#exclude to exclude certain software from the upgrade list. You can use wildcards. Each item in the list must be separated by spaces. This is useful for installation. For example, beautification package, Chinese patch is especially useful for friends.

keepcache=[1 or 0]

# Setting keepcache=1, yum retains cached headers and packages after successfully installing the package. The default value is keepcache=0. Do not save

reposdir=[包含 .repo 文件的目录的绝对路径]

#. This option allows the user to specify the absolute path of the .repo file. The .repo file contains information about the software repository (same as the [repository] section in the /etc/yum.conf file).

Part 2:

vi /etc/yum.repo.d/xx.repo

In fact, this field can also be configured directly in yum.conf

[serverid]

#where serverid is used for To distinguish between different repositories, there must be a unique name. Repeatedly, the front covers the back - or the other way around? ? ? Using enabled to test is to overwrite the previous

name=Some name for this server

#name, which is a description of the repository and supports variables like $releasever $basearch; name=Fedora Core $releasever - $basearch - Released Updates

baseurl=url://path/to/repository/

#The baseurl is the most important part of the server settings. Only when the settings are correct can the software be obtained from it. Its format is:

baseurl=url://server1/path/to/repository/
url://server2/path/to/repository/
url://server3/path/to/repository/

#The url supports three protocols: http:// ftp:// file://. The baseurl can be followed by multiple URLs. You can change it to a faster mirror site yourself, but there can only be one baseurl, which means it cannot be in the following format:

baseurl=url://server1/path/to/repository/
baseurl=url://server2/path/to/repository/
baseurl=url://server3/path/to/repository/

The directory pointed to by the url must be this The upper level of the repository header directory, it also supports variables such as $releasever $basearch.

#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch

#The above line specifies the address list of a mirror server, which is usually enabled. In this example, a comment symbol is added to disable it. We can try to replace $releasever and $basearch with their corresponding versions and Architectures, such as 10 and i386, are opened in a browser and we can see a long list of available mirror server addresses.

You can add multiple options after the url, such as gpgcheck, exclude, failovermethod, etc., for example:

gpgcheck=1

exclude=gaim

# Among them, gpgcheck and exclude have the same meaning as the [main] part, but they only work on this server.

failovermethod=priority

#failovermethode has two options: roundrobin and priority, which mean there are When there are multiple URLs to choose from, the order selected by yum and roundrobin are randomly selected. If the connection fails, the next one is used, and the cycle is repeated. Priority starts from the first one according to the order of the URLs. If not specified, the default is roundrobin.

enabled=[1 or 0]

#When a software repository is configured as enabled=0, yum will not use the repository as a software package when installing or upgrading software packages. Provide source. Using this option, the software repository can be enabled or disabled.

#You can also easily enable and disable specified software repositories through yum's --enablerepo=[repo_name] and --disablerepo=[repo_name] options, or through PackageKit's "Add/Remove Software" tool.

Several variables

$releasever, the release version, is obtained from the distroverpkg in the [main] section. If not, it is judged based on the redhat-release package.

$arch, cpu system, such as i686, athlon, etc.

$basearch, the basic system group of cpu, such as i686 and athlon both belong to i386, alpha and alphaev6 both belong to alpha.

After the yum.conf setting is completed, we can fully experience the convenience brought by yum.

There is one more thing that has not been done. That is to import the GPG key of each repository. As mentioned before, yum can use gpg to verify the package to ensure the integrity of the downloaded package, so we first need to go to each repository site to find the gpg key, which is usually placed prominently on the homepage. Location, some plain text files with names such as RPM-GPG-KEY.txt, download them, and then use the rpm --import xxx.txt command to import them. It is best to import the GPG-KEY that comes with the distribution. rpm --import /usr/share/doc/redhat-release-*/RPM-GPG-KEY is used for official software upgrades.

Recommended learning: "linux video tutorial"

The above is the detailed content of what is linux repo. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Heart of Linux: The 5 Core ComponentsThe Heart of Linux: The 5 Core ComponentsApr 13, 2025 am 12:15 AM

The five core components of Linux are kernel, shell, file system, system library and system tools. 1. The kernel manages hardware resources and provides services to the application. 2. Shell serves as the interface between the user and the system, interprets and executes commands. 3. The file system is responsible for the storage and organization of data. 4. The system library provides precompiled functions to provide program calls. 5. System tools are used for system management and maintenance. These components work together to give Linux powerful functionality and flexibility.

How to check Debian OpenSSL configurationHow to check Debian OpenSSL configurationApr 12, 2025 pm 11:57 PM

This article introduces several methods to check the OpenSSL configuration of the Debian system to help you quickly grasp the security status of the system. 1. Confirm the OpenSSL version First, verify whether OpenSSL has been installed and version information. Enter the following command in the terminal: If opensslversion is not installed, the system will prompt an error. 2. View the configuration file. The main configuration file of OpenSSL is usually located in /etc/ssl/openssl.cnf. You can use a text editor (such as nano) to view: sudonano/etc/ssl/openssl.cnf This file contains important configuration information such as key, certificate path, and encryption algorithm. 3. Utilize OPE

How to build a Hadoop development environment on DebianHow to build a Hadoop development environment on DebianApr 12, 2025 pm 11:54 PM

This guide details how to build a Hadoop development environment on a Debian system. 1. Install Java Development Kit (JDK) First, install OpenJDK: sudoaptupdatesudoaptininstallopenjdk-11-jdk-yConfigure JAVA_HOME environment variable: sudonano/etc/environment at the end of the file (adjust the path according to the actual JDK version): JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64" Save and exit, and then execute: source/etc

How to do Hadoop resource management on DebianHow to do Hadoop resource management on DebianApr 12, 2025 pm 11:51 PM

Effectively managing Hadoop resources on the Debian system requires the following steps: Hadoop deployment: First, complete the installation and configuration of Hadoop on the Debian system. This includes necessary operations such as downloading Hadoop distribution packages, decompressing, setting environment variables, etc. Cluster configuration: After the installation is completed, configure the Hadoop cluster, covering the settings of HDFS (Hadoop distributed file system) and YARN (YetAnotherResourceNegotiator). You need to modify the core configuration file, such as: core-site.xml, hdfs-site.xml, mapred-site.x

What are the security settings for Debian Tomcat logs?What are the security settings for Debian Tomcat logs?Apr 12, 2025 pm 11:48 PM

To improve the security of DebianTomcat logs, we need to pay attention to the following key policies: 1. Permission control and file management: Log file permissions: The default log file permissions (640) restricts access. It is recommended to modify the UMASK value in the catalina.sh script (for example, changing from 0027 to 0022), or directly set filePermissions in the log4j2 configuration file to ensure appropriate read and write permissions. Log file location: Tomcat logs are usually located in /opt/tomcat/logs (or similar path), and the permission settings of this directory need to be checked regularly. 2. Log rotation and format: Log rotation: Configure server.xml

How to interpret warnings in Tomcat logsHow to interpret warnings in Tomcat logsApr 12, 2025 pm 11:45 PM

Warning messages in the Tomcat server logs indicate potential problems that may affect application performance or stability. To effectively interpret these warning information, you need to pay attention to the following key points: Warning content: Carefully study the warning information to clarify the type, cause and possible solutions. Warning information usually provides a detailed description. Log level: Tomcat logs contain different levels of information, such as INFO, WARN, ERROR, etc. "WARN" level warnings are non-fatal issues, but they need attention. Timestamp: Record the time when the warning occurs so as to trace the time point when the problem occurs and analyze its relationship with a specific event or operation. Context information: view the log content before and after warning information, obtain

How Tomcat logs help troubleshoot memory leaksHow Tomcat logs help troubleshoot memory leaksApr 12, 2025 pm 11:42 PM

Tomcat logs are the key to diagnosing memory leak problems. By analyzing Tomcat logs, you can gain insight into memory usage and garbage collection (GC) behavior, effectively locate and resolve memory leaks. Here is how to troubleshoot memory leaks using Tomcat logs: 1. GC log analysis First, enable detailed GC logging. Add the following JVM options to the Tomcat startup parameters: -XX: PrintGCDetails-XX: PrintGCDateStamps-Xloggc:gc.log These parameters will generate a detailed GC log (gc.log), including information such as GC type, recycling object size and time. Analysis gc.log

What is the impact of Debian Apache log on server performanceWhat is the impact of Debian Apache log on server performanceApr 12, 2025 pm 11:39 PM

The impact of Apache logs on server performance under the Debian system is a double-edged sword, which has both positive effects and potential negative effects. Positive aspect: Problem diagnosis tool: Apache log records all requests and responses in detail on the server, and is a valuable resource for quickly locating faults. By analyzing the error log, configuration errors, permission issues, and other exceptions can be easily identified. Security Monitoring Sentinel: Access logs are able to track potential security threats, such as malicious attack attempts. By setting log audit rules, abnormal activities can be effectively detected. Performance Analysis Assistant: Access logging request frequency and resource consumption to help analyze which pages or services are most popular, thereby optimizing resource allocation. Combined with top or htop, etc.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Atom editor mac version download

Atom editor mac version download

The most popular open source editor