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
Layman
Managing Repository
$ layman-updater -R
$ layman --list
$ layman --list-local
* xwing [Rsync ] (rsync://gentoo.xwing....)
$ layman --fetch
* Fetching remote list...
* Fetch Ok
Eix
Diffing local ebuild.
$ emerge --ask app-portage/eix
First Thing First, as usual.
$ eix-update
$ 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
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
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
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
List Overlays
List available overlays. This will produce long list.
$ layman -L
List installed overlays.
$ layman -l
* xwing [Rsync ] (rsync://gentoo.xwing....)
Overlay
Overlay removal is also straightforward.
$ layman -d xwing
* Deleting selected overlay(s)...
* Deleting directory "/var/lib/layman/xwing"
* Successfully deleted overlay(s) xwing.
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
...
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
...
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.
Configuration
$ less /etc/portage/make.conf
...
GENTOO_MIRRORS="rsync://ftp.jaist.ac.jp/pub/Linux/Gentoo/ http://ftp.jaist.ac.jp/pub/Linux/Gentoo/"
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 ...
...
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
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.
$ 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.
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