1. 程式人生 > >debian linux 中如何檢視軟體包是否已經安裝和如何安裝、解除安裝軟體

debian linux 中如何檢視軟體包是否已經安裝和如何安裝、解除安裝軟體

如果您不確定某個軟體包是否已經安裝,可以使用 dpkg 的 -l (L的小寫) 選項:

$ dpkg -l zsh No packages found matching zsh. 

上面結果這表明 zsh 沒有 安裝。

可以使用 apt-cache 命令和它的 search 子命令來搜尋軟體包: zsh,如清單 1 所示。


清單 1. 使用 apt-cache 搜尋 zsh
     $ apt-cache search zsh kdesdk-scripts - scripts and data files for development zsh - A shell with lots of features zsh-dbg - A shell with lots of features (debugging symbols) zsh-dev - A shell with lots of features (development files) zsh-doc - zsh documentation - info/HTML format csh - Shell with C-like syntax, standard login shell on BSD systems draai - A command-line music player for MPD fatrat-czshare - fatrat plugin allowing download and upload to czshare grml-shlib - Generic shell library used in grml scripts tucan - Download and upload manager for 1-Click Hosters viewglob - A graphical display of directories referenced at the shell prompt zsh-beta - A shell with lots of features (dev tree) zsh-beta-doc - zsh beta documentation - info/HTML format zsh-lovers - tips, tricks and examples for the zsh zsh-static - A shell with lots of features (static link) zshdb - debugger for Z-Shell scripts 

該輸出給出了相關聯的幾個軟體包,包含了 zsh 字串。如果您想安裝 Z shell,zsh 包就是您要的。(您可能還要安裝 zsh-doc 和其他的包,但現在安裝 zsh 就可以了。)

要從一個 APT 程式碼庫安裝,可以使用 apt-get 和它的 install 選項,如清單 2 所示。


清單 2. 通過 APT 安裝 zsh
     $ sudo apt-get install zsh Reading package lists... Done Building dependency tree        Reading state information... Done Suggested packages:   zsh-doc The following NEW packages will be installed:   zsh 0 upgraded, 1 newly installed, 0 to remove and 59 not upgraded. Need to get 4,504 kB of archives. After this operation, 14.1 MB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/main zsh amd64 4.3.11-4ubuntu2.is.3ubuntu1 [4,504 kB] Fetched 4,504 kB in 7s (643 kB/s)                                               Selecting previously deselected package zsh. (Reading database ... 146971 files and directories currently installed.) Unpacking zsh (from .../zsh_4.3.11-4ubuntu2.is.3ubuntu1_amd64.deb) ... Processing triggers for menu ... Processing triggers for man-db ... Setting up zsh (4.3.11-4ubuntu2.is.3ubuntu1) ... update-alternatives: using /bin/zsh4 to provide /bin/zsh (zsh) in auto mode. update-alternatives: using /bin/zsh4 to provide /bin/rzsh (rzsh) in auto mode. update-alternatives: using /bin/zsh4 to provide /bin/ksh (ksh) in auto mode. Processing triggers for menu ... 

注意: 由於 debian 的安全模式,影響軟體包安裝的命令前面必須加 sudo。某些發行版以及修改了預設安全模式的 debian,可以忽略 sudo,但需要從 root 使用者執行命令。

apt-get install 命令搜尋並安裝 zsh。如果有任何依賴包沒有裝,該命令同時安裝這些包。

使用 -s 或 --status選項驗證 zsh 是否已經安裝。見清單 3。


清單 3. 驗證 zsh 是否安裝
     $ dpkg -s zsh Package: zsh Status: install ok installed Priority: optional Section: shells Installed-Size: 13732 Maintainer: Ubuntu Developers (
[email protected]
) Architecture: amd64 Version: 4.3.11-4ubuntu2.is.3ubuntu1 Depends: libc6 (>= 2.4), libcap2 (>= 2.10), libncursesw5 (>= 5.6+20070908) Recommends: libc6 (>= 2.11), libpcre3 (>= 8.10) Suggests: zsh-doc Conffiles: /etc/zsh/zlogin 48032df2ace0977f2491b016e3c421a3 /etc/zsh/zlogout b73789c3e790b855302ce10ca076037a /etc/zsh/zprofile 58c4f65d775c055b5d80b67c1bd12838 /etc/zsh/zshenv 5a8a0ff4f6ff945a5aa6ba7f6f1e8c97 /etc/zsh/zshrc e069ba51ba293da1aeddd5779324df19 /etc/zsh/newuser.zshrc.recommended dac3563a2ddd13e8027b1861d415f3d4 Description: A shell with lots of features Zsh is a UNIX command interpreter (shell) usable as an interactive login shell and as a shell script command processor. Of the standard shells, zsh most closely resembles ksh but includes many enhancements. Zsh has command-line editing, built-in spelling correction, programmable command completion, shell functions (with autoloading), a history mechanism, and a host of other features. Homepage: http://www.zsh.org/ Original-Maintainer: Debian Zsh Maintainers ([email protected])

This package is now installed, and you can see information on its version, its dependencies, who created it, and so on.

To learn which files were installed as part of the zsh package, use the -L option to dpkg:

$ dpkg -L zsh    

The resulting output is quite lengthy, because the package includes many individual files. If you wanted to search for a particular file, you might want to pipe the output through grep or less.

For the final exercise, uninstall zsh (unless you want to try it and perhaps even use it regularly). To do so, use apt-get and its remove or purge command. Listing 4 shows the code.


清單 4. 解除安裝 zsh
     $ sudo apt-get remove zsh Reading package lists... Done Building dependency tree        Reading state information... Done The following packages will be REMOVED:   zsh 0 upgraded, 0 newly installed, 1 to remove and 59 not upgraded. After this operation, 14.1 MB disk space will be freed. Do you want to continue [Y/n]? y (Reading database ... 148096 files and directories currently installed.) Removing zsh ... Processing triggers for man-db ... Processing triggers for menu ... 

Alternatively, you could use dpkg and its -r/--remove or -P/--purge option. Listing 5 shows the code.


清單 5. 使用 dpkg 解除安裝
     $ sudo dpkg -P zsh (Reading database ... 148096 files and directories currently installed.) Removing zsh ... Purging configuration files for zsh ... Processing triggers for man-db ... Processing triggers for menu ...

相關推薦

debian linux 如何檢視軟體是否已經安裝如何安裝解除安裝軟體

如果您不確定某個軟體包是否已經安裝,可以使用 dpkg 的 -l (L的小寫) 選項: $ dpkg -l zsh No packages found matching zsh. 上面結果這表明 zsh 沒有 安裝。 可以使用 apt-cache 命令和它的 search 子命令來搜尋軟體包

Linux檢視某個軟體安裝路徑

Linux中檢視某個軟體的安裝路徑(地址)有時顯得非常重要。比如某個檔案的快速啟動項被刪除,或者你要建立快速啟動項,或者想刪除、新增安裝檔案等等,很多地方都要用到查案檔案安裝路徑的命令。 這裡給大家介紹Linux檢視檔案安裝路徑(地址)命令。 一、檢視檔案安裝路徑: 由於軟體安裝的地方不止一個地

Linux二進位制/ 原始碼軟體安裝 rpm

一、二進位制分發版(*.rpm形式的二進位制軟體包、*.tar.gz/*.tgz、*.bz2形式的二進位制軟體包)   (一)、*.rpm形式的二進位制軟體包 安裝:rpm –ivh packagename.rpm 解除安裝:rpm -e packagename (二)、*.tar.gz/*.tg

Linux源碼安裝MySQL的shell腳本

login support des ant chown default sets emctl group #!/bin/bash#安裝MYSQL yum -y install ncurses-develyum -y install autoconftar zxf /cmak

Linux檢視磁碟空間使用情況命令df與du的區別

1、兩者區別  du,disk usage of each file,是通過搜尋檔案來計算每個檔案的大小然後累加,du能看到的檔案只是一些當前存在的,沒有被刪除的。他計算的大小就是當前他認為存在的所有檔案大小的累加和。 df,disk free,通過檔案系統來快速獲取空間大小的資訊,當我們

如何將 Debian Linux 的預設的 Python 版本切換為替代版本,link

https://linux.cn/article-6970-1.html 如何將 Debian Linux 中的預設的 Python 版本切換為替代版本 譯者: LCTT  Ping Yang | 2016-02-02 20:09   評論: 4

如何將 Debian Linux 的默認的 Python 版本切換為替代版本,link

all using 登錄 只需要 接下來 php yii ash line https://linux.cn/article-6970-1.html 如何將 Debian Linux 中的默認的 Python 版本切換為替代版本 譯者: LCTT Ping Yang |

Linux檢視各資料夾大小命令du -h --max-depth=1

du [-abcDhHklmsSx] [-L <符號連線>][-X <檔案>][--block-size][--exclude=<目錄或檔案>] [--max-depth=<目錄層數>][--help][--

Linux檢視socket狀態

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

Linux檢視jdk安裝目錄解除安裝jdkrpm命令rm命令引數

一、Linux中檢視jdk安裝目錄 [[email protected] ~]# whereis java java: /usr/bin/java /usr/local/java#java執行路徑 [[email protected] ~]# which java /usr/

linux檢視當前伺服器的http連線有哪些?

首先,我們要用netstat -n|grep 80 命令來檢視具體埠對應程式的TCP/IP連線情況 ** netstat -n|grep 80出現大量time_wait ** 在執行netstat -n|grep 80 | awk '/^tcp/ {++S[$NF]} END {fo

使用adduser命令在Debian Linux建立使用者

  在本教程中,我們將學習如何使用命令列介面在Debian Linux中新增使用者。 Debian Linux使用adduser命令從命令列建立使用者。使用adduser命令後跟使用者名稱來建立具有預設選項的新使用者。 命令格式: adduser [使用者名稱] 比如

Linux檢視所有正在執行的程序

可以使用ps命令。它能顯示當前執行中程序的相關資訊,包括程序的PID。Linux和UNIX都支援ps命令,顯示所有執行中程序的相關資訊。 kill[引數][程序號]    kill -9 4394 kill就是給某個程序id傳送了一個訊號。預設傳送的訊號是SIGTERM

linux 檢視記憶體使用情況

用 'top -i' 看看有多少程序處於 Running 狀態,可能系統存在記憶體或 I/O 瓶頸,用 free 看看系統記憶體使用情況,swap 是否被佔用很多,用 iostat 看看 I/O 負載情況... 還有一種辦法是 ps -ef | sort -k7 ,將程序按

【轉】【Linux】在Linux檢視所有正在執行的程序

可以使用ps命令。它能顯示當前執行中程序的相關資訊,包括程序的PID。Linux和UNIX都支援ps命令,顯示所有執行中程序的相關資訊。 ps命令能提供一份當前程序的快照。如果想狀態可以自動重新整理,可以使用top命令。 ps命令 輸入下面的ps命令,顯示所有執行中

Linux檢視分割槽表的4種方法

作為Linux管理員,我們需要一次又一次地檢視硬碟的分割槽表。這有助於我們通過為進一步分割槽騰出空間來重新組織舊驅動器,並在必要時為新驅動器建立空間。您可以在硬碟上建立不超過四個主分割槽,但可以在多個邏輯分割槽或擴充套件分割槽上建立,具體取決於系統上安裝的硬碟大小。 分割槽表包含有關所有邏輯磁碟或分割槽的資

Linux檢視系統版本(核心發行)CPU資訊以及修改主機名

檢視cpu資訊        cat /proc/cpuinfo   檢視系統與核心相關資訊        Uname [選項]  &nbs

linux檢視當前所用系統及核心版本的方法

問題: 1. 當使用一臺linux機器的時候,常常需要確認當前所用作業系統的版本資訊,核心資訊等, 作業系統的版本資訊可以通過以下命令完成,比如:lsb_release -a;cat /etc/issue 而檢視核心版本可以通過以下命令完成,比如:uname -a;cat

Ubuntu 軟體安裝解除安裝以及檢視的方法總結

apt-cache search # ------(package 搜尋包)apt-cache show #------(package 獲取包的相關資訊,如說明、大小、版本等)apt-get install # ------(package 安裝包)apt-get install # -----(packa

linux檢視目錄下隱藏檔案方式?

Linux系統中,除了儲存了大量可見的檔案和資料夾,還附帶了很多隱藏的檔案和資料夾,那麼該如何進行檢視?這些隱藏檔案又有什麼用呢?檢視Linux主目錄隱藏檔案可以通過執行ls–a來實現,對於隱藏檔案,不建議進行更改和刪除操作,原因是,主目錄中的隱藏檔案和目錄包括使用者程式訪問