Is there a way to accomplish this? I don’t see it in the man pages.
devnullv2 wrote:
> Is there a way to accomplish this? I don’t see it in the man pages.
i’m running 10.3 which has a different zypper man than do the later
versions (guess you are not using 10.3?), but my man zypper says:
remove (rm) [options] <name>
so, just make the list of packages/applications you don’t use and then
put them into this CLI formula, one at a time in the “name”
position…you probably need to look at the man’s options:
zypper rm [options] <name>
–
palladium
Actually, let me clarify.
Removing packages isn’t a problem.
I want to remove all unused packages. Apt in ubuntu/debian, i believe pacman in Arch, and aptitude all can keep track of what libraries and such are no longer in use by any application and they have commands where you can simply remove all packages not in use by the system without you having to go through and compile a list (which would next to impossible).
Also, does anyone know if there’s a cli front end to search/download/install packages from the build service?
Actually it is slightly more complex.
But no, there is no an autoremove option for zypper or YaST. I don’t really miss it, and so I forgot about it, but I was expecting it to be available for 11.2… Perhaps for 11.3.
You can do more or less that with webpin and osc.
devnullv2 wrote:
> all can keep track of what libraries and
> such are no longer in use by any application
hmmmm, sounds like a tracking program keeps a list of untouched for
xxx days stuff…
as far as i know that feature is not here, but i do not know for sure
(disk space is pretty darn inexpensive these days…why don’t you log
it in openFATE and see if it gets put into our bag of tricks…
> Also, does anyone know if there’s a cli front end to
> search/download/install packages from the build service?
you, mean like zypper?
just add the interesting build service repo and let’er rip!
be aware, though that you can get conflicting packages from the
different repos and really gum up the works that way…there is sound
advice withing some noob stickies (and other places) to stick to the
four primary repos, unless you know how to resolve problems you
introduce by enabling more…
or, maybe you are looking for this, where you can read up on all
aspects of the Build Service: http://en.opensuse.org/Build_Service
–
palladium
hmmmm, sounds like a tracking program keeps a list of untouched for
xxx days stuff…
as far as i know that feature is not here, but i do not know for sure
(disk space is pretty darn inexpensive these days…why don’t you log
it in openFATE and see if it gets put into our bag of tricks…
I think it’s really more of a dependency tracker, keeping up with how many (if any) apps symlink against a particular package or not, but i’m sure it’s a bit more complicated than that.
this has been requested on openFATE but it will not be present in 11.2
good find, good info!
–
palladium
good to know
Maybe you want to use “rpmorphan”.
But as for any of those “autoremove” features, be careful in what you are doing, even on distributions that claim this as an official feature of their package management there are glitches (though rare).
This command looks for unneeded packages using “zypper packages --unneeded”, trims the output and feeds it to the “zypper rm” command:
sudo zypper rm $(sudo zypper packages --unneeded| awk '{ print $5 }'|sed '1,/Name/d'|tr '
' ' ')
(This may not be the most sophisticated way, as I copy/pasted this into 1 command from different commands relating the question OP had.)
if you get the output “Too few arguments.” there weren’t found any unused packages
This was a FIVE YEAR old thread.
Holy necro batman.
Hi,
Since this is a very old thread, let us resurrect the dead
Combining awk and sed is not needed. Bash version 4 and up has the builtin mapfile aka readarray which you can use.
mapfile -t packages < <(zypper packages --unneeded| awk '/^i/{ print $5 }'); zypper rm "${packages@]}"
Note on the above code: sudo will not work, one needs to be root.
That said if you insist on doing it your way, you still don’t need sed and tr.
sudo zypper rm $(zypper packages --unneeded| awk '/^i/{ print $5 }' ORS=" ")
well, also zombie rise again…
which criteria use to say that a package is unused???
this is the result of zypper packages --unneeded command on my opensuse 13.2…
can I safely delete this or it is unuseful becouse occupied room is small and it is not worth??
suse-TW:/home/pla # zypper packages --unneeded
.....
S | Repository | Name | Version | Arch
--+-------------------+-----------------------+-----------------------------------+-------
i | openSUSE-13.2-Oss | rhino | 1.7R3-12.1.3 | noarch
i | openSUSE-13.2-Oss | gobject-introspection | 1.42.0-1.2 | x86_64
i | openSUSE-13.2-Oss | xdotool | 2.2012+git.20130201.65cb0b1-4.1.7 | x86_64
i | openSUSE-13.2-Oss | unixODBC | 2.3.2-2.2.1 | x86_64
i | openSUSE-13.2-Oss | cdparanoia-devel | 3.10.2-26.1.2 | x86_64
i | openSUSE-13.2-Oss | libkpeople-lang | 0.3.0-1.2 | x86_64
i | openSUSE-13.2-Oss | vcdimager | 0.7.24cvs-12.1.2 | x86_64
i | openSUSE-13.2-Oss | libdb-4_5 | 4.5.20-128.1.5 | x86_64
i | openSUSE-13.2-Oss | libfprint0 | 0.5.1-3.1.3 | x86_64
i | openSUSE-13.2-Oss | libpackagekitqt4-0 | 0.9.2-2.1 | x86_64
i | openSUSE-13.2-Oss | libmsn0_3 | 4.2.1-9.1.3 | x86_64
i | openSUSE-13.2-Oss | ddd | 3.3.12-4.1.11 | x86_64
i | openSUSE-13.2-Oss | freeglut-devel | 2.8.1-4.2.1 | x86_64
i | openSUSE-13.2-Oss | ibus-m17n | 1.3.4-10.1.3 | x86_64
i | openSUSE-13.2-Oss | gnu-free-fonts | 0.20120503-6.1.8 | noarch
i | openSUSE-13.2-Oss | dri2proto-devel | 2.8-2.2.1 | x86_64
i | openSUSE-13.2-Oss | glproto-devel | 1.4.17-2.2.1 | x86_64
i | openSUSE-13.2-Oss | resourceproto-devel | 1.2.0-2.2.1 | x86_64
i | openSUSE-13.2-Oss | xf86driproto-devel | 2.1.1-2.2.1 | x86_64
i | @System | openSUSE-release-dvd | 13.2-1.28 | x86_64