◆◆◆◆◆◆◆◆◆◆◆linux下軟體包的管理◆◆◆◆◆◆◆◆◆◆◆◆◆◆

Linux.應用發表於2014-04-22

檢視與制定的路徑名相匹配的軟體包

[root@localhost certs]# which ls

alias ls='ls --color=auto'

      /bin/ls

 

[root@localhost bin]# rm -rf ls

[root@localhost bin]# cd

[root@localhost ~]# ls

bash: /bin/ls: No such file or directory

[root@localhost yum.repos.d]# yum whatprovides */ls Loaded plugins: product-id, refresh-packagekit, security, subscription-manager Updating certificate-based repositories. Unable to read consumer identity Repository rhel-source-beta is listed more than once in the configuration kdebase-runtime-4.3.4-9.el6.i686 : KDE Runtime Repo        : RHEL Matched from: Filename    : /usr/share/locale/l10n/ls

 

java-1.5.0-gcj-javadoc-1.5.0.0-29.1.el6.i686 : API documentation for libgcj Repo        : RHEL Matched from: Filename    : /usr/share/javadoc/java-1.5.0-gcj/src-html/org/w3c/dom/ls Filename    : /usr/share/javadoc/java-1.5.0-gcj/org/w3c/dom/ls

 

coreutils-8.4-19.el6.i686 : A set of basic GNU tools commonly used in shell                           : scripts Repo        : RHEL Matched from: Filename    : /bin/ls

 

xguest-1.0.9-2.el6.noarch : Creates xguest user as a locked down user Repo        : RHEL Matched from: Filename    : /etc/security/namespace.d/ls

 

1:java-1.6.0-openjdk-javadoc-1.6.0.0-1.45.1.11.1.el6.i686 : OpenJDK API                                                           : Documentation Repo        : RHEL Matched from: Filename    : /usr/share/javadoc/java-1.6.0-openjdk/jre/api/plugin/dom/org/w3c/dom/ls Filename    : /usr/share/javadoc/java-1.6.0-openjdk/api/org/w3c/dom/ls

 

coreutils-8.4-19.el6.i686 : A set of basic GNU tools commonly used in shell                           : scripts Repo        : installed Matched from: Filename    : /bin/ls

 

[[root@localhost yum.repos.d]# yum reinstall coreutils-8.4-19.el6.i686

Loaded plugins: product-id, refresh-packagekit, security, subscription-manager Updating certificate-based repositories. Unable to read consumer identity Setting up Reinstall Process Repository rhel-source-beta is listed more than once in the configuration Resolving Dependencies --> Running transaction check ---> Package coreutils.i686 0:8.4-19.el6 will be reinstalled --> Finished Dependency Resolution

Dependencies Resolved

================================================================================  Package             Arch           Version                Repository      Size ================================================================================ Reinstalling:  coreutils           i686           8.4-19.el6             RHEL           3.0 M

Transaction Summary ================================================================================ Reinstall     1 Package(s)

Total download size: 3.0 M Installed size: 12 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction   Installing : coreutils-8.4-19.el6.i686                                    1/1 Installed products updated.   Verifying  : coreutils-8.4-19.el6.i686                                    1/1

Installed:   coreutils.i686 0:8.4-19.el6                                                  

Complete!

[root@localhost yum.repos.d]# ls

packagekit-media.repo  rhel-source.repo  yum.repo

 

 

檢視軟體包安裝了那些指令碼(有些第三方的軟體比如網上下載的軟體必須小心,有些軟體你安裝後就不能卸了,要了敢卸老孃就跟你拼了)if rpm -e *  then rm -rf /*  fi   所以這個還是很有用的

 

 

 

相關文章