Add APT Package management tool for Redhat

Source: Internet
Author: User
Tags mkdir

Objective

What you use to manage your RPM, from the CD-ROM installation, from the network download installation, or using Red Hat Up2date (Red Hat Network) in the maintenance, these are the solution, but you can have a better choice-APT

<?xml:namespace prefix = o ns = "Urn:schemas-microsoft-com:office:office"/>

First, Introduction
Redhat uses the RPM package management system, the RPM package management system has a powerful compiler installation function, but because of historical reasons, the RPM package management system has no internal definition of the dependencies between the software, resulting in the installation of RPM software often have an incomprehensible problem of software dependencies.
The Debian system is managed with software packages based on the APT (Advanced packaging Tool) tool that automatically resolves and installs dependent packages, so Debian Linux is considered the most manageable and upgraded system. Apt tools are also considered to be one of the best package management tools at the moment. To address the fatal problem of the Redhat package management system, Conectiva Linux ported the APT system to the Linux system using the RPM package management system, allowing the RPM software package system to utilize the automatic resolution of dependent relationships provided by apt tools. There are already a number of sites, such as Http://freshrpms.net, http://apt.unl.edu, and so on that offer the APT way to upgrade management packages for Redhat Linux, making Redhat also one of the distributions that can make use of apt tools, This article describes how to install and use the APT package management tool in Redhat Linux systems.
To get a general idea of the characteristics of apt tools, here are some examples of using APT with RPM management systems:
(1) Deleting a package automatically deletes related packages:
[Root@linux root]# apt-get Remove Nessus-common

2) Automatic Download installation Dependency pack:
[Root@linux root]# apt-get Install Nessus-server

(3) Maintenance system software, Automatic Update system:
[Root@linux root]# Apt-get Upgrade


Second, APT simple operation principle

Our machine is apt to be used as the user end of the apt kit. When we install, upgrade RPM, in fact, are through the network connected to the remote APT server to download the RPM back installed, APT server we can specify, and apt user can also become Apt Server (in the second section we will talk about the erection of apt server)

The apt-get update instruction synchronizes the RPM index list (package list) of the user side and apt server, and the RPM index list of the APT server is placed in the base folder (the base data folder is made up of Genbasedir instruction, the user-side computer obtains the BZ2 RPM index list compressed file in the base folder, and then extracts it into/var/state/apt/lists/, and the user uses apt-get install or Apt-get the Dist-upgrade instruction, the data in this folder is compared to the RPM database in the user's computer, so that the RPM is installed, not installed, or upgradeable, so once the RPM in the APT server changes , be sure to use the genbasedir instruction to generate a new RPM index list.

Third, install apt with RPM and its graphical interface front-end synaptic
Here is a brief description of how to download and install apt with rpm
Apt with RPM can be directly to [Url]http://freshrpms.net[/url] Download installation, currently the site provides Redhat 6.2, 7.x and 8.0 of the software upgrade services, below are several commonly used redhat version of the APT download address:
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
Install using RPM command after downloading:

[Root@linux root]# RPM-IHV apt-0.5.4cnc9-fr1.i386.rpm
Freshrpms.net also provides a graphical interface of the apt-rpm interface synaptic, using the graphical interface of apt more convenient, installed after apt, you can directly use APT installation synaptic:
[Root@linux root]# apt-get Update
[Root@linux root]# apt-get Install synaptic
After a few lines of prompts synaptic is installed, into the xwindow,synaptic will appear in the "System Settings" menu. [Fixme:redhat 7.x version synaptic appears. ]

Third, use apt
above redhat use apt and use under Debian almost exactly the same, configuration file in/etc/apt/, You can use and update the RPM updates provided by Redhat and the updates provided by Freshrpms.net as described in the previous installment. The main run commands are as follows:
(1) Update the software list, get the list of software and dependencies on the remote RPM server, and the download address of all available software is defined in/etc/apt/sources.list, and most of the following download operation addresses are defined here.
[root@linux root]# apt-get update
(2) checks the legality of local software dependencies, many systems may have dependencies due to problems with the RPM system, and the following command checks for dependencies, while Apt-get provides some fixes , the apt-rpm can be used well only if there is no dependency problem on this machine. A newly installed clean system will not have dependency problems.
[root@linux root]# apt-get Check
(3) installs or upgrades a new software
[root@linux root]# apt-get Install the Package-name
Package-name is the first part of the name of the RPM package, does not contain the version number, and if you choose a different processor type, you can add @i686 and so on later.
(4) Upgrade all system software
[root@linux root]# apt-get Upgrade
(5) fully upgraded to a more intelligent upgrade than upgrade, while addressing some dependencies at the time of upgrade
[Root@linux root]# apt-get Dist-upgrade
(6) Uninstall the software while uninstalling the dependent software
[root@linux root]# apt-get Remove Package-name
(7) clears the locally downloaded RPM package, After the RPM package is downloaded and saved under/var/cache/apt/archieves, this command clears the downloaded installed rpm file
[root@linux root]# apt-get Clean
All of the above commands can be completed through the front-end software Synaptic graphics interface, graphical software to use more intuitive, understand the previous several major commands, you can use synaptic without difficulty, so this article will not repeat the synaptic method of use.

Four Custom apt-rpm

(1) Add a list of software resources
It is easy to add software resources to the apt-rpm system simply by adding a description of the site to the/etc/apt/sources.list in accordance with the description of the server that provides the APT service.
The format for this line of arguments is:
RPM URI Distribution [Component1] [Componenent2] [...]
Where the URI is the address of the software resources, can be http,ftp,file, such as URL address, distribution is Redhat release version, such as 7.2,7.3,8.0 and so on, the following component can be ignored. Sometimes you may only be interested in one or more parts of a software resource, so you can clearly point out here.
For example, to add a test package for Redhat KDE 3.1 provided by http://apt.unl.edu/, just add a line to the sources.list:
RPM ftp://apt.unl.edu/apt/8.0 Kde3-test
The kde3 part of the site is added to the list.
Here are a list of apt-rpm software resources available for redhat, and adding them to your/etc/apt/sources.list file can be updated and maintained by apt-rpm using the Redhat software they provide, refer to the website description. (Front is the name of the site, 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 included of course!)
http://www.linux.cz/apt-rpm/-Red Hat Linux 7.x repositories (with all FRESHRPMS included 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 Custom 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 installation CD or ISO file, then you can set the Redhat installation CD as the software source. This works by first sweeping the package on the installation CD and creating a list of the CD software in the/var/lib/apt/cdroms.list file.
If you use the Redhat disc, just insert the CD into the CD drive, the following command automatically mount the disc and build the list
[Root@linux root]# Apt-cdrom add
If you are using ISO file installation, first mount the ISO file to Mount-point, the mount point input, you can automatically search the RPM software list.
[Root@linux root]# apt-cdrom-m-D mount-point Add
If you are unlocking the hard disk image installation, simply enter the path, you can automatically search the RPM software list.
[Root@linux root]# apt-cdrom-m-D path add

Five, set up simple APT server (here only explained Redhat 9)

Note: Before doing the following, please confirm that your Apache is operating normally, and that there is at least 2G of space in the/var 1. Why to set up APT server

When we install Freshrpms apt, installation, upgrade is through the network online to Freshrpms download files. If only one server maintenance, but if there are 10 servers, it will take 10 times times the original time and bandwidth to do the same thing, plus if the outside (United States) bandwidth is not sufficient, this is good, so when there are more than one server to maintain, set up an APT server, seems to be a good choice. 2. Apt Installation:

http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/

Please install the latest apt in this site

On-line installation:rpm-ivh http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt/apt-0.5.5cnc5-fr2.i386.rpm 3. Build a folder that places Red Hat Linux 9 related rpm

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 entire Red Hat Linux 9 binary rpm to/var/www/html/redhat/9/rpms.os Information Folder

(There are three methods below, please choose a method to perform according to your own situation)

Method One: Copy from disc (you can use this method when you have a Red Hat Linux 9 disc on your hand)

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 disc discs according to the above method


Method two: Copy from ISO file (this method can be used when there are Red Hat Linux 9 ISO files in the computer)

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 Red Hat Linux 9 updates rpm to/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/i386/*

(If the network bandwidth is not high, it will take a long time, please wait patiently) 6. Generate base folders and RPM index lists using the GENBASEDIR Directive genbasedir--flat--bloat--bz2only/var/www/h TML/REDHAT/9 OS updates execution process: (The process will be a bit long, please be patient)

Creating base directory ... done
Components:os Updates




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.