Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mini-HowTo: EMERGE (Package handling)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Thu Jan 22, 2004 4:38 pm    Post subject: Mini-HowTo: EMERGE (Package handling) Reply with quote

As far as i didn't find any overview for the most important things about (de)installing, i began this thread for that reason. "etcat" and "qpkg" are part of gentoolkit.

Installation/Upgrade/Rebuild

Just installing:
emerge TheThingYouWant

To see what would happen:
emerge -pv TheThingYouWant

To see possible versions:
etcat -v TheThingYouWant

To install a version:
emerge =TheThingYouWant-1.2.3

To install a masked version:
ACCEPT_KEYWORDS="~x86" emerge =TheThingYouWant-1.2.3
Better: Make a small textfile "touch /sbin/memerge", "chmod +x" it and paste "ACCEPT_KEYWORDS="~x86" emerge "$@"" in it. Now you can "memerge =TheThingYouWant-1.2.3".

If that didn't worked:
Look at /usr/portage/profiles/package.mask and comment the line with the wanted package out

And if you want to know WHY it's masked:
Look at /usr/portage/profiles/package.mask and read the comment for the package


Searching

Just search by name:
emerge -s TheThingYouWant

Searching in descriptions:
emerge -S TheThingYouWant

Searching in installed ebuilds for files:
qpkg -pf WhatYouWant

Searching for missing files in installed ebuilds:
qpkg -I -c -vv|grep "not exist". Be aware that this may take a LONG time.

Searching in UNinstalled files:
No possible solution till now. Perhaps searching .deb-Packages online is a way..


Deinstallation

Simple unistall:
emerge -C TheThingYouDontWant


Information

Just list everything:
qpkg

List all installed packages:
qpkg -I

List all UNinstalled packages:
qpkg -U

To see all flags and settings:
emerge info

To see all flags from one package:
etcat -u TheThingYouWant


Else

Fetch the sources, don't compile:
emerge -f TheThingYouWant

Only merge TheThingYouWant, NOT the dependencies:
emerge -O TheThingYouWant

Only merge the dependencies, NOT TheThingYouWant:
emerge -o TheThingYouWant

Let's say, you want to install a package, that's got a dependency, you're absolutely sure, it has not to be installed, you can just pretend it's installation to the system:
emerge -i ReportedlyNeeded


Last edited by qeldroma on Thu Apr 22, 2004 2:30 pm; edited 10 times in total
Back to top
View user's profile Send private message
verbatim
Apprentice
Apprentice


Joined: 13 Mar 2003
Posts: 223

PostPosted: Thu Jan 22, 2004 4:40 pm    Post subject: Reply with quote

Nice helpful guide. :)

But I think telling people to go commenting things out in packages.mask might be a little extreme for a fast help guide... if it's masked, there's usually a good reason it's in there...
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Karlsruhe, Germany

PostPosted: Thu Jan 22, 2004 4:50 pm    Post subject: Reply with quote

Good work, some comments:

Quote:

If that didn't worked:
Look at /usr/portage/profiles/package.mask and comment the line with the wanted package out

A better way that survives an 'emerge sync': Copy the entry that masks the package from /usr/portage/profiles/package.mask into /etc/portage/package.unmask (create if needed). Masking packages (e.g. not compiling ones) can be accomplished with similar entries in /etc/portage/package.mask.

Quote:

Simple unistall:
emerge -c TheThingYouDontWant

It's a capital "C", or "emerge unmerge TheThingYouDontWant"
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Thu Jan 22, 2004 4:58 pm    Post subject: Reply with quote

Earthwings wrote:
Good work, some comments:
Quote:

If that didn't worked:
Look at /usr/portage/profiles/package.mask and comment the line with the wanted package out

A better way that survives an 'emerge sync': Copy the entry that masks the package from /usr/portage/profiles/package.mask into /etc/portage/package.unmask (create if needed). Masking packages (e.g. not compiling ones) can be accomplished with similar entries in /etc/portage/package.mask.

I didn't add Alternatives or other ways to keep it small and simple

Quote:

Quote:

Simple unistall:
emerge -c TheThingYouDontWant

It's a capital "C", or "emerge unmerge TheThingYouDontWant"


You're right.
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Karlsruhe, Germany

PostPosted: Thu Jan 22, 2004 5:01 pm    Post subject: Reply with quote

Quote:

I didn't add Alternatives or other ways to keep it small and simple

I didn't add the whole thing as verbatim suggested, or do it this way. Editing /etc/portage/profiles/package.mask is quick'n'dirty.

edit: I should give a reason why it's quick'n'dirty :wink:
suppose you unmask package foo-4.2 this way and emerge it. some days later you want to update your system, thus run "emerge sync; emerge -uD world -pv" and now aks yourself why foo gets downgraded to, say foo-4.1
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Thu Jan 22, 2004 5:28 pm    Post subject: Reply with quote

Earthwings wrote:
Quote:

I didn't add Alternatives or other ways to keep it small and simple

I didn't add the whole thing as verbatim suggested, or do it this way. Editing /etc/portage/profiles/package.mask is quick'n'dirty.

edit: I should give a reason why it's quick'n'dirty :wink:
suppose you unmask package foo-4.2 this way and emerge it. some days later you want to update your system, thus run "emerge sync; emerge -uD world -pv" and now aks yourself why foo gets downgraded to, say foo-4.1


Again, you're right 8)
Back to top
View user's profile Send private message
oldan
Tux's lil' helper
Tux's lil' helper


Joined: 11 Dec 2003
Posts: 137
Location: Atlanta, Georgia, USA

PostPosted: Thu Jan 22, 2004 7:48 pm    Post subject: Reply with quote

I could sure go for an extra little command:
Code:
emerge installed
which shows me every package already installed on the system.
-- Oldan
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Karlsruhe, Germany

PostPosted: Thu Jan 22, 2004 8:01 pm    Post subject: Reply with quote

oldan, like 'qpkg -I -nc -v'?

qeldroma, you could mention one needs gentoolkit for etcat (and qpkg)
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Fri Jan 23, 2004 12:41 pm    Post subject: Reply with quote

oldan wrote:
I could sure go for an extra little command:
Code:
emerge installed
which shows me every package already installed on the system.
-- Oldan


Code:
root@xxx /# emerge installed
Calculating dependencies
emerge: there are no masked or unmasked ebuilds to satisfy "installed".

!!! Error calculating dependencies. Please correct.


And how does this work at your station? My result is what you see above.
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Fri Jan 23, 2004 12:46 pm    Post subject: Reply with quote

Earthwings wrote:
oldan, like 'qpkg -I -nc -v'?


I tried out qpkg now, how do i search for a file in an uninstalled ebuild? I tried "qpkg -f lspci" and it found nothing. AFAIK "lspci" is available under gentoo, too. Isn't it?
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Fri Jan 23, 2004 1:07 pm    Post subject: Reply with quote

qeldroma,

to list intalled packages with qpkg you use the "-l" option:

Code:

qpkg -l lspci


if you wish to search for a specific file installed by a package installed on your system use the "-f" option"

Code:

qpkg -f /usr/lib/liblsof.a   


I recently had a few corrupt binaries after using distcc with a p4 and Athlon processor-I forget to specify i686 (DUH!)-so I enden up with Athlon optimized binaries on my p4(Not Good(TM))-so I kept getting relocation errors on certain libraries- I did not know which packages these libraries belonged to-so "qpkg -f /usr/lib/messedupbinary.so" helped me quickly isolate and remerge those packages....
Back to top
View user's profile Send private message
masseya
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 2602
Location: Baltimore, MD

PostPosted: Fri Jan 23, 2004 10:07 pm    Post subject: Reply with quote

Moving from Portage and Programming.
_________________
if i never try anything, i never learn anything..
if i never take a risk, i stay where i am..
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Sun Jan 25, 2004 12:41 pm    Post subject: Reply with quote

Did some updates. Thanks to all again.
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Thu Apr 22, 2004 2:01 pm    Post subject: Reply with quote

And again, i added some nifty things 8)
Back to top
View user's profile Send private message
olias2
Apprentice
Apprentice


Joined: 23 Aug 2003
Posts: 234
Location: CANADA

PostPosted: Thu Apr 22, 2004 11:29 pm    Post subject: Reply with quote

Anybody know how to uninstall old kernels? If I type 'emerge -Cp gentoo-dev-sources' it shows all and if I type "emerge -Cp linux-2.6.3-gentoo-r1' it can't find it.

Thanks, Olias
_________________
A wise man realizes that he too is a fool and then humbles himself to learn that which is greater than he.
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Thu Apr 22, 2004 11:41 pm    Post subject: Reply with quote

With "etcat -v gentoo-dev-sources" you will get an overview of all versions.

"emerge -C =gentoo-dev-sources-2.6.3-r1" will be your friend then.
Back to top
View user's profile Send private message
olias2
Apprentice
Apprentice


Joined: 23 Aug 2003
Posts: 234
Location: CANADA

PostPosted: Fri Apr 23, 2004 1:14 am    Post subject: Reply with quote

Thanks for that. :D

It seemed to empty the right directories but the files are still there. Is it up to me to delete the /usr/src/linux-2.6.3-gentoo-r1 directory now?

Thanks again... Olias
_________________
A wise man realizes that he too is a fool and then humbles himself to learn that which is greater than he.
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Fri Apr 23, 2004 4:32 pm    Post subject: Reply with quote

Yes. It's not perfect for uninstalling kernels, don't know why. Perhaps because the leftover-files have been changed..
Back to top
View user's profile Send private message
olias2
Apprentice
Apprentice


Joined: 23 Aug 2003
Posts: 234
Location: CANADA

PostPosted: Sat Apr 24, 2004 2:39 pm    Post subject: Reply with quote

Thanks qeldroma. I just did a 'rm/usr/src/linux-2.6.3-gentoo-r1' to finish it off.

I was wondering about another issue regarding clean-up. I have 1.4GB worth of files in my /usr/portage/distfiles directory. Is is safe to just 'rm usr/portage/distfiles/unwantedtar.bz2' or will there be some ill effect from this?

Sorry if I'm going off topic... Olias
_________________
A wise man realizes that he too is a fool and then humbles himself to learn that which is greater than he.
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Sat Apr 24, 2004 3:32 pm    Post subject: Reply with quote

You can safely remove /usr/portage/distfiles/* and /var/tmp/portage/*. There are only downloaded/temporary files.
Back to top
View user's profile Send private message
Slinger
Apprentice
Apprentice


Joined: 14 Dec 2002
Posts: 230

PostPosted: Sat Apr 24, 2004 3:53 pm    Post subject: Reply with quote

tag
Back to top
View user's profile Send private message
Narada
Guru
Guru


Joined: 12 Dec 2002
Posts: 300
Location: London, UK

PostPosted: Sun Apr 25, 2004 12:02 pm    Post subject: Reply with quote

`regenworld` regenerates world file. This needs more publicity as some still don't know it. Good reference!
_________________
http://dhruba.name/
Back to top
View user's profile Send private message
qeldroma
Guru
Guru


Joined: 17 Oct 2002
Posts: 370

PostPosted: Sun Apr 25, 2004 1:01 pm    Post subject: Reply with quote

Narada wrote:
`regenworld` regenerates world file. This needs more publicity as some still don't know it. Good reference!


When do i need to do this?
Back to top
View user's profile Send private message
Narada
Guru
Guru


Joined: 12 Dec 2002
Posts: 300
Location: London, UK

PostPosted: Sun Apr 25, 2004 1:37 pm    Post subject: Reply with quote

qeldroma wrote:
Narada wrote:
`regenworld` regenerates world file. This needs more publicity as some still don't know it. Good reference!


When do i need to do this?


Look here for an FAQ answer. Basically, sometimes there are updates which emerge -Duvp world does not catch due to some installed packages not being in the world file. Running regenworld recreates your world file based upon packages installed on your system and overwrites your old world file. It also tells you what additions it made to the file.
_________________
http://dhruba.name/
Back to top
View user's profile Send private message
porter
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jan 2003
Posts: 95

PostPosted: Wed Apr 28, 2004 10:07 am    Post subject: Reply with quote

My
Code:
etcat -v

provides this output:

Code:
*  sys-kernel/vanilla-sources :
        [   ] 2.0.40 (2.0.39)
        [   ] 2.2.26 (2.2.25)
        [   ] 2.4.20 (2.4.20)
        [   ] 2.4.21 (2.4.21)
        [  I] 2.4.22 (2.4.22)
        [   ] 2.4.23 (2.4.23)
        [   ] 2.4.24 (2.4.24)
        [M  ] 2.4.24-r1 (2.4.24)
        [   ] 2.4.25 (2.4.25)
        [  I] 2.4.26 (2.4.26)


What does M and I mean ?
_________________
no pain, no gain
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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