Management of software packages for Linux learning Notes 1. RPM (RPM Package Manager) Format: for example, cvs.1.11.2-10. i386.rpm cvs: Software name 1.11.2: software package version number, including the main version number and minor version number i386: software running hardware platform rpm: File Extension www.2cto.com uninstall: rmp-e cvs [-- nodeps] if other software includes dependencies, a prompt message is displayed when the software is uninstalled. You can use -- nodeps to forcibly uninstall the software for query: rmp-qa package name [root @ CentOS-Test Packages] # rpm-aq sudo query other Packages on which this package depends [root @ CentOS-Test/] # rpm-qf/etc /services Query the file package setup-2.8.14-16.el6.noarch to which the file belongs [root @ CentOS-Test Packages] # rpm -Qip sudo-1.7.4p5-11.el6.i686.rpm to query what the uninstalled software package is for [root @ CentOS-Test/] # rpm-qc sudo to view the configuration file/etc/pam installed with rpm. d/sudo/etc/pam. d/sudo-I/etc/sudo-ldap.conf/etc/sudoers [root @ CentOS-Test/] # rpm-ql sudo package installation path and what files are installed, general/etc are under the configuration file/usr/bin is the command sudo-1.7.4p5-11.el6.i686 installation: rmp-ivh package name rpm-ivh -- excludedocs package name installation documentation rpm-ivh -- prefix path package name specifies the installation path rpm-ivh -- test package name only for Installation test Try not to actually mount the CD: if mkdir/mnt/cdrom is not available, you can first create this folder mount/dev/cdrom/mnt/cdrom and mount the disc file to the folder you just created [root @ CentOS-Test ~] # Mount/dev/cdrom/mnt/cdrom mount: block device/dev/sr0 is write-protected, mounting read-only [root @ CentOS-Test Packages] # ls | grep sudo sudo-1.7.4p5-11.el6.i686.rpm upgrade installation: rpm-Uvh package name override installation: when the rpm-ivh -- replacepkgs package name file conflicts, install the rpm-ivh -- replacefiles package name for unresolved dependencies. The rpm-ivh -- nodeps software name is forcibly installed to resolve the dependencies during installation, however, yum cannot be used in cases. 2. Advantages of yum: a software package that automatically solves the dependency between software packages must be connected to the Internet. Installation: yum install software package name check update: yum check- Update package name update: yum update package query: yum list | grep sudo yum list | grep samba finds the package information on the yum Source: yum info sudo is used to view the package information. Uninstall: yum remove package name help: yum -- help 3. Verify the md5sum file name and only verify the file content [root @ CentOS-Test data] # md5sum lhc_xx.txt 1_lhc_xx.txt [root @ CentOS-Test data] # echo "# this is a test file "> lhc_xx.txt [root @ CentOS-Test data] # md5sum lhc_xx.txt 10be8cdfcd22f7cbd149414 1a03e67f8 lhc_xx.txt rpm-V software name parameters are as follows: 5: file md5 check value S: file size L: Link file T: File Creation Time D: Device File U: file user G: file user group M: File Permission 4. Extraction of RPM package management package files, for example: accidentally deleted the/etc/inittab file or switched from the disc to repair mode [root @ CentOS-Test bak] # rm-f/etc/inittab to find the rpm package to which the inittab file belongs [root @ CentOS-Test bak] # rpm-qf/etc/inittab initscripts-9.03.31-2.el6.centos.i686 mount the disc to mnt/cdrom [root @ CentOS-Test bak] # mount/dev/cdrom/mnt/cdrom from restore the inittab file to the current directory in the rpm package on the CD Directory [root @ CentOS-Test bak] # rpm2cpio/mnt/cdrom/Packages/initscripts-9.03.31-2.el6.centos.i686.rpm | cpio-idv. /etc/inittab. /etc/inittab 11182 block copy. /etc/inittab file to/etc/inittab [root @ CentOS-Test bak] # cp etc/inittab/etc/inittab 5. The source code package can be installed flexibly. specify path or other options, the gcc or other compilers must be available before installation. The installation procedure is generally to install the gcc compiler (which can be installed using yum) and decompress the package. /confgure make install to install proftpd as an example to extract the package [root @ CentOS-Test software] # tar-xzvf proftpd-1.3.4b.tar.gz to the decompressed directory and then display the file list [root @ CentOS-Test A proftpd-1.3.4b] # ls acconfig. h configure. in install-sh modules README. controls README. modules src aclocal. m4 contrib lib news readme. cygwin README. PAM stamp-h.in ChangeLog COPYING locale proftpd. spec README. dso readme. ports tests config. guess CREDITS ltmain. sh README. facl README. solaris2.5x utils config. h. in doc m4 README. aix readme. freeBSD README. unixware config. sub include Makefile. in README. capabilities README. IPv6 RELEASE_NOTES configure INSTALL Make. rules. in README. classes README. LDAP sample-deployments find configure in the file, execute and add the -- prefix parameter to specify the installation path [root @ CentOS-Test proftpd-1.3.4b] #. /configure -- prefix =/usr/local/proftpd checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: no acceptable C compiler found in $ PATH See 'config. log' for more details. the gcc compiler is not found, therefore, you need to first install the gcc compiler [root @ CentOS-Test proftpd-1.3.4b] # rpm-qa gcc [root @ CentOS-Test proftpd-1.3.4b] # yum install gcc and then run the [root @ CentOS- proftpd-1.3.4b Test] #. /configure -- prefix =/usr/local/proftpd Compilation: make before you install the compiler [root @ CentOS-Test proftpd-1.3.4b] # make install [root @ CentOS-Test proftpd-1.3.4b] # make install 6, script installation such as: webmin, OpenOffice