521 524




Using Linux:Managing Applications






-->















Previous
Table of Contents
Next




Installing the vim rpm package


1.  rpm software packages generally follow a standard naming convention:


name-version-release.arch.rpm


name is the package’s name, version is the package’s version, release is the package’s release level, arch is the hardware architecture the package is for, and rpm is the default extension. This naming scheme is quite handy because some of the essential information about a particular package can be determined from just looking at its name.
2.  For this example, vim package, vim version 4.5, release 2 is installed for a computer with the i386 architecture. To install this package, mount your Red Hat CD-ROM on /mnt/cdrom using the mount command, like this:


# mount /mnt/cdrom


The package you want to install is located in the following directory:


/mnt/cdrom/RedHat/RPMS/vim-4.5-2.i386.rpm


3.  Use cd to change to the appropriate directory, then install vim by using the rpm command’s i, v, and h options, followed by the name of vim’s rpm file, like so:


# rpm -ivh vim-4.5-2.i386.rpm


As the package is installed, the output will look like the following:


vim ################


When the install is finished, 50 hash marks are displayed.


SEE ALSO• To learn more about other text editors for Linux besides vim, see page 49.

In this example, I used the pound character (#) to indicate the root prompt because only root can properly install packages for an entire system. If you try to install this package as a user other than root, an error similar to the following will be generated:


failed to open //var/lib/rpm/packages.rpm
error: cannot open //var/lib/rpm/packages.rpm


Occasionally, the files that one package installs conflict with the files of a previously installed package. If you had vim version 4.2 installed, the following message would have been generated:


/bin/vim conflicts with file from vim-4.2-8/usr/share/vim/vim_tips.txt
conflicts with file from vim-4.2-8
error: vim-4.5-2.i386.rpm cannot be installed


If you wanted to install these files anyway, the --replacefiles option can be added to the command.
Another type of conflict that is sometimes encountered is a dependency conflict. This happens when a package that is being installed requires certain other packages to function correctly. For example, perhaps you try to install the following package:


# rpm -ivh dosemu-0.66.2-1.i386.rpm


You get the following dependency errors:



failed dependencies:
kernel >= 2.0.28 is needed by dosemu-0.66.2-1
dosemu = 0.64.1 is needed by xdosemu-0.64.1-1


This indicates two things. You must upgrade your kernel to 2.0.28, and if you install a newer version of dosemu, you must also install a newer version of xdosemu. Although it is usually not a good idea to ignore dependency problems, using the --nodeps option causes rpm to ignore these errors and install the package.
Upgrading Packages
rpm’s upgrade mode provides an easy way to upgrade existing software packages to newer versions. Upgrade mode is similar to install mode:


rpm -U [options] [packages]


options can be any of the install options or any of the general options.
Here is an example of how to upgrade packages. Suppose that on your system you are currently running emacs version 19.31, but you want to upgrade to the newer emacs version 19.34. To upgrade, use the following command:


# rpm -Uvh emacs-19.34-4.i386.rpm


The upgrade mode is really a combination of two operations, uninstall and install. First, rpm uninstalls any older versions of the requested package, and then installs the newer version. If an older version of the package does not exist, rpm simply installs the requested package.
An additional advantage of upgrade over a manual install and uninstall is that upgrade automatically saves configuration files. For these reasons, some people prefer to use upgrade rather than install for all package installations.
Uninstalling Packages
The uninstall mode of rpm provides for a clean method of removing files belonging to a software package from many locations.

SEE ALSO• To learn about other ways to delete files, see page 42.

Many packages install files in /etc, /usr, and /lib, so removing a package can be confusing, but with rpm an entire package can be removed as follows:


rpm -e [options] [package]


options is one of the options listed later in this section, and package is the name of the package to be removed. For example, if you want to remove the package for dosemu, the command is as follows:


# rpm -e dosemu


The name specified here for the package is just the name of the package, not the name of the file that was used to install the package. Perhaps you ask for the following:



# rpm -e dosemu-0.64.1-1.i386.rpm


The following error would have been generated:



package dosemu-0.64.1-1.i386.rpm is not installed


Another common error encountered while trying to uninstall packages is a dependency error. This occurs when a package that is being uninstalled has files required by another package. For example, when you try to remove dosemu from your system, you get the following error:


removing these packages would break dependencies:
dosemu = 0.64.1 is needed by xdosemu-0.64.1-1






Previous
Table of Contents
Next














Wyszukiwarka

Podobne podstrony:
521 523
2006 praktyczny czerwiecid 524
524,6,artykul
521,37,artykul
Router bezprzewodowy D Link DI 524 AirPlus G High Speed 2 4GHz
517 521
521 522
519 521
524 528
2011 01 09 WIL Wyklad 17id 521

więcej podobnych podstron