You are not logged in.

#1 2009-02-05 07:22:55

arli
Member
From: China
Registered: 2009-02-05
Posts: 7
Website

[SOLVED]about package unneed

how can i to smart clean unneed package..
because `pacman --remove --unneeded` to clean all package with i need..

i'm archlinux new user, help me pls tell me any package can doit like:

/var/lib/portage/world by `emerge --depclean` @ Gentoo Linux
/usr/local/etc/pkg_cutleaves by `pkg_cutleaves` @ FreeBSD

to clean unneed package without my package.

Last edited by arli (2011-11-02 12:11:07)

Offline

#2 2009-02-05 07:26:21

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: [SOLVED]about package unneed

man pacman said:

SYNC OPTIONS
            -c, --clean
           Remove packages that are no longer installed from the cache as well as currently unused sync databases to free up disk space. When pacman downloads packages, it saves them in a
           cache directory. In addition, databases are saved for every sync DB you download from, and are not deleted even if they are removed from the configuration file
           linkman:pacman.conf[5]. Use one --clean switch to only remove packages that are no longer installed; use two to remove all packages from the cache. In both cases, you will have a
           yes or no option to remove packages and/or unused downloaded databases.

           If you use a network shared cache, see the CleanMethod option in linkman:pacman.conf[5]


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#3 2009-02-05 08:01:52

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: [SOLVED]about package unneed

I think he's asking about orphans rather than the cache.  This will attempt to list orphaned deps:

$ pacman -Qqdt

Offline

#4 2009-02-05 08:34:55

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: [SOLVED]about package unneed

Maybe. Ive never used Gentoo, and didnt stay in FBSD long enough to care about stuff like that, so i admit the original post was a bit confusing.

Last edited by dolby (2009-02-05 08:37:08)


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#5 2009-02-05 11:21:28

arli
Member
From: China
Registered: 2009-02-05
Posts: 7
Website

Re: [SOLVED]about package unneed

thank you for reply.. i fix my question tongue

Q1, how can i remove all the non-dependencies (non-Required By) package? as

pacman --query --unrequired | pacman --remove --recursive --nosave

Q2, follow Q1, how to set exclusion? as

/var/lib/portage/world by `emerge --depclean` @ Gentoo Linux
/usr/local/etc/pkg_cutleaves by `pkg_cutleaves -Rxg` @ FreeBSD

Q3, how to check / fix the package tree when a sub-packages has "deleted or upgrade to version of conflict" .. mad

Q4, where i can find abs mirror list.. the 'rsync.archlinux.org' is tooo slower for me.

Last edited by arli (2009-02-06 15:12:45)

Offline

#6 2009-02-19 13:08:32

arli
Member
From: China
Registered: 2009-02-05
Posts: 7
Website

Re: [SOLVED]about package unneed

update: delete, i got solution

Last edited by arli (2009-02-19 13:20:01)

Offline

#7 2009-02-20 03:37:56

tigrmesh
IRC Op
From: Florida, US
Registered: 2007-12-11
Posts: 794

Re: [SOLVED]about package unneed

Please tell us the solution so others can find help.  Also, please mark this thread as [solved] (edit your first post).

Offline

#8 2011-11-02 12:09:35

arli
Member
From: China
Registered: 2009-02-05
Posts: 7
Website

Re: [SOLVED]about package unneed

tigrmesh wrote:

Please tell us the solution so others can find help.  Also, please mark this thread as [solved] (edit your first post).

sorry about that..
this topic start by my friend(at that time, we share same http-proxy with cookies).
but i remember he's solution, an script create by me.

$ cat pkg_cutleaves.sh

#!/bin/sh
# req: pacman, grep, awk, cut
# by ArLi Weng, program@163.com, last update: 20100512

# conf file path here, for example: /etc/pkg_cutleaves.conf
_conf="/mnt/public/gPRG/sh/linux/arch/pkg_cutleaves.conf"

_conf_grps=`grep "@" $_conf | cut -d@ -f2`
_conf_pkgs=`grep -E "^[a-z]" $_conf`

list() {
	_pkgs_qt=`pacman -Qtq`

	for _pkg_qt in $_pkgs_qt
	do
		_group=`pacman -Qi $_pkg_qt | grep "Groups" | awk '{print $3}'`
		filter_grps "$_group" "$_pkg_qt"
	done
}

filter_grps() {
	for _grp in $_conf_grps
	do
		if [ "$_grp" = "$1" ]
		then
			return 0
		fi
	done
	
	filter_pkgs "$2"
}

filter_pkgs() {
	for _pkg in $_conf_pkgs
	do
		if [ "$_pkg" = "$1" ]
		then
			return 0
		fi
	done
	
	hit_pkg "$1"
}

hit_pkg() {
	# pacman -Rsn "$1"
	echo "$1"
}

list

here is my "pkg_cutleaves.conf"

$ cat /mnt/public/gPRG/sh/linux/arch/pkg_cutleaves.conf

# groups
@base
@xfce4

# system
abs
cifs-utils
gnu-netcat
iftop
ntp
openssh
qemu
tcpdump
w3m

# dev
autoconf
automake
fakeroot
gdb
make
patch
pkg-config

# x support
nvidia
ttf-dejavu
xf86-input-synaptics
xorg-xprop
xorg-xrdb

# xfce4 apps
alsa-utils
gvfs
thunar-archive-plugin
xarchiver
xfce4-notes-plugin
xfce4-notifyd
xfce4-power-manager
ristretto

# archive
p7zip
unrar
unzip

# java
icedtea-web
jamvm

# pkgs
amule
axel
blueman
bogofilter
celestia
deluge
desmume
dosbox
epdfview
fcitx-stable
firefox3
flashplugin
freerdp
geany
gimp
libreoffice-calc
libreoffice-draw
libreoffice-impress
libreoffice-writer
mkvtoolnix-gtk
mplayer-stable
mtpaint
pidgin
stardict
sylpheed
timidity-freepats
vorbis-tools
wicd-gtk
wine
wqy-microhei-nightly_build

Last edited by arli (2011-11-02 12:39:53)

Offline

#9 2011-11-02 23:32:54

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED]about package unneed

Thank you arli. I'm closing this thread to prevent further bumping. Please do not consider this as disapproval of your post.
(Reasoning for the curious, topic is old, issue is solved.)


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

Board footer

Powered by FluxBB