Linux learning notes: (III) software package management (under update)



  • In Linux system, the most commonly used software packages are RPM package and tar package
  • To manage RPM packages, you can use the rpm and Yum commands (centos8 uses the DNF command to manage)
    • The yum command automatically collects information about RPM packages, checks dependencies, and installs all dependent packages at once without tedious installation
    • DNF is a new generation of RPM package manager. DNF package manager overcomes some bottlenecks of Yum package manager and improves many aspects, including user experience, memory occupation, dependency analysis, running speed and so on

1、 RPM package management

graph LR

1. Install RPM package

  1. Install example RPM package

    • rpm -i example.rpm
  2. Install example RPM package and display the file information being installed during installation

    • rpm -iv example.rpm
  3. Install example RPM package and display the file information being installed and the installation progress during installation

    • rpm -ivh example.rpm
  4. Only the installation is tested, and the software package is not actually installed

    • rpm -ivh –test example.rpm
  5. Install the software even if the software package is already installed

    • rpm -ivh –replacepkgs example.rpm
  6. Ignore package dependencies and force package installation

    • rpm -ivh –nodeps example-xxx.rpm

2. Uninstall RPM package

  1. Uninstall installed packages

    • rpm -e example
      • When uninstalling, you need to use the package name instead of the file package name, which is usually usedrpm -q… command to find out the name of the installation package to be uninstalled
  2. Force uninstall package

    • rpm -e –nodeps example
      • Because the software package has dependencies, the dependency detection failure will be prompted during partial uninstallation. At this time, the dependency is ignored and forced uninstallation is performed

3. Upgrade refresh RPM package

  1. upgrade
    • rpm -Uvh example.rpm
      • It is actually a combination of uninstallation and installation
      • The upgrade option installs the package regardless of whether a previous version of the software has been installed
  2. Refresh
    • rpm -Fvh example.rpm
      • When refreshing a package, the system compares the specified package version with the system package version
      • If the package is not preinstalled, RPM’s refresh option will not install the package

4. Querying RPM packages

  1. Check whether tomcat4 is installed
    • rpm -qa | grep example
  2. See example RPM installation package information
    • rpm -qip example.rpm
  3. View the information of the installation package where the / bin / DF file is located
    • rpm -qif /bin/df
  4. Check the directory where each file in the installation package where the / bin / DF file is installed
    • rpm -qlf /bin/df

Recommended Today

Proper memory alignment in go language

problem type Part1 struct { a bool b int32 c int8 d int64 e byte } Before we start, I want you to calculatePart1What is the total occupancy size? func main() { fmt.Printf(“bool size: %d\n”, unsafe.Sizeof(bool(true))) fmt.Printf(“int32 size: %d\n”, unsafe.Sizeof(int32(0))) fmt.Printf(“int8 size: %d\n”, unsafe.Sizeof(int8(0))) fmt.Printf(“int64 size: %d\n”, unsafe.Sizeof(int64(0))) fmt.Printf(“byte size: %d\n”, unsafe.Sizeof(byte(0))) fmt.Printf(“string size: %d\n”, […]