Task 8 Configuration of the YUM source and YUM installation of the software

YUM is a shell front-end package manager in Fedora and RedHat and Centosz. Based on rprn package management, it can automatically download and install the ram package from the specified server, and can automatically handle the dependency relationship, and the package packaged in this way does not need to be downloaded and installed again and again.

The key point of YUM is to have a reliable repository, that is, a software repository. It can be an http or ftp site, or a local software pool, but the header of the ram must include various information of the rpm package, including description. , features, provided files, dependencies, etc. It is these headers that are collected and analyzed that automate the task.

Subtask 1: Configure the local YUM source

In the installation CD of the Centos system, there are many software packages that we commonly use, which is very convenient to use. In an environment without an external network, we only need to build a local YUM source to install most of the software. Enter command query.

Step 1: View the YUM source installed by default in the system

When installing the Centos operating system, YUM is basically installed by default, and no additional installation is required, just enter the command to query.

(rpm -qa yum) View the installed YUM main program.

(rpm -qa | grep yum) View installed YUM related programs.

Step 2: Mount the system installation CD

Put the CD into the CD-ROM drive, and then use the (mount /dev/cdrom /mnt/) command to mount the CD on the commonly used mount point /mnt. After the installation is successful, you will see the files on the CD in the /mnt directory.

Step 3: Backup the default YUM configuration file

Before modifying the configuration file, back up the files to be modified and develop good engineering habits.

(cd /etc/yum.repos.d) to enter the YUM configuration directory.

ls will see the default 4 configuration files with repo extension of the Centos system.

[makdir /etc/yum.repos.d/bak]/Create a backup folder.

[mv /etc/yum.repos.d/C ent */etc/yum.repos.d//bak] Backup the original configuration file and move the original configuration file to the backup folder.

Step 4: Edit your own repo file

Use the following command to create a new YUM source of your own.

[vim/etc/yum.repos.d/local.repo] Create a new local. repo file.

[local_server] #YUM library name

name=this is a local repo #name description

baseur1=file:///mnt/ #YUM address, the mount point of the disc

enabled=1 #Whether to enable the YUM source, 0 is not enabled

gpgcheck=1 #Check GPG-KEY, 0 means no check, 1 means check

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Centos-6 #gpgcheck=0 No configuration required

Then press the Esc key, then enter [:wq] to save and exit. Finally, just use the [yum list] command to update the YUM configuration to view the configured YUM source.

Step 5: Summarize the format of the repo file

All repository server settings should follow the format below.

【Servers】

name=Some name for this server

baseurr1 = ur1: // path/to/repository/

serverid is used to distinguish different repositories, and must have a unique name: name is the description of the repository, and supports variables such as $releasever and $basearch; baseurl is the most important part of the server settings, and only when the settings are correct can Get the software from above. Its format is;

baseur1 = ur1: // server1/path/repository/

               ur1://server2/path/repository/

               ur1://server3/path/repository/

Among them, ur1 supports three kinds of protocols: http://, ftp://, file://. After baseur1, multiple ur1s can be followed, and users can change to a faster mirror station by themselves, but there can only be one baseur1, which means it cannot be in the following format.

baseur1 = ur1: // server1/path/repository/

 baseur1  = ur1: // server2/path/repository/

 baseur1  = ur1: // server3/path/repository/

Among them, the directory pointed to by ur1 must be the upper level of the repository header directory, and it also supports variables such as $releasever and $baserch.

Step 6: Install the software using the YUM source

The [yum] command with the parameter install means to install the specified software.

[yum install -y dialog] Install the dialog software through the YUM source.

[yum install yum -fastestmirror] Automatically search for the fastest mirror plugin.

[yum install yumex] Install the YUM graphical window plug-in.

[yum localinstall -y dialog] Install the local rpm package dialog.

-h: show help information

-y: answer "yes" to all questions

-c: specify the configuration file

-q: quiet mode

-v: verbose mode

-d: Set the debug level (0~10)

-e: set error level (0~10)

-R: Set the maximum wait time for YUM to process a command

-C: Run entirely from the cache without downloading or updating header files.

Step 7: Update Software Using YUM

The [yum] command paired with the parameter update means to update the specified software. The detailed usage and explanation are as follows.

[yum update -y dialog] Update the dialog package.

[yumcheck-update -y dialog] Check if there is an update dialog package available.

     [yumlocalupdate -y dialog] If there is a new version of dialog and it is also downloaded locally, you can update the dialog locally in this way.

     [yumupdate] Update all YUM sources.

Step 9: Other options of the [YUM] command

     [yumlist dialog] displays the information of the dialog package.

     [yumsearch dialog] Check the dialog package information.

     [yuminfo dialog] Displays the description and summary information of the specified dialog package.

     [yumclean] Clean up the expired cache of YUM.

     [yumshell] Enter the shell prompt of YUM.

     [yumresolvedep dialog] Displays the dependencies of the dialog package.

     [yumdeplist dialog] Displays all dependencies of the dialog package.

     [yumclean packages] Clear the packages in the cache directory.

     [yumclean headers] Clear the headers in the cache directory.

     [yumclean oldheaders] Clear the old headers in the cache directory. Step 10: Query the installed dialog software Software       installed through YUM, still use the [rpm] command to query the installation status of the software.
 



    [rpm -qa dialog] Query dialog software installation information.

[Subtask 2] Configure the YUM source on the domestic network. The

local YUM source address points to the CD. However, the software in the CD is limited after all, and the default YUM source (Red Hat's official YUM source) is often unsatisfactory in speed. In order to achieve the purpose of fast installation, it is sometimes necessary to point the YUM source to a domestic address.

Step 1: Configure Shanghai Jiaotong University YUM source 

       Modify /etc/yum.repos.d/CentOS-Base.repo to the following content.

  Step 2: List        of       Enterprise

      YUM Sources  University:                 http://mirror.bit.edu.cn (IPv4 only)                 http://mirror.bit6.edu.cn (IPv6 only)       Beijing Jiaotong University:                 http://mirror.bjtu.edu.cn (IPv4 only ) )                 http://mirror6.bjtu.edu.cn (IPv6 only)                 http://debian.bjtu.edu.cn (IPv4+IP





























Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324398990&siteId=291194637