8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux
Home » Articles » Linux » Here
This article provides an overview of the
rpm
and yum
commands for installing software packages on Linux, with specific reference to the information needed for the RHCSA EX200 and RHCE EX300 certification exams.Remember, the exams are hands-on, so it doesn't matter which method you use to achieve the result, so long as the end product is correct.
Related articles.
rpm
The
rpm
command is used to install, update, list and remove software packages. The command expects to be supplied with flags to indicate the mode of operation and one or more package files. Check out the man pages for a list of all the available options. Using the '-i' flag indicates you are attempting an install of one or more packages. The example below attempts to install a package from a CD. Notice wildcards are supported.The '-U' option uses the supplied packages to update the system. If a package already exists on the system, but the supplied package is newer it will be applied. If the package does not already exist on the system it will be installed.
The '-q' option allows you to query installed packages. You can then erase specific packages using the '-e' option.
The big limitation of the
rpm
command is it does not handle dependencies for you. If there are missing dependencies, an installation will fail. It is for this reason you will probably prefer to use the yum
command described below.yum Repositories
The
yum
command requires a repository as the source of the packages. If you are connected to the internet, you may choose to use the repository provided by your Linux distribution. In this case I am using Oracle Linux 6.x, so I could use the repository provided by Oracle (public-yum.oracle.com). If you have paid for RHEL support, you will register your server using the rhn_register
command, which will configure a yum repository.You can also create a local repository from a distribution DVD, CD or iso file. To do this you will need to mount the DVD, CD or iso file
Next, you can do one of two things.
- Use the DVD directly as a Yum repository.
- Create a new Yum repository by copying the packages off the DVD.
To use the DVD directly, create a file called '/etc/yum.repos.d/dvd.repo' with the following contents, where the 'baseurl' points to your DVD mount point.
Import the GPG key from the DVD.
You can now use the DVD as a Yum repository by referencing it using the '--enablerepo' option.
If you want to take the second option and create a new Yum repository by copying the packages off the DVD, create a local directory to hold the yum repository and copy the packages to it.
To create a repository, we need to install the
createrepo
package, which requires a couple of dependencies.Now we can create a repository out of the contents of the directory.
To allow the
yum
command to use the repository, we must create a '.repo' file in the '/etc/yum.repos.d' directory. Create a file called '/etc/yum.repos.d/localrepo.repo' with the following contents.Notice the 'baseurl' parameter. This indicates the location of the repository. In this case I am using a local file system, so the parameter is set to 'file://' followed by the path to the repository '/repo/'. If this were an internet repository we would expect a baseurl with a HTTP address. For example, the Oracle Linux repository setting would be as follows.
When using internet repositories, you typically expect the 'gpgkey' entry as a security precaution.
You should now be able to use the
yum
command to install packages.yum
The
yum
command allows you to install, update, list and remove packages.The advantage of
yum
over the rpm
command is it deals with all dependencies for you, prompting you with the required dependencies and the total size of the operation. If you agree, all necessary dependencies will be installed, in addition to your specified package(s).He can choose to either kill the bandits and save the peasants, or he can side with the bandits and kill the peasants. Download battle realms installer. When he returns from exile, Kenji comes across bandits raiding a peasant village.
The main Linux distribution repositories also support package groups, allowing you to install, update or remove entire feature sets using a single command. To check if any groups have been defined in the repository, issue the following command.
You can install, update or remove entire groups of packages as follows.
GUI
The 'Add/Remove Software' dialog is available from the console menu (System > Administration > Add/Remove Software). Provided you have yum repository available, you can use this tool to install individual packages or package groups.
Kernel Updates
Updating the kernel on a system is simple using the
yum
command. Simply issue the following command and the kernel and all its dependencies will be updated. How to dry shoes.The updated version of the kernel will be set as the default in the '/boot/grub/grub.conf' file, so next time the system is booted it will be used.
yum-cron
You can choose to download and apply package updates automatically using
yum-cron
.If you are using Oracle Linux, you will have to enable to optional repository (ol*_optional_latest) in the '/etc/yum.repos.d/public-yum-ol*.repo' file by switching the 'enabled' flag to '1'.
Once installed check the 'man yum-cron' page for configuration options. Most of the config files are under the '/etc/yum' directory, but depending on your version of RHEL/OL, the main config file may be placed under the same directory, or under the '/etc/sysconfig' directory.
You can choose to download-only, or download and apply the package changes. In newer versions of RHEL/OL, you also get options to specify the types of changes that will be applied, like only critical updates etc. You can also get it to email you when changes have been applied.
Remember, kernel updates will only take effect after a reboot, so you will need to schedule this where appropriate.
For more information see:
Hope this helps. Regards Tim..
Erase complains package is not installed :
Install complains package is already installed:
Why is this?
EDIT:
user304064
barrristabarrrista78955 gold badges1919 silver badges3737 bronze badges
1 Answer
You have a better version of the package than the one you want to install (
libstdc++-4.1.2-52.el5_8.1.x86_64
vs libstdc++-4.1.2-54.el5
). When you type yum erase libstdc++-4.1.2-52.el5_8.1.x86_64
, yum tries to erase this specific version, but it's not installed. When you type, yum install libstdc++-4.1.2-52.el5_8.1.x86_64
, yum sees that a more recent version is already installed, so it does nothing.If you know what you're doing and really want this specific version, use
yum downgrade
.WilQuWilQu