Linux Learning Record 5 (software installation and upgrade) and linux record

Source: Internet
Author: User

Linux Learning Record 5 (software installation and upgrade) and linux record

I. gcc

Gcc is the most standard C language compiler on Linux, used for source code compilation links.

Gcc-c hello. c compilation generates the target file hello. ogcc-O hello. c compilation generates the target file and optimizes gcc-o hello. c generates the executable binary file hello. disadvantage: Command redundancy. If a C-language program contains references to other functions or programs, other programs must be compiled into the target file, and then compiled into an executable file to run successfully. A large program references a lot, so it seems redundant when compiled with gcc. Ii. makeUse make for macro compilation. The make function is to simplify the commands issued during the compilation process. If a primitive code file is modified after the compilation is completed, make will only update the file, other files will not be modified. Use the make command because the makefile file is prepared in advance. Then, the make command is used to install the file compilation link, which greatly simplifies the compilation process. The basic syntax of makefile (to be honest, it is a bit like Java's ant ):

Basic Syntax of makefile variables:
  • Variables and variable content are separated by "=", and both sides can have spaces
  • You cannot have a tab on the left of the variable.
  • The content of variables and variables cannot be on both sides of =:
  • In terms of habits, it is best to use uppercase letters as the primary variables.
  • Use $ {Variable} or $ (variable) when using the variable
  • Shell environment variables can be used. For example, the CFLAGS variable
  • You can also give variables in command mode.
$ @ Indicates the current target Iii. TarballBasic Steps for installation: 1. Extract the source code to the/usr/local/src folder. 2 ,. /configure -- prefix =/usr/local/ntp -- enable-all-clocks -- enable-parse-clocks generate the makefile file in the target folder. 3. make clean the makefile file before packaging. compiled target file 4. make compiled into binary file 5. make install Installation File Iv. rpmInformation about software installation is written into/var/lib/rpm/. We can check whether software upgrade is required. The comparison of versions also comes from this database. The biggest problem with rpm software installation is the Dependency Property of the software. If the associated software is not installed, the software cannot be installed. Run the rpm command to install the software and view the installation information (install to a custom path): run the rpm-ivh software name (-- prefix/usr/local) rpm to test whether the software is dependent: rpm-ivh software name-testrpm software upgrade (software exists, be updated; software does not exist, be installed): rpm-Uvh software name rpm upgrade software (software exists, be updated; the software does not exist and is not installed.): rpm-fvl software name rpm query software:

List all files on the system that may have been changed: rpm-Va

Rebuilding an rpm Database: rpm -- rebuilddb

  V. yumYum is currently the most convenient software management tool for Linux. Compared with rpm, yum can automatically handle dependency attribute issues of software to solve software installation, uninstall, and upgrade problems. yum query function:

List the software available for local upgrade on the current server: yum list updates

Install software: yum install software name

Upgrade software: yum update Software name

Uninstall software: yum remove software name

Modify the source and configuration file of yum: vim/etc/yum. repos. d/CentOS-Base.repo

Delete data related to all software libraries: yum clean all

Delete the downloaded software file: yum clean packages

Delete the downloaded software file header: yum clean headers

Features of the yum software group:

Note: optional software is not installed by default for software group installation. If you want to install optional software, you need to modify the configuration file vim/etc/yum. conf: Add group_package_types = default, mandatory, optional to the file.

Software to be upgraded automatically throughout the system: yum-y update

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.