Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Uninstall parameters of linux rpm

2025-02-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "unloading parameters of linux rpm". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Rpm uninstall parameters-- test: uninstall test-- nodeps: do not check for dependencies-- noscripts: do not execute scripts-- notriggers: do not execute triggers-- justdb: modify only databases-- force force

When RPM uninstalls the package, it doesn't simply delete the original installed files one by one. If you do that, you may have problems of one kind or another. For example, package A relies on package B to do some work, and if package B is uninstalled, package A will not work properly. For the sake of user security, RPM will do some checks to rule out errors as much as possible.

When uninstalling the package, RPM does the following step by step:

1. Check dependencies (Denpendency)

The purpose of checking dependencies is to ensure that there are currently no packages that depend on the package you are currently uninstalling.

two。 Trigger script before uninstall (Triggerun)

3. Execute the pre-uninstall script (Preuninstall)

This program is set for the software package maker to complete some work before uninstalling, for example, one of the software packages to be uninstalled

While the program is currently running, the script must kill it, or it cannot be uninstalled correctly.

4. Check the configuration file (Configfiles)

Before uninstalling the package, RPM will check whether the configuration file in the package has been modified. If so, RPM should save it under a different name.

The file name is generally "original file name + .rpmsave". (this is one of the features of RPM package management)

5. Really uninstall

That is, delete the files one by one according to the list of files in the package. It is important to note that if any of the files belong to something else

Software packages (that is, two packages have a file with the same name), RPM is not deleted.

6. Execute post-uninstall script (Postuninstall)

The main purpose of this procedure is to complete the aftermath of uninstallation, such as modifying the system configuration file inetd.conf and removing the installation.

What is added when, and so on.

7. Update RPM database

After uninstalling, RPM deletes all information about the package in the database.

8. Trigger script after uninstall (Triggerpostun)

Command format

Rpm-e [uninstall option 1 uninstall option 2.] [package ID 1 package ID 2.]

Note:-- erase can also be used instead of-e, the effect is the same.

Package identification

For installed packages, RPM uniquely identifies them using the following format:

Name [- Subname]-Version-Release

Where: Name: refers to the software name

Subname: this option refers to the name of the software package

Version: refers to the software version number. Note: it cannot contain minus sign (-) characters.

Release: refers to the software release number.

For example, after the package file file-3.26-6.i386.rpm is installed, its package is identified as file-3.26-6. You can use this ID to uninstall, query, and verify the package. When entering the package ID on the command line, it can be written in full or abbreviated. For example, file-3.26-6, you can enter only file, or file-3.26, or all. Another example: the package with subpackage identification XFree86-devel-3.3.6-6, you can enter only XFree86-devel, or XFree86-devel-3.3.6, but also can be fully entered.

Note: the package logo is case-sensitive, that is, uppercase letters and lowercase letters have different meanings. For example, the bash-2.03-10 logo cannot be input to Bash-2.03-10, nor can it be lost to bAsh-2.03-10, and so on.

Here are some explanations for the specified options:

1.-- test: uninstall the test

What does the uninstall test of RPM do? The main thing is to check dependencies to ensure that there are no packages in the system that depend on the packages to be uninstalled. If there are other packages that depend on the package to be uninstalled, RPM prompts an error that the dependency will be broken, for example:

# rpm-e-test mktemp

Error: removing these packages would break dependencies:

Mktemp is needed by autoconf-2.13-5

Mktemp is needed by dev-2.7.7-4BP

Mktemp is needed by groff-1.11a-10BP

Mktemp is needed by gzip-1.2.4-15BP

Mktemp is needed by initscripts-4.16-3BP

Mktemp is needed by metamail-2.7-21BP

Mktemp is needed by rpm-3.0.3-4BP

Mktemp is needed by autofs-3.1.3-2

/ bin/mktemp is needed by apache-1.3.12-5BP

/ bin/mktemp is needed by linuxconf-1.16r1.3-4BP

#

Of course, we know more clearly by browsing the debugging information output when uninstalling the test.

# rpm-e-test-vv file | nl

1 D: opening database mode 0x0 in / / var/lib/rpm/

2 D: getting list of mounted filesystems

3 + echo triggeruninstall

4 triggeruninstall

5 D: will remove files test = 1

6 D:file: / usr/share/magic action: remove

7 D:file: / usr/man/man4/magic.4 action: remove

8 D:file: / usr/man/man1/file.1 action: remove

9 D:file: / usr/bin/file action: remove

10 + echo triggerpostuninstall

11 triggerpostuninstall

12 D: removing database entry

Note: this example carries on the unloading test of file package, and the output information is sent to nl to list the line number, which is explained line by line. (the output of the line starting with D: after the line number is the debugging information.)

Line 1: open the RPM database in / var/lib/rpm directory

Line 2: take a list of mounted file systems

Line 3: trigger the script before uninstalling

Line 4: this line is the result of the execution of the trigger script before uninstalling

Line 5: RPM prompts you to delete the file, where test=1 indicates that the test is uninstalled, not really deleted

Lines 6-9: show the execution of each file-delete

Line 10: triggers the script after uninstalling

Line 11: this line is the result of the execution of the triggered script after uninstalling

This is the end of "uninstall parameters for linux rpm". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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: 0

*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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report