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 5 Core Components of the Linux Operating SystemThe 5 Core Components of the Linux Operating SystemMay 08, 2025 am 12:08 AM

The five core components of the Linux operating system are: 1. Kernel, 2. System libraries, 3. System tools, 4. System services, 5. File system. These components work together to ensure the stable and efficient operation of the system, and together form a powerful and flexible operating system.

The 5 Essential Elements of Linux: ExplainedThe 5 Essential Elements of Linux: ExplainedMay 07, 2025 am 12:14 AM

The five core elements of Linux are: 1. Kernel, 2. Command line interface, 3. File system, 4. Package management, 5. Community and open source. Together, these elements define the nature and functionality of Linux.

Linux Operations: Security and User ManagementLinux Operations: Security and User ManagementMay 06, 2025 am 12:04 AM

Linux user management and security can be achieved through the following steps: 1. Create users and groups, using commands such as sudouseradd-m-gdevelopers-s/bin/bashjohn. 2. Bulkly create users and set password policies, using the for loop and chpasswd commands. 3. Check and fix common errors, home directory and shell settings. 4. Implement best practices such as strong cryptographic policies, regular audits and the principle of minimum authority. 5. Optimize performance, use sudo and adjust PAM module configuration. Through these methods, users can be effectively managed and system security can be improved.

Linux Operations: File System, Processes, and MoreLinux Operations: File System, Processes, and MoreMay 05, 2025 am 12:16 AM

The core operations of Linux file system and process management include file system management and process control. 1) File system operations include creating, deleting, copying and moving files or directories, using commands such as mkdir, rmdir, cp and mv. 2) Process management involves starting, monitoring and killing processes, using commands such as ./my_script.sh&, top and kill.

Linux Operations: Shell Scripting and AutomationLinux Operations: Shell Scripting and AutomationMay 04, 2025 am 12:15 AM

Shell scripts are powerful tools for automated execution of commands in Linux systems. 1) The shell script executes commands line by line through the interpreter to process variable substitution and conditional judgment. 2) The basic usage includes backup operations, such as using the tar command to back up the directory. 3) Advanced usage involves the use of functions and case statements to manage services. 4) Debugging skills include using set-x to enable debugging mode and set-e to exit when the command fails. 5) Performance optimization is recommended to avoid subshells, use arrays and optimization loops.

Linux Operations: Understanding the Core FunctionalityLinux Operations: Understanding the Core FunctionalityMay 03, 2025 am 12:09 AM

Linux is a Unix-based multi-user, multi-tasking operating system that emphasizes simplicity, modularity and openness. Its core functions include: file system: organized in a tree structure, supports multiple file systems such as ext4, XFS, Btrfs, and use df-T to view file system types. Process management: View the process through the ps command, manage the process using PID, involving priority settings and signal processing. Network configuration: Flexible setting of IP addresses and managing network services, and use sudoipaddradd to configure IP. These features are applied in real-life operations through basic commands and advanced script automation, improving efficiency and reducing errors.

Linux: Entering and Exiting Maintenance ModeLinux: Entering and Exiting Maintenance ModeMay 02, 2025 am 12:01 AM

The methods to enter Linux maintenance mode include: 1. Edit the GRUB configuration file, add "single" or "1" parameters and update the GRUB configuration; 2. Edit the startup parameters in the GRUB menu, add "single" or "1". Exit maintenance mode only requires restarting the system. With these steps, you can quickly enter maintenance mode when needed and exit safely, ensuring system stability and security.

Understanding Linux: The Core Components DefinedUnderstanding Linux: The Core Components DefinedMay 01, 2025 am 12:19 AM

The core components of Linux include kernel, shell, file system, process management and memory management. 1) Kernel management system resources, 2) shell provides user interaction interface, 3) file system supports multiple formats, 4) Process management is implemented through system calls such as fork, and 5) memory management uses virtual memory technology.

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft