| View previous topic :: View next topic |
| Author |
Message |
hedmo l33t


Joined: 29 Aug 2009 Posts: 829 Location: halmstad
|
Posted: Sun May 16, 2010 8:40 pm Post subject: howto cleanup my system |
|
|
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 |
|
 |
platojones Veteran


Joined: 23 Oct 2002 Posts: 1491 Location: Just over the horizon
|
Posted: Sun May 16, 2010 9:15 pm Post subject: |
|
|
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 |
|
 |
dol-sen Developer


Joined: 30 Jun 2002 Posts: 2365 Location: Richmond, BC, Canada
|
Posted: Mon May 17, 2010 12:00 am Post subject: |
|
|
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 |
|
 |
yzg Apprentice

Joined: 18 Jun 2005 Posts: 179
|
Posted: Mon May 17, 2010 3:34 am Post subject: |
|
|
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 |
|
 |
phajdan.jr Developer


Joined: 23 Mar 2006 Posts: 1740 Location: Poland
|
Posted: Mon May 17, 2010 10:07 am Post subject: Re: howto cleanup my system |
|
|
| 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 |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 829 Location: halmstad
|
Posted: Mon May 17, 2010 8:05 pm Post subject: |
|
|
thanks guys for your quick answers .
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
ones again thanks |
|
| Back to top |
|
 |
rh1 Guru


Joined: 10 Apr 2010 Posts: 495
|
Posted: Mon May 17, 2010 10:41 pm Post subject: |
|
|
| 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 |
|
 |
Etal Veteran


Joined: 15 Jul 2005 Posts: 1633
|
|
| Back to top |
|
 |
Shining Arcanine Veteran

Joined: 24 Sep 2009 Posts: 1110
|
Posted: Tue May 18, 2010 1:35 am Post subject: Re: howto cleanup my system |
|
|
| 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 |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 829 Location: halmstad
|
Posted: Tue May 18, 2010 7:28 pm Post subject: |
|
|
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 |
|
 |
phajdan.jr Developer


Joined: 23 Mar 2006 Posts: 1740 Location: Poland
|
Posted: Tue May 18, 2010 7:43 pm Post subject: |
|
|
| hedmo wrote: | | i dont know what a cron job is |
Just another useful admin's tool. 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 |
|
 |
krinn Advocate


Joined: 02 May 2003 Posts: 3670
|
Posted: Tue May 18, 2010 8:41 pm Post subject: |
|
|
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 |
|
 |
platojones Veteran


Joined: 23 Oct 2002 Posts: 1491 Location: Just over the horizon
|
Posted: Tue May 18, 2010 8:45 pm Post subject: |
|
|
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 |
|
 |
elmar283 Tux's lil' helper

Joined: 06 Dec 2004 Posts: 138 Location: Netherlands
|
Posted: Sat Mar 16, 2013 11:04 am Post subject: |
|
|
| Platojones: why should you run emerge --sync and eix-update? Arn't you doing things dubble then? |
|
| Back to top |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1241
|
Posted: Sat Mar 16, 2013 11:40 am Post subject: |
|
|
| 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 |
|
 |
elmar283 Tux's lil' helper

Joined: 06 Dec 2004 Posts: 138 Location: Netherlands
|
Posted: Sat Mar 16, 2013 11:46 am Post subject: |
|
|
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 |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1241
|
Posted: Sat Mar 16, 2013 12:26 pm Post subject: |
|
|
| 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 |
|
 |
mv Advocate


Joined: 20 Apr 2005 Posts: 3131
|
Posted: Sat Mar 16, 2013 4:54 pm Post subject: |
|
|
| 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 |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1241
|
Posted: Sat Mar 16, 2013 5:02 pm Post subject: |
|
|
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 |
|
 |
|