Common Operation Problems and Solutions in Linux

Source: Internet
Author: User
Article Title: Common Operation Problems and Solutions in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1. Set the self-configured environment variables at startup

In the Linux terminal environment, the export command can be used to set environment variables, but the variables it sets disappear immediately after the terminal is closed.

If you want to set an environment variable that exists at startup and disappears at shutdown, you need to change some system configuration files.

/Etc/profile file: when the system starts, it sets the environment variable to work for any user;

/Etc/bashrc file: when the user's shell is opened, set the environment variable to work for any user;

/Home/[Username]/. bash_profile file: sets the environment variable when the user logs on, which is valid for the current user;

/Home/[Username]/. bashrc file: sets the environment variable when the user's shell is opened, which is valid for the current user.

In addition, the environment variables set in/home/[Username]/. bashrc can only inherit the environment variables set in/etc/profile.

To set environment variables in these files, you only need to add the export command statement to the file.

2. install the software package

Linux software packages can be divided into two types: one is generated by source code compilation, called the source code package; the other is provided in the form of RPM self-installation files, called the RPM package. The installation methods of the two software packages are different.

The source code packages are generally stored in the compressed form. Therefore, after obtaining the software package, decompress the package.

There are also two types of compressed packages, one is the tar.gz package and the other is the tar.bz2 package.

Decompress the tar.gz package: tar zxvf unzip packagename#.tar.gz

Decompress the tar.bz2 package: tar jxvf unzip packagename#.tar.bz2

After decompression, the folder is usually the same as [PackageName]. If it is different, you can use the ls command to query the folder.

Go to the folder and execute the ls command. If you see a file such as configure, You need to configure it before compiling.

The specific configuration options are as follows:

"-- Cache-file = FILE"

Test existing features. The test results are stored in a cache file;

"-- Help"

Outputs help information;

"-- No-create"

Prevents output files from being created.

"-- Quiet" or "-- silent"

Additional information cannot be output;

"-- Version"

Displays the Autoconf version used to generate the configure script;

"-- Prefix = PREFIX"

Set the installation path to generate Makefile;

"-- Exec-prefix = EPREFIX"

Sets the installation location of the file on which the structure depends. If not configured, it is the same as the -- prefix option value;

"-- Bindir = DIR"

Specifies the installation location of the binary file. The binary file here is defined as a program that can be directly executed by the user;

"-- Sbindir = DIR"

Specifies the installation location of the Super binary file. This is a program that can only be executed by the Super User;

"-- Libexecdir = DIR"

Specifies the installation location of executable support files. These files are not directly executed by the user, but are executed by the binary files mentioned above;

"-- Datadir = DIR"

Specifies the installation location of common data files;

"-- Sysconfdir = DIR"

Specifies the installation location of read-only data used on a single machine;

"-- Sharedstatedir = DIR"

Specifies the installation location of writable data that can be shared on multiple machines;

"-- Localstatedir = DIR"

Specifies the installation location of writable data that can only be used by a single machine;

"-- Libdir = DIR"

Specifies the installation location of the library file;

"-- Includedir = DIR"

Specifies the installation location of the C header file. This option can also be used for header files in other languages such as C ++;

"-- Oldincludedir = DIR"

Specifies the installation location of the C header file installed by the compiler except GCC;

"-- Infodir = DIR"

Specifies the installation location of the Info format document. Info is the document format used by the GNU project;

"-- Mandir = DIR"

Specifies the installation location of the manual page;

"-- Srcdir = DIR"

In general, you do not need to specify the location of the configure source code, because the configure script is generally in the same directory as the source code file;

"-- Program-prefix = PPREFIX"

Specifies the prefix that will be added to the name of the installed program. This option will only work when used by the Makefile. in file;

"-- Program-suffix = SUFFIX"

Specifies the suffix that will be added to the name of the installed program;

"-- Program-transform-name = PROGRAM"

Generates installation name setting parameters for sed-e PROGRAM;

"-- Build = BUILD"

The system platform where the software package is installed. If not. The default value is the value of the -- host option;

"-- Host = HOST"

If the system platform where the software runs is not specified, config. guess will be run for detection;

"-- Target = TARGET"

Specifies the system platform for the software. If no value is specified, the -- host option value is used by default;

"-- Disable-FEATURE"

Disable compilation of large options;

"-Enable-FEATURE [= ARG]"

In contrast to the previous item, ARG provides option parameters to determine the method to use;

"-- With-PACKAGE [= ARG]"

Provide information about other installed software packages;

"-- Without-PACKAGE"

Prohibit the interaction between a software package and an existing software package;

"-- X-regiondes = DIR"

Specify the directory containing the X11 header file to the configure script;

"-- X-libraries = DIR"

Similarly, the -- x-libraries option provides a method to indicate to the configure script the directory containing the X11 library.

Enter the command when executing the configuration. /Configure -- [Options] {= [Params.

After the configuration is complete, run the make command. After the make command is executed, run the make install or su; make install command.

You can install the RPM on your own. Command: rpm-[Options] [PackageName]. rpm

When installing a software package, [Options] is usually set to "ivh". When uninstalling the software package, it is usually set to "e ".

Query all installed software packages, use rpm-qa, query specific installed software packages, and use rpm-q [PackageName].

In addition to the above two types of operations, there are also some common operations on network configuration, but due to a lot of content, it is another post for discussion.

Enjoy Linux.

Related Article

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.