In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Linux Application Foundation
The relationship between 1.Linux applications and commands
(1) basic commands for .Linux are usually placed in the "/ bin" and "/ sbin" subdirectories of the system, and applications are usually placed in the "/ usr/bin" and "/ usr/sbin" directories.
(2)。 Command files are usually installed when the Linux system is installed, and the application needs to be selectively installed by the administrator in the form of a software package
(3)。 The function of the command is to manage the Linux system itself, while the application program completes relatively independent tasks.
(4)。 Commands can only be run on the command line, and applications run in a variety of ways.
(5)。 Commands are generally run only in the character interface, and applications can be run in the graphical interface
two。 Comparison between system applications and third-party applications
(1)。 System applications usually follow the Linux package management format, and third-party applications may be installed in other ways
(2)。 The installation of system applications is generally simple and smooth, and the installation process of third-party applications is complex, which usually requires the administrator to complete the configuration manually.
(3)。 Source code is available for system applications, while commercial third-party applications only provide executable code for the program, generally not source code
3.Linux application composition
(1)。 Normal execution file, saved in the "/ usr/bin" directory
(2)。 Server execution program files and management program files, saved in the "/ usr/sbin" directory
(3)。 Application configuration files, saved in the "/ etc" directory
(4)。 Application documentation file, saved in the "/ usr/share/doc/" directory
(5)。 Application man page file, saved in the "/ usr/share/man/" directory
(6)。 Log files, saved in the "/ var/log" directory
II. RPM package management
The basic concept of 1.RPM package management: RPM (short for Redhat Package Manager) was first proposed by Red Hat, and now it has become a recognized package management standard in Linux.
File name of the 2.RPM package: the name of the RPM package file has a fixed format, such as "bash-3.0-19.2.i386.rpm", "bash" is the software name, "3.0" is the major version number, "19.2" is the minor version number, "i386" is the running hardware platform, "rpm" is the extension of the file, and it is a software package in RPM format.
3.rpm command format: using alone will display rpm command format, "rpm" command is very complex, using different command options can achieve the functions are: query installed RPM software package information, query RPM software package installation file information, install RPM software package, uninstall software package, upgrade package
4. Use the rpm command to query the software package: (rpm-Q)
(1) .rpm-qa: query the RPM package installed in the system, and use it with the "grep" command to query the software package containing the specified keyword string in the RPM package name, such as "rpm-qa | grep-I x11 | head-3".
(2) .rpm-Q: query whether the software package is installed. The name needs to be spelled accurately.
(3) .rpm-qi: query package details. The results of the command include the package name, version information, establishment time, installation time, size, license agreement complied with, Packer, summary and detailed description information.
(4) rpm-ql: query the list of files in the installed package. The result of the command execution will display the list of all files included in the package. Work with "grep" to filter the query results, and only display the list of files including the specified keywords.
(5) rpm-qf: query the software package to which the files in the system belong
(6) rpm-qc: check the configuration file of the rpm package
(7) rpm-qd: documentation manual
(8) rpm-qpi: query the information in the RPM installation package file, (show the details of the RPM package file) and "RPM package file name" (when qp is the option, the path of the package must be taken as a parameter)
(9) rpm-qpl: (displays a list of files contained in the RPM package)
5. Use the rpm command to install the software package
(1) .rpm-I: install the RPM package
(2) .rpm-U: update
(3) .rpm-F: check which rpm installation package a folder directory belongs to
6. Use the rpm command to uninstall the package:
(1). Before uninstalling the rpm-eRPM package, you should make sure that any files in the package are no longer needed in the system.
7. Secondary option
(1). Force: enforcement
(2)-- nodeps: solve the problem of rpm dependency
(3).-h: friendly display
(4).-v: detailed display
8. Maintain the database
(1)。 Rebuild the database
(2)。 Import verification public key
III. Application compilation
1. Reasons for compiling and installing with source code:
(1) the software in Linux distribution is not rich enough.
(2) the configuration function of the application can not meet the requirements.
(3) some specific functions can be added by programming.
two。 Preparation before compiling the application
(1) confirm that the compilation environment is installed in the system: before compiling the source code of any application, you need to verify that the gcc compiler environment is installed on the current system (if not, use the graphical interface to install it)
(2) download the application source code installation package file, or obtain it from other sources (we take Super Mary Game as an example. If you are in the lab, you can download it on ftp. I have packaged the installation file source code with two files.)
(3) release the downloaded source code package file, use the "tar" command to extract the source code package, and release it to a subdirectory with the same name (.tar.gz format extract command: tar-zxvf, tar.bz2 format extract command is tar-jxvf)
(4) enter the source code directory and use the "cd" command to place the user in the subdirectory where the source code is located (first install the rpm package in the sdl directory, which contains some library files, and then install the source code)
3. Pre-compilation configuration, all source code software needs to execute the "configure" command to complete the pre-compilation configuration before compilation. The "configure" command needs to be executed after entering the source code directory. The command format is ". / configure-- the absolute path of the prefix= program installation directory". Use the "--prefix" option to specify the installation path after the application has been compiled, if you do not use this parameter. Default installation path is "/ usr/local/bin"
4. Compilation and installation
(1) during the process of program compilation, after the source code is configured with the "configure" command, the binary compilation of the program needs to be done with the "make" command.
(2) Program installation process. After compilation, the installation command of the program is "make install" and will be installed to the directory set by the "--prefix" option.
(3) verify the compiled and installed program, and verify the installed application after completing the compilation and installation of the application.
A) View the directory established at the time of installation
B) use the "man" command to view the contents of the man page
C) whether the installed program implements the required functions
5. Summary of application compilation
(1) it is more flexible and customizable to compile the source code.
(2) it takes longer because the application needs to be configured and compiled.
(3) installation is complex and uninstallation is more complex.
Establishment of 6.YUM warehouse (yum warehouse installation package can be used in case of network disconnection)
(1) set the virtual machine network connection to host-only mode, so that the virtual machine cannot access the Internet.
(2) enter the terminal and enter vim / etc/sysconfig/network-scripts/ifcfg-ens33 to enter the network card
(3) change dhcp to static, and set ip, subnet, gateway, save exit
(4) enter service network restart to enable the service.
(5) to connect to the cd-rom, the image or the image you choose to install (described in the previous article "linux system installation")
(6) enter mount / dev/sr0 / mnt to mount the image to the / mnt directory
(7) enter cd / etc/yum.repos.d/
(8) back up the files in a folder
(9) enter vim abc.repo to create a new
Enter [abc] (file name)
Name=test (descriptive information)
Baseurl=file:///mnt (rpm package storage path)
Enabled=1 (on = 1 off = 0)
Gpgcheck=0 (off = 0)
Save exit
(10) enter yum list to load the rpm package
(11) enter yum install httpd to install httpd
(12) enter systemctl start httpd to enable the service.
Enter systemctl stop firewalld.service to turn off the firewall
Enter setenforce 0 to turn off the enhanced security feature
(13) enter 192.168.1.100 in the web page to see if you can connect.
Successful connection indicates that httpd is installed successfully
In this way, our YUM warehouse is completed.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 206
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.