[Tuo original] Using the APT in Redhat Linux to replace Up2Date to update your system!

zhaozj2021-02-16  173

problem:

At present, our hosts use redhat Linux, just if you want to update the RPM package, you put patch or use new features for some software used in the system, and we are now available to Redhat. Up2date programs, but you have to get the registered account of the Redhat company website, and fill in the relevant information, and to see if you want to go to their website, otherwise you will not let you update, so you have brought a lot of inconvenience, using Debian After that, it is found that the software package update in Debian is very convenient (using up2date), making love unlearable! And I have heard it on the website, RPM can also use ATP, so today I use Google search, I found true, and found the primary station of ATP, and put pt.cjcht.com, and Sunroll. COM Install ATP, then use the APT-GET UPDATE, use the APT-GET UPGRADE to update all unrecognized packages to the latest, now a brief operation, talk to everyone!

In fact, if you use Debian, I don't want to say too much. If you haven't used Debian, it doesn't matter. After you read the information I give you, I think it is very simple!

APT introduction and article information:

APT (Advanced Package Tool) is a tool for debian gnu / linux. To manage our rpm.

ATP master:

Http://freshrpms.net/

ATP introduction:

http://freshrpms.net/apt/

Download APT Page in Various Linux Releases:

http://apt.freshrpms.net/

In fact, use ATP, nothing more than installing the APT package, you can download the APT package to the home of the APT:

We pt.cjcht.com and Sunroll.com is installed on the installation of Redhat Linux 7.3 so you go to the APT homepage corresponding RPM package, and install it, I downloaded:

APT-0.5.5cnc5-fr0.RH73.2.I386.5cnc5-fr0.r73.2.i386.rpm (not required)

However, use the ATP-GET APT-CACHE and other orders to update or other actions, I don't say it, I have already said it is very clear, you will use Man, will be more clear, ATP Server Didn't get it, we have no significance of server!

Look at the attachment and the information on the ATP master station above is a very fast palm APT.

Zhu Bin

Use APT Management Red Hat Linux RPM Since 2003-05-31 by Yang Jintic

Foreword

What method do you use in Managing Your RPM, installed from the disc installation, downloads from the Internet, or uses Red Hat Up2date (Red Hat Network) in maintenance, these are methods of solving the problem, but you can have better Select - APT

This file contains two chapters, the first section: APT installation, use, the second section: APT Servo Rack

(Note: All operations are completed in Red Hat Linux 9) The first APT installation, use

1-1. What is APT

APT (Advanced Package Tool) is a tool for Debian GNU / Linux, which is used by CONECTIVA's Linux Suite, which transplays it to the Linux kit using the RPM system, so we can use APT on Red Hat Linux. To manage our rpm

1-2. What can APT?

We can manage our RPM with the APT, whether it is installation, removal, or upgrade, APT is done, but we choose the APT's biggest reason: it can automatically handle RPM dependence, such as us: To install A rpm, and when A rpm and b rpm have dependencies, the traditional practice is to download the B rpm installation, then download A rpm installation; but if we have installed APT, as long as the next line "Apt-Get The INSTALL A "instructions can be, so the APT will help us download A rpm, and will automatically download the dependent file (B rpm) to help us install, so we can install, remove, or upgrade for RPM installation, removal, or upgrade There is no need to take care of the annoying dependence.

1-3. APT simple operation principle

After our machine installed the APT suite, we became an APT user. When we installed, upgrade RPM, in fact, it is done to download RPM back to the far-ended APT server through the network. APT Server We can specify it yourself, and the APT user ends can also become an APT server (in the second quarter, we will talk to the APT server)

The APT-GET UPDATE instruction will synchronize the User-end and the APT server's RPM index list (the RPM index of the APT server is placed in the base folder, and the user-end computer obtains the BZ2 RPM index in the Base data clip. Once the list is quoted, it will be decompressed in / var / limited, while the user uses the APT-GET Install or the APT-Get Dist-Upgrade command, the information in the folder will With the RPM database comparison within the computer, you can know that the RPM is installed, not installed, or can be upgraded.

1-4. Installation of APT

All of the following examples are examples maintained by http://freshrpms.net/-

(If you are interested in the APT maintained by CLE, please refer to: http://cle.linux.org.tw/~candyz/apt-howto_cle.txt)

http://apt.freshrpms.net/

Please come to this website to find an APT download that is suitable for your Red Hat Linux version (hereinafter will be used as an example of Red Hat Linux 9)

Online installation: rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/redhat/9/APT/APT-0.5.5cnc6-fr1.i386.rpm

1-5. Installing Red Hat Linux, Freshrpms GPG Key:

RPM - IMPORT ftp://linux.sinica.edu.tw/redhat/redhat-9/EN/OS/i386/rpm-gpg-key

RPM - IMPORT http://ftp.freshrpms.net/pub/freshrpms/rpm-gpg-key1-6. The use of the APT lists several commonly used instructions

APT-GET UPDATE

Update: This command is used to get a list of distal servo in /etc/apt/sources.list, and you must remember this before using the "APT-Get Dist-Upgrade" instruction to upgrade the kit. Instructions to update the suite file list

APT-GET DIST-UPGRADE

Upgrade: The upgrade here does not mean the upgrade of 9.0 to 9, but when the Red Hat has an upgraded RPM, we can upgrade our installed rpm through this instruction.

Red Hat Linux 9 has these upgrade kits, can be known by this website: https://rhn.redhat.com/errata/rh9-errata.html

Note:

The APT is derived from Debian GNU / Linux, and Debian is numbered in the same version, and the maturity is also divided into Stable Testing UnStable. If we use the debina 3.0r1 stable, use the APT-GET UPGRADE to upgrade for stable software, and use the APT-GET DIST-UPGRADE to choose to upgrade the system from the Stable to Testing or unsteable, but in Red Hat There is no such point in Linux, so the result of using the APT-GET UPGRADE and APT-GET DIST-UPGRADE is the same.

Apt-Cache Search

Search: We can use this instruction to search for rpm, for example: Apt-Cache Search Httpd, this RPM with HTTPD in this file will appear.

Apt-cache depends

Dependency: We can use this instruction to see all of the dependent files of a RPM, such as: Apt-Cache Depends httpd, so that all dependent files in HTTPD will appear, sometimes it is not sure that a dependent file is This instruction is useful when it belongs to that rpm.

APT-GET INSTALL

Install: When we know that the RPM name, you can use this command to install the kit, for example: apt-get install httpd, so APT will automatically download HTTPD rpm back to install, if HTTPD has a dependency kit, APT will also Automatic download installation

Apt-get clean

Clear: When using the APT-GET Install instruction to install the kit, download the RPM will be placed on / var / cache / APT / Archives, you can clear it using the APT-GET Clean directive to avoid the hard drive space.

Apt-Get Remove

Remove: If we want to remove an RPM, you can use this instruction, for example: Apt-get remove httpd, it will remove httpd. If this RPM has a dependent kit, the APT will also Remove

These instructions should be enough, if you want to get a further directive, please use the man :)

1-7. Regular update:

Vi /etc/cron.daily/upgrade

#! / bin / sh

APT-GET UPDATE

Apt-get -y dist-upgradeapt-get clean

CHMOD 755 / Etc/cron.daily/upgrade

Start Crond: Chkconfig --Level 345 Crond on

This time this computer will be updated every day (please do /etc/cron.daily/upgrade before you, check if there is any error)

If you want to use the FreshrPMS website to use your own APT Server source, you don't have to set up a server yourself. You don't have to read it below :)

Second section set a APT server

Note: Please confirm your Apache first before doing the following operations, and at least 5G space under / VAR dividing area.

2-1. Why is it to set up an APT server?

When we install the APT, installation and upgrade of FreshrPMS, we will download the file through the network connection to the FRESHRPMS website. If only one server is maintained, it is ok, if there is ten servo, it takes ten times the time and bandwidth to do the same thing, plus if the width of the foreign connection is not abundant. How to be good, so when there are multiple servo to maintain, set up an APT server, which seems to be a good choice.

2-2. Install the APT:

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

Please install the latest APT suite in this site

Online installation: rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/redhat/9/APT/APT-0.5.5cnc6-fr1.i386.rpm

2-3. Built the folder of the Red Hat Linux 9 related SOURCE

Mkdir -p / var / ftp / pub / redhat / linux / 9 / EN / OS / I386

# Establish a folder placement Red Hat Linux 9

Mkdir -p / var / ftp / pub / redhat / linux / updates / 9 / EN / OS

# 建立 放 资 资 资 资 资 资 资

2-4. Mirror Red Hat Linux 9 Source

(Provide three methods under the end, please select a method according to your own situation)

Method 1: Copy from the disc (when there is a Red Hat Linux 9 disc, this method can be used)

Mount / MNT / CDROM

CP-RF / MNT / CDROM / * / VAR / FTP / PUB / Redhat / Linux / 9 / EN / OS / I386

Umount / MNT / CDROM

Copy the second piece, the third disc in accordance with the above method

Method 2: Copy from ISO (when there is Red Hat Linux 9 ISO file in the computer)

MKDIR / MNT / ISO

Mount -o loop shrike-i386-disc1.iso / mnt / ISO

CP-RF / MNT / ISO / * / VAR / FTP / PUB / Redhat / Linux / 9 / EN / OS / I386

Umount / MNT / ISO

Mount -o loop shrike-i386-disc2.iso / mnt / ISO

CP-RF / MNT / ISO / * / VAR / FTP / PUB / Redhat / Linux / 9 / EN / OS / I386

Umount / MNT / ISO

Mount -o loop shrike-i386-disc3.iso / mnt / ISO

CP-RF / MNT / ISO / * / VAR / FTP / PUB / Redhat / Linux / 9 / EN / OS / I386UMOUNT / MNT / ISO

Method 3: Download directly from the Chinese Research Institute (when there is no optical disc slice, and there is no ISO file in the computer)

CD / var / ftp / pub / redhat / linux / 9 / EN / OS / I386

Wget -r -nh --cut-DIRS = 6 ftp://linux.sinica.edu.tw/pub1/redhat/redhat-9/EN/OS/i386/

(Including SRPMS, about 3.5 g, if the network is wide, it will take a long time, please wait patiently: P)

2-5. Mirror Red Hat Linux 9 Updates

CD / VAR / FTP / PUB / Redhat / Linux / Updates / 9 / EN / OS

Wget -r -nh --cut-dirs = 6 ftp://linux.sinica.edu.tw/pub1/redhat/Updates/9/EN/OS/On/OS/

(2003.11.01 stop about 600 MB)

2-6. Establish an APT data clip

Mkdir -P / var / ftp / pub / redhat / APT / 9 / I386

2-7. Establish a link

Ln -s / var / ftp / pub / redhat / linux / 9 / EN / OS / I386 / Redhat / RPMS /VAR/FTP/Pub/redHat/apt/9/i386/rpms.os

Ln -s / var / ftp / pub / redhat / linux / 9 / EN / OS / I386 / SRPMS /VAR/FTP/Pub/redhat/apt/9/i386/srpms.os

LN -S / VAR / FTP / PUB / Redhat / Linux / Updates / 9 / EN / OS / SRPMS /VAR/FTP/Pub/redHat/apt/9/i386/srpms.Updates

# 将 RPMS, SRPMS folder, and Updates of Red Hat Linux 9 to / VAR / FTP / PUB / Redhat / APT folder and name RPMS.OS, Srpms.os, Srpms.Updates

2-8. Establish RPMS.UPDATES folder and generate RPM related links

MKDIR /VAR/FTP/Pub/redhat/apt/9/i386/rpms.Updates

CD /VAR/FTP/Pub/redhat/apt/9/i386/rpms.Updates

Find / var / ftp / pub / redhat / linux / updates / 9 / en / os / -type f! -name "* .src.rpm" -name "* .rpm" -exec ln -sf {} /;

# Use the find command to search for the Updates folder, the depot is named RPM, and then make a connection

# Some files are installed, if you use i386 (or i686) file, you must use the same architecture when you upgrade, otherwise an error will occur, and the most often erroneous place is to upgrade Glibc. So Script above is to avoid such errors, he will connect all UPDATES RPM of different architectures to the same data clip, so that APT has a way to get UPDATES RPM suitable for machine architecture to upgrade the kit.

2-9. Use the GenBasedir instruction to generate a base folder and file index list

GenBasedir - Flat - Bloat --bz2only / var / ftp / pub / redhat / APT / 9 / I386 OS Updates

Execution process: (Process will have a little longer, please be patient)

Creating Base Directory ... DONE

Components: OS Updates

Processing pkglists ... OS Updates [DONE]

Processing Srclists ... [DONE]

Creating Component Releases ... OS Updates [DONE]

Creating Global Release File ... [DONE]

Appending MD5SUM ... OS Updates [DONE]

All your base area belong to us !!!

Note:

To install the ATP kit, there will be a genbasedir instruction, and the above instruction column will establish the base folder under the / var / ftp / pub / redhat / APT / 9 / i386 folder, then generate related file index list BZ2 compressed files and RELEASE file

Note:

In the future, as long as the / var / ftp / redhat / linux / updates / 9 / EN / OS / Data clamp is more moving, you need to execute this instruction to generate a new file index list.

2-10. Establish a link

LN -S / VAR / FTP / PUB / RedHat / VAR / WWW / HTML / Redhat

# Connect the data within the FTP and HTML, so that you can use the APT Server by HTTP.

2-11. Modify /etc/httpd/conf/httpd.conf

Vi /etc/httpd/conf/httpd.conf in the end plus this paragraph

Options Indexes Followsymlinks MultiViews

Restart httpd: service httpd restart

Note:

Do you want to modify httpd.conf and you will not affect the function of the APT Server, just modify, from the web page to see RPM

2-12. Regular Mirror Updates RPM

Install mirrordir:

Mirrordir official website: http://mirrordir.sourceforge.net/

Online installation: rpm -ivh http://mirrordir.sourceforge.Net/mirrordir-0.10.49-1.i386.rpm

Mirror Updates rpm:

mirrordir -V ftp://linux.sinica.edu.tw/pub1/redhat/Updates/9/EN/OS/i386/VAR / FTP / PUB / Redhat / Linux / Updates / 9 / EN / OS /

Regular mirror:

vi /etc/cron.daily/mirrorupdates

#! / bin / sh

Mirrordir ftp://linux.sinica.edu.tw/redhat/Updates/9/EN/OS/ / var / ftp / pub / redhat / linux / updates / 9 / EN / OS /

Rm -rf /var/ftp/pub/redhat/apt/9/i386/rpms.Updates/**

CD /VAR/FTP/Pub/redhat/apt/9/i386/rpms.Updates

Find / VAR / FTP / PUB / Redhat / Linux / Updates / 9 / EN / OS / -TYPE F! -NAME "* .src.rpm" -name "* .rpm" -exec ln -sf {} /; genbasedir --flat --bloat --bz2only / var / ftp / pub / redhat / APT / 9 / i386 OS Updates

Modifying permissions: chmod 755 /etc/cron.daily/mirrorupdates

Start Crond: Chkconfig --Level 345 Crond on

This way servers will go to Mirror Updates RPM and generate RPM indexes every day.

(Please do /etc/cron.daily/mirrorupdates before the end, check to see if there is any error)

2-13. CLIENT End Computer setting, operation

Install APT:

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

Please install the latest APT in this site

Online installation: rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/redhat/9/APT/APT-0.5.5cnc6-fr1.i386.rpm

Modify Sources.List:

vi /etc/apt/sources.list

# Red Hat Linux 9

RPM http://ayo.freshrpms.net redhat / 9 / i386 os Updates Freshrpms

RPM-SRC http://ayo.freshrpms.net redhat / 9 / i386 OS Updates Freshrpms

Modified

# Red Hat Linux 9

# rpm http://ayo.freshrpms.net redhat / 9 / i386 OS Updates Freshrpms

# rpm-src http://ayo.freshrpms.net redhat / 9 / i386 os Updates Freshrpms

RPM http: // Your_ip / redhat / APT / 9 i386 OS Updates

RPM-SRC http: // Your_IP / Redhat / APT / 9 i386 OS Updates

# 其中 Your_ip, please replace it with your own server

Note: Sources.list is the setting file for setting the APT server source, setting the last

OS represents Raw RPM of Red Hat Linux 9

Updates Represents Red Hat Update (Updates) RPM

Freshrpms represents add-on rpm maintained by FreshrPms.NET (http://shrike.freshrpms.net/)

RPM-SRC represents Source RPM

Regularly updated:

Vi /etc/cron.daily/upgrade

#! / bin / bash

APT-GET UPDATE

APT-GET -Y DIST-UPGRADE

Apt-get clean

CHMOD 755 / Etc/cron.daily/upgrade

Start Crond: Chkconfig --Level 345 Crond on

This time this computer will be updated every day (please execute /etc/cron.daily/upgrade before the end, check if there is any error)

Conclusion:

A bit complicated: Is P to be successful? ~~~~ In fact, the above practices but copy the Red Hat Linux 9-piece CD (including Source RPM) and Updates to / var / ftp / pub, and then the part you need to use by link. To the APT data clip, the more especially rpms.Updates is the folder, because the Updates' rpm is also distinguished, so use the Find Direction, find all Updates, to RPMs.Updates, last Then generates the relevant archive list compressed files again with the GenBaseDir instruction. After doing only the above practice, we don't just have an APT server, just start anonymous ftp, and also get the online installation server for FTP and HTTP mode, allow the user to install Red Hat Linux through the network. Network installation process Reference) http://www.redhat.com/download/mirror.html Listed on the Red Hat website, there are two Taiwan's Mirror Station, I pick up the Central Research Institute's FTP station as my mirror source If you are plenty of more frequently, you can use the Red Hat's platform for the Mirror source. Red Hat Linux 9 Updates: ftp://ftp.redhat.com/pub/redha/linux/Updates/9/EN/OS/i386/ If you have played x window, you can download the SYNAPTIC kit back to install, this is the graphic of the APT In the interface, it is a bit like a debian gnu / linux (in fact, Debian also has Synaptic). (Figure) If you are interested in the audio and video, you will recommend the other RPM maintained by Freshrpms. You don't have to find it around you. There are still a few good play. Game, it is hard to imagine that FreshrPms related websites and kits are all maintained by Matthias Saou. Freshrpms Red Hat Linux 9 Add-on Packages: http://shrike.freshrpms.net/ The APT server set above is in the way in HTTP, if you want to change to FTP, it is possible, but You must first set anonymous FTP. Using FTP's way, you can limit the number of people log in, which is more stringent, but FTP will have a login process (even anonymous login), the speed is not HTTP. If it is now used by Red Hat Linux 8.0, 7.3 ........., slightly modify, you can set up an APT server suitable for yourself, if you need it :) Directory structure: / var / FTP / PUB / RedHat

/ VAR / FTP / PUB / RedHat /

| - APT

| `- 9

| `- I386

| | - rpms.os -> / var / ftp / pub / redhat / linux / 9 / EN / OS / I386 / RedHat / RPMS

| - rpms.updates (only this folder under the i386 folder is its own) | | - SRPMS.OS -> / VAR / FTP / PUB / Redhat / Linux / 9 / EN / OS / I386 / SRPMS

| | - SRPMS.UPDATES -> / VAR / FTP / PUB / RedHat / Linux / Updates / 9 / EN / OS / SRPMS

| `- Base (This data clip is generated by the GenBasedir instruction)

`- linux

| - 9 (This data clamp is the original Red Hat Linux 9 SOURCE)

| `- EN

| `- OS

| `- I386

| | - Redhat

| | `--RPMS

| `--Srpms

`- Updates (this data clamp is the update file of Red Hat Linux 9)

`- 9

`- en

`- OS

| - SRPMS

| - Athlon

| - i386

| - i586

| - i686

`- noarch

Note:

Directory Structure I try to establish it with the Red Hat's FTP official website, so so many layers can we be built according to ourselves.

Some links in the FreshrPMS website:

FRESHRPMS Home: http://freshrpms.net/ FRESHRPMS APT Servo Construction Description: http://freshrpms.net/apt/server/ Freshrpms Maintor Matthias Saou Home: http://www.marmotte.net/thias / Make up the machine (with photos!): Http://freshrpms.net/about/systems/ All ftp.freshrpms.net directory: http://ftp.freshrpms.net/pub/freshrpms/ FreshrPMS Mirrors: http://freshrpms.neet/mirror/

Photos:

Http://freshrpms.net/apt/server/ (This article is mainly referred to this article) http://cle.linux.org.tw/~candyz/ http://www.study-area. ORG / TIPS / SECURITY.TXT http://phorum.study-area.org/viewtopic.php?t=14087&highlight=APT

FAQ

1. How do I set up proxy for APT?

Answer: VI /etc/apt/apt.conf found proxy ""; // http:// user: pass @ host: port / add your available proxy "http: // Your_Proxy: port"; // http : // User: Pass @ Host: Port /

2. I don't want to set up APT Server, Freshrpms.Net is very difficult to connect, is there any other APT Server available?

A: vi /etc/apt/sources.list Add the following APT Server (Fro Red Hat Linux 9) RPM http://opensource.nchc.org.tw/redhat/apt/redhat/9/EN i386 OS Updates DRBL Firefly

# National High Speed ​​Network Center Maintenance APT Server: This site features include Mirror Firefly (firefly) kits, and there are also national high-speed network centers in promoting DRBL related kits.

# 有 有 x x 人,, firefly, big font patches is certain; the additional DRBL is a solution for the establishment without a hard drive system, interested people can try it.

#firefly: http://firefly.idv.tw/test/forum.php? Board = 1 # DRBL: http://drbl.nchc.org.tw/

RPM ftp://cle.linux.org.tw pub / shrike / redhat OS Updates Cle Freshrpms

#CLE maintenance APT Server: This platform is the biggest feature, it is a kit with CLE, in addition, it also has a Mirror Freshrpms kit, so if we are not very good, it can replace HTTP: / /ayo.frserpms.net

# 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 有 安 安Download, save a lot of time

#freshrpms Maintenance Suite: http://shrike.freshrpms.net/

# 下 几 国 网 网站

RPM http://apt.au.freshrpms.net/redhat/9/EN i386 OS Updates

RPM http://ftp-stud.fht-sslingen.de/apt/redhat/9 i386 OS Updates

RPM http://redhat.usu.edu/mirror/apt redhat / 9 / en / i386 OS Updates

RPM ftp://ftp.stw-bonn.de/pub/apt redhat / 9 / en / i386 os Updates

RPM ftp://apt-rpm.tuxfamily.org/apt redhat / 9 / en / i386 OS Updates

转载请注明原文地址:https://www.9cbs.com/read-8563.html

New Post(0)