Preface
What method do you use to manage your rpm, install it from an optical disk, download and install it from the network, or maintain it using Red Hat's up2date (Red Hat Network, but you can have a better choice -- Apt
I. Introduction
RedHat adopts the RPM software package management system. The RPM software package management system has powerful compilation and installation functions. However, due to historical reasons, the RPM software package management system has no internal definition of dependencies between software, this often causes incomprehensible software dependencies when installing RPM software.
Debian systems manage software packages based on the advanced packaging tool, which can automatically solve and install dependent software packages. Therefore, Debian Linux is considered the easiest system to manage and upgrade, APT is also considered to be one of the best software package management tools at present. To solve the critical problem of the RedHat package management system, conectiva Linux transplanted the apt system to the Linux system using the RPM package management system, the RPM software package-based system can use the apt tool to automatically resolve dependency. At present, there are many sites that provide apt update management software packages for Redhat Linux, such as http://freshrpms.net, http://apt.unl.edu and so on, making RedHat one of the releases that can use apt tool, this article describes how to install and use apt software package management tools in RedHat Linux.
For a general understanding of the features of the apt tool, the following describes several instances using the apt with RPM management system:
(1) When a software package is deleted, the related software package is automatically deleted:
[Root @ linux root] # apt-Get remove Nessus-common
2) automatically download and install the dependency package:
[Root @ linux root] # apt-Get install Nessus-Server
(3) maintain system software and automatically update the system:
[Root @ linux root] # apt-Get upgrade
Ii. Simple apt Operation Principle
After the apt kit is installed on our machine, it becomes the apt user end. When we install and upgrade the RPM, in fact, all are connected to a remote apt server through the network to download the rpm for installation. We can specify the apt server, APT users can also become apt servers at the same time (in section 2, we will talk about the setup of APT servers)
Apt-Get updateThe command synchronizes the RPM index list (package list) of the user and APT server. The RPM index list of the apt server is placed in the base folder (the base folder is composedGenbasedirAfter the user computer obtains the bz2 RPM index list compressed file in the base folder, it will be decompressed and placed in/var/State/APT/lists/, while the user usesApt-Get installOrApt-Get dist-UpgradeThe command compares the information in this folder with the RPM database on the user's computer, so that you can know that the RPM has been installed, not installed, or can be upgraded, so once the RPM in the apt Server Changes, remember to useGenbasedirCommand to generate a new RPM index list.
3. Install apt with rpm and its graphic interface front-end synaptic
The following describes how to download and install apt with RPM.
APT with rpm can be downloaded directly to the [url] http://freshrpms.net [/url], which currently provides RedHat 6.2, 7. for software upgrade services of x and 8.0, the following are some common RedHat versions of APT:
RedHat 6.2
Http://ftp.freshrpms.net/pub/freshrpms/redhat/6.2/apt/apt-0.5.4cnc7-fr0.62.1.i386.rpm
RedHat 7.2
Http://ftp.freshrpms.net/pub/freshrpms/redhat/7.2/apt/apt-0.3.19cnc55-fr7.i386.rpm
RedHat 7.3
Http://ftp.freshrpms.net/pub/freshrpms/redhat/7.3/apt/apt-0.5.4cnc9-fr0.1.rh73.i386.rpm
RedHat 8.0
Http://ftp.freshrpms.net/pub/freshrpms/redhat/8.0/apt/apt-0.5.4cnc9-fr1.i386.rpm
RedHat 9.0
Http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/apt-0.5.5cnc6-fr1.i386.rpm
After downloading the file, run the RPM command to install the file:
[Root @ linux root] # rpm-ihv apt-0.5.4cnc9-fr1.i386.rpm
Freshrpms.net also provides a graphical apt-RPM interface synaptic, which is more convenient to use. After APT is installed, you can directly use apt to install synaptic:
[Root @ linux root] # apt-Get update
[Root @ linux root] # apt-Get install synaptic
After several lines of prompts, synaptic will be installed. In the XWindow window, synaptic will appear in the system settings menu. [Fixme: Where does synaptic of RedHat 7.x appear?]
Iii. Use Apt
The use of APT in RedHat is almost the same as that in Debian. The configuration file is in/etc/APT /, you can use and update the RPM update and freshrpms.net updates provided by RedHat after installing apt as described earlier. Run the following command:
(1) update the software list to obtain the Software List and dependency list on the remote RPM server. All available software is in/etc/APT/sources. list. Most download operation addresses are also defined here.
[Root @ linux root] # apt-Get update
(2) Check the legitimacy of local software dependency. Due to RPM system problems, many systems may have some dependency problems. Run the following command to check the dependency, at the same time, Apt-Get provides some repair solutions. Only when the local machine has no dependency problems can apt-rpm be used well. A newly installed clean system does not have dependency issues.
[Root @ linux root] # apt-Get check
(3) install or upgrade a new software
[Root @ linux root] # apt-Get install package-name
Package-name is the first part of the RPM package name and does not contain the version number. If you select a different processor type, you can add an identifier such as @ i686.
(4) upgrade all System Software
[Root @ linux root] # apt-Get upgrade
(5) comprehensive upgrade, more intelligent upgrade than upgrade, and solving some dependencies during upgrade
[Root @ linux root] # apt-Get dist-Upgrade
(6) uninstall software and dependency Software
[Root @ linux root] # apt-Get remove package-name
(7) Clear the local RPM package. After downloading the RPM package, save it under/var/Cache/APT/archieves. This command clears the RPM file that has been downloaded and installed.
[Root @ linux root] # apt-Get clean
All the above commands can be completed through the front-end software synaptic of the graphic interface. The graphic software is more intuitive to use. After understanding the main commands above, you can use synaptic without any difficulty, therefore, this article will not describe how to use synaptic.
4. Custom apt-rpm
(1) Add a software resource list
It is very easy to add software resources to the APT-RPM system. You only need to add a description of the website in/etc/APT/sources. list according to the instructions of the server that provides the apt service.
The parameter format of this line is:
Rpm URI distribution [component1] [componenent2] [...]
The URI is the address of the software resource, which can be the URL address such as HTTP, FTP, and file, and the distribution is the release version of RedHat, such as 7.2, 7.3, and 8.0. The component can be ignored later. Sometimes you may only be interested in one or more parts of a software resource.
For example, to add a test package for http://apt.unl.edu/provided RedHat KDE 3.1, you only need to add a line in sources. List:
Rpm ftp://apt.unl.edu/apt/ 8.0 kde3-test
Add the kde3 part of the website to the list.
The following is a list of APT-RPM software resources that can be used for Redhat, and add them to your/etc/APT/sources. the list file can be updated and maintained using the RedHat software provided by APT-rpm. For more information, see the website description. (The previous is the website name, followed by the applicable RedHat version and Introduction)
Http://apt.freshrpms.net/-Red Hat Linux 6.2, 7.x, 8.0and 9.0 repositories (with all freshrpms sorted DED of course !)
Http://www.linux.cz/apt-rpm/-Red Hat Linux 7.x repositories (with all freshrpms encoded too !)
Http://apt-rpm.tuxfamily.org/-Red Hat Linux 6.2, 7.x, 8.0and 9.0 Repositories
Http://apt.nlc.no/apt/-Red Hat Linux 6.2, 7.x and rawhide Repositories
Http://ftp.uninett.no/pub/linux/apt/-Red Hat Linux 6.2, 7.x, 8.0and 9.0 and rawhide Repositories
Http://redhat.usu.edu/-Red Hat Linux 7.2, 7.3 and 8.0 Repositories
Ftp://mirror.pa.msu.edu/apt/-Red Hat Linux 7.2, 7.3 and 8.0 Repositories
Http://apt-rpm.codefactory.se/-Red Hat Linux 7.2, 7.3 and 8.0 and gnomehide Repositories
Http://apt.42h.de/-Red Hat Linux 7.2, 7.3 and 8.0 Repositories
Http://apt.toggletext.com.au/-a few Red Hat Linux 7.2 packm packages
Http://people.ecsc.co.uk /~ Matt/repository.html-lots of custom Red Hat Linux 8.0 GNOME 2 and related packages
Http://ftp-stud.fht-esslingen.de/apt/-Red Hat Linux 7.x, 8.x and rawhide
Http://apt.unl.edu/-Red Hat Linux 7.3 and 8.0
Http://kde-redhat.sourceforge.net/-KDE for Red Hat Project
(2) Add the RedHat installation disk to the software source
Sometimes you need to install and uninstall the software from the RedHat CD or ISO file. In this case, you can set the RedHat CD as the software source. In this way, you must first scan the software package on the CD and create a CD Software List in the/var/lib/APT/CDROMs. list file.
If you use a RedHat disc, you only need to insert the disc into the optical drive. The following command will automatically mount the disc and create a list
[Root @ linux root] # apt-CDROM add
If you use the ISO file for installation, first mount the ISO file to the Mount-point and input the mount point to automatically search for the RPM Software List.
[Root @ linux root] # apt-CDROM-m-D Mount-point add
If you want to install the unlocked hard disk image, you only need to input the path to automatically search for the RPM Software List.
[Root @ linux root] # apt-CDROM-m-D path add
5. Set up a simple apt server (RedHat 9 is explained here)
Note: before performing the following operations, make sure that your Apache is running normally and/var has at least 2 GB space.
1. Why should I set up an apt server?
When we install apt of freshrpms, the installation and upgrade are all online to freshrpms to download files. It would be nice to maintain only one server, but if there are ten servers, It would take 10 times the original time and bandwidth to do the same thing, plus if the external connection (United States) the bandwidth is not enough, so it seems to be a good choice to set up an apt server when multiple servers need to be maintained.
2. Install apt:
Http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/
Please install the latest apt on this website
Online installation:Rpm-IVHHttp://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/apt-0.5.5cnc5-fr2.i386.rpm
3. Create a folder for storing RPM related to Red Hat Linux 9
Mkdir-P/var/www/html/RedHat/9
Mkdir/var/www/html/RedHat/9/RPMs. OS
Mkdir/var/www/html/RedHat/9/RPMs. Updates
4. Copy the binary RPM of Red Hat Linux 9 to the/var/www/html/RedHat/9/RPMs. OS folder.
(Three methods are provided below. Please select one method based on your own situation)
Method 1: copy from an optical disk (this method can be used when there is a Red Hat Linux 9 optical disk)
Mount/mnt/CDROM
CP-F/mnt/CDROM/RedHat/RPMS/*/var/www/html/RedHat/9/RPMs. OS/
Umount/mnt/CDROM
Copy the RPM in the second and third optical disks according to the above method.
Method 2: copy from the ISO file (this method can be used when the computer has the Red Hat Linux 9 ISO file)
Mkdir/mnt/ISO
Mount-o loop shrike-i386-disc1.iso/mnt/ISO
CP/mnt/ISO/RedHat/RPMS/*/var/www/html/RedHat/9/RPMs. OS/
Umount/mnt/ISO
Mount-o loop shrike-i386-disc2.iso/mnt/ISO
CP-F/mnt/ISO/RedHat/RPMS/*/var/www/html/RedHat/9/RPMs. OS/
Umount/mnt/ISO
Mount-o loop shrike-i386-disc3.iso/mnt/ISO
CP-F/mnt/ISO/RedHat/RPMS/*/var/www/html/RedHat/9/RPMs. OS/
Umount/mnt/ISO
5. Copy the RPM of Red Hat Linux 9 updates to the/var/www/html/RedHat/9/RPMs. Updates folder.
CD/var/www/html/RedHat/9/RPMs. Updates
Wget ftp://linux.sinica.edu.tw/pub1/redhat/updates/9/en/ OS/I /*
(If the bandwidth is not high, it will take a long time. Please wait)
6. use the genbasedir command to generate the base folder and RPM index list genbasedir -- flat -- bloat -- bz2only/var/www/html/RedHat/9 OS updates: (the process takes a long time, please be patient)
Creating base directory... Done
Components: OS updates