linux 卸載軟件命令_如何在Linux中使用命令行卸載軟件

linux 卸載軟件命令

linux 卸載軟件命令

00_lead_image_uninstalling_software_in_linux

Linux provides different methods for installing software. You can install software from the standard Ubuntu software repositories using the Ubuntu Software Center, from outside of the standard Ubuntu software repositories, or by compiling source code. However, what if you need to uninstall a program?

Linux提供了不同的軟件安裝方法。 您可以安裝軟件,從標準的Ubuntu軟件倉庫使用Ubuntu軟件中心,從標準的Ubuntu軟件倉庫的外面,或者通過編譯源代碼。 但是,如果您需要卸載程序怎麼辦?

If you’ve installed software from the Ubuntu software repositories using the Ubuntu Software Center, you can use the Ubuntu Software Center to uninstall that software as well. However, if you’re more comfortable using the command line, we’ll show you an easy way to see what’s installed on your system and uninstall programs.

如果您已使用Ubuntu軟件中心從Ubuntu軟件庫中安裝了軟件,則也可以使用Ubuntu軟件中心來卸載該軟件。 但是,如果您更習慣使用命令行,我們將爲您提供一種簡單的方法來查看系統上已安裝的內容並卸載程序。

If you have an idea of what you want to uninstall, but you don’t know the exact name, see our article about finding out exact package names in Linux. You can also use the 「dpkg」 command to see a list of all installed packages on your computer, press 「Ctrl + Alt + T」 to open a Terminal window. Type the following command at the prompt and press 「Enter」.

如果您對要卸載的內容有所瞭解,但不知道確切的名稱,請參閱有關在Linux中查找確切的軟件包名稱的文章。 您也可以使用「 dpkg」命令查看計算機上所有已安裝軟件包的列表,按「 Ctrl + Alt + T」打開「終端」窗口。 在提示符下鍵入以下命令,然後按「 Enter」。

dpkg --list

dpkg的--名單

NOTE: There are two dashes before 「list」.

注意:「列表」之前有兩個破折號。

01_dpkg_list_command

Scroll through the list of installed packages in the Terminal window to find the one you want to uninstall. Note the full name of the package.

在「終端」窗口中滾動瀏覽已安裝軟件包的列表,找到要卸載的軟件包。 注意包的全名。

02_gimp_in_list

To uninstall a program, use the 「apt-get」 command, which is the general command for installing programs and manipulating installed programs. For example, the following command uninstalls gimp and deletes all the configuration files, using the 「--purge」 (there are two dashes before 「purge」) command.

要卸載程序,請使用「 apt-get」命令,這是用於安裝程序和操作已安裝程序的常規命令。 例如,下面的命令卸載辮形並刪除所有的配置文件,使用「 --吹掃」(有兩個短劃線「清洗」之前)命令。

sudo apt-get --purge remove gimp

sudo易於得到--清除刪除瘸子

Enter your password when prompted and press 「Enter」.

出現提示時輸入密碼,然後按「 Enter」。

NOTE: The password does not display as you type it. However, you can choose to display asterisks as you type the password.

注意:輸入密碼時,密碼不會顯示。 但是,您可以在輸入密碼時選擇顯示星號

03_uninstalling_gimp_with_purge

The uninstallation process begins and a summary of the actions to be taken displays. When asked if you want to continue, type a 「y」 and press 「Enter」.

卸載過程開始,並顯示要採取的措施的摘要。 當詢問您是否要繼續時,鍵入「 y」並按「 Enter」。

04_do_you_want_to_continue

The installation process continues. When it’s done, type 「exit」 at the prompt and press 「Enter」 to close the Terminal window, or click the 「X」 button in the upper-left corner of the window.

安裝過程將繼續。 完成後,在提示符下鍵入「 exit」,然後按「 Enter」以關閉「終端」窗口,或單擊窗口左上角的「 X」按鈕。

05_closing_terminal_window

If you don’t want to remove the configuration files, simply leave out the 「--purge」 command, as shown in the following command.

如果你不想刪除配置文件,只需離開了「 --清除」命令,如圖下面的命令。

sudo apt-get remove gimp

sudo apt-get刪除gimp

06_uninstalling_gimp_without_purge

As discussed in this article, programs installed in Linux depend on other packages to function. When you uninstall a program, there may be packages that the uninstalled program depended upon that are no longer used. To remove any unused packages, use the 「autoremove」 command, as shown in the following command.

本文所述,Linux中安裝的程序依賴於其他程序包才能起作用。 當您卸載程序時,可能不再使用已卸載程序所依賴的軟件包。 要刪除所有未使用的軟件包,請使用「 autoremove」命令,如以下命令所示。

sudo apt-get autoremove

須藤apt-get autoremove

07_running_autoremove_command

You can combine the two commands for removing a program and removing dependencies that are no longer being used into one, as shown below (again, two dashes before 「auto-remove」).

您可以將這兩個命令組合在一起,以刪除程序和刪除不再使用的依賴項,如下所示(再次,在「自動刪除」之前加兩個破折號)。

sudo apt-get purge --auto-remove gimp

sudo易於得到淨化--自動刪除GIMP

08_using_one_command_to_autoremove

If you’re short on space, you can use the 「clean」 command to remove downloaded archive files, as shown below.

如果空間不足,可以使用「 clean」命令刪除下載的存檔文件,如下所示。

sudo apt-get clean

須藤apt-get clean

This command removes the aptitude cache in 「/var/cache/apt/archives」. When you install a program, the package file is downloaded and stored in that directory. You don’t need to keep the files in that directory. However, the only drawback of deleting them, is that if you decide to install any of those programs again, the packages would have to be downloaded again.

此命令將刪除「 / var / cache / apt / archives」中的智能緩存。 安裝程序時,將下載軟件包文件並將其存儲在該目錄中。 您無需將文件保留在該目錄中。 但是,刪除它們的唯一缺點是,如果您決定再次安裝這些程序中的任何一個,則必須重新下載軟件包。

09_cleaning_apt_cache

The 「apt-get」 is a handy tool that makes downloading, installing, and uninstalling programs quick and easy. For more information about using the 「apt-get」 command, type 「apt-get」 at the prompt and press 「Enter」.

「 apt-get」是一種方便的工具,可以快速輕鬆地下載,安裝和卸載程序。 有關使用「 apt-get」命令的更多信息,請在提示符下鍵入「 apt-get」,然後按「 Enter」。

翻譯自: https://www.howtogeek.com/229699/how-to-uninstall-software-using-the-command-line-in-linux/

linux 卸載軟件命令