Site Administration Page 2 - Linux Administration: Installing Software |
The easiest way to install a new package is to use the -i option with RPM. For example, if you downloaded a package called bc-1.05a-4.i386.rpm and wanted to install it, you would type:
If the installation went fine, you would not see any errors or messages. This is the most common method of installing RPMs. On the other hand, if the package already exists, you would see this message:
Some packages rely on other packages. A game, for example, may depend on SVGA libraries having already been installed. In those instances, you will get a message indicating which packages need to be installed first. Simply install those packages and then come back to the original package. If you need to upgrade a package that already exists, use the -U option, like so:
Some additional command-line options to RPM are listed in Table 1.
Table 1 RPM Command-Line Options For example, to force the installation of a package regardless of dependencies or other errors, you would type:
where packagename.rpm is the name of the package being installed. Querying a Package Sometimes it is handy to know which packages are currently installed and what they do. You can do that with the RPM query options. To list all installed packages, simply type:
Be ready for a long list of packages! If you are looking for a particular package name, you can use the grep command to specify the name (or part of the name) of the package, like so:
NOTE The -i parameter in grep tells it to make its search case-insensitive. If you just want to view all of the packages one screen at a time, you can use the more command, like so:
To find out which package a particular file belongs to, type:
where filename is the name of the file that you want to check on. To find out the purpose of a package that is already installed, you must first know the name of the package (taken from the listing in rpm -qa) and then specify it, like so:
where packagename is the name of the package that you want information about. To find out what files are contained in a package, type:
where packagename is the name of the package that you want information about.
blog comments powered by Disqus |