what is linux repo

Mar 25, 2023 am 09:08 AM
linux repo

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
Copy after login

#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后缀文件
Copy after login

#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
Copy after login

#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]
Copy after login

# 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 文件的目录的绝对路径]
Copy after login

#. 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
Copy after login

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
Copy after login

#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/
Copy after login

#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/
Copy after login

#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/
Copy after login

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 of this Website
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

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 ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Unable to log in to mysql as root Unable to log in to mysql as root Apr 08, 2025 pm 04:54 PM

The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

C language conditional compilation: a detailed guide for beginners to practical applications C language conditional compilation: a detailed guide for beginners to practical applications Apr 04, 2025 am 10:48 AM

C language conditional compilation is a mechanism for selectively compiling code blocks based on compile-time conditions. The introductory methods include: using #if and #else directives to select code blocks based on conditions. Commonly used conditional expressions include STDC, _WIN32 and linux. Practical case: Print different messages according to the operating system. Use different data types according to the number of digits of the system. Different header files are supported according to the compiler. Conditional compilation enhances the portability and flexibility of the code, making it adaptable to compiler, operating system, and CPU architecture changes.

【Rust Self-study】Introduction 【Rust Self-study】Introduction Apr 04, 2025 am 08:03 AM

1.0.1 Preface This project (including code and comments) was recorded during my self-taught Rust. There may be inaccurate or unclear statements, please apologize. If you benefit from it, it's even better. 1.0.2 Why is RustRust reliable and efficient? Rust can replace C and C, with similar performance but higher security, and does not require frequent recompilation to check for errors like C and C. The main advantages include: memory security (preventing null pointers from dereferences, dangling pointers, and data contention). Thread-safe (make sure multi-threaded code is safe before execution). Avoid undefined behavior (e.g., array out of bounds, uninitialized variables, or access to freed memory). Rust provides modern language features such as generics

How to solve mysql cannot be started How to solve mysql cannot be started Apr 08, 2025 pm 02:21 PM

There are many reasons why MySQL startup fails, and it can be diagnosed by checking the error log. Common causes include port conflicts (check port occupancy and modify configuration), permission issues (check service running user permissions), configuration file errors (check parameter settings), data directory corruption (restore data or rebuild table space), InnoDB table space issues (check ibdata1 files), plug-in loading failure (check error log). When solving problems, you should analyze them based on the error log, find the root cause of the problem, and develop the habit of backing up data regularly to prevent and solve problems.

What are the 5 basic components of Linux? What are the 5 basic components of Linux? Apr 06, 2025 am 12:05 AM

The five basic components of Linux are: 1. The kernel, managing hardware resources; 2. The system library, providing functions and services; 3. Shell, the interface for users to interact with the system; 4. The file system, storing and organizing data; 5. Applications, using system resources to implement functions.

Can mysql run on android Can mysql run on android Apr 08, 2025 pm 05:03 PM

MySQL cannot run directly on Android, but it can be implemented indirectly by using the following methods: using the lightweight database SQLite, which is built on the Android system, does not require a separate server, and has a small resource usage, which is very suitable for mobile device applications. Remotely connect to the MySQL server and connect to the MySQL database on the remote server through the network for data reading and writing, but there are disadvantages such as strong network dependencies, security issues and server costs.

Where is the C language function library? How to add the C language function library? Where is the C language function library? How to add the C language function library? Apr 03, 2025 pm 11:39 PM

The C language function library is a toolbox containing various functions, which are organized in different library files. Adding a library requires specifying it through the compiler's command line options, for example, the GCC compiler uses the -l option followed by the abbreviation of the library name. If the library file is not under the default search path, you need to use the -L option to specify the library file path. Library can be divided into static libraries and dynamic libraries. Static libraries are directly linked to the program at compile time, while dynamic libraries are loaded at runtime.

Solutions to the errors reported by MySQL on a specific system version Solutions to the errors reported by MySQL on a specific system version Apr 08, 2025 am 11:54 AM

The solution to MySQL installation error is: 1. Carefully check the system environment to ensure that the MySQL dependency library requirements are met. Different operating systems and version requirements are different; 2. Carefully read the error message and take corresponding measures according to prompts (such as missing library files or insufficient permissions), such as installing dependencies or using sudo commands; 3. If necessary, try to install the source code and carefully check the compilation log, but this requires a certain amount of Linux knowledge and experience. The key to ultimately solving the problem is to carefully check the system environment and error information, and refer to the official documents.

See all articles