repos rhel vs ubuntu yum rpm apt-get aptitude apt-cache search
[root@192 ~]# yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos2.hti.pl
* epel: ftp.colocall.net
* extras: mirror-pl.kielcetechnologypark.net
* updates: ftp.wcss.pl
repo id repo name status
!base/7/x86_64 CentOS-7 - Base 9,363
!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 11,369
!extras/7/x86_64 CentOS-7 - Extras 311
!updates/7/x86_64 CentOS-7 - Updates 1,109
repolist: 22,152
[root@192 ~]#
apt-cache search nmap #seach for package
apt-cache policy docker-engine #check available versions in repo
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos2.hti.pl
* epel: ftp.colocall.net
* extras: mirror-pl.kielcetechnologypark.net
* updates: ftp.wcss.pl
repo id repo name status
!base/7/x86_64 CentOS-7 - Base 9,363
!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 11,369
!extras/7/x86_64 CentOS-7 - Extras 311
!updates/7/x86_64 CentOS-7 - Updates 1,109
repolist: 22,152
[root@192 ~]#
[root@192 ~]# yum search nmap
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos2.hti.pl
* epel: ftp.colocall.net
* extras: ftp.vectranet.pl
* updates: ftp.wcss.pl
======================================= N/S matched: nmap =======================================
nmap-frontend.noarch : The GTK+ front end for nmap
nmap-ncat.x86_64 : Nmap's Netcat replacement
nmap.x86_64 : Network exploration tool and security scanner
Name and summary matches only, use "search all" for everything.
[root@192 ~]#
RPM
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/System_Administration_Guide/s1-rpm-using.html
Installing
RPM packages typically have file names like foo-1.0-1.i386.rpm. The file name includes the package name (foo), version (1.0), release (1), and architecture (i386). Installing a package is as simple as logging in as root and typing the following command at a shell prompt:
rpm -Uvh foo-1.0-1.i386.rpm |
If installation is successful, the following output is displayed:
Preparing... ########################################### [100%] 1:foo ########################################### [100%] |
Uninstalling
Uninstalling a package is just as simple as installing one. Type the following command at a shell prompt:
rpm -e foo |
Upgrading
Upgrading a package is similar to installing one. Type the following command at a shell prompt:
rpm -Uvh foo-2.0-1.i386.rpm |
What you do not see above is that RPM automatically uninstalled any old versions of the foo package. In fact, you may want to always use -U to install packages, since it works even when there are no previous versions of the package installed.
Since RPM performs intelligent upgrading of packages with configuration files, you may see a message like the following:
saving /etc/foo.conf as /etc/foo.conf.rpmsave |
This message means that your changes to the configuration file may not be "forward compatible" with the new configuration file in the package, so RPM saved your original file, and installed a new one. You should investigate the differences between the two configuration files and resolve them as soon as possible, to ensure that your system continues to function properly.
Upgrading is really a combination of uninstalling and installing, so during an RPM upgrade you can encounter uninstalling and installing errors, plus one more. If RPM thinks you are trying to upgrade to a package with an older version number, the output is similar to the following:
package foo-2.0-1 (which is newer than foo-1.0-1) is already installed |
To cause RPM to "upgrade" anyway, use the --oldpackage option:
rpm -Uvh --oldpackage foo-1.0-1.i386.rpm |
Freshening
Freshening a package is similar to upgrading one. Type the following command at a shell prompt:
rpm -Fvh foo-1.2-1.i386.rpm |
RPM's freshen option checks the versions of the packages specified on the command line against the versions of packages that have already been installed on your system. When a newer version of an already-installed package is processed by RPM's freshen option, it is upgraded to the newer version. However, RPM's freshen option does not install a package if no previously-installed package of the same name exists. This differs from RPM's upgrade option, as an upgrade does install packages, whether or not an older version of the package was already installed.
RPM's freshen option works for single packages or a group of packages. If you have just downloaded a large number of different packages, and you only want to upgrade those packages that are already installed on your system, freshening does the job. If you use freshening, you do not have to delete any unwanted packages from the group that you downloaded before using RPM.
In this case, issue the following command:
rpm -Fvh *.rpm |
RPM automatically upgrades only those packages that are already installed.
Querying
Use the rpm -q command to query the database of installed packages. The rpm -q foo command displays the package name, version, and release number of the installed package foo:
foo-2.0-1 |
Verifying
Verifying a package compares information about files installed from a package with the same information from the original package. Among other things, verifying compares the size, MD5 sum, permissions, type, owner, and group of each file.
The command rpm -V verifies a package. You can use any of the Package Selection Options listed for querying to specify the packages you wish to verify. A simple use of verifying is rpm -V foo, which verifies that all the files in the foo package are as they were when they were originally installed. For example:
- To verify a package containing a particular file:
rpm -Vf /bin/vi
- To verify ALL installed packages:
rpm -Va
- To verify an installed package against an RPM package file:
rpm -Vp foo-1.0-1.i386.rpm
This command can be useful if you suspect that your RPM databases are corrupt.
ubuntu
apt-cache search nmap #seach for package
apt-cache policy docker-engine #check available versions in repo
Comments
Post a Comment