Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
howto cleanup my system
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 839
Location: halmstad

PostPosted: Sun May 16, 2010 8:40 pm    Post subject: howto cleanup my system Reply with quote

hi i want to clean up my gentoo.i have only used --depclean put it dont clean everything.
this is what i like to get help with.

1.my /usr/portage/distfiles is getting full and i like to clean it

2.when i emerge a thing and unmerge it,gentoo still know what i have done if reemerege it.
i like to know how to erase things like that

3.is there a command to see the things have emerge and not the thing that comes with.

4.what exactly does emerge -e world do? is it a thing i should do ones in a while?

5. is there some more faq about this or have you guys some advice

regards
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1533
Location: Just over the horizon

PostPosted: Sun May 16, 2010 9:15 pm    Post subject: Reply with quote

I'll take #1...it's the easy one. If you haven't emerged gentoolkit, do that. Then just use the 'eclean-dist --destructive' command. It will remove anything from your distfiles that's not currently installed.

Oh and #4 just reinstalls all current packages and their dependencies. Probably won't do much to help you clean up your system.
Back to top
View user's profile Send private message
dol-sen
Developer
Developer


Joined: 30 Jun 2002
Posts: 2503
Location: Richmond, BC, Canada

PostPosted: Mon May 17, 2010 12:00 am    Post subject: Reply with quote

for #3 you can look at the world file directly
Code:
cat /var/lib/portage/world | less

_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
yzg
Apprentice
Apprentice


Joined: 18 Jun 2005
Posts: 192

PostPosted: Mon May 17, 2010 3:34 am    Post subject: Reply with quote

1- Check your /usr/src/ directory and remove all the old kernels sources.
2- Remove everything under /var/tmp/protage/
3- Set WIPE_TMP="yes" in /etc/conf.d/bootmisc
Back to top
View user's profile Send private message
phajdan.jr
Developer
Developer


Joined: 23 Mar 2006
Posts: 1764
Location: Poland

PostPosted: Mon May 17, 2010 10:07 am    Post subject: Re: howto cleanup my system Reply with quote

hedmo wrote:
1.my /usr/portage/distfiles is getting full and i like to clean it


Using eclean-dist in a cron job seems to be the best way to deal with that.

hedmo wrote:
2.when i emerge a thing and unmerge it,gentoo still know what i have done if reemerege it.
i like to know how to erase things like that


Do you mean /var/log/emerge.log? You can delete that file, but I see no benefit in doing so. In fact, the file can be helpful to re-generate your /var/lib/portage/world file in case of emergency.

hedmo wrote:
3.is there a command to see the things have emerge and not the thing that comes with.


Code:
Parse error on line 1, on "things have emerge and not..."


hedmo wrote:
4.what exactly does emerge -e world do? is it a thing i should do ones in a while?


It re-emerges the packages from /var/lib/world and all packages they depend on. You should do that after a major GCC upgrade, and doing it once in a while does no harm, and may help sometimes (YMMV).

hedmo wrote:
5. is there some more faq about this or have you guys some advice


/etc/portage is also a place that may need some cleaning, and /lib/modules and /usr/src (kernel sources).
_________________
http://phajdan-jr.blogspot.com/
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 839
Location: halmstad

PostPosted: Mon May 17, 2010 8:05 pm    Post subject: Reply with quote

thanks guys for your quick answers :lol: .

1.fixed

2.what i meant was not the emerge,unmerge part.its when i have bin using a program and conf.. it
for me.if i make a misstake or dont like it like it have become and want to start from scratch.how do i
make gentoo forget that program before emerge it again.every program start with default text or gui
but if you change something,gentoo will remember and this is what i like clean.its har to describe this sort of
problem but i hope i made it :?

3."cat /var/lib/portage/world | less" was the thing but :? yzg 3- Set WIPE_TMP="yes" in /etc/conf.d/bootmisc
please describe

4. okej correct me if i am wrong but this is a good thing if some time i have too hit power off (hold 6 sec)
when sys freeze and have to do a fsck manually

5.i am getting back to that :wink:

ones again thanks
Back to top
View user's profile Send private message
rh1
Guru
Guru


Joined: 10 Apr 2010
Posts: 501

PostPosted: Mon May 17, 2010 10:41 pm    Post subject: Reply with quote

Quote:
2.what i meant was not the emerge,unmerge part.its when i have bin using a program and conf.. it
for me.if i make a misstake or dont like it like it have become and want to start from scratch.how do i
make gentoo forget that program before emerge it again.every program start with default text or gui
but if you change something,gentoo will remember and this is what i like clean.its har to describe this sort of
problem but i hope i made it


I understand exactly what you mean. I've tried the uninstall/reinstall to fix things. Problem is portage doesn't normally delete or overwrite the "config" files for anything. That's why when you re-install it "remembers". It's finding the old config files. I don't know of any program that will clean them out for you. I usually search though till i find what i want and delete it. Most user configs are stored in the home directory in hidden files. The rest are usually in "/etc" though i'm sure there are a few exceptions.
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1639

PostPosted: Mon May 17, 2010 11:52 pm    Post subject: Reply with quote

Here's a nice article in the FAQ section. I wish more people knew about it:

http://forums.gentoo.org/viewtopic-p-175546.html#175546
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Tue May 18, 2010 1:35 am    Post subject: Re: howto cleanup my system Reply with quote

phajdan.jr wrote:
Using eclean-dist in a cron job seems to be the best way to deal with that.


He should also do eclean-dist --destructive periodically (although perhaps less frequently than eclean-dist). Doing clean-dist will only delete the stuff no longer referenced by the portage tree instead of the stuff that is no longer required by things installed on his system. /usr/portage/distfiles can grow to be more than 10GB in size unless eclean-dist --destructive is done, so doing it is a good idea.
Back to top
View user's profile Send private message
hedmo
l33t
l33t


Joined: 29 Aug 2009
Posts: 839
Location: halmstad

PostPosted: Tue May 18, 2010 7:28 pm    Post subject: Reply with quote

eclean-dist --destructive swiped 1G off

phajdan.jr wrote:
Using eclean-dist in a cron job seems to be the best way to deal with that.

i dont know what a cron job is

AM088 thanks for the link this will comes in hand from time to time

about : 2.

i am trying to clean vdr infact the vdr-xineliboutput. usualy its a plugin that is in vdr dirs
but this is a plugin for xine and i cant find the conf file .i was in vdr when i made the bad change

but its the same with all conf files.i hope there is a cleaning command for cleaning old conf files
that are not used after a --unmerge
Back to top
View user's profile Send private message
phajdan.jr
Developer
Developer


Joined: 23 Mar 2006
Posts: 1764
Location: Poland

PostPosted: Tue May 18, 2010 7:43 pm    Post subject: Reply with quote

hedmo wrote:
i dont know what a cron job is


Just another useful admin's tool. :D See the guide http://www.gentoo.org/doc/en/cron-guide.xml and feel free to ask any questions if you're still not sure how to automate running eclean-dist --destructive.

Note: one of the main advantages of Linux is that you can easily automate a lot of things. If you find doing some things over and over, try to find a way to do the same automatically. This is not always applicable, for example the Gentoo update process needs manual supervision.
_________________
http://phajdan-jr.blogspot.com/
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 3907

PostPosted: Tue May 18, 2010 8:41 pm    Post subject: Reply with quote

cleaning your system is the best way to break it if you don't know what you are doing :)

hopefully (or sadly ?) breaking your system is the best way to learn howto not break it again.

So my advise, you can get both advantages: cleaning your system and learn howto avoid breaking it with just that: take great care of what you are doing, and try to think first of what you are doing.

And generally speaking: automated process (like --depclean) or running a cron job is best way to loose control and fastest path to breakage.

Don't use automated things, do it by hands, take more time to think about what you are about to do and what will happen, you will learn, it will take a little more time, but your system will stay healthy and the little more time taken will be less more time than trying to repair your system when you have no idea why/where and how it has been broken.

there's really few simple things you can do that will save you time, as examples: use emerge -1 (oneshot) to install a program, always run --pretend (--version is also a good one, specially with --depclean!), always fetch files before upgrading (emerge -fuD world), emerge -uDN system than emerge -uDN world is better than emerge -uDN world, think twice when looking at etc-update output, run etc-update (i mean don't forget to run it), emerge gentoolkit (revdep-rebuild should be install by default).
and --help : it might just be stupid but --help will always gave you information you might not think exist. for example again, i'm sure many persons don't know revdep-rebuild can use --pretend and --version for a more safe run while this information is just at their hands with a --help output)...
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1533
Location: Just over the horizon

PostPosted: Tue May 18, 2010 8:45 pm    Post subject: Reply with quote

There are quite a few things you can automate along these lines. Here's a daily cron script I wrote and just dropped into my /etc/cron.daily directory (a quick and easy way to use cron, BTW):

Code:
#!/bin/sh
source /root/.profile
echo "..................................................." > /var/log/rsync.log 2>&1
echo "running emerge --sync..." >> /var/log/rsync.log 2>&1
echo "..................................................." >> /var/log/rsync.log 2>&1
/usr/bin/emerge --sync >> /var/log/rsync.log 2>&1
echo "..................................................." >> /var/log/rsync.log 2>&1
echo "running layman -N -S..." >> /var/log/rsync.log 2>&1
echo "..................................................." >> /var/log/rsync.log 2>&1
/usr/bin/layman -N -S >> /var/log/rsync.log 2>&1
echo "..................................................." >> /var/log/rsync.log 2>&1
echo "running eix-update..." >> /var/log/rsync.log 2>&1
echo "..................................................." >> /var/log/rsync.log 2>&1
/usr/bin/eix-update >> /var/log/rsync.log 2>&1
echo "eclean distfiles..." >> /var/log/rsync.log 2>&1
echo "..................................................." >> /var/log/rsync.log 2>&1
/usr/bin/eclean-dist --destructive >> /var/log/rsync.log 2>&1
Back to top
View user's profile Send private message
elmar283
Apprentice
Apprentice


Joined: 06 Dec 2004
Posts: 173
Location: Netherlands

PostPosted: Sat Mar 16, 2013 11:04 am    Post subject: Reply with quote

Platojones: why should you run emerge --sync and eix-update? Arn't you doing things dubble then?
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1533

PostPosted: Sat Mar 16, 2013 11:40 am    Post subject: Reply with quote

elmar283 wrote:
Platojones: why should you run emerge --sync and eix-update? Arn't you doing things dubble then?

elmar283 ... eix-update only updates the cache eix uses, it doesn't run --sync ... 'eix-sync' does that. None the less there are some redundencies in Platojones' script as 'eix-sync' can update the portage tree, layman, and will run 'eix-update' once completed.

/etc/eix-sync.conf
Code:
# sync layman overlays
*

Additionally, running 'eclean-dist -d' is probably best performed after 'emerge -uDN' as it'll only clean any remaining distfiles obsoleted by the last --update.

best ... khay
Back to top
View user's profile Send private message
elmar283
Apprentice
Apprentice


Joined: 06 Dec 2004
Posts: 173
Location: Netherlands

PostPosted: Sat Mar 16, 2013 11:46 am    Post subject: Reply with quote

Thanks for your answer. I had only eix-sync in my crontab:
Code:

30 6 * * *      /usr/bin/eix-sync > /dev/null

I just added
Code:

0 7 * * *      /usr/bin/eix-update > /dev/null

If I understand you right eix-sync just runs emerge --sync and eix-update updates the cache for eix?

EDIT: Just an other question. Where stands the 2>&1 for. I'm not that known to sh. It looks like regualar expressions in php (eg. preg_replace).
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1533

PostPosted: Sat Mar 16, 2013 12:26 pm    Post subject: Reply with quote

elmar283 wrote:
If I understand you right eix-sync just runs emerge --sync and eix-update updates the cache for eix?

elmar283 ... you don't need the latter as its run as part of the final stage of eix-sync, so just eix-sync is all thats required.

elmar283 wrote:
EDIT: Just an other question. Where stands the 2>&1 for. I'm not that known to sh. It looks like regualar expressions in php (eg. preg_replace).

No, "1" is stdout (standard output) and "2" is stderr (standard error) ... so the above is redirecting both standard output and standard error.

Code:
# echo "hello elmar283"
hello elmar283
# echo "hello elmar283" 2>&1 >/dev/null && echo "it didn't echo hello!"
it didn't echo hello!

best ... khay
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 3782

PostPosted: Sat Mar 16, 2013 4:54 pm    Post subject: Reply with quote

khayyam wrote:
so the above is redirecting both standard output and standard error.

Yes, but it depends on the order. Your example is bad:
Quote:
Code:
# echo "hello elmar283" 2>&1 >/dev/null && echo "it didn't echo hello!"

In this example, stderr will send its output to stdout and then stdout(of echo) will send its output to /dev/null. Hence, if "echo" would produce something on stderr, you would see it on stdout:
Code:
( echo a; echo b >&2 ) 2>&1 >/dev/null | read var; echo "$var"

On the other hand
Code:
(echo a; echo b >&2 ) >/dev/null 2>&1

produces really nothing since it first redirects stdout to /dev/null and then stderr to the (redirected) stdout. This is not very logical, but it is the way how the shell behaves.
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1533

PostPosted: Sat Mar 16, 2013 5:02 pm    Post subject: Reply with quote

mv ...

yes, I missed that, and stand corrected. I generally *do* place the '2>&1' *after* the /dev/null but clearly I'm in a higgildy-piggildy.

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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