What should I do if the error occurs when CentOS 5.4 adds or removes an application?

  

In CentOS 5.4, there was an error message when adding or removing software. Adding or deleting software was unsuccessful at the time, which caused some troubles for many people. The following small series will introduce you to CentOS 5.4. A solution to the error when deleting or adding an application.

After booting, put the CentOS installation disk into the CD-ROM drive and enter the /var/ftp directory. It is also possible to enter other directories.

Execute dd if=/dev/cdrom of=/var/ftp/centos.iso

or cat /dev/cdrom ” /var/ftp/centos.iso

The above two instructions execute any one. The meaning is to write the contents of the CD-ROM drive to the centos.iso file in the /var/ftp directory.

For /var/ftp/centos.iso, /var/ftp is the directory where the disc image file centos.iso is saved, and centos.iso is the name of the image file created. These contents are to be written according to the individual's situation.

For example, if you want to save an image file on your desktop, write

dd if=/dev/cdrom of=~/Desktop/centos.iso

Or cat /dev/cdrom ” ~/Desktop/centos.iso

If the image file wants to use other names such as linux.iso,

dd if=/dev/cdrom of=/Var/ftp/linux.iso

or cat /dev/cdrom ” /var/ftp/linux.iso

This step is not required, but it is recommended to do it. When you need to install the software in the future, you don't have to put the disc in advance. And this step may take a little longer. Need to wait patiently.

Do a trigger mount while waiting. That is to say, create a directory. After entering the directory, enter the ls command to immediately display the contents of the CD image.

Open a new terminal,

Assuming the trigger mount directory is /yum/iso then

mkdir /yum

Open /etc/auto. Master file, add one in it:

/yum /etc/auto.img

Save and exit.

Create a new file /etc/auto.img

Write in the file:

iso -fstype=iso9660,loop :/var/ftp/centos.iso Save and exit

Note here:

For the /etc/auto.master file, add the content: /yum is the first half of the directory/yum/iso that triggers the mount. The second half of /etc/auto.img is a new file that you need to create yourself.

For the new file /etc/auto.img, the content inside: iso -fstype=iso9660, loop :/var/ftp/centos.iso is the first iso is triggered after the mount directory Half part. The last /var/ftp/centos.iso is the directory where your CD image file is located and the name of the image file itself. Reminder: In the /etc/auto.img file, in the newly added content, there is no character in front of the leftmost iso. Don't write /iso that red /is superfluous, for the middle part, -fstype=iso9660, the red one of the beginning of the loop - is needed. For the content on the right side, just remember to copy it as it is. For the right side: /var/ftp/centos.iso, a red colon is also required.

Now, let's see if the image file has been created. The method is to go back to the terminal where the image file was originally created, and see if there is something like [root @localhost ~] # in the terminal, if the description is completed. You can proceed to the next step

Enter service autofs restart

Then, cd /yum/iso

ls If the above steps are correct, you can see the contents of the CD image.

Now go to the /etc/yum.repos.d directory

There are two files in this directory. One is CentOS-Base.repo and the other is CentOS-Media.repo

The first file CentOS-Base.repo is responsible for the installation source management in the network environment, if your yum source is needed on the network Use a service such as ftp HTTP to properly install the software, please use it. And your yum source is CentOS-Media.repo on this machine, CentOS-Media.repo is renamed CentOS-Media.repo.bak

Here, since the CD image file has been created, Then use the CentOS-Media.repo file and change the name of CentOS-Base.repo. As long as it is not a suffix with .repo. For example, rename it to CentOS-Base.repo.bak or move CentOS-Base.repo to another directory.

Now open the CentOS-Base.repo file and edit it inside
Previous12Next page Total 2 pages

Copyright © Windows knowledge All Rights Reserved