Table of Content

This is a two-parts article. There are few sections here.

Part One
  • Preface: Test Bed
  • Getting Started With Docker
  • Package Management: Portage Frontend, Get Help
  • Updating System: OS Release, webrsync, Update, Manually, More
  • Package IRSI: Install, Confirmation, Ambiguous, Download, Removal, Query Search, Show Info
  • What's Next
Part Two
  • Dependency: Dependency, Reverse Dependency, Pretend, Verify
  • Group: Metapackages, Sets
  • System Wide: emerge, revdep-rebuild, Upgradables, Installed, Recent, Obsolete
  • Package: Building Package, Extract
  • History: The Log File
  • Clean Up
  • What's Next
Part Three
  • Interesting Tools: Equery, Layman, Eix
  • Repository: Adding, Configuration, List Overlays, Removal, Synchronize, List Packages
  • Mirror: Install, Select Mirror, Configuration, Test
  • Hold Package: Example, Before Mask, Configuration, After Mask
  • Conclusion

Interesting Tools

I do think that these tools are what I need.

  • Equery

  • Layman

  • Eix

Equery

There are a lot of interesting stuff in package site.

$ emerge --ask app-portage/gentoolkit
$ equery depgraph ncdu

Docker Equery: Dependency in Graph

Layman

Managing Repository

$ layman-updater -R
$ layman --list
$ layman --list-local

* xwing [Rsync ] (rsync://gentoo.xwing....)
$ layman --fetch

* Fetching remote list...
* Fetch Ok

Docker Layman: List Available

Eix

Diffing local ebuild.

$ emerge --ask app-portage/eix

First Thing First, as usual.

$ eix-update

Docker Eix: Update

$ eix-sync

Docker Eix: Sync


Repository

Gentoo utilize portage tree as main ebuild repository.

Configuration

$ cat /usr/share/portage/config/repos.conf
[DEFAULT]
main-repo = gentoo

[gentoo]
location = /usr/portage
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes

# for daily squashfs snapshots
#sync-type = squashdelta
#sync-uri = mirror://gentoo/../snapshots/squashfs

Docker Portage: Configuration

In Funtoo this wouldlook a little bit different.

[DEFAULT]
main-repo = gentoo

[gentoo]
location = /usr/portage
sync-type = git
sync-uri = git://github.com/funtoo/ports-2012.git
auto-sync = yes

I do not know how it looks in Zentoo.

Overlay

Gentoo has repository concept called ebuild repository, or in short called overlay. Overlay is additional ebuild outside the main package tree.

This is a list of overlay.

There is an ebuild repository frontend called layman.

Adding Overlay

Adding overlay is pretty straightforward.

$ layman -a xwing

* Adding overlay...
* Overlay "xwing" is not official. Continue installing? [y/n]: y
* Running Rsync... # /usr/bin/rsync -rlptDvz --progress --delete --delete-after --timeout=180 --exclude=distfiles/* --exclude=local/* --exclude=packages/* rsync://gentoo.xwing.info/xwing-overlay/ /var/lib/layman/xwing
This is xwing.info / alderaan.xwing.info

Server Address : 91.134.139.206
Contact Name : webmaster@xwing.info
Hardware : VPS 2016 SSD 3

More Info

Docker Layman: Add Overlay

Configuration

Now xwing has been added to the layman.conf.

$ cat /etc/portage/repos.conf/layman.conf 
[xwing]
priority = 50
location = /var/lib/layman/xwing
layman-type = rsync
auto-sync = No

Docker Layman: Configuration

Consider have a look at the provided path.

$ ls /var/lib/layman/xwing/
app-office media-gfx net-misc skel.metadata.xml
eclass media-plugins profiles x11-misc
licenses media-video skel.ChangeLog x11-plugins
mail-filter metadata skel.ebuild x11-themes

Docker Layman: /var/lib/layman

List Overlays

List available overlays. This will produce long list.

$ layman -L

List installed overlays.

$ layman -l

* xwing [Rsync ] (rsync://gentoo.xwing....)

Docker Layman: List Installed

Overlay

Overlay removal is also straightforward.

$ layman -d xwing

* Deleting selected overlay(s)...
* Deleting directory "/var/lib/layman/xwing"
* Successfully deleted overlay(s) xwing.

Docker Layman: Remove Overlay

Synchronize Overlays

$ layman -S

* Fetching remote list...
* Fetch Ok

* Syncing selected overlay(s)...
* Running Rsync... # /usr/bin/rsync -rlptDvz --progress --delete --delete-after --timeout=180 --exclude=distfiles/* --exclude=local/* --exclude=packages/* rsync://gentoo.xwing.info/xwing-overlay/ /var/lib/layman/xwing
This is xwing.info / alderaan.xwing.info
...

Docker Layman: Synchronize

List Packages

We can use eix to list packages. No need to check out /var/lib/layman/xwing/ manually. First we have to eix-sync.

$ eix-sync
$ eix --in-overlay xwing --only-names
app-office/grisbi
mail-filter/sqlgrey
media-gfx/AfterShotPro
...

Docker Eix: --in-overlay

This is basic operation for ebuild repository. It is enough for preview. We are done.


Mirror

Mirror can be configured in etc/portage/make.conf.

Install

$ emerge --ask app-portage/mirrorselect

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild N ] dev-util/dialog-1.3.20170131 USE="nls unicode -examples -minimal -static-libs"
[ebuild N ] app-portage/mirrorselect-2.2.2-r2 PYTHON_TARGETS="python2_7 python3_4"

Would you like to merge these packages? [Yes/No]

Select

$ mirrorselect -i -c Japan
* Using url: https://api.gentoo.org/mirrors/distfiles.xml
* Limiting test to "country=Japan" hosts.
* Downloading a list of mirrors...
...
* Modifying /etc/portage/make.conf with new mirrors...
Reading make.conf
Moving to /etc/portage/make.conf.backup
Writing new /etc/portage/make.conf
* Done.

Docker Portage: mirrorlist dialog

Configuration

$ less /etc/portage/make.conf
...
GENTOO_MIRRORS="rsync://ftp.jaist.ac.jp/pub/Linux/Gentoo/ http://ftp.jaist.ac.jp/pub/Linux/Gentoo/"

Docker Portage: mirror make.conf

Test

Now we have new Mirror

$ emerge-webrsync 
Fetching most recent snapshot ...
Trying to retrieve 20170908 snapshot from rsync://ftp.jaist.ac.jp/pub/Linux/Gentoo ...
Fetching file portage-20170908.tar.xz.md5sum ...
Fetching file portage-20170908.tar.bz2.md5sum ...
Fetching file portage-20170908.tar.gz.md5sum ...
Trying to retrieve 20170908 snapshot from http://ftp.jaist.ac.jp/pub/Linux/Gentoo ...
Fetching file portage-20170908.tar.xz.md5sum ...
Fetching file portage-20170908.tar.xz.gpgsig ...
Fetching file portage-20170908.tar.xz ...
Checking digest ...
Getting snapshot timestamp ...
...

Docker Portage: jaist webrsync


Hold Package

Portage hold package using package.mask configuration.

Example

$ eix --installed --upgrade
[U] app-text/docbook-xml-dtd
Available versions:
(4.1.2) 4.1.2-r6
(4.2) 4.2-r2
(4.3) 4.3-r1
(4.4) 4.4-r2
(4.5) 4.5-r1
Installed versions: 4.1.2-r6(4.1.2)(05:57:54 08/03/17)
Homepage: http://www.docbook.org/
Description: Docbook DTD for XML

Docker Portage: upgradable

Consider app-text/docbook-xml-dtd as our guinea pig example.

Before Mask

This is the result before mask.

  • Latest version available: 4.5-r1
$ emerge -a docbook-xml-dtd

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild NS ] app-text/docbook-xml-dtd-4.5-r1 [4.1.2-r6]

Would you like to merge these packages? [Yes/No] n

Quitting.

Docker Portage: example docbook

$ emerge -s docbook-xml-dtd

[ Results for search key : docbook-xml-dtd ]
Searching...

...

* app-text/docbook-xml-dtd
Latest version available: 4.5-r1
Latest version installed: 4.1.2-r6
Size of files: 97 KiB
Homepage: http://www.docbook.org/
Description: Docbook DTD for XML
License: docbook

Configuration

Limit version to: 4.1.2-r6

$ echo ">app-text/docbook-xml-dtd-4.1.2-r6" > /etc/portage/package.mask/docbook
$ cat /etc/portage/package.mask/docbook
>app-text/docbook-xml-dtd-4.1.2-r6

Consider have a look at comparation below.

Docker Portage: comparation

After Mask

This is the result after mask.

  • Latest version available: 4.1.2-r6
$ emerge -a docbook-xml-dtd
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] app-text/docbook-xml-dtd-4.1.2-r6

Would you like to merge these packages? [Yes/No]
$ emerge -s docbook-xml-dtd

[ Results for search key : docbook-xml-dtd ]
Searching...

...

* app-text/docbook-xml-dtd
Latest version available: 4.1.2-r6
Latest version installed: 4.1.2-r6
Size of files: 74 KiB
Homepage: http://www.docbook.org/
Description: Docbook DTD for XML
License: docbook

Conclusion

The fact that this article only takes three parts, compared to other four-parts article, show my lack of knowledge.

I am a n00bs !

I just feel that I’m not afraid to use emerge. Portage is not scary at all.


Thank you for reading