English
Ask Your Question
5

Removing packages with dependencies

asked 2013-10-08 15:52:37 +0000

Faisal Aslam gravatar image

I install Chromium in Fedora 19. I don't like it and removed it. Now using Google Chrome. I want to ask that what about the dependencies which were installed with Chromium? Should I have to remove dependencies one by one or is there any option like they have in Ubuntu

sudo apt-get clean

Is there any option like this to remove dependencies which are not in use. Please is there any command then let me know.

Also sorry for my bad English.

edit retag flag offensive close merge delete

Comments

1

How were you able to remove Chromium without removing its dependencies as well?

hawkfeather ( 2013-10-08 16:26:40 +0000 )edit

Often, not all dependencies are removed. That I believe is what Faisal wants to do.

nonamedotc ( 2013-10-08 16:42:06 +0000 )edit

Generally, if you use yum or rpm to remove a package, its otherwise-unneeded dependencies will also be removed. And sometimes, inexperienced users will simply delete an unwanted application, and I wondered if maybe that's what Faisal had done.

hawkfeather ( 2013-10-09 03:56:24 +0000 )edit

I just remove Chromium by this command rpm -e chromium

Faisal Aslam ( 2013-10-09 12:44:47 +0000 )edit

4 answers

Sort by ยป oldest newest most voted
3

answered 2013-10-09 08:12:23 +0000

hawkfeather gravatar image

updated 2013-10-15 17:17:58 +0000

It turns out that yum also has an autoremove* option, same as that of Debian's apt-get.

$ sudo yum autoremove will remove any unneeded dependencies from your system. You should run that command straightaway after adding the clean_requirements_on_remove=1 line to your /etc/yum.conf file as described in the previous answer.

*- Found in the man page documentation for yum

edit flag offensive delete link more
5

answered 2013-10-08 16:41:05 +0000

You could also add this option to /etc/yum.conf: clean_requirements_on_remove=1.

From man 5 yum.conf:

clean_requirements_on_remove When removing packages (by removal, update or obsoletion) go through each package's dependencies. If any of them are no longer required by any other package then also mark them to be removed. Boolean (1, 0, True, False, yes, no) Defaults to False

edit flag offensive delete link more

Comments

That's nice! Good to know!

nonamedotc ( 2013-10-08 16:42:54 +0000 )edit

This is one of those little flags that I didn't know existed. Thanks, this will be very useful.

cobra ( 2013-10-09 10:09:16 +0000 )edit
3

answered 2013-10-08 17:28:27 +0000

skytux gravatar image

In my opinion, the best way to remove a package alongside its installed dependencies is with yum history.

In the first place, you need to identify the number (ID) of the transaction:

# yum history

Then, use that number to undo the complete transaction:

# yum history undo ID

(where ID is the first column number corresponding to the package you have installed).

Example. Suppose I want to remove python3-ipython and its dependencies, then I do the following:

# yum history

ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
   230 | install python3-ipython  | 2013-10-07 12:56 | Install        |   16   
   229 | install python-pyside    | 2013-10-06 19:02 | Install        |    2   
   228 | --enablerepo=updates-tes | 2013-10-06 14:18 | Update         |    2   
   227 | update                   | 2013-10-06 13:48 | E, I, U        |   12 EE

# yum history undo 230

Undoing transaction 230, from Mon Oct  7 12:56:34 2013
    Dep-Install python3-dateutil-2.0-5.fc19.noarch            @fedora
    Install     python3-ipython-0.13.2-1.fc19.noarch          @fedora
    Dep-Install python3-ipython-console-0.13.2-1.fc19.noarch  @fedora
    Dep-Install python3-ipython-gui-0.13.2-1.fc19.noarch      @fedora
    Dep-Install python3-ipython-notebook-0.13.2-1.fc19.noarch @fedora
    Dep-Install python3-matplotlib-1.2.0-14.fc19.x86_64       @updates
    Dep-Install python3-mglob-0.4-8.fc19.noarch               @fedora
    Dep-Install python3-numpy-1:1.7.1-5.fc19.x86_64           @updates
    Dep-Install python3-pexpect-2.5.1-8.fc19.noarch           @updates
    Dep-Install python3-pygments-1.4-8.fc19.noarch            @fedora
    Dep-Install python3-pyparsing-1.5.6-8.fc19.noarch         @fedora
    Dep-Install python3-pytz-2012d-4.fc19.noarch              @fedora
    Dep-Install python3-setuptools-0.6.36-1.fc19.noarch       @fedora
    Dep-Install python3-simplegeneric-0.8-6.fc19.noarch       @fedora
    Dep-Install python3-tornado-2.2.1-4.fc19.noarch           @fedora
    Dep-Install python3-zmq-13.0.0-1.fc19.x86_64              @fedora
Resolving Dependencies
--> Running transaction check
---> Package python3-dateutil.noarch 0:2.0-5.fc19 will be erased
---> Package python3-ipython.noarch 0:0.13.2-1.fc19 will be erased
---> Package python3-ipython-console.noarch 0:0.13.2-1.fc19 will be erased
---> Package python3-ipython-gui.noarch 0:0.13.2-1.fc19 will be erased
---> Package python3-ipython-notebook.noarch 0:0.13.2-1.fc19 will be erased
---> Package python3-matplotlib.x86_64 0:1.2.0-14.fc19 will be erased
---> Package python3-mglob.noarch 0:0.4-8.fc19 will be erased
---> Package python3-numpy.x86_64 1:1.7.1-5.fc19 will be erased
---> Package python3-pexpect.noarch 0:2.5.1-8.fc19 will be erased
---> Package python3-pygments.noarch 0:1.4-8.fc19 will be erased
---> Package python3-pyparsing.noarch 0:1.5.6-8.fc19 will be erased
---> Package python3-pytz.noarch 0:2012d-4.fc19 will be erased
---> Package python3-setuptools.noarch 0:0.6.36-1.fc19 will be erased
---> Package python3-simplegeneric.noarch 0:0.8-6.fc19 will be erased
---> Package python3-tornado.noarch 0:2.2.1-4.fc19 will be erased
---> Package python3-zmq.x86_64 0:13.0.0-1.fc19 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================
 Package                        Arch         Version                 Repository      Size
==========================================================================================
Removing:
 python3-dateutil               noarch       2.0-5.fc19              @fedora        364 k
 python3-ipython                noarch       0.13.2-1.fc19           @fedora        0.0  
 python3-ipython-console        noarch       0.13.2-1.fc19           @fedora        5.6 M
 python3-ipython-gui            noarch       0.13.2-1.fc19           @fedora        803 k
 python3-ipython-notebook       noarch       0.13.2-1.fc19           @fedora        1.1 M
 python3-matplotlib             x86_64       1.2.0-14.fc19           @updates        50 M
 python3-mglob                  noarch       0.4-8.fc19              @fedora         22 k
 python3-numpy                  x86_64       1:1.7.1-5.fc19          @updates ...
(more)
edit flag offensive delete link more

Comments

This looks a little too much like a brute-force method to me, like it would remove dependencies regardless of whether they are needed by other packages and possibly leave you w\ a broken system. Am I right?

hawkfeather ( 2013-10-09 04:05:13 +0000 )edit

Well, it is a yum command... I'm not sure if it would remove dependencies needed by other packages. Every time I want to test a package, and then I don't like it, I remove it in that way, so I never experienced the situation you are describing here. But anyway it would be worth consulting a yum developer.

skytux ( 2013-10-12 18:25:57 +0000 )edit
2

answered 2013-10-08 16:04:08 +0000

nonamedotc gravatar image

My favorite is the yum plugin remove with leaves. This does exactly what you wanted. Install the plugin as follows -

yum install yum-plugin-remove-with-leaves

When you are removing a package, do

yum remove *packagename* --remove-leaves

This should get rid packages that were installed as dependencies but not needed anymore. This command works similar to apt-get autoremove

Note: Pay close attention to what packages yum wants to remove to avoid having a broken system (albeit rarely)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Stats

Asked: 2013-10-08 15:52:37 +0000

Seen: 57,348 times

Last updated: Oct 15 '13