rpm command
Naming method name-VERSION-release.arch.rpm
Common arch:
x86: i386 i486 i586 i686
x86_64: x64 x86_64 amd64
Platform independent: noarch
List of commands:
Install rpm -ivh vsftpd-2.2.2-24.el7.x86_64.rpm
Uninstall rpm -e vsftpd (must be exact package name)
query rpm -q vsftpd (must be exact package name)
Fuzzy query rpm -qa | grep "vsft"
to view the files contained in the installation package rpm -ql vsftpd to
view which package the file comes from rpm -qf /usr/bin/tree
to view the file list of the uninstalled package rpm -ql -p /root/vsftpd-2.2.2-24 .el7.x86_64.rpm to
view the configuration file rpm -qc vsftpd
to view package dependencies rpm -qR vsftpd
database /var/lib/rpm
View the detailed information in the rpm package
rpm2cpio /misc/treex86-64.rpm | cpio -tv (preview details) or cpio -idv (unzip the rpm package to the current directory) or cpio -idv /usr/bin/tree (unzip the specified file)
yum command
Solve the rpm package installation dependency problem management tool The latest tool is called dnf
Based on the c/s structure, it is divided into server and client. The yum command is a secondary encapsulation of the rpm command, and the bottom layer of yum still needs to depend on the rpm command. The two are not the relationship between replacement and replacement.
Working principle After the client sends a request, the server will first look in the meta data to find out whether there are rpm packages and dependent packages that need to be installed. The client will cache the meta data of the server
yum install will first download the metadata of the corresponding package and cache it locally, and then download the corresponding rpm package. After the downloaded rpm package is installed, it will be deleted by default.
yum will install the latest version of the package by default.
The client only needs to configure one file
The parent directory of repodata is the warehouse directory (baseurl) that needs to be configured.
baseurl can specify multiple paths at the same time
baseurl=file:///mnt/cdrom http:// https:// ftp://
mirrorlist=file:///root /repolist
The yum command does not allow to run multiple yum installation commands in parallel on the same machine at the same time, only serially.
yum list
A package with an @ sign indicates that it has been installed, and @anaconda indicates that the package is installed by the program that installs the operating system
@base means that it has been downloaded and installed from the base repository through the yum command. base means that the rpm package is stored in the base repository, but has not been installed.
Server
1. Various rpm packages 2. Metadata of rpm packages
3. Create your own yum source warehouse
and store your own rpm package in the createrepo /data /data directory
4. Build yum server
1. Install httpd server httpd root directory is /var/www/html
by default 2.cd /var/www/html && mkdir centos/7/os/x86_64
3. Copy the contents of the CD to the warehouse directory
mount /dev/sr0 centos/7/os/x86_64
yum repolist
yum list *ftp*
yum install httpd 或者 yum install /mnt/cdrom/httpd.rpm
yum history | yum history list 12 | yum history info 12
yum history undo 12 | yum history redo 12
yum package group function
yum grouplinstall group1
yum grouplist group1
yum groupremove group1
source code compilation
rescue rescue mode
Entering rescue mode will load a small Linux operating system, which has nothing to do with the failure of the hard disk. After the system starts, the system on the original hard disk will be mounted to the /mnt/sysimage directory
[root@centos7 ~]# ldd /bin/ls View the library that the command needs to call (dependency)
linux-vdso.so.1 => (0x00007ffdb09f7000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f0f1807e000 )
libcap.so.2 => /lib64/libcap.so.2 (0x00007f0f17e79000)
libacl.so.1 => /lib64/libacl.so.1 (0x00007f0f17c6f000)
libc.so.6 => /lib64/libc.so .6 (0x00007f0f178ac000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f0f1764a000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f0f17445000)
lib64/ld-linux-x86-64 .so.2 (0x0000555b426e9000)
libattr.so.1 => /lib64/libattr.so.1 (0x00007f0f17240000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0f17024000)
Points to note when creating soft links:
libc.so.6 -> libc-2.17.so
The absolute path cannot be used in rescue mode ln -s /mnt/sysimage/libc-2.17.so /mnt/sysimage/libc.so.6 After the system restarts, the /mnt/sysimage directory cannot be found and fails
Must use relative path cd /mnt/sysimage/ ln -s libc-2.17.so libc.so.6
2.ldconfig -p
3.mount /dev/sr0 /mnt/cdrom
install rpm package to specify what directory is the root
rpm -ivh /mnt/packages/rpm_4.8.rpm --root=/mnt/sysimage/
switch root directory
chroot /mnt/sysimage /