LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 12-27-2016, 07:13 AM   #1
leniviy
Member
 
Registered: Jul 2009
Distribution: Archlinux
Posts: 69

Rep: Reputation: 4
package-cleanup and circular dependencies


Hi. I have a shell snippet that takes a list of packages I want to keep and uninstalls all the rest:

Code:
    diff -u ~/my_packs_to_keep.lst ~/my_packs_all.lst | sed '1,3d;/cifs-utils\|samba-client/d;s/^+//;t;d' >~/my_packages-ec-stage-db-1-to-uninst.txt
    while true; do
        package-cleanup --leaves --all | xargs rpm -q --queryformat "%{NAME}.%{ARCH}\n" | LC_ALL=C sort >~/my_packages-ec-stage-db-1-leaves.txt
        b=`LC_ALL=C join ~/my_packages-ec-stage-db-1-to-uninst.txt ~/my_packages-ec-stage-db-1-leaves.txt`
        [ -z "$b" ] && break
        yum erase $b || break
    done
Today I noticed it cannot uninstall this trinity:
- gdm
- pulseaudio-gdm-hooks
- plymouth-gdm-hooks

because they depend on each other and from `package-cleanup` point of view, they're not leaves.

How to change my script? The most important thing is to not accidentally erase a package that needs to be kept.

Last edited by leniviy; 12-27-2016 at 07:20 AM.
 
Old 12-27-2016, 08:24 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You can use "rpm -e" to remove any RPM and if you specify multiple RPMs after the -e it will check to see if any dependencies it encounters are in the list you specified and if so remove those. This won't remove any rpm you did NOT specify (so long as you didn't provide other options to the rpm command that tell it to do so) so is relatively safe.

Last edited by MensaWater; 12-27-2016 at 09:04 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] circular dependencies, please explain a4z Slackware 18 12-22-2016 05:13 AM
Circular dependencies linuxbriel Linux - General 2 09-08-2006 02:53 AM
libstdc++ : circular dependencies? yekrahs Linux - Software 21 10-23-2005 10:57 AM
How to install modules? (circular dependencies!) redss Linux - Software 1 01-07-2005 03:11 PM
sash glibc circular dependencies twosider Mandriva 2 08-09-2004 03:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration