Install Rpm Package On Arch Linux

Re: Install deb or rpm package (SOLVED) pacman needs.pkg.tar.gz files, not just.tar.gz. I think you can use rpmextract for rpm's, not sure of an equivalent for deb but if all else fails, you can try using alien to convert from deb to rpm and then rpm extract. For the strength of the pack is the wolf, and the strength of the wolf is the pack. Jul 12, 2020 Arch (and any based ditros on it) does not rely on RPM 1 format, that's is in fact developed and used by Red Hat derivates. There are some cases (e.g. This one 2) in which a RPM package is used to install an application on Arch (and derivates) systems, but prior to do this, the RPM is extracted and handled/converted in the Arch flavour.

  1. Install Rpm Package On Arch Linux Command
  2. Install Rpm Package On Arch Linux Download
  3. Install Rpm Package On Arch Linux Operating System
  4. Install Rpm Package On Arch Linux Windows 10
  5. Install Rpm Package On Arch Linux Os

This section describes how to install Privilege Management for Unix and Linux using a package installer for Red Hat Enterprise Linux (RHEL) 4 or 5 on an x86, x86_64, ia64, or S/390 computer. Use the Linux package installation if you want to install Privilege Management for Unix and Linux using the Linux RPM package manager.

The Privilege Management for Unix and Linux Linux package installer that is described here is not compatible with the Privilege ManagementPrivilege Management v5.x packages. You must remove BeyondTrustPrivilege Management packages v5.x before installing Privilege Management for Unix and Linux Linux packages.

Prerequisites

To use the Linux package installer, you must have the following:

  • Package tarball file for the appropriate Privilege Management for Unix and Linux flavor

For the Privilege Management for Unix and Linux Linux package installer, the tarball files are cumulative. That is, an update tarball file contains a complete Privilege Management for Unix and Linux installation. It is not necessary to install a baseline version of Privilege Management for Unix and Linux before installing an upgrade.

  • Root access or superuser privileges
  • RPM Package Manager (rpm) v4.4 or later

The Privilege Management for Unix and Linux Linux package installer does not support prefix or suffix installations.

Plan Your Installation

When preparing to use the Privilege Management for Unix and Linux package installer, you should be familiar with the following concepts and restrictions:

Component packages: A Privilege Management for Unix and Linux component package is an RPM package manager (.rpm) file that installs a part of the Privilege Management for Unix and Linux application. The Privilege Management for Unix and Linux component packages are listed below with the format powerbroker-component-v.v.r.bb-pv.arch.rpm, where:

  • component = Privilege Management component package name
  • v = major version v = minor version r = release
  • bb = build
  • pv = version number of the package
  • arch = architecture (for example, i386)
Component PackageDescription
powerbroker-loghost-v.v.r.bb-pv.arch.rpmContains log host, pbsync, and pbsyncd.
powerbroker-shlibs-v.v.r.bb-pv.arch.rpmContains shared libraries.
powerbroker-pbrest-v.v.r.bb-pv.arch.rpmContains REST API files.
powerbroker-rnssvr-v.v.r.bb-pv.arch.rpmContains Registry Name Service files.
powerbroker-licsvr-v.v.r.bb-pv.arch.rpmContains license server files.
powerbroker-master-v.v.r.bb-pv.arch.rpmContains policy server host, pbsync, and pbsyncd.
powerbroker-submithost-v.v.r.bb-pv.arch.rpmContains submit host and Privilege Management for Unix and Linux shells.
powerbroker-runhost-v.v.r.bb-pv.arch.rpmContains run host and Privilege Management for Unix and Linux utilities.
powerbroker-guihost-v.v.r.bb-pv.arch.rpmContains GUI host and secure GUI host.

Which component packages are required depends on the type of Privilege Management for Unix and Linux host you create, such as policy server host, submit host, and so on. You can select the types of Privilege Management for Unix and Linux hosts in the pbinstall installation menu, as shown in the following table. For readability the ending of each component in the table (-v.v.r.bb-pv.arch.rpm) is removed.

Menu Selection

Required Components (-v.v.r.bb-pv.arch.rpm)

Install everything here (demo mode)? = Yes

powerbroker-master

powerbroker-runhost

powerbroker-submithost

powerbroker-loghost

powerbroker-guihost

powerbroker-shlibs

Install Master Host? = Yes

powerbroker-master

Install Run Host? = Yes

powerbroker-runhost

Install Submit Host? = Yes

powerbroker-submithost

Install Log Host? = Yespowerbroker-loghost
Install GUI Host? = Yespowerbroker-guihost
Install Secure GUI Host? = Yespowerbroker-guihost
Install BeyondTrust built-in third-party libraries? = Yespowerbroker-shlibs
Install Registry Name Services Server? [yes]powerbroker-rnssvr
Install License Server? [yes]powerbroker-licsvr

Configuration package: RPM package that is used to install the following files:

  • pb.settings: Hardcoded target location /etc/pb.settings
  • pb.cfg: Hardcoded target location /etc/pb.cfg
  • All the encryption keyfiles defined for networkencryption, eventlogencryption, iologencryption, reportencryption, policyencryption, and restkeyencryption
  • By default, two key files are created: pb.key and pb.rest.key
  • The sysadmin can define multiple encryption with different keyfiles in locations other than /etc. To upgrade and retain settings on the target machine, view all encryption settings in /etc/pb.settings and copy the files to the settings_files directory before running 'pbinstall -z' and pbcreate*cfgpkg
  • pb.conf (for policy server hosts)
  • Man pages for the pbinstall and pbcreatelincfgpkg programs

The Privilege Management for Unix and Linux configuration package is created by the pbcreatelincfgpkg program. The component packages must be installed before you install the configuration package.

Package name: Name of the package as stored in the RPM package manager database. For Privilege Management for Unix and Linux package installations, this name is the same as the package file name without the .arch.rpm extension.

Relocated base directory: The directory where the Privilege Management for Unix and Linux binary files and log files are installed. You can choose an alternative directory in which to install these files.

pbinstall program: To create the Privilege Management for Unix and Linux settings files, you use the pbinstall program with the -z (settings only) option. pbinstall -z only creates the settings files, and is incompatible with the following command line options:

Options Incompatible with pbinstall -z

Description

-bRuns pbinstall in batch mode.
-cSkip the steps that process or update the Privilege Management for Unix and Linux settings file.
-eRuns install script automatically by bypassing the menu step of pbinstall.
-iIgnores previous pb.settings and pb.cfg files.
-pSets the pb installation prefix.
-sSets the pb installation suffix.
-uInstalls the utility programs.
-xCreates a log synchronization host (installs pbsyncd).

When you execute pbinstall with the -z option, you can see two menu items that are not otherwise available:

  • Enter existing pb.settings path: This enables you to specify your own pb.settings file. pbinstall reads this settings file and populates the remaining menu choices. You can override some menu choices. If set to none, then pbinstall does not read a settings file. The remaining menu choices are populated with default values.
  • Enter directory path for settings file creation: This enables you to specify an alternative output directory for the settings files. The default directory is /unzip-dir/powerbroker/v<flavor>/<flavor>install/settings_files, where unzip-dir is the directory where the package tarball file was unzipped.

The behavior of pbinstall -z depends on whether certain additional command line options are specified:

  • If no other command line options are specified, pbinstall initially presents a short version of the installation menu. Depending on the choices you make in these items, further menu items become available.
  • If command line options -g, -l, -m, -o, -r, or -w are specified, pbinstall presents an expanded version of the installation menu that reflects the host types that you are configuring.

When running pbinstall with the -z option, the following menu items are preprogrammed and cannot be changed:

  • Install man pages?
  • Privilege Management daemon location
  • Administration programs location
  • User programs location
  • GUI library directory
  • Policy include (sub) file directory
  • User man page location
  • Admin man page location
  • Policy filename
  • BeyondTrust built-in third-party library directory

In addition, the values of the following menu items determine the values of other menu items:

Options Preset When Running pbinstall -z

Setting this menu option to Yes

Sets these values to Yes

Install Master Host?Install Synchronization? Synchronization can be initiated from this host?
Install Run Host?Install Utilities?
Install Submit Host?Install PBSSH?

Install pbksh?

Install pbsh?

Will this host use a Log Host?

Install Log Host?Install Synchronization? Synchronization can be initiated from this host?

If you plan to use the package installer to install Privilege Management for Unix and Linux on a computer that already has an interactive Privilege Management for Unix and Linux installation on it, see Interactive Versus Packaged Installation for additional considerations.

If you plan to use Registry Name Service and are running pbinstall -z on a client host (non-primary server), you must perform client registration. This is necessary to properly set up the registry name service database. Client registration also requires that you collect from the Privilege Management for Unix and Linux primary server the following information:

  • REST Application ID
  • REST Application Key
  • Primary server network name or IP address
  • Primary License Server REST TCP/IP port
  • Registration Client Profile name

Registering client with Primary RNS: If Registry Name Services is enabled for Privilege Management for Unix and Linux, each client host (after the first server installation) needs to be registered with the Primary Registry Name Server. When using package installers on a target host, a post-install configuration script (/opt/pbul/scripts/pbrnscfg.sh) is provided to be manually executed on that host to properly register it. This post-install configuration script asks for information about the Primary Registry Name Server, including the Application ID (appid), Application Key (appkey), address/domain name, and the REST TCP/IP port number. This is the same information provided during the client registration part of a pbinstall -z install which generates the settings file.

If you prefer a more convenient method of registering RNS clients where the post-install configuration script is non-interactive, Privilege Management for Unix and Linux can save the relevant information in a hidden file during the settings-only run of pbinstall, bundle it with the configuration package, and automatically apply it to the target host when that package is installed. However, understand that this is not secure, but is available if the security-convenience trade-off is acceptable. To enable this, refer to the question regarding post-install configuration script displayed when running pbinstall -z.

For more information, please see the following:

  • On pbinstall command-line options, Installation Programs

Overview of Steps

Use of the Linux package installer involves the following steps:

  1. Unpack the Privilege Management for Unix and Linux package tarball file.
  2. Use the pbinstall program to create Privilege Management for Unix and Linux settings files.
  3. Use the pbcreatelincfgpkg program to create the Privilege Management for Unix and Linux configuration package.
  4. Perform a package installation using the Linux rpm command for any required components.
  5. Perform a package installation using the Linux rpm command for the Privilege Management for Unix and Linux configuration package.
  6. If Registry Name Service is enabled and installing on a non-primary servery, run /opt/pbul/scripts/pbrnscfg.sh to register the host.

For additional details on the above steps, please see Installation Procedure.

This article aims to assist users creating their own packages using the Arch Linux 'ports-like' build system, also for submission in AUR. It covers creation of a PKGBUILD – a package build description file sourced by makepkg to create a binary package from source. If already in possession of a PKGBUILD, see makepkg. For instructions regarding existing rules and ways to improve package quality see Arch packaging standards.

Overview

Packages in Arch Linux are built using the makepkg utility and the information stored in a PKGBUILD file. When makepkg runs, it searches for a PKGBUILD in the current directory and follows the instructions in it to acquire the required files and/or compile them to be packed within a package file (pkgname.pkg.tar.zst). The resulting package contains binary files and installation instructions ready to be installed by pacman.

An Arch package is no more than a tar archive, or 'tarball', compressed using zstd(1), which contains the following files generated by makepkg:

  • The binary files to install.
  • .PKGINFO: contains all the metadata needed by pacman to deal with packages, dependencies, etc.
  • .BUILDINFO: contains information needed for reproducible builds. This file is present only if a package is built with pacman 5.1 or newer. See BUILDINFO(5).
  • .MTREE: contains hashes and timestamps of the files, which are included in the local database so that pacman can verify the integrity of the package.
  • .INSTALL: an optional file used to execute commands after the install/upgrade/remove stage. (This file is present only if specified in the PKGBUILD.)
  • .Changelog: an optional file kept by the package maintainer documenting the changes of the package. (It is not present in all packages.)

Preparation

Prerequisite software

First, ensure that the necessary tools are installed: the package group base-devel should be sufficient, it includes make and additional tools needed for compiling from source.

The key tool for building packages is makepkg (provided by pacman), which does the following:

  1. Checks if package dependencies are installed.
  2. Downloads the source file(s) from the specified server(s).
  3. Unpacks the source file(s).
  4. Compiles the software and installs it under a fakeroot environment.
  5. Strips symbols from binaries and libraries.
  6. Generates the package meta file which is included with each package.
  7. Compresses the fakeroot environment into a package file.
  8. Stores the package file in the configured destination directory, which is the current working directory by default.

Download and test the installation

Download the source tarball of the software you want to package, extract it, and follow the author's steps to install the program. Make a note of all commands and/or steps needed to compile and install it. You will be repeating those same commands in the PKGBUILD file.

Most software authors stick to the 3-step build cycle:

This is a good time to make sure the program is working correctly.

Creating a PKGBUILD

When makepkg is run, it looks for a PKGBUILD file in the current working directory. If it finds one, it downloads the software's source code and compiles it according to the instructions specified in the PKGBUILD file. The instructions must be fully interpretable by the Bash shell. After successful completion, the resulting binaries and metadata of the package, i.e. package version and dependencies, are packed in a pkgname.pkg.tar.zst package file. The newly created package can be installed by simply using makepkg --install which will call pacman in the background, or by directly using pacman -U pkgname.pkg.tar.zst.

To start building a new package, first create a new directory for the package and change current directory into this one. Then, a PKGBUILD file needs to be created: a prototype PKGBUILD found in /usr/share/pacman/ can be used or you can start from a PKGBUILD from another package. The latter may be a good choice if a similar package already exists.

Defining PKGBUILD variables

Example PKGBUILDs are located in /usr/share/pacman/. An explanation of possible PKGBUILD variables can be found in the PKGBUILD article.

makepkg defines two variables that you should use as part of the build and install process:

srcdir
This points to the directory where makepkg extracts or symlinks all files in the source array.
pkgdir
This points to the directory where makepkg bundles the installed package, which becomes the root directory of your built package.

They contain absolute paths, which means you do not have to worry about your working directory if you use these variables properly.

Note:makepkg, and thus the build() and package() functions, are intended to be non-interactive. Interactive utilities or scripts called in those functions may break makepkg, particularly if it is invoked with build-logging enabled (--log). (See FS#13214.)

PKGBUILD functions

When building a package, makepkg will invoke the following five functions if they have been defined in the PKGBUILD. Function package() is required in every PKGBUILD and will always be invoked. If any of the other functions is not defined, makepkg will simply skip the invocation of that function.

During the build, the functions are invoked in the order in which they are listed here.

prepare()

With this function, commands that are used to prepare sources for building are run, such as patching. This function runs right after package extraction, before pkgver() and the build function. If extraction is skipped (makepkg --noextract), then prepare() is not run.

Note: (From PKGBUILD(5)) The function is run in bash -e mode, meaning any command that exits with a non-zero status will cause the function to exit.

pkgver()

pkgver() runs after the sources are fetched, extracted and prepare() executed. So you can update the pkgver variable during a makepkg stage.

This is particularly useful if you are making git/svn/hg/etc. packages, where the build process may remain the same, but the source could be updated every day, even every hour. The old way of doing this was to put the date into the pkgver field which, if the software was not updated, makepkg would still rebuild it thinking the version had changed. Some useful commands for this are git describe, hg identify -ni, etc. Please test these before submitting a PKGBUILD, as a failure in the pkgver() function can stop a build in its tracks.

Note: pkgver cannot contain spaces or hyphens (-). Using sed to correct this is common.

build()

Install Rpm Package On Arch Linux

Now you need to implement the build() function in the PKGBUILD file. This function uses common shell commands in Bash syntax to automatically compile software and create a directory called pkg to install the software to. This allows makepkg to package files without having to sift through your file system.

The first step in the build() function is to change into the directory created by uncompressing the source tarball. makepkg will change the current directory to $srcdir before executing the build() function. Therefore, in most cases, like suggested in /usr/share/pacman/PKGBUILD.proto, the first command will look like this:

Now, you need to list the same commands you used when you manually compiled the software. The build() function in essence automates everything you did by hand and compiles the software in the fakeroot build environment. If the software you are packaging uses a configure script, it is good practice to use --prefix=/usr when building packages for pacman. A lot of software installs files relative to the /usr/local directory, which should only be done if you are manually building from source. All Arch Linux packages should use the /usr directory. As seen in the /usr/share/pacman/PKGBUILD.proto file, the next two lines often look like this:

Note: If your software does not need to build anything, do not use the build() function. The build() function is not required, but the package() function is.

check()

Place for calls to make check and similar testing routines. It is highly recommended to have check() as it helps to make sure software has been built correctly and works fine with its dependencies.

Users who do not need it (and occasionally maintainers who can not fix a package for this to pass) can disable it using BUILDENV+=('!check') in PKGBUILD/makepkg.conf or call makepkg with --nocheck flag.

Install Rpm Package On Arch Linux Command

package()

The final step is to put the compiled files in a directory where makepkg can retrieve them to create a package. This by default is the pkg directory—a simple fakeroot environment. The pkg directory replicates the hierarchy of the root file system of the software's installation paths. If you have to manually place files under the root of your filesystem, you should install them in the pkg directory under the same directory structure. For example, if you want to install a file to /usr/bin, it should instead be placed under $pkgdir/usr/bin. Very few install procedures require the user to copy dozens of files manually. Instead, for most software, calling make install will do so. The final line should look like the following in order to correctly install the software in the pkg directory:

Note: It is sometimes the case where DESTDIR is not used in the Makefile; you may need to use prefix instead. If the package is built with autoconf / automake, use DESTDIR; this is what is documented in the manuals. If DESTDIR does not work, try building with make prefix='$pkgdir/usr/' install. If that does not work, you will have to look further into the install commands that are executed by 'make <...> install'.

makepkg --repackage runs only the package() function, so it creates a package without building. This may save time e.g. if you have changed just the depends variable of the package.

Install Rpm Package On Arch Linux Download

Testing the PKGBUILD and package

As you are writing the build() function, you will want to test your changes frequently to ensure there are no bugs. You can do this using the makepkg command in the directory containing the PKGBUILD file. With a properly formatted PKGBUILD, makepkg will create a package; with a broken or unfinished PKGBUILD, it will raise an error.

If makepkg finishes successfully, it will place a file named pkgname-pkgver.pkg.tar.zst in your working directory. This package can be installed with the pacman -U command. However, just because a package file was built does not imply that it is fully functional. It might conceivably contain only the directory and no files whatsoever if, for example, a prefix was specified improperly. You can use pacman's query functions to display a list of files contained in the package and the dependencies it requires with pacman -Qlp [package file] and pacman -Qip [package file] respectively.

If the package looks sane, then you are done! However, if you plan on releasing the PKGBUILD file, it is imperative that you check and double-check the contents of the depends array.

Also ensure that the package binaries actually run flawlessly! It is annoying to release a package that contains all necessary files, but crashes because of some obscure configuration option that does not quite work well with the rest of the system. If you are only going to compile packages for your own system, though, you do not need to worry too much about this quality assurance step, as you are the only person suffering from mistakes, after all.

Checking package sanity

After testing package functionality check it for errors using namcap:

Namcap will:

  1. Check PKGBUILD contents for common errors and package file hierarchy for unnecessary/misplaced files
  2. Scan all ELF files in package using ldd, automatically reporting which packages with required shared libraries are missing from depends and which can be omitted as transitive dependencies
  3. Heuristically search for missing and redundant dependencies

and much more.

Get into the habit of checking your packages with namcap to avoid having to fix the simplest mistakes after package submission.

Submitting packages to the AUR

Please read AUR submission guidelines for a detailed description of the submission process.

Summary

  1. Download the source tarball of the software to package.
  2. Try compiling the package and installing it into an arbitrary directory.
  3. Copy over the prototype /usr/share/pacman/PKGBUILD.proto and rename it to PKGBUILD in a temporary working directory.
  4. Edit the PKGBUILD according to the needs of your package.
  5. Run makepkg and check whether the package builds correctly.
  6. If not, repeat the previous two steps.

Warnings

  • Before you can automate the package building process, you should have done it manually at least once unless you know exactly what you are doing in advance, in which case you would not be reading this in the first place. Unfortunately, although a good bunch of program authors stick to the 3-step build cycle of './configure; make; make install', this is not always the case, and things can get real ugly if you have to apply patches to make everything work at all. Rule of thumb: If you cannot get the program to compile from the source tarball, and make it install itself to a defined, temporary subdirectory, you do not even need to try packaging it. There is not any magic pixie dust in makepkg that makes source problems go away.
  • In a few cases, the packages are not even available as source and you have to use something like sh installer.run to get it to work. You will have to do quite a bit of research (read READMEs, INSTALL instructions, man pages, perhaps ebuilds from Gentoo or other package installers, possibly even the MAKEFILEs or source code) to get it working. In some really bad cases, you have to edit the source files to get it to work at all. However, makepkg needs to be completely autonomous, with no user input. Therefore if you need to edit the makefiles, you may have to bundle a custom patch with the PKGBUILD and install it from inside the prepare() function, or you might have to issue some sed commands from inside the prepare() function.

More detailed guidelines

Arch package guidelines

32-bit – CLR – CMake – Cross – DKMS – Eclipse – Electron – Font – Free Pascal – GNOME – Go – Haskell – Java – KDE – Kernel – Lisp – Meson – MinGW – Node.js – Nonfree – OCaml – Perl – PHP – Python – R – Ruby – Rust – VCS – Web – Wine

PKGBUILD generators

PKGBUILDs for some packages can be generated automatically.

Note: Users are still responsible for ensuring that the package meets the high quality standards before submitting the generated files to the AUR.

Install Rpm Package On Arch Linux Operating System

  • Haskell: cblrepo, arch-hs
  • Node.js: nodejs-npm2archAUR
  • Python: pipman-gitAUR, pip2arch-gitAUR, python-pypi2pkgbuildAUR
  • Ruby: gem2archAUR, pacgemAUR
  • Rust: cargo-pkgbuildAUR

Install Rpm Package On Arch Linux Windows 10

See also

  • How to correctly create a patch file.
  • Arch Linux Classroom IRC Logs of classes about creating PKGBUILDs.

Install Rpm Package On Arch Linux Os

Retrieved from 'https://wiki.archlinux.org/index.php?title=Creating_packages&oldid=684574'