Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
depclean would like to clean old (but used) kernel
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
castor_fou
Apprentice
Apprentice


Joined: 23 May 2002
Posts: 249
Location: Clermont-Ferrand, France

PostPosted: Mon Nov 05, 2007 11:09 am    Post subject: depclean would like to clean old (but used) kernel Reply with quote

1st time I see that.
emerge -pv --depclean proposes to clean all but the last downloaded version of my kernel.

sys-kernel/gentoo-sources
selected: 2.6.18-r6 2.6.19-r5 2.6.20-r8 2.6.21-r4 2.6.22-r2 2.6.22-r5 2.6.22-r8
protected: none
omitted: 2.6.22-r9

I would like to keep previous versions, I have to protect /usr/src/linux ?
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Mon Nov 05, 2007 3:45 pm    Post subject: Reply with quote

It won't uninstall the actual kernel or the modules, it will only uninstall the sources in /usr/src/, and even then it won't remove everything.

You should only need to keep what depclean would remove in this case if you required the sources to re-configure these kernels, everything you need to boot them will remain in /boot and /lib/modules.

To see why letting depclean remove these might be a good idea, run `du -chs /usr/src/*`, I'm betting removing them will free up more than 2 gigs of disk space.

Anyway, if you really wanted to keep all these sources around, you could add the following to /var/lib/portage/world;
Code:
sys-kernel/gentoo-sources:2.6.18-r6
sys-kernel/gentoo-sources:2.6.19-r5
sys-kernel/gentoo-sources:2.6.20-r8
sys-kernel/gentoo-sources:2.6.21-r4
sys-kernel/gentoo-sources:2.6.22-r2
sys-kernel/gentoo-sources:2.6.22-r5
sys-kernel/gentoo-sources:2.6.22-r8
sys-kernel/gentoo-sources:2.6.22-r9

_________________
"You have to invite me in"
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Mon Nov 05, 2007 7:30 pm    Post subject: Reply with quote

Hopeless wrote:
It won't uninstall the actual kernel or the modules, it will only uninstall the sources in /usr/src/, and even then it won't remove everything.

You should only need to keep what depclean would remove in this case if you required the sources to re-configure these kernels, everything you need to boot them will remain in /boot and /lib/modules.


But you know that the sources are needed to re-configure the old kernels?

I don't like this behaviour, too, because sometimes I still need the old kernel sources especially because I can't or don't want to compile the whole kernel if I want to change only one small kernel option. And I can't or don't want to always compile a complete kernel as soon as an emerge -uDN world installs a new kernel source. But I do want to uninstall every unnecessary dependencies immediately after an emerge -uDN world.

Hopeless wrote:
To see why letting depclean remove these might be a good idea, run `du -chs /usr/src/*`, I'm betting removing them will free up more than 2 gigs of disk space.


Removing these is not a good idea for the reasons I mentioned above. And look at the output of `emerge -pv` then you will see an "S" in the output. So you will see that every new version of the kernel sources is installed slotted and this is for good reasons, the reasons I mentioned above. So you know that old kernel sources won't be uninstalled automatically. And so you know that you must/can/should - whatever - uninstall old kernel versions manually which is really easy. So it's up to you if you waste too much disk space with unneeded old kernel sources.

Btw. the slotted installation of new kernel version is made senseless by this new behaviour of emerge --depclean.

Hopeless wrote:
Anyway, if you really wanted to keep all these sources around, you could add the following to /var/lib/portage/world;
Code:
sys-kernel/gentoo-sources:2.6.18-r6
sys-kernel/gentoo-sources:2.6.19-r5
sys-kernel/gentoo-sources:2.6.20-r8
sys-kernel/gentoo-sources:2.6.21-r4
sys-kernel/gentoo-sources:2.6.22-r2
sys-kernel/gentoo-sources:2.6.22-r5
sys-kernel/gentoo-sources:2.6.22-r8
sys-kernel/gentoo-sources:2.6.22-r9


This is not really the sense of the WORLD file. And this is in fact really an impertinence to add every single kernel version to the WORLD file manually and this is, btw., much more complicated than to manually uninstall an old unneeded kernel version.
Back to top
View user's profile Send private message
castor_fou
Apprentice
Apprentice


Joined: 23 May 2002
Posts: 249
Location: Clermont-Ferrand, France

PostPosted: Mon Nov 05, 2007 8:25 pm    Post subject: Reply with quote

Hopeless, I agree with you that deleting the kernel sources can free a lot of disk space but I prefer to manage it manually.
Cyberpatrol has perfectly summarized what I need.

There has been a recent change in the behaviour of emerge --depclean ? How to rollback to the previous behaviour ?
Back to top
View user's profile Send private message
cyberpatrol
Apprentice
Apprentice


Joined: 18 Sep 2003
Posts: 161
Location: Germany

PostPosted: Tue Nov 06, 2007 12:29 am    Post subject: Reply with quote

I've filed a bug report.
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Tue Nov 06, 2007 12:37 am    Post subject: Reply with quote

castor_fou wrote:
a lot of disk space but I prefer to manage it manually.

Code:
user host /usr/src $ du -sh ./
11G     ./

I agree with you about wanting to manage them manually.
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Tue Nov 06, 2007 2:48 am    Post subject: Reply with quote

cyberpatrol wrote:
I've filed a bug report.
I'm sorry, but I disagree with your points here.

The kernel sources are installed like any other package, it's recorded to the world file and whenever a new version comes along it's upgraded, the only difference being that older versions are not removed.

If you want to indefinitly hold onto every single version you have installed then you need to make sure each version is recorded in the world file, the correct way of doing that is by specifying the version with the emerge command via the slot mechanism, eg `emerge sys-kernel/gentoo-sources:2.6.22-r9`.

Remember, you don't have to use --depclean, and I for one rely on it's current behaviour to clean out old sources.

If you really don't want portage to remove them ever, why not just install them manually independent of portage, plenty of users do that already.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
rlhartley
n00b
n00b


Joined: 07 Apr 2007
Posts: 2

PostPosted: Mon Nov 26, 2007 9:07 pm    Post subject: Reply with quote

I disagree with the assertion that every slot of a package in world should be kept. I have no need for old, never used, kernel sources.

*But* currently installed kernels are special, and the currently running kernel is *extra* special (as is the one pointed to by /usr/src/linux).

It is *not* ok to unmerge the current kernel without any warning at all.

There are packages that will not install without access to the source of the current kernel. For example x11-drivers/ati-drivers.

Also, kernels have a long installed life (they are a pain to configure), and a short life in portage. So the slot you need is likely to be no longer in the portage tree, making repairs difficult.

Is there a way for a package to say that it depends on the current kernel? If not (and I don't think there is), then there are dependencies portage does not know about, which is always asking for trouble.
Back to top
View user's profile Send private message
Bowman
n00b
n00b


Joined: 22 May 2005
Posts: 19

PostPosted: Wed Dec 05, 2007 5:49 am    Post subject: Reply with quote

I noticed this new behavior a while back, and I had hoped that it was just a temporary bug. I read the bug report, and I am in absolute shock. It seems that certain devs just don't care what users think. Some of the comments in the bug report have made me very angry.

Thank you, cyberpatrol, for being so patient and persistent. Don't let a few rotten devs spoil Portage.
Back to top
View user's profile Send private message
jcat
Veteran
Veteran


Joined: 26 May 2006
Posts: 1337

PostPosted: Wed Dec 05, 2007 7:41 am    Post subject: Reply with quote

The world file is a file that contains a list of packages that are specifically installed AND required by the user.
It has been updated recently to support slots.

Why not use it for what it's for, and just add the extra kernel package slots that you want to keep?

Why is this such a hassle?

This is the same for all slotted packages, depclean will always want to remove the older slotted versions. You actually have far more flexibility and choice like this. And isn't that what Gentoo is all about?




Cheers,
jcat
Back to top
View user's profile Send private message
Bowman
n00b
n00b


Joined: 22 May 2005
Posts: 19

PostPosted: Thu Dec 06, 2007 3:29 am    Post subject: Reply with quote

jcat wrote:
The world file is a file that contains a list of packages that are specifically installed AND required by the user.
It has been updated recently to support slots.

Why not use it for what it's for, and just add the extra kernel package slots that you want to keep?

Why is this such a hassle?


Because it's extra and unnecessary work. This wasn't necessary before, why do I need to do it now? In fact, until now, the world file was something that I did not even need to touch. It's just one more thing to do, and one more thing for newbies to learn. I might even be able to understand if the world file were somewhere convenient like /etc, but it's not. It's in /var somewhere, and I can never remember where!

jcat wrote:

This is the same for all slotted packages, depclean will always want to remove the older slotted versions. You actually have far more flexibility and choice like this. And isn't that what Gentoo is all about?


--depclean is for removing obsolete DEPENDENCIES. --prune is for removing obsolete SLOTS. If you want to combine the functionality of these two, that's fine. I think it's silly, but then, I'm just a user, not a developer. :roll: But give me an easy way to protect my kernel sources. For chrissakes, I'm only human. If I have to edit world manually every time gentoo-sources updates, I might forget once or twice. Then I'd have a nasty surprise next time I tried to update ati-drivers.

What absolutely has me dumbfounded is the attitude of the devs in this situation. Several people have expressed the same concern, but the developers won't even listen. They won't even compromise! It's like schoolchildren with their fingers in their ears going "Nya! Nya! I'm not listening!" This is a very bad attitude for developers to have. But for my part, I guess this is an occupational hazard of using open-source software.

Several reasonable compromises have been suggested in the bug report. I would like to suggest my own compromise: Create a mask file for --depclean, so that I can add gentoo-sources to it. I also like the idea in comment #28 in the bug report: Allow wildcard slots in the world file. These are both simple, and with my limited programming knowledge, I would think that they would be easy to implement.

I hope that we can come to a compromise in this. The problem won't just go away.

-Gareth
Back to top
View user's profile Send private message
jcat
Veteran
Veteran


Joined: 26 May 2006
Posts: 1337

PostPosted: Thu Dec 06, 2007 7:30 am    Post subject: Reply with quote

I don't agree that adding something to the world file is much extra work, I believe that many Gentoo users will feel the same way. You could even script it to make it automatic.

However, I do like the suggestion of adding wild card support to the world file.



Cheers,
jcat
Back to top
View user's profile Send private message
qwert667
n00b
n00b


Joined: 26 Jun 2006
Posts: 6

PostPosted: Fri Dec 07, 2007 7:32 am    Post subject: Reply with quote

Bowman wrote:
--depclean is for removing obsolete DEPENDENCIES.

That's what I thought, too... "dep" stands for "dependencies", doesn't it?
If you want it to do something different, give it a different name!

As pointed out before, especially in case of sources of a kernel that's currently in use this new bug/feature is really anoying.

Bowman wrote:
What absolutely has me dumbfounded is the attitude of the devs in this situation. Several people have expressed the same concern, but the developers won't even listen. They won't even compromise! It's like schoolchildren with their fingers in their ears going "Nya! Nya! I'm not listening!" This is a very bad attitude for developers to have.

ACK, I'm lost for words!
Back to top
View user's profile Send private message
kokes
Tux's lil' helper
Tux's lil' helper


Joined: 14 Apr 2005
Posts: 81
Location: Prague

PostPosted: Sat Dec 08, 2007 4:48 pm    Post subject: Reply with quote

Did anybody try to edit the world file? I want depclean to keep gcc 4 and gcc 3 on my system. So, I have in world these lines now:
Code:

sys-devel/gcc:3.4.6-r2
sys-devel/gcc:4.1.2

There are no other references to gcc. BUT, depclean tells me:
Code:

sys-devel/gcc
    selected: 3.4.6-r2
   protected: none
     omitted: 4.1.2

So how does slots in world file work?

Thanks
_________________
Jeden Gebiè všemocný
jeden jim všem vládne
zagebí se jako ty
do šklebu je sváže.
Back to top
View user's profile Send private message
eruvaer_ohta
n00b
n00b


Joined: 18 Jul 2007
Posts: 23

PostPosted: Sun Dec 23, 2007 7:33 pm    Post subject: Reply with quote

jcat wrote:
This is the same for all slotted packages, depclean will always want to remove the older slotted versions. You actually have far more flexibility and choice like this. And isn't that what Gentoo is all about?


You are right that gentoo is all about flexibility and choice. But why are the devs now taking away the choice if I want to keep my old kernel sources for whatever reasons I might have to want this or if I want to get rid of them? There might be reasons for this change in the way --depclean works given by design or whatever the reasons may be, but why do I not have the choice to decide between the two ways depclean works?

If it would be absolutely senseless to keep the old sources I would understand this, but since you need the sources of the actual kernel to compile some external packages (-> drivers for graphics-card etc.) it is elemental that you have the choice to keep them. Editing the world file, by editor or by the use of --noreplace atom , is in my opinion just a workaround which would not be necessary if the devs gave us just two different arguments:
--depclean for the old behaviour
--whateverclean for the new behaviour
which should not be hard to implement since this would only add the new behaviour under a new name, keeping the old one untouched.

So it does not matter how much more work it is to work around the new behaviour, I just want to decide by myself which behaviour of --depclean is more useful to me. I guess that is what the philosophy of gentoo tells me. It is a pity that some devs seem to think differently and put their opinion over the opinion of users.
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Sat Dec 29, 2007 5:31 pm    Post subject: Reply with quote

is it possible to wildcard the world file entries such as
Code:
sys-kernel/gentoo-sources:*

so keep them all... doesn't look like it but I wondered if anyone has found a good solution to this.
Back to top
View user's profile Send private message
jmacdonagh
n00b
n00b


Joined: 26 Oct 2007
Posts: 12

PostPosted: Sun Dec 30, 2007 12:01 am    Post subject: Reply with quote

I can't believe someone reporting this as a bug. I read the bug report, as well as how they attacked the developers who have to sift through bug reports from people who don't understand how portage works, and it's unbelievable.

Your world file is a special package (called a set), which installs nothing, but has dependencies, namely the atoms listed in the world file.

I'm guessing your world file has a line like this:
sys-kernel/gentoo-sources

What this says is your world package requires the *latest* installable ebuild of gentoo-sources. When you update your gentoo-sources, the world file depends on that, not on both instances of gentoo-sources. Therefore, --depclean is doing *exactly* what it's supposed to do.

A very large majority of Gentoo users like how --depclean works. Just because you're too lazy or ignorant to specify the exact packages in your world file, doesn't mean the rest of us have to suffer having older packages, or a *special* command line argument to perform the documented functionality.

Now, I understand the person who started this thread wasn't the one attacking the devs on the bug report, but seriously, grow up. Wild cards in the world file would be nice, but yelling at the developers to return emerge to broken functionality is stupid. We're here to improve the portage system, not maintain broken backwards compatibility.
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Sun Dec 30, 2007 5:09 am    Post subject: Reply with quote

jmacdonagh wrote:
Wild cards in the world file would be nice, but yelling at the developers to return emerge to broken functionality is stupid.

who are you talking at? certainly not me. and this thread is sort of dead, I only bumped it wondering if there was perhaps a wildcard.

a wildcard seems perfectly reasonable, in this context. i guess there isn't one though... maybe i'll make my own patch.
Back to top
View user's profile Send private message
Dominique_71
Veteran
Veteran


Joined: 17 Aug 2005
Posts: 1877
Location: Switzerland (Romandie)

PostPosted: Sun Dec 30, 2007 5:52 pm    Post subject: Reply with quote

Just a few 2 cents remarks:

1) Some programs like dev-libs/klibc or cdrtools are linking against the kernel sources and not the kernel headers. That implies that, if portage remove the kernel sources pointed by /usr/src/linux, that is a bug. (It is the kernel I am using most of the time, and it is an old one)

2) The same it true for not in the tree kernel modules.

3) All the kernel I have are ~x86. That implies that I will carefully test a new kernel version before I decide to keep or remove it. But I don't want that portage take away this choice.

4) I understand that for many users, current portage's behavior can be a good choice, but I would really appreciate if I don't have to manage files in /var! It is enough for me with files in /etc. Why not to have one more variable in /etc/make.conf for an user that don't want that behavior at all?

5) With current harddisk sizes and prices, I don't find that keeping a few kernel sources is a problem anymore. But I don't have enough money to afford to have 2 boxes, one for production, the other for test.
_________________
"Confirm You are a robot." - the singularity
Back to top
View user's profile Send private message
Napalm Llama
Guru
Guru


Joined: 04 Jun 2005
Posts: 533
Location: Cardiff, UK

PostPosted: Mon Jan 14, 2008 12:24 am    Post subject: Reply with quote

Hmm, that's weird.

If I run emerge --depclean --pretend then the slotted worldfile thing works fine.
But if I run emerge --depclean --pretend gentoo-sources then it ignores the slot and still tries to purge everything except the very latest version.

Is that a bug or a feature?
_________________
Ryzen 5600x; Asus TUF Gaming B550-Plus; Geforce 1660 Super
Registered Linux User #381314
# killall humans
Back to top
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Mon Jan 14, 2008 1:51 am    Post subject: Reply with quote

kokes wrote:
Did anybody try to edit the world file? I want depclean to keep gcc 4 and gcc 3 on my system. So, I have in world these lines now:
Code:

sys-devel/gcc:3.4.6-r2
sys-devel/gcc:4.1.2

There are no other references to gcc. BUT, depclean tells me:
Code:

sys-devel/gcc
    selected: 3.4.6-r2
   protected: none
     omitted: 4.1.2

So how does slots in world file work?


A slot name is not the same as a version number. You can see the slot names by running
Code:
equery list gcc

This will give you something like
Code:
[ Searching for package 'gcc' in all categories among: ]
 * installed packages
[I--] [ -] sys-devel/gcc-4.1.2 (4.1)
[I--] [  ] sys-devel/gcc-config-1.4.0-r4 (0)

The number at the end is the slot name: for gcc-4.1.2, it's 4.1. In your case, you would put
Code:

sys-devel/gcc:3.4
sys-devel/gcc:4.1

in your world file.
Back to top
View user's profile Send private message
Carnildo
Guru
Guru


Joined: 17 Jun 2004
Posts: 594

PostPosted: Mon Jan 14, 2008 1:54 am    Post subject: Reply with quote

Napalm Llama wrote:
Hmm, that's weird.

If I run emerge --depclean --pretend then the slotted worldfile thing works fine.
But if I run emerge --depclean --pretend gentoo-sources then it ignores the slot and still tries to purge everything except the very latest version.

Is that a bug or a feature?


Who knows? The manpage says nothing about how "emerge --depclean" is supposed to behave if you provide it with a package name, and a good case could be made either way.
Back to top
View user's profile Send private message
sundialsvc4
Guru
Guru


Joined: 10 Nov 2005
Posts: 436

PostPosted: Mon Jan 14, 2008 1:58 am    Post subject: Reply with quote

I tend to use the --ask parameter ("just tell me, don't do it") along with "--depclean" and then take what it tells me as a suggestion. The stuff that I agree with, I remove manually.

equery (from the "portage tools" package) is also a must-have.

"Updating stuff" is something that I am generally willing to let be automated, but "removing stuff" is something that I am reluctant to delegate to any piece of software alone...
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Sat Jan 26, 2008 8:53 am    Post subject: Reply with quote

I just installed KDE 4 for testing, and obviously want to keep KDE 3.5.8, but depclean doesn't seem to agree with me... :S A new option to disable this feature would be nice :)
_________________
# "Hmm, sounds like your system froze up."
# "I don't know why. It's about 80 degrees in here!"

http://www.rinkworks.com/stupid/cs_mincing.shtml
Back to top
View user's profile Send private message
vandien
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2006
Posts: 137

PostPosted: Mon Apr 21, 2008 11:09 pm    Post subject: Reply with quote

Hopeless wrote:
If you want to indefinitly hold onto every single version you have installed then you need to make sure each version is recorded in the world file, the correct way of doing that is by specifying the version with the emerge command via the slot mechanism, eg `emerge sys-kernel/gentoo-sources:2.6.22-r9`.


Kind of old post but I want to second this. The behavior is sane and works well as is. In my case I'm using ~x86 and want to keep gentoo-sources 2.6.24-r5 but let emerge install new 2.6.25 versions until I've tested it and am comfortable to switch.

Intuitively I just type:

Code:
emerge -n =sys-kernel/gentoo-sources-2.6.24-r5


and it adds that version to my world file and --depclean works as expected.

I love gentoo!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum