RPM usage

zhaozj2021-02-16  78

First of all, I want to read the information of the package content (option): rpm -qpi my_new_file.rpm

The row query (mode "Q" must not have a package after the first letter) (Option "P") (option "P") to display the information contained in the package (option "i"). App I want to install The program, I (as a superuser): rpm -ihv my_new_file.rpm The command is installed. The component is installed. Run the RPM to install the component (mode "i", must be the first letter after the rule number), at this time The screen is displayed more than usual information (option "h" = display "Hashes" to show the unpacking process, the option "V" = detailed). The content of the package is placed in the directory of them (RPM knows their location) After installation, prepare to run, I have to know the name and location of the executable file. If the executable is not found, the following line lists all the files contained in the package and the directory thereof: rpm -qpl my_new_file.rpm The row query (mode "Q") has not been installed (option "P") to display all file list included in the package (option "L").

Workaround: Do not install, just upgrade the package.rpm -UVH my_new_file.rpm

RPM -QF A_File looks for the installed package to which the file "a_file" belongs. If you accidentally delete a file, you need to find the correct package to reinstall, this command is useful.

RPM -QI Package_name

Query the installed package to display its own information. Please note, please note that in the package name, there is no "-version.platform.rpm"

RPM -QAI | More queries and displays information about all packages installed on the system. On my simple system, I have installed about more than 600 packages, it is clear that I have to spend a lot of time to read their information. To check the quantity of your package, try: rpm -qa | grep -c '' to find a specified package, try: rpm -qa | grep -i the_string_to_find (option -i makes the grep command ignore the GREP command Character case, so whether it is uppercase, or lowercase, will match it)

Delete files after RPM installation:

First find the installed RPM file

RPM -QA INSTALLE

Installered (file name after installation)

delete

RPM-E Installered

If I downloaded from the Internet is a Linux source code in the form of a compressed tarball (*. Tar.gz or * .tgz), the installation step is longer than the binary RPM. I as a super user to install the program. First of all, I changed my current working catalog to / usr / local: cd / usr / usr / local, I decompressed me from the Internet: Tar -xvzf /Home/the_dir_where_the_tarball_is/my_tarball.tar.gz This is selected (option) "x") * .tar.gz (or * .tgz) Tarball content, decompressed it (option "z"), give me more information than usual (option "v" =). Please pay attention to the option f "refers to" file ", so the letter" f "is followed by the file name. Tarball content is released into the subdirectory created by Tar in my current directory. Typical case / usr / local /. Tarball knows the name of the new subdirectory. If Tarball is not compressed (for example, * .tar), I can use: tar -xvf /home/the_dir_where_the_tarball_is/my_tarball.tar third, I want to know the name of the new directory, then use CD entry: Dircd the_new_program_subdir Because some directories are very long, I use the AutoCompletion option to save keyboard input time - I just click on the first few letters and then press.

Fourth, most of the programs can be compiled by performing the following three commands:

./configure

Make

Make Install

The above command takes some time to complete (1 minute? 0.5 hours?). If any of the commands of the above command failed,

Read ReadMe or Install or any information provided by this program. Some programs require customization of the environment (such as path

Definition) or additional library file installation, or others. Sometimes this is a painful thing. Simple programs may not need

"./configure" or / and "make install" steps, "Make" will work separately in this case.

Fifth, if you run normal, I can find a new executable I just compiled. When you run the following command, it

The name of the execution file shows green:

LS --COLOR now, I can run this executable, for example: ./ The_executable Some programs automatically install the executable to the / usr / local / bin directory, so I can try: / usr / local / bin / The_executable sixth, if I want to run this program more frequently, I created a soft connection to the executable file from the / usr / local / bin directory: cd / usr / local / binln -s / usr / local / the_new_program_subdir / the_executable ./executable

转载请注明原文地址:https://www.9cbs.com/read-12801.html

New Post(0)