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
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1305
Location: sweden

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: 1602
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
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
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
Guru
Guru


Joined: 18 Jun 2005
Posts: 493

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
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
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
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1305
Location: sweden

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: 1931

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:

https://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
Veteran
Veteran


Joined: 29 Aug 2009
Posts: 1305
Location: sweden

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
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
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
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

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: 1602
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
Guru
Guru


Joined: 06 Dec 2004
Posts: 316
Location: Haarlem, 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
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

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
Guru
Guru


Joined: 06 Dec 2004
Posts: 316
Location: Haarlem, 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
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

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
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

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
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

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
as.gentoo
Guru
Guru


Joined: 07 Aug 2004
Posts: 319

PostPosted: Thu Feb 15, 2018 2:58 am    Post subject: Reply with quote

krinn,

I just stumbled upon this post. Can you please explain?

krinn wrote:
there's really few simple things you can do that will save you time, as examples: use emerge -1 (oneshot) to install a program,

Why should I emerge packages using --oneshot. The result will be that packages will not be updated when I ask portage to do a world update (since packages have not been added to /var/lib/portage/world). Why would I do that for imediff2, gimp or libreoffice?
I guess that might be good when you just want to try software and soon unmerge it. But that's not the usual case... just for me?
'emerge --oneshot' is helpful if you want to (re)emerge or update(?) system packages like gcc or coreutils although no other software depends on an updated package.

krinn wrote:
always fetch files before upgrading (emerge -fuD world),

Why should I d/l the sources first just to execute an emerge as the next step, manually? Usually you do not look at the source code before emerging. It makes sense if you want to check for malware/trojan/virus in the sources first, but clamav - or whatever you use - needs to be executed then. I'm nor sure if that's common.

krinn wrote:
emerge -uDN system then emerge -uDN world is better than emerge -uDN world

Why? One usually wants all packages in the world file to be updated. Portage might even downgrade a system-package you just updated with '@system' because some other program can not handle the updated system package.

krinn wrote:
think twice when looking at etc-update output,

100% agreed!
If you have a desktop system meld, kompare or similar software may be even better because it is visually easier to spot the differences. Imediff2 is nice too because it works on the command line (ncurses?) and helps visually as well. Kind of puts both files (recent and update) upon another, you can then swich between both using the enter-key in order to get the different parts in blue or red - one color is assigned to one file. So you can use it on a server w/o X.org as well.

So, what did I miss here?


Portage usually tells you when config has to be updated, that might not have been the case when you posted…
revdep-rebuild or something like that is done after upgrades automatically, since some time.

My sysupdate script uses 'emerge -vaquUND @world'. emerge gives you a colored list that shows new packages (might be dependencies), updated packages and the use flags (colored) as well. It waits for your approval to start compiling/… When you decide to manually block or unblock packages or to edit use flags… you can simply abort emerge using ctrl-c.

It's easier to 'put' emerge command line parameters into EMERGE_DEFAULT_OPTS @ /etc/portage/make.conf so you do not have to state them every time.
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