RPM repository or simply through the yumdownloader
command. In this lesson, we'll look at installing Ninvaders, space invaders for the command line!
Firstly, we want to install the package with the following command:
#
yumdownloader ninvaders
ninvaders-0.1.1-12.fc23.x86_64.rpm
rpm
installs, verifies and queries RPM packages. Included are actions, along with options for fine-tuning. We'll look at the most well-used options, but for a more comprehensive list, check the man page.
#
rpm [action][options] [package]
Below are some general options you can use with the rpm
command.
Now here are five of the most commonly used actions with rpm
.
You can verify if a package is installed with the -q
option. This will print out its name, version and release name.
#
rpm -q ninvaders package ninvaders is not installed
#
rpm -q openssh openssh-7.1p1-3.fc23.x86_64
Here, we can see that openssh is already installed, while ninvaders is not.
If you already know that a program is installed, tack on the -i
option to check its information.
#
rpm -qi openssh
Name : openssh Version : 7.1p1 Release : 3.fc23 Architecture: x86_64 Install Date: Thu 29 Oct 2015 02:23:32 PM PDT Group : Applications/Internet Size : 1586400 License : BSD Signature : RSA/SHA256, Fri 25 Sep 2015 06:44:55 PM PDT, Key ID 32474cf834ec9cba Source RPM : openssh-7.1p1-3.fc23.src.rpm Build Date : Fri 25 Sep 2015 05:31:51 AM PDT Build Host : buildvm-14.phx2.fedoraproject.org Relocations : (not relocatable) Packager : Fedora Project Vendor : Fedora Project URL : http://www.openssh.com/portable.html Summary : An open source implementation of SSH protocol versions 1 and 2 Description : SSH (Secure SHell) is a program for logging into and executing commands on a remote machine. SSH is intended to replace rlogin and rsh, and to provide secure encrypted communications between two untrusted hosts over an insecure network. X11 connections and arbitrary TCP/IP ports can also be forwarded over the secure channel. OpenSSH is OpenBSD's version of the last free version of SSH, bringing it up to date in terms of security and features. This package includes the core files necessary for both the OpenSSH client and server. To make this package useful, you should also install openssh-clients, openssh-server, or both.
To list all packages listed in your system, use:
#
rpm -qa
... libvisio-0.1.3-2.fc23.x86_64 libsysfs-2.1.0-18.fc23.x86_64 librdmacm-1.0.18.1-4.fc23.x86_64 spice-glib-0.30-1.fc23.x86_64 sssd-client-1.13.1-2.fc23.x86_64 ...
We can also query as to what dependencies a package fulfills.
#
rpm -q --whatrequires openssh
openssh-clients-7.1p1-3.fc23.x86_64 openssh-askpass-7.1p1-3.fc23.x86_64 openssh-server-7.1p1-3.fc23.x86_64
To install a package, change into the directory that holds the .rpm file, then run with the -i
option. With this, rpm
will check for dependencies, conflicts, set config files, and unpack the files to place them in the right folders.
#
rpm -ivh ninvaders-0.1.1-12.fc23.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:ninvaders-0.1.1-12.fc23 ################################# [100%]
The -i
option does the actual installing, while the -v
option is for verbosity, and -h
is to display hash marks for progression.
To specify a root folder, you may add the --root dir
option. This will specify where the root directory, which is helpful if you have more than one Linux installation.
When installing, you may run into dependency issues. To force the installation, use the --force
option. To not check for dependencies, use --nodeps
.
Now that we've installed ninvaders, we can play it by typing nInvaders
!
To upgrade a package to its most recent version, use the -U
option for upgrade (or install if unavailable) or -F
for freshen.
#
rpm -Uvh ninvaders-0.1.1-12.fc23.x86_64.rpm
To uninstall a package, specify the package name (not the .rpm) file.
#
rpm -e ninvaders
The RPM configuration file is located in /usr/lib/rpm/rpmrc. If you want to create your own settings, edit /etc/rpmrc or set a ~/.rpmrc file within your home folder.
Notably, this file allow you to fine-tune the compilation process, according to the CPU being used.
Just like how dpkg
doesn't provide you with the ability to install and manage package dependencies, rpm
does not either. Instead, we can use yum
, which we will discuss next.
This book approaches system administration in a practical way and is an invaluable reference for both new administrators and experienced professionals. It details best practices for every facet of system administration, including storage management, network design and administration, email, web hosting, scripting, and much more.
$ Check priceThis book synthesizes the most effective techniques and must-know principles into clear, pragmatic guidance. No matter what your experience level, development environment, or project size, this book will inform and stimulate your thinking - and help you build the highest quality code.
$ Check priceAd