• Installing rpm packages on Linux. Package management in RHEL - rpm Rpm depending on the processor

    RPM (RedHat Package Manager)- the most popular package management utility for systems based on RedHat such as RHEL, CentOS, Fedora. The tool allows system administrators and users to install, update, uninstall, query, check and manage system software packages on operating systems Unix/Linux. Package Manager RPM stores information about applications installed on the system in its database /var/lib/rpm. The .rpm files themselves contain compiled versions of the software, the libraries necessary for their operation, as well as up-to-date information about package sources, versions and dependencies. RPM cannot control software compiled and installed from source codes.

    Essentially RPM works in several modes. Queries and checks:

    • rpm (-q|--query)
    • rpm (-V|--verify)
    Installing, updating, removing packages:
    • rpm (-i|--install) PACKAGE_FILE ...
    • rpm (-U|--upgrade) PACKAGE_FILE ...
    • rpm (-F|--freshen) PACKAGE_FILE ...
    • rpm (-e|--erase) [--allmatches] [--justdb] [--nodeps] [--noscripts][--notriggers] [--test] PACKAGE_NAME ...

    1. Check the gpg signature of the rpm package

    It is advisable to always check gpg signing the package before installing it to verify its authenticity. # rpm --checksig pidgin-2.7.9-5.el6.2.i686.rpm pidgin-2.7.9-5.el6.2.i686.rpm: rsa sha1 (md5) pgp md5 OK

    2. Installing the rpm package

    To install the rpm package, use the key -i: # rpm -ivh pidgin-2.7.9-5.el6.2.i686.rpm Preparing... ########################## ################# 1:pidgin ############################### ############# -i: Install package -v: show debugging information -h: Output hash marks when installing

    3. Check the rpm package dependencies before installation

    You can view the list of package dependencies like this: # rpm -qpR htop-2.0.2-2.fc26.aarch64.rpm ld-linux-aarch64.so.1())(64bit) ld-linux-aarch64.so.1(GLIBC_2. 17)(64bit) libc.so.6())(64bit) libc.so.6(GLIBC_2.17)(64bit) libm.so.6())(64bit) libm.so.6(GLIBC_2.17)(64bit) ) libncursesw.so.6() (64bit) libtinfo.so.6() (64bit) rpmlib(CompressedFileNames)<= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsXz) <= 5.2-1 rtld(GNU_HASH) -q: execute request -p | --package: request information -R: query mode option, package dependency list

    4. Rpm, installing packages without dependencies

    If you are sure that all the necessary dependencies are installed, but the rpm complains and does not allow you to install the package, you can ignore installing dependencies using the flag --nodeps: # rpm -ivh --nodeps BitTorrent-5.2.2-1-Python2.4.noarch.rpm Preparing... ####################### ###################### 1:BitTorrent ############################ ################ The above command will force install the package despite errors rpm. Please note that if it turns out that the dependencies are still missing from the system, the installed program will not work and you will need to install the necessary dependencies separately.

    5. Rpm, check installed package

    To check whether a package is installed or not, you need to query the required package: package htop installed # rpm -q htop htop-2.0.2-1.el7.x86_64 package fake not installed # rpm -q fake package fake is not installed

    6. Rpm, list of installed package files

    The list of files of the installed package can be obtained by request -ql (query list): # rpm -ql htop /usr/bin/htop /usr/share/doc/htop-2.0.2 /usr/share/doc/htop-2.0.2/AUTHORS /usr/share/doc/htop-2.0. 2/COPYING /usr/share/doc/htop-2.0.2/ChangeLog /usr/share/doc/htop-2.0.2/README /usr/share/man/man1/htop.1.gz /usr/share/ pixmaps/htop.png

    7. Rpm, list of recently installed packages

    # rpm -qa --last htop-2.0.2-1.el7.x86_64 Sat 03 Jun 2017 06:20:07 PM MSK

    8. Rpm, list all installed packages

    To get a list of all packages installed on the system, you need to run the request -qa without additional parameters # rpm -qa perl-HTML-Parser-3.71-4.el7.x86_64 dracut-network-033-463.el7.x86_64 filesystem-3.2-21.el7.x86_64 ......... ..........the list of packages will be quite large; for page-by-page output you can use utilities such as more or less: # rpm -qa | more

    9. Updating the rpm package

    To update any rpm package option is used -U (upgrade). This option not only updates any package to the latest version, but also creates a backup copy of the old version of the package. If after the update something goes wrong and the software does not work, you can return to the previously installed and known working version. # rpm -Uvh nx-3.5.0-2.el6.centos.i686.rpm Preparing... ############################ ################ 1:nx ############################### #############

    10. Removing the rpm package

    To remove a package, use the option -e (erase), the vv option is used for more detailed debug output: # rpm -evv nx

    11. Removing an rpm package without dependencies

    Parameter --nodeps forcefully removes a package rpm from the system. Keep in mind that removing a specific package may break other working applications. # rpm -ev --nodeps htop

    12. Rpm, request a file belonging to a package

    If you need to find out which package owns a specific file, use the option -qf (query file): # rpm -qf /etc/my.cnf mariadb-libs-5.5.52-1.el7.x86_64

    13. Rpm, get information about the installed package

    To get detailed information about the installed package, use the option -qi (query info): # rpm -qi htop Name: htop Version: 2.0.2 Release: 1.el7 Architecture: x86_64 Install Date: Sun 04 Jun 2017 10:20:51 AM MSK Group: Applications/System Size: 212139 License: GPL+ Signature: RSA/SHA256, Sun 24 Jul 2016 09:22:13 PM MSK, Key ID 6a2faea2352c64e5 Source RPM: htop-2.0.2-1.el7.src.rpm Build Date: Sun 24 Jul 2016 01:01:34 PM MSK Build Host: buildvm-26.phx2.fedoraproject.org Relocations: (not relocatable) Packager: Fedora Project Vendor: Fedora Project URL: http://hisham.hm/htop/ Summary: Interactive process viewer Description: htop is an interactive text- mode process viewer for Linux, similar to top(1).

    14. Rpm, get information about a package that is not yet installed

    To get information about a package that has already been downloaded but not yet installed, you can request -qip (query info package): rpm -qip ./pachage_name.rpm

    15. Rpm, view documentation files for a specific package

    Request -qdf (query document file) will list all documentation files for a package: # rpm -qdf /usr/bin/htop /usr/share/doc/htop-2.0.2/AUTHORS /usr/share/doc/htop-2.0.2/COPYING /usr/share /doc/htop-2.0.2/ChangeLog /usr/share/doc/htop-2.0.2/README /usr/share/man/man1/htop.1.gz

    16. Checking a specific rpm package

    When checking a package, information about the package's installed files is compared with the database rpm. # rpm -Vp sqlbuddy-1.3.3-1.noarch.rpm S.5....T. c /etc/httpd/conf.d/sqlbuddy.conf

    17. Checking all rpm packages

    # rpm -Va S.5....T. c /etc/rc.d/rc.local .......T. c /etc/dnsmasq.conf .......T. /etc/ld.so.conf.d/kernel-2.6.32-279.5.2.el6.i686.conf

    18. Import GPG key

    To check packages RHEL/CentOS/Fedora, need to import GPG key. To do this, run the following command: # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

    19. Rpm, view all imported keys

    # rpm -qa gpg-pubkey* gpg-pubkey-7bd9bf62-5762b5f8 gpg-pubkey-352c64e5-52ae6884 gpg-pubkey-f4a80eb5-53a7ff4b gpg-pubkey-810f8996-552b1d92

    20. Rebuild corrupted rpm database

    Sometimes the rpm database can become corrupted and the rpm cannot function properly. If this happens, you need to rebuild the database rpm: # cd /var/lib/rpm # rm -f __db.* # rpm --rebuilddb And as usual: # man rpm Good luck

    A package manager is used to install, uninstall and update programs in RHEL, Fedora, Mandriva, AltLinux and some others distributions rpm. The rpm package manager allows you to install, remove, and verify packages of the appropriate format, but does not have tools for automatically resolving dependencies and searching repositories. To automate the installation of packages, you can use the program yum(Yellowdog Update Manager), which automatically resolves dependencies between packages and downloads the necessary files. If you need to build a package with the program from source code, you can use rpmbuild. To do this, you need to prepare a package in .src.rpm format, including the source code of the program and a .spec file describing the build process.

    Package structure

    Packages are named according to the following scheme: name-version-build. Packages are distributed as files with .architecture.rpm appended to their names. For example, squid-2.5.STABLE8–1.FC3.1.i386.rpm stands for: squid program, version 2.5.STABLE8, build 1.FC3.1, i386 architecture (unoptimized application for i386 compatible processors). The build number may include the name of the distribution (FC3 in this case, or may not include it). The noarch architecture means scripts that are independent of the processor architecture. .src.rpm files contain the source code of programs and are installed in a special way.

    Each package contains files of programs, libraries, configuration, documentation, etc., packed with the cpio archiver. The package also contains additional sections:

    • PROVIDE– provided functionality (for example, “mail server”) plus package files;
    • REQUIRENAME– packages, files, etc. necessary for correct operation. (what is required in REQUIRENAME, must be present in PROVIDE previously installed packages);
    • OBSOLETE– list of packages that can be removed because their functionality and/or files are replaced by this package;
    • PREIN, POSTIN– scripts executed before installation (for example, stopping an updated daemon), and scripts executed after installation (for example, editing configuration files for a specific machine);
    • PREUN, POSTUN– scripts executed during deletion;
    • SUMMARY– brief description of the package;
    • DESCRIPTION– detailed description.

    In addition, each package belongs to some group Internet, Software Development, Entertainment, etc. You can view sections of the rpm file in mc.

    In further descriptions<пакет>means the package name without i386.rpm (if one version of the program is installed, then the version and build number can also be omitted), and<файл>stands for .rpm file name. You can specify its URL as a file, for example, http://download.fedora.redhat.com/pub/fedora/linux/core/updates/3/i386/yum-2.2.0-0.fc3.noarch.rpm

    Installing, uninstalling, updating programs

    Auxiliary options: -v – verbose message output, -h – show installation progress indicator.

    rpm-ivh<файл>... – install package(s)
    rpm -Uvh<файл>... – update the package(s), if not installed – install
    rpm -Fvh<файл>... – update already installed package(s)
    rpm -e<пакет>... – remove package(s)

    View information about installed packages or rpm files

    Auxiliary options: -a – all installed packages, -p – information about the rpm file (not shown everywhere in the examples).

    rpm -q<пакет>... – checks for the presence of an installed package and its version
    rpm -qa - list all packages
    rpm -qi<пакет>... – DESCRIPTION of the package
    rpm -qip<файл>... – file DESCRIPTION
    rpm -qR<пакет>... – REQUIERS package
    rpm -ql<пакет>... – list of package files
    rpm -qf<файл_в_файловой_системе>... – determining whether an arbitrary file belongs to one of the installed packages

    Checking the integrity of the rpm package

    Files placed in an rpm package are accompanied by a calculated checksum and, as a rule, are digitally signed by the package builder. After installing the package, checksums and signatures are saved in the installed package database. This supporting data allows you to perform several checks, such as verifying that the package was created by a trusted publisher and that the package files have not been tampered with after installation.

    The first check is very important when downloading packages from the Internet, and the second when you suspect that your computer has been hacked.

    Public keys for signature verification are automatically installed when installing from the distribution, and are also semi-automatically added when installing rpm packages for connecting yum repositories. Key files in CentOS are installed in the /etc/pki/rpm-gpg/ directory. You can add the key manually by specifying the path to the local file or its url. The key file must have the text format "ASCII armored"

    Rpm --import PUBKEY-file

    After installation, the same commands apply to the keys as to installed packages

    rpm -qa gpg-pubkey* – list all keys
    rpm -qi gpg-pubkey-db42a60e – information (including owner name) about a specific key
    rpm -e gpg-pubkey-db42a60e – delete a key

    Checking the package file for integrity

    Rpm --checksig<файл>

    Checking the installed package for integrity

    Rpm --verify<пакет>

    After executing this command, a list of changed files will be displayed indicating what exactly has changed in them. The change type information consists of a string of abbreviations including:

    • S– size (Size)
    • M– file type or access rights (Mode)
    • 5 – checksum (MD5)
    • D– major or minor device device (Device)
    • L– contents of a symbolic link (Link)
    • U– owner (User)
    • G– group (Group)
    • T– modification time (mTime)
    • P– capability

    Extracting and packaging rpm package files

    The rpm2cpio program extracts files from an RPM package in the cpio archive format. To unpack files along with the directory structure, use the cpio command with the options -i - unpack and -d - create directories:

    rpm2cpio<файл.rpm>| cpio -i -d

    rpmrebuild

    Special cases

    If the package is already installed and you need to reinstall it or you need to downgrade the package version, you can add the --force option to the installation or update commands.

    If installing or removing a package formally breaks the dependencies, but it is known that everything will be fine, then the --nodeps option is used.

    When a buyer tries to assemble a computer from components on his own or simply choose a hard drive for a PC, he often encounters the concept of “RPM”. What is it and is it important? RPM is not just important, but one of the key parameters of a hard drive that must be taken into account first when choosing. Let's take a closer look at what RPM is.

    Concept

    The abbreviation RPM (Rounds per minute) in Russian is literally translated as “Revolutions per minute”. This unit refers to a hard drive, but the concept itself does not mean anything to the average user. The RPM of the hard drive plays a role in system performance, and the higher the rotation speed, the faster the entire system will run. Most often, this parameter is indicated in the specifications for a hard drive, and between two hard drives, it is advisable to choose the one with a higher RPM.

    If you take two disks that are identical in all respects, but with different spindle speeds, you can immediately notice a significant difference in system performance.

    What is a spindle?

    A hard drive consists of several sealed circular platters that are stacked on top of each other and coated with a layer of ferromagnetic material. The housing also contains a reading head. During operation, these plates rotate using a spindle - a special rotating shaft. This shaft is driven by an electric motor. When the platters rotate, the read heads do not touch the surface of the disks, but are at the closest possible distance to them. As a result, with the help of heads it is possible to write and read information from solid media - disks.

    Over the course of thousands of hours, the spindle consistently rotates the plates at enormous speeds, so this element must be reliable. Due to the absence of direct physical contact between the spindle and the disk, information can be written to and erased on the latter. It is believed that, on average, information can be written and erased 100 thousand times on one disk.

    This is what hard drive spindles look like. Of course, they may differ depending on the device model and manufacturer.

    So, we found out that this is RPM. The parameter determines at what speed the plates can rotate during normal operation. In turn, this allows you to understand how quickly the computer system can obtain information from the hard drive when accessing it. The higher the speed, the faster the data exchange between the system and the disk will occur.

    How does this work?

    To understand more precisely what RPM is, it is necessary to understand the operating principle of the device itself. When certain information is requested, the magnetic head unit moves to the requested track. This requires a certain amount of time to search (Seek latency). After the read heads move to the desired sector, you must wait until the disks rotate so that the desired area is under the read head. This period of time is called rotation delay. It is this parameter that depends on the spindle rotation speed, and the higher it is, the lower the rotation delay will be.

    Both delays (spindle movement and disk rotation) determine the speed of system access to data. Many performance testing programs calculate this parameter and display it under the “Access to data time” lines. This allows you to determine the real speed of the disk. This parameter directly affects the performance of the entire system. Today there are many powerful laptops that are equipped with powerful video cards and processors, and a large amount of RAM. But at the same time, very slow hard drives with a rotation speed of 5400 rpm are used together with good hardware. As a result, all these powerful components do not work at full capacity due to low data access speeds. So the RPM of the disk is important along with the processor frequency and the video card bus width.

    Impact of HDD RPM on performance

    Hard drives (as hard drives are often called) can be in LFF and SFF formats. To put it simply, one type of disk has a 2.5-inch format, the other - 3.5 inches. The first is often used in laptops and servers, the second in conventional system units. It is this type of hard drive that most often has a high spindle speed - 7200 rpm. In such models, the half-turn time is 4.2 ms, and the average search time is 8.5 ms. Therefore, the data access time will be 12.7 ms.

    Note that most desktop computers use SATA hard drives. 7200 RPM is the standard speed for these models. There are also drives with 5400 RPM, but they are not recommended for use on modern systems, although they are cheaper. There are also disks with a parameter of 10,000 RPM - in such models, the search and rotation delays are about 3 ms. Such devices are most often used on gaming computers, but even they can be called outdated. Modern desktop PCs and laptops are increasingly using SSD drives, the operating principle of which is completely different. We'll talk about this a little later.

    Non-standard RPM parameter

    There are also models on the market with a spindle speed of 15,000 rpm. As you guessed, the latency time there is even lower - about 2 ms, and the average search time is 3.8 ms. This allows access to data in 5.8 ms. Consequently, disks with a high RPM have a low search time for the necessary information, which ensures fast exchange between the information storage and the system.

    However, it is important to note that when accessing large data, the difference in performance between disks with high and low RPM parameters will be insignificant, since there will be no delays in accessing information at all.

    How to find out the spindle speed?

    Determining this parameter is as easy as pie - it is always indicated on a sticker on the device itself. Just open the case of your system unit and look at the sticker. There may be a lot of confusing options, but there is always one of the following lines:

    1. HDD RPM: 5400.
    2. RPM: 7200.
    3. RPM: 10000.

    If the hard drive is hidden under the laptop case, which is quite difficult to open, then you can use a special hardware testing program.

    The following are popular:

    1. Crystalmark.
    2. Aida64.
    3. Speccy.

    They are available for downloading from the Internet completely free of charge. By running one of these programs, you can quickly find information about your storage device. There the hard drive parameters will be displayed in detail. We are primarily interested in the "Rotation Rate" line and the value opposite it. In the Russian version of the Aida64 program, you need to click on “Data storage” - “Windows data storage” on the left side, then in the upper part you need to select the hard drive, after which information about it will appear at the bottom, including the line “Rotation speed”.

    Disadvantages of High Speed

    Of course, high RPM ensures high system performance as a whole, but there are also disadvantages. The faster the spindle rotates, the hotter the disk itself heats up, and the more noisy it operates. Also, such hard drives consume more electricity. However, modern technologies make it possible to set the RPM and reduce energy consumption and noise by reducing the spindle speed. Performance losses are compensated by a special data caching algorithm.

    SSD as an alternative

    When developing modern computer platforms, the use of hard drives with platters and a spindle is abandoned. Today, solid-state drives are used, which have no moving parts at all. The "innards" of these drives are chips on a circuit board. Such devices work like regular flash drives, but the performance and speed of data access in them is very high and far exceeds the performance of standard HDD drives. In addition, they are quiet, very light and consume little energy. The high price is the only drawback. 7200 RPM for 1 TB will cost less than a 128 or 256 GB SSD.

    If we draw an analogy, the difference between an SSD and a HDD is approximately the same as the difference between a regular DVD and a flash drive. They have already moved away from disks, and today only flash drives are mainly used.

    Conclusion

    When choosing a hard drive, it is first of all important to consider the performance parameter, which is determined primarily by the spindle speed. Unfortunately, most users look at disk capacity, although this is not the most important thing. It is better to give preference to a hard drive with a capacity of 500 GB and a spindle speed of 7200 rpm than to choose a 1 TB drive with an RPM parameter of 5400. In general, today we need to move away from using such systems, since SSD drives are superior to outdated HDD devices in everything .

    Sooner or later we have to install software not from official repositories. Not all packages are available there, and the newest versions of newly released programs are not always available. Very often, developers post packages for the most popular distributions on their official website. Usually these are deb and rpm. The latter is a little less common, but if you're using a Red Hat-based distribution, this is the package format you need. You can also often find libraries and other components online that are not available in packaged repositories.

    Previously, we already looked at installing deb packages in Ubuntu. And this article will discuss in detail the installation of rpm packages in Linux.

    RPM or RPM Package Manager is a package manager used in Red Hat-based Linux distributions. The file format of this package manager has the same name.

    This format is not very different from the same Deb. You can see their detailed comparison in the article what. Here, I’ll just note that the rpm file is a regular cpio archive, which contains the program files themselves, as well as metadata describing where they should be installed. The database of all installed packages is located in the /var/lib/rpm directory. Among the features, it can be noted that rpm does not support recommended packages, as well as either-or format dependencies.

    To manage packages, just like in Debian systems, there is a console, low-level utility with the same name - rpm. We will consider this further in the article. Different systems use different package managers, for example Red Hat uses Yum, Fedora uses DNF, and OpenSUSE uses zypper, but all of these systems will run the rpm utility.

    Installing RPM packages on Linux

    Let's first look at the syntax of the rpm utility itself:

    $ rpm -mode options package

    The utility can operate in one of the modes:

    • -q- request, obtaining information;
    • -i- installation;
    • -V- package checking;
    • -U- update;
    • -e- deletion.

    Let's consider only the most interesting program options that we will need in this article:

    • -v- show detailed information;
    • -h- display a status bar;
    • --force- perform an action forcibly;
    • --nodeps- do not check dependencies;
    • --replacefiles- replace all old files with new ones without warnings;
    • -i- get information about the package;
    • -l- list of package files;

    Now that you already have an idea of ​​how to work with this utility, you can consider installing the rpm package on Linux. The simplest installation command will look like this:

    sudo rpm -i package_name.rpm

    To work with the command current directory there must be a folder with a package. Here we set the installation mode and transfer the package file. If the installation is successful, the utility will not display anything; if an error occurs, you will know about it.

    To view more detailed information during the installation process, use the -v option:

    sudo rpm -iv packagename.rpm

    You can also enable display of the status bar during the installation process:

    sudo rpm -ivh packagename.rpm

    To check if the package is installed, we already need to use the query mode:

    sudo rpm -q packagename

    You can also immediately remove the package if you don’t need it:

    sudo rpm -e package_name

    But rpm, like dpkg, has one significant drawback. The program cannot resolve dependencies. If the required package is not on the system, you will simply receive an error message and the package will not be installed.

    To automatically download dependencies during the installation of rpm linux, you need to use the distribution's package manager. Let's look at several commands for the most popular RPM distributions. On RedHat and other distributions that use Yum, use this command:

    sudo yum --nogpgcheck localinstall packagename.rpm

    The first option disables GPG key verification, and the second says that we will install a local package. In Fedora, dnf makes things even easier:

    sudo dnf install package_name.rpm

    The Zypper package manager and OpenSUSE do just as well:

    sudo zypper install packagename.rpm

    This is how easy it is to install an rpm with dependencies. But not everyone likes to work in the console; many new users want to use a graphical interface to solve all tasks, including this one. Next we will look at several such utilities.

    Installing RPM file in GUI

    If you use OpenSUSE this is very easy. The universal YaST system configurator, among other things, allows you to install rpm packages. You can do this using the file manager by selecting the context menu option for the file open with Yast or by running the command:

    yast2 -i package_name.rpm

    In Fedora, you can use the distribution's application manager for the same purpose. Previously, there were several more universal utilities for solving this problem, but now they are all outdated.

    Conclusions

    Now you know how to install an rpm file in Linux. In fact, it is very simple and there is not only one way, but several. Although there are slightly fewer graphical utilities here than in Ubuntu. But console utilities are completely enough. If you have any questions, ask in the comments!

    Attention! Actions in paragraphs 1 and 4 of these instructions are performed with administrative rights (root)!

    1. Install the necessary packages for the build process

    # apt-get install rpm-build

    2. Install the src.rpm package of the required software that needs to be assembled

    We find and download the src.rpm package of the required software that we will build, and install it (from the user!):

    $ rpm -i package_name_version.src.rpm

    In this case, the sources (source code) of the package will be located in ~/RPM/SOURCES , and the spec - in ~/RPM/SPECS .
    Availability of software source code and spec, i.e. description of the build process, is a necessary and sufficient condition for building an rpm package (or rebuilding, for example, a package from a newer branch for an older one).

    3. Package assembly

    Let's start assembling, this is done with the command:

    $ rpm -ba --target (i586|x86_64) ~/RPM/SPECS/spec_name of the_required_package_for_build.spec

    In this case, it is necessary to expand the brackets depending on the architecture for which the package is built.

    The compiled packages will be located in ~/RPM/RPMS .

    Note:

    You can rebuild the package without installing (unpacking) it like this:

    $ rpmbuild --rebuild --target (i586/x86_64) package_name_with_version.src.rpm

    In this case, it is also necessary to expand the brackets depending on the architecture for which the package is built.

    Note: As for processors not belonging to the x86_64 family, the indication “--target i586” itself is optional (the build will work without it, but the compiler will build a package precisely tailored to your type of processor and the name of the package will differ from the name of the packages brunches, for example, xxx.athlon.rpm or xxx.pentium4.rpm). The absence of the "--target i586" parameter during assembly does not at all guarantee that the package compiled in this way can be installed on another computer with a different processor. If the assembly is performed under a 64-bit system (on a 64-bit processor with a 64-bit system installed), then the “--target x86_64” key loses its meaning and is not necessary to set it at all.

    Note: If rpm complains about not found macros something like this: “error: Macro %groupadd not found” or “error: Macro %license not found”, then the installation of one of the rpm-build-* packages on the system should help in further building the package, which, in fact, , is an additional dependency for building (rebuilding) your package and is responsible for assigning the required values ​​to these very unfound macros.

    4. Installing assembly dependencies

    If you have an srpm package that you need to install dependencies to build, you can do this by running the following command:

    # apt-get build-dep package_name_with_version.src.rpm

    If there is no srpm package and there is a separate spec and source code, then almost 100% of the build will not work right away - at the very beginning of the output, the console will show packages that must be installed on the system before the build can go further. You install them (these assembly dependencies displayed in the console)

    # apt-get install package1 package2 package3 ...

    and then repeat the assembly (return to step 3).

    5. Automatic search for dependencies for a newly built package

    If you are building a new package, and not rebuilding an existing srpm, then the utility will serve you well as part of the design (search and registration) of the necessary dependencies in the spec buildreq from the rpm-utils package:

    $ buildreq spec_file_name.spec