Ошибка попытка удаления защищенного yum

Well, I’m trying to execute the following command.

yum remove libffi-3.0.9-1.el5.rf.i386

Because I need that file (?), however facing problems while installing ruby with rvm, as libffi-devel is a dependecy of rvm to install ruby.

However it gives me the following error, and of course it doesn’t delete anything.

Error: Trying to remove "yum", which is protected
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

I’ve already tried with —skip-broken and I get this:

Error: Trying to remove "yum", which is protected
 You could try running: rpm -Va --nofiles --nodigest

As you may see, I’m not an expert in Linux, but I need to install Ruby with rvm and I can’t because of this error, does anyone of you have an idea of what am i doing wrong?

Thank you :)

Ну, я пытаюсь выполнить следующую команду.

yum remove libffi-3.0.9-1.el5.rf.i386

Потому что мне нужен этот файл (?), Но возникают проблемы при установке ruby ​​с помощью rvm, поскольку libffi-devel зависит от rvm для установки ruby.

Однако это дает мне следующую ошибку и, конечно, ничего не удаляет.

Error: Trying to remove "yum", which is protected
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Я уже пробовал с —skip-broken и получаю следующее:

Error: Trying to remove "yum", which is protected
 You could try running: rpm -Va --nofiles --nodigest

Как видите, я не эксперт в Linux, но мне нужно установить Ruby с помощью rvm, и я не могу из-за этой ошибки, кто-нибудь из вас знает, что я делаю не так?

Спасибо :)

2 ответа

Лучший ответ

Правильный способ сделать то, что я искал, — это сделать:

rpm -e --nodeps PACKAGE

В командной строке.


14

Uriel Hernández
4 Апр 2013 в 19:24

Команда yum remove <package> удаляет пакет, а также все зависящие от него пакеты.

В вашем случае вы пытаетесь удалить пакет, в котором есть много других пакетов, зависящих от него, включая сам пакет yum. Это как если бы вы запустили yum remove yum, поэтому вы получаете это сообщение об ошибке.

Команда:

rpm -e --nodeps <package>

Может использоваться для удаления пакета без удаления пакетов, зависящих от него, но это, очевидно, приведет к поломке всех остальных пакетов.

Установка или удаление пакетов с помощью rpm —nodeps может привести к неправильной работе и / или сбоям приложений, а также к серьезным проблемам с управлением пакетами или, возможно, к сбою системы.

Для получения дополнительной информации см. https: // access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Removing.html


6

Ahmad Abdelghany
3 Мар 2021 в 13:24

Trying to update one of the my VPS today with sudo yum update command and encounter this funky error message :

error: trying to remove «yum», which is protected

From the output :

 --> Finished Dependency Resolution
 Error: Package: coreutils-libs-8.4-31.el6_5.2.x86_64 (@updates)
 Requires: coreutils = 8.4-31.el6_5.2
 Removing: coreutils-8.4-31.el6_5.2.x86_64 (@updates)
 coreutils = 8.4-31.el6_5.2
 Updated By: coreutils-8.4-37.el6.x86_64 (base)
 coreutils = 8.4-37.el6
  You could try using --skip-broken to work around the problem
 ** Found 31 pre-existing rpmdb problem(s), 'yum check' output follows:

and issuing the sudo yum --skip-broken command will work but give this hint for what is causing the funky error :

error: Failed dependencies:

coreutils-libs = 8.4-31.el65.2 is needed by (installed) coreutils-8.4-31.el65.2.x86_64

seems like the package coreutils-8.4-31.el6_5.2.x86_64 is causing the problem with dependencies issue

SOLUTION :

To fix this funky error, use the rpm- e --justdb <package name> command and in my own example here, I’ll just issue

> sudo rpm -e --justdb coreutils-libs-8.4-37.el6.x86_64

and than

> sudo yum update

bingo! all packages updated.

Introduction

I’m in the process of trying to reduce the number of vulnerabilities with an array of projects associated with our Kubernetes cluster, one of the processes involved is hardening our images. To do so, I’m currently utilising Twistlock to highlight all potential vulnerabilities, currently we’re trying to remove all high/important & critical vulnerabilities.

According to Twistlock’s dashboard, one of the packages that’s vulnerable is associated to sqlite & another is associated to libxml2. If I can, I’d also like to remove the vulnerabilities associated with dbus, only at this point I’m a little unsure of how to tackle this.

Process

So far, I’m trying to use a rather primitive process to approach the packages mentioned above, since I’m using CentOS, I’m executing the following commands inside of my dockerfile:

## Use the base image. 
FROM base-img

## Utilise root for package management. 
USER root

RUN yum update
RUN yum clean all 
RUN yum remove sqlite
RUN yum remove libxml2

## Run as non root user.
USER jboss

## Now to remove yum.
RUN rpm -e $(rpm -qa '*yum*')

## etc.

However, this results in some set of errors, like so, when trying to run our docker build command:

...
Error: Trying to remove "systemd", which is protected
Error: Trying to remove "yum", which is protected
...

Conclusion

I believe that I need some assistance form a Linux guru here? Since the requirements of this project is to ensure that the security is kept to a maximum, we’d really like to remove as many potential threats as possible, I’ve pretty much nailed the application layer already. Now I’m delving into the OS layer & soon I’ll be delving into the network layer also, so if anyone can provide any input or guidance on how we could remove such threats, the help would be much appreciated.

Disclaimer

Unfortunately I’m far from a Linux pro, maybe intermediate at best, so please be patient if I’m missing something. I’ve also created a question on SO, only that’s more associated with JBoss, if any of you are able to help with that question, help would be much appreciated there also.

Introduction

I’m in the process of trying to reduce the number of vulnerabilities with an array of projects associated with our Kubernetes cluster, one of the processes involved is hardening our images. To do so, I’m currently utilising Twistlock to highlight all potential vulnerabilities, currently we’re trying to remove all high/important & critical vulnerabilities.

According to Twistlock’s dashboard, one of the packages that’s vulnerable is associated to sqlite & another is associated to libxml2. If I can, I’d also like to remove the vulnerabilities associated with dbus, only at this point I’m a little unsure of how to tackle this.

Process

So far, I’m trying to use a rather primitive process to approach the packages mentioned above, since I’m using CentOS, I’m executing the following commands inside of my dockerfile:

## Use the base image. 
FROM base-img

## Utilise root for package management. 
USER root

RUN yum update
RUN yum clean all 
RUN yum remove sqlite
RUN yum remove libxml2

## Run as non root user.
USER jboss

## Now to remove yum.
RUN rpm -e $(rpm -qa '*yum*')

## etc.

However, this results in some set of errors, like so, when trying to run our docker build command:

...
Error: Trying to remove "systemd", which is protected
Error: Trying to remove "yum", which is protected
...

Conclusion

I believe that I need some assistance form a Linux guru here? Since the requirements of this project is to ensure that the security is kept to a maximum, we’d really like to remove as many potential threats as possible, I’ve pretty much nailed the application layer already. Now I’m delving into the OS layer & soon I’ll be delving into the network layer also, so if anyone can provide any input or guidance on how we could remove such threats, the help would be much appreciated.

Disclaimer

Unfortunately I’m far from a Linux pro, maybe intermediate at best, so please be patient if I’m missing something. I’ve also created a question on SO, only that’s more associated with JBoss, if any of you are able to help with that question, help would be much appreciated there also.

Ну, я пытаюсь выполнить следующую команду.

yum remove libffi-3.0.9-1.el5.rf.i386

Потому что мне нужен этот файл (?), Но возникают проблемы при установке ruby ​​с помощью rvm, поскольку libffi-devel зависит от rvm для установки ruby.

Однако это дает мне следующую ошибку и, конечно, ничего не удаляет.

Error: Trying to remove "yum", which is protected
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Я уже пробовал с —skip-broken и получаю следующее:

Error: Trying to remove "yum", which is protected
 You could try running: rpm -Va --nofiles --nodigest

Как видите, я не эксперт в Linux, но мне нужно установить Ruby с помощью rvm, и я не могу из-за этой ошибки, кто-нибудь из вас знает, что я делаю не так?

Спасибо :)

2 ответа

Лучший ответ

Правильный способ сделать то, что я искал, — это сделать:

rpm -e --nodeps PACKAGE

В командной строке.


14

Uriel Hernández
4 Апр 2013 в 19:24

Команда yum remove <package> удаляет пакет, а также все зависящие от него пакеты.

В вашем случае вы пытаетесь удалить пакет, в котором есть много других пакетов, зависящих от него, включая сам пакет yum. Это как если бы вы запустили yum remove yum, поэтому вы получаете это сообщение об ошибке.

Команда:

rpm -e --nodeps <package>

Может использоваться для удаления пакета без удаления пакетов, зависящих от него, но это, очевидно, приведет к поломке всех остальных пакетов.

Установка или удаление пакетов с помощью rpm —nodeps может привести к неправильной работе и / или сбоям приложений, а также к серьезным проблемам с управлением пакетами или, возможно, к сбою системы.

Для получения дополнительной информации см. https: // access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Removing.html


9

Ahmad Abdelghany
3 Мар 2021 в 13:24

Trying to update one of the my VPS today with sudo yum update command and encounter this funky error message :

error: trying to remove «yum», which is protected

From the output :

 --> Finished Dependency Resolution
 Error: Package: coreutils-libs-8.4-31.el6_5.2.x86_64 (@updates)
 Requires: coreutils = 8.4-31.el6_5.2
 Removing: coreutils-8.4-31.el6_5.2.x86_64 (@updates)
 coreutils = 8.4-31.el6_5.2
 Updated By: coreutils-8.4-37.el6.x86_64 (base)
 coreutils = 8.4-37.el6
  You could try using --skip-broken to work around the problem
 ** Found 31 pre-existing rpmdb problem(s), 'yum check' output follows:

and issuing the sudo yum --skip-broken command will work but give this hint for what is causing the funky error :

error: Failed dependencies:

coreutils-libs = 8.4-31.el65.2 is needed by (installed) coreutils-8.4-31.el65.2.x86_64

seems like the package coreutils-8.4-31.el6_5.2.x86_64 is causing the problem with dependencies issue

SOLUTION :

To fix this funky error, use the rpm- e --justdb <package name> command and in my own example here, I’ll just issue

> sudo rpm -e --justdb coreutils-libs-8.4-37.el6.x86_64

and than

> sudo yum update

bingo! all packages updated.

Команда:

yum remove <package>

Постарается удалить пакет, а также любые пакеты, которые зависят от него.

В вашем случае вы пытаетесь удалить пакет, в то время как от него зависит множество других пакетов, включая yum сам пакет Это как если бы вы бежали yum remove yumВот почему вы получаете это сообщение об ошибке.

Команда:

rpm -e --nodeps <package>

Может использоваться для удаления пакета без удаления пакетов, которые зависят от него, но это, очевидно, нарушит все эти другие пакеты.

Установка или удаление пакетов с помощью rpm —nodeps может привести к неправильной работе и / или аварийному завершению работы приложений, а также может вызвать серьезные проблемы с управлением пакетами или, возможно, сбой системы.

Для получения дополнительной информации см. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Removing.html

  • Ошибка попытка послать бинарный файл
  • Ошибка попытка использовать имя переменной нулевой длины
  • Ошибка попытка доступа к процессу выполняющему процедуру завершения
  • Ошибка попытайтесь задать винтовой канал другим образом
  • Ошибка попробуйте через несколько минут инстаграмм