Как удалить программу centos
Перейти к содержимому

Как удалить программу centos

  • автор:

How to Uninstall or Remove Packages from CentOS

Uncesscerary packages slow down system performance and take up storage space. If specific software isn’t being used, then it’s best to remove it, and doing so is easy.

In this tutorial, learn how to remove packages and uninstall dependencies from CentOS 7.

Tutorial on how to uninstall packages from CentOS.

  • Access to a user account with sudo or root privileges
  • A terminal window or command line (Ctrl+Alt+F2)
  • The YUM and RPM package managers, included by default

Uninstall Package from CentOS with Yum

CentOS is an RHEL (Red Hat Enterprise Linux) distribution. Users rely on the RPM (Red-hat Package Manager) and YUM (The Yellowdog Updater, Modified) package manager.

To remove a package from CentOS, use the following yum commands:

In the following example, we deleted the Apache web server package, filed under the name httpd.x86_64, using the yum command.

Before removing, the command prompt asks for the root (or sudo user) password, and confirmation that you want the software deleted.

Type in y (for yes) and press Enter. If you have changed your mind, press n (for no) and then Enter.

Finally, the output informs you that the process is complete and shows you which package has been deleted.

software removed from centos with yum remove command

Note: Only root users and users added to the sudousers group have permission to install and remove packages in CentOS.

How to Remove Packages with Dependencies Using Yum

Package dependencies are binaries, libraries, and modules on which software rely on. When installing software, it will automatically download and store the required dependencies.

In most cases, deleting software from the local package manager will also erase its dependencies (unless other programs require them).

Still, there are instances in which these dependencies have to be removed manually.

To remove a package and erase all the unneeded dependencies use the following command:

Note: When a user installs a package, YUM downloads and stores it in /var/cache/yum. However, packages remain in cache even after they’ve been installed and removed. In time, the stored cache may take up too much disk space or cause issues due to corrupt metadata. To reclaim disk space, be sure to clean the YUM cache.

Alternatively, you can alter the yum configuration file to automatically remove package dependencies when deleting a package with the yum remove or yum erase commands.

Start by opening the yum.conf file with a text editor of your choice:

Then, add the following line to the file:

edit yum confi file for autoremove

Save and exit the file.

How to Find Specific File in CentOS

In case you need to delete a package but are unsure of its exact file name, you can use one of the following two commands:

The output will list all installed packages with the specified phrase found in the file name.

As you can see in the image below, httpd appears in the following packages (and dependencies):

find package name in centos

After you have the exact name of the package you want to erase, you can uninstall it from your CentOS system.

For more options on listing packages on CentOS read our detailed tutorial.

After reading this tutorial, you should now know how to remove packages and dependencies to free up space taken up by redundant programs.

You also know how quickly find specific packages or files you want to delete.

How to uninstall programs from CentOS 8

Uninstall program centos 8

Each Linux distribution is a collection of various packages. So, all packages must keep in a suitable package manager. Different types of package managers are available on every Linux distribution. When we talk about CentOS then, using RPM is a package, and YUM is used as Package Manager. YUM is available on almost all kinds of RPM-based environments like CentOS, Fedora, OpenSUSE, and RHEL. However, it is used on RHEL and CentOS distributions mostly.

So, we will guide you in this article about how you can uninstall a program or package using the yum package manager. We have implemented all commands on the latest available CentOS 8 Linux distribution. But, these below mentioned commands can also be used on an older CentOS environment. It is important to note that you can uninstall rpm packages using the yum package manager.

Prerequisites

To make any system-level change in the Linux distribution, you must have sudo command or root privileges. In the CentOS environment, you need to login from a root account or any user who can execute sudo commands.

All commands we need to run on a command-line tool. Therefore, open the terminal. To do that, click on ‘Activities’ on top left corner and from the sidebar click on the terminal application icon as follows:

Now, let’s start the demonstration about how to uninstall a package using yum on CentOS 8.

List the installed Package Using Yum Package Manager

Before uninstalling any program from your system, you need to know either this package is installed on this system or not. You must have the package name that you want to uninstall from your CentOS 8 system. For this purpose, you need to list all installed packages. Therefore, by executing the following command you can list all installed packages on your system:

For your convenience, you can use less with the above-mentioned command.

You can filtered the displaying output with the help of following ‘grep’ command:

For example, you want to search the gcc package. Just type gcc in the search term as follows:

Uninstall a Package Using Yum

Now, we are assuming that you know about the package name that you want to uninstall. So, using the following command you can uninstall the required package:

For example, you want to remove a package with the name gcc.x86_64. Then, you can remove it by using the following command:

Uninstall Multiple Packages

By executing the same above command using the following structure, you can uninstall multiple packages:

For example, we want to remove two packages gcc.x86_64 and Firefox. Then, use the command as follows:

How to uninstall programs from CentOS

Uninstall a packages group

Many similar kinds of packages you can install using the group package installation. So, if you don’t want to use it further then, you can also uninstall this group.

Let’s give you an example, you can install a group ‘Development tools’ in which different packages related to development like gcc compiler, cmake, git and automake, etc are included. So, by using just a single command you can uninstall the packages group.

How to uninstall programs from CentOS

How to uninstall programs from CentOS

Alternatively, you can use the below command that will perform the same operation that we have done in the above command.

Automate package removal confirmation prompt

When you uninstall a package, it will show you a confirmation prompt. So, if you don’t want to view the prompt during the installation then, use the option ‘-y’ with your command.

However, yum isn’t the only one that offers this feature. Using this powerful manager you can perform more tasks. So, execute the following command to explore more features of Yum package manager:

How to uninstall programs from CentOS

Conclusion

We have a simple way to uninstall a package using Yum. You need to just type the package name with root privileges. Moreover, we have also seen how to remove a single package, multiple, and group by using the Yum package manager. Send us your feedback through comments.

Maryam-Sulemani

Samreena Aslam holds a master’s degree in Software Engineering. She’s a technical writer and has written various articles on different Linux flavours including Ubuntu, Debian, CentOS and Mint as well as programming guides in various programming languages

Удаление или удаление пакета с помощью терминала на CentOS — VITUX

Необходимо удалить дополнительные программные пакеты из системы, потому что эти пакеты занимают много места и замедляют скорость вашей системы. Если конкретное программное обеспечение или связанные пакеты не используются недостаточно, это лучший способ удалить или стереть их из системы. Для этого он также создаст комфортную рабочую среду. В этой статье мы рассмотрим, как удалить или удалить пакеты из вашей системы CentOS 8.0 с помощью терминала.

Предварительные условия

  1. Вы должны войти в систему от имени пользователя root или должны иметь права для запуска команды Sudo.
  2. Менеджеры пакетов RPM и YUM / DNF обычно уже установлены. Если нет, то установите их.

Перечислить или найти установленные пакеты

Чтобы удалить лишний пакет, перечислите все установленные пакеты системы. Откройте окно терминала и выполните следующую команду, чтобы получить список всего установленного программного обеспечения или пакетов.

Синтаксис

Список пакетов RPM в CentOS

Найдите конкретное программное обеспечение или пакет

Чтобы удалить определенный пакет из системы, это лучший способ найти конкретное программное обеспечение по его имени. Выполните следующую команду, чтобы найти конкретное программное обеспечение или пакет:

Синтаксис

Найдите установленный пакет RPM

Использование yum для удаления программного обеспечения или пакета из CentOS

CentOS — это дистрибутив RHEL (Red Hat Enterprise Linux). В CentOS 8.0 большинство пользовательских команд основано на YUM (The Yellowdog Updater, Modified) и диспетчере пакетов RPM (Red-hat Package Manager). Вы можете установить или удалить пакет или программное обеспечение с помощью команды yum.

Сначала убедитесь, что yum установлен в вашей системе. После установки yum, чтобы удалить ненужное программное обеспечение или пакет из CentOS 8.0, выполните следующую команду yum.

Синтаксис

Здесь мы удалим python2 из нашей системы. Введите следующую команду на терминале. Он попросит вас ввести пароль администратора. Введите пароль пользователя / администратора Sudo.

ням удалить пакет

Вариант Y / N будет отображаться на терминале, который подтвердит, что вы хотите удалить этот конкретный package нажмите y, а затем Enter, чтобы продолжить, и нажмите N и Enter, если вы не хотите удалять это упаковка.

Наконец, процесс удаления завершен. Здесь введите имя пакета, который нужно удалить из системы. После отображения вывода он сообщит вам, что pythons2 был удален из вашей системы.

удаление rpm завершено

Вывод

В этой статье мы узнали, как удалить или удалить пакеты из CentOS 8.0, чтобы освободить место, занимаемое ненужными программами. Теперь вы также можете перечислить установленные пакеты и найти конкретный пакет или программное обеспечение, которые вы, возможно, захотите удалить. Я надеюсь, что это руководство будет для вас полезным, и вы сможете удалить или стереть любое программное обеспечение или пакет приложений из системы в CentOS 8.0.

Removing content

The following sections describe how to remove content in CentOS 8:

Removing installed modules describes removing content installed from a module stream.

Resetting module streams describes resetting module streams to initial state.

Commands for removing content summarizes the commands for removing content.

Removing installed packages

This section describes how to remove packages.

Remove the package:

The package is removed together with any other dependent packages.

Removing installed modules

Removing a module removes all of the packages installed by profiles of the currently enabled module stream, and any further packages and modules that depend on these.

Packages installed from this module stream not listed in any of its profiles remain installed on the system and can be removed manually.

A module which you want removed must have already installed some profiles.

List packages installed from the module:

Replace module-name with the name of the module. This will list all packages installed from this module.

Remove the packages listed in the previous step:

Replace package with the packages listed in previous step. You can supply multiple package names separated by spaces. The yum tool will present a summary of the changes and ask for confirmation.

Mark the module profiles as uninstalled:

The currently enabled module stream remains enabled.

Optionally, reset or disable the stream.

Resetting module streams

Resetting a module is an action that returns all of its streams to their initial state — neither enabled nor disabled. If the module has a default stream, that stream becomes active as a result of resetting the module.

Reset the module state:

All streams of the module are returned to the initial state. No installed content is removed.

Commands for removing content

This section lists commonly used commands for removing content.

All CentOS Documentation content available under CC-BY-SA 3.0.

This page was built using a modified version of the Antora default UI. The source code for this UI is licensed under the terms of the MPL-2.0 license.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *