Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
what utility cleans /var/db/pkg -- keeps accruing sources
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
tckosvic
Apprentice
Apprentice


Joined: 18 Apr 2023
Posts: 188

PostPosted: Fri Sep 22, 2023 3:27 pm    Post subject: what utility cleans /var/db/pkg -- keeps accruing sources Reply with quote

Directory /var/db/pkg keeps accruing older sources for kernels and all other packages as far as I can see. E.G., the sys-kernel subdirectory of /var/db/pkg has 12 sets of old kernel file sources in it.

I am only a short term user on a vm but it looks like this directory could chew up alot of disk space if not cleaned. It is a major disk use directory in my vm; that is how I found it.

Is there a utility that removes some of this? I assume manual deletion will not hurt .

thanks, tom kosvic
Back to top
View user's profile Send private message
De-Javu
n00b
n00b


Joined: 30 Mar 2009
Posts: 24
Location: USA

PostPosted: Fri Sep 22, 2023 3:36 pm    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic-t-1104180-start-0.html 8)
Back to top
View user's profile Send private message
sMueggli
l33t
l33t


Joined: 03 Sep 2022
Posts: 616

PostPosted: Fri Sep 22, 2023 3:37 pm    Post subject: Reply with quote

I think you are looking for eclean.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55372
Location: 56N 3W

PostPosted: Fri Sep 22, 2023 3:45 pm    Post subject: Reply with quote

tckosvic,

Portage cleans /var/db/pkg.
That's where portage keeps track of everything that is installed, how it was built and so on.

Look but don't touch. That's portages mind.

Entries are added when packages are emerged and removed when portage is used to remove a package. e.g. with --depclean.

If you remove kernel sources from /usr/src without using portage, portage won't update it's database and they will still be listed there.
Code:
emerge -ca  gentoo-sources:<slot>
will case portage to remove gentoo-sources:<slot> from /usr/src it its there and from /var/db/pkg regardless.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2274

PostPosted: Sat Sep 23, 2023 11:12 am    Post subject: Reply with quote

tckosvic wrote:
Directory /var/db/pkg keeps accruing older sources for kernels and all other packages as far as I can see. E.G., the sys-kernel subdirectory of /var/db/pkg has 12 sets of old kernel file sources in it.
...

Tom, if there's actual kernel source, rather than a lot of files containing information gleaned from ebuilds, you have a mis-configured portage setup. Package source files should (by default) be in /var/cache/distfiles. here's my list of stuff in sys-kernel for linux-firmware (I build my kernels on another machine, so there's no kernel source ebuild present):
Code:
paul@hp ~ $ ls /var/db/pkg/sys-kernel/linux-firmware-20230804/
BINPKGMD5   CC        COUNTER     DEFINED_PHASES   FEATURES   IUSE_EFFECTIVE  linux-firmware-20230804.ebuild  QA_PREBUILT  SIZE
BUILD_TIME  CFLAGS    CXX         DESCRIPTION      HOMEPAGE   KEYWORDS        NEEDED                          RDEPEND      SLOT
CATEGORY    CHOST     CXXFLAGS    EAPI             INHERITED  LDFLAGS         NEEDED.ELF.2                    repository   USE
CBUILD      CONTENTS  DEBUGBUILD  environment.bz2  IUSE       LICENSE         PF                              RESTRICT

You may be seeing several sets of files like that for different kernels - that's because currently Gentoo has slotted ebuilds for many kernels, such as long-term-stable versions. But those files are not the kernel source - that's a whole lot more - several hundred MB. In this case, that lot above comes to just 390 KB of data extracted from the ebuild, whereas the linux firmware source files are over 100 MB.

<edit>
You shouldn't be seeing several sets of files like that. I was conflating /var/db/pkg - the portage cache of ebuild information for installed packages, with /var/db/repos/gentoo - the entire portage package tree. So if you are seeing lots of source files, you definitely have a misconfigured portage system (see /etc/portage/make.conf settings, by default) that's putting package source in /var/db/pkg, and that's just wrong! As mentioned earlier, it should be /var/cache/distfiles by default.)
</edit>
_________________
Greybeard
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23590

PostPosted: Sat Sep 23, 2023 12:29 pm    Post subject: Reply with quote

If you still need help, please show us what you see. Do not summarize it. Show us the commands you ran and what they printed.
Back to top
View user's profile Send private message
tckosvic
Apprentice
Apprentice


Joined: 18 Apr 2023
Posts: 188

PostPosted: Sat Sep 23, 2023 2:54 pm    Post subject: Reply with quote

Directory /var/db/pkg does show files similar to those shown by @Goverp. My error, I thought those were source code.

Directory /var/cache/distfiles does show a myriad of *.tar.gz files that must be the source codes.

My system must be set up properly. Thanks for the insights.

15 yr openSUSE user that is exploring gentoo and learning.

tom kosvic
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
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