This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

よくある質問

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page FAQ and the translation is 67% complete.

このFAQは gentoo-dev メーリングリストと Freenode Internet Relay Chat (IRC) から集められた質問と回答のコレクションです。

イントロダクション

これらの質問の多くはオフィシャルのGentooドキュメントとガイドの中で答えられていることに注意してください。これは単純な、よくある質問のリストです。GentooとGNU/Linuxがどのように動いているかや、ここで答えられていないような質問への回答についてよりよい理解を得るには、Gentooドキュメントとmanページを読んでください。

はじめに

Gentooはどう発音するのか、そしてその意味は?

"Gentoo"は"gen-too"と発音します("Gentoo"の"g"は"gentle"のようにソフトな"g"です)。Gentoo ペンギンの学名は"Pygoscelis papua"です。"Gentoo"という名前はフォークランド島に生息しているペンギンからつけられました。

Gentooらしさとは何か?

GentooはBSD portsに似たPortageと呼ばれるシステムを使用します。PortageはGentooシステムへのソフトウェアのインストールと管理に強力な柔軟性を与えます。コンパイル時のオプションのサポート(USEフラグを利用して)、条件付き依存解決、インストールされる予定のパッケージの概要の表示、安全なインストール(sandboxを使用して)、ソフトウェアのアンインストール、システムのプロファイル、設定ファイルの保護、その他様々な機能を提供します。

Gentooでは一般に、ユーザーが選択した最適化を使用して、システム全体をソースコードからビルドします。ユーザーは、インストールする、またはしないパッケージを完全にコントロール出来ます。Gentooはあなたに多数の選択を提供します。これにより、あなた好みのGentooをインストール出来ます。これがGentooがメタディストリビューションと呼ばれる理由です。

Gentooはアクティブに開発されています。ディストリビューション全体で迅速な開発スタイルを採用しています。パッケージへのパッチは素早くメインのツリーに取り込まれ、ドキュメントは日々更新され、Portageの機能は頻繁に追加され、1年に2回の公式リリースがあります。

インストール

'-O9 -ffast-math -fomit-frame-pointer' の最適化をしていると、すべてがとても不安定です。どうしたらいいですか?

-O3以上の最適化は必要ありません。なぜなら現行のバージョンのGCCではサポートされていないからです。とても積極的な最適化は、時には適切なアセンブリコードに効率化されることと、もはや同じことをしない原因になります。

バグレポートをする前にCFLAGS -O2 -march=<system_arch>でコンパイルすることを試してください。

どうすればroot (または他のユーザの)パスワードを変更できますか?

passwdコマンドを使って、現在ログインしているユーザのパスワードを変更することが出来ます。rootユーザであれば、passwd usernameコマンドでどのユーザのパスワードも変更が出来ます。他のオプションや設定についてはpasswdのmanページ(man passwd)を見てください。

一般ユーザを追加するにはどうすればいいですか?

useradd larryコマンドでは"larry"というユーザが追加されます。しかし、この方法では、システムで適切に働くために、そのユーザに与えるべきいくつかの権限が与えられません。そのため、以下のコマンドの方が好ましいでしょう。

root #useradd -m -G users,audio,wheel larry

これは"larry"というユーザを追加します。-Gオプションはユーザーを様々なグループに追加します:

  • usersはシステムのインタラクティブユーザにとって標準のグループです。
  • audioグループのユーザにはサウンドデバイスへのアクセスが許可されます。
  • wheelグループのユーザにはsuコマンドの実行が許可され、これにより(rootのパスワードを知っていれば)root権限を得ることができるようになります。

なぜ一般ユーザは root に su 出来ないのですか?

セキュリティの観点から、ユーザがwheelグループに所属していた場合のみrootにsu出来ます。ユーザをwheelグループに追加するためには、以下のコマンドをrootユーザとして実行してください。

root #gpasswd -a <username> wheel

Gentooをあるリリースから次のリリースに再インストールせずにアップグレード出来ますか?

事実上、インストールされた個別のリリースの間に違いはありません。Gentoo 1.4 とそれ以降のリリースは、glibc-2.3.x(かそれ以降)をベースにしています。 emerge --sync && emerge -uDN @world を実行することでシステム全体が "最新のGentoo" になります。 個々のリリース間に存在する差異は、インストールメディアとコンパイル済みのパッケージのみです。 profileとアップグレードの際のそれの役割についての、より詳細な情報はGentooアップグレードガイドを見てください。

また、 emerge -uDN @world コマンドはあなたがインストールしたパッケージと同時に、それらの依存パッケージも更新する一方、ビルド時依存パッケージ(インストール後ではなく、ビルド中に必要とされるパッケージ)は更新しないことに注意してください。それらのパッケージも含めてアップデートするためには、--with-bdeps=yオプションを付けたほうが良いでしょう。

カーネルがブートしません。何をするべきでしょうか?

インストールのすべてのステップをやり直す必要はありません。しかし、カーネルとそれに関連するステップを調査することが必要です。Gentooを/dev/sda1 (/boot)と/dev/sda3 (/)、/dev/sda2をスワップとしてインストールしたと仮定します。

インストールCDからブートし、コマンドプロンプトが表示されるまで待ちます。

最初にすべてのパーティションを mount します:

root #mount /dev/sda3 /mnt/gentoo
root #mount /dev/sda1 /mnt/gentoo/boot
root #swapon /dev/sda2
root #mount -t proc proc /mnt/gentoo/proc

その後、Gentooの環境にchrootし、カーネルの設定をします:

root #chroot /mnt/gentoo /bin/bash
root #env-update && source /etc/profile
root #cd /usr/src/linux
root #make menuconfig

前回間違って設定した(しなかった)ものを修正します。 それから終了し、カーネルをコンパイルします:

root #make && make modules_install

新しいbzImageファイルで古いものを上書きします:

root #cp arch/i386/boot/bzImage /boot/<kernel_name>

もしLILOが使われているなら、liloを実行しなおします。GRUBユーザーは次の手順に進んでください:

root #/sbin/lilo

chrootを抜けてシステムを再起動します。

root #exit
root #umount /mnt/gentoo/proc /mnt/gentoo/boot /mnt/gentoo
root #reboot

If, on the other hand, the problem lies with the bootloader configuration, follow the same steps, but instead of configuring and compiling the kernel, reconfigure the bootloader (recompilation of the bootloader is usually not necessary).

私の使っているプロキシでは認証が必要です。どうしたらいいですか?

Portageが自動的にその方法を使えるように、/etc/portage/make.confに設定します:

FILE /etc/portage/make.confSetting up proxy
http_proxy="http://username:password@yourproxybox.org:portnumber"
ftp_proxy="ftp://username:password@yourproxybox.org:portnumber"
RSYNC_PROXY="rsync://username:password@yourproxybox.server:portnumber"

なお、プロキシサーバーは rsync で使うポートに対する CONNECT をサポートしている必要があります。

ISOファイルをディスクに書き込むには?

ISOファイルはCD全体を表すものです。このためCDにISOファイルをそのまま置くのではなく、ディスクイメージとしてCDに書き込む必要があります。

ライティングソフトは山のように存在するので、それらを全て説明するのは無理な話です。ここでは有名なものをいくつか紹介します。

  • With EasyCD Creator select File, Record CD from CD image. Then change the Files of type to ISO image file. Then locate the ISO file and click Open. After clicking Start recording the ISO image will be burned correctly onto the CD/DVD.
  • With Nero Burning ROM, cancel the wizard which automatically pops up and select Burn Image from the File menu. Select the image to burn and click Open. Now click the Burn button and watch the brand new Gentoo Live CD being burnt.
  • With cdrecord, simply type cdrecord dev=/dev/cdrom (replace /dev/cdrom with the CDROM drive's device path) followed by the path to the ISO file.
  • With K3B, select ToolsCDBurn CD Image. Then locate the ISO file within the 'Image to Burn' area. Click Start to begin the burn process.
  • With Mac OS X Panther, launch Disk Utility from Applications/Utilities, select Open from the Images menu, select the mounted disk image in the main window and select Burn in the Images menu.
  • With Mac OS X Jaguar, launch Disk Copy from Applications/Utilities, select Burn Image from the File menu, select the ISO and click the Burn button.

私のCPUではどのCD/stageを使えばいいですか?

First find out what CPU is in the system Gentoo is to be installed on (for instance a Pentium-M). Next find out what CPU type it is compatible with (instruction-wise) to find a proper match with Gentoo's CD or stages. Consulting the CPU's vendor website for this information usually works, although querying a search engine of choice is usually more efficient.

When uncertain, take a "lower" CD/stage file, for instance a i686 or even generic x86 (or the equivalent in the system's arch). This will ensure that the system will work, but may not be as fast as further optimizations.

Please note that many more options exist than those for which Gentoo builds binary stages. Please see the GCC guide for setting the -march flag.

再起動したらインターネットに接続できなくなりました

まずネットワークカードがカーネルに正しく認識されているか確認してください。ifconfig -aを実行して、eth0、eno1、enp2s0、enp0s8や(無線LANの場合)wlan0といった名前を探してみてください。ネットワークカードをカーネルに認識させるためにカーネルモジュールを読み込ませる必要があるかもしれません。この場合、/etc/conf.d/modulesにそのモジュールを記載してください。

もしお使いのネットワークカードのサポートをカーネルに組み込み忘れたなら、カーネルの再設定と、場合によっては再コンパイルが必要です。

ネットワークカードは正しく認識されていて、DHCPを使うように設定していたのであれば、DHCPクライアントがインストールされていないのかもしれません。Gentooでは様々なDHCPクライアントを利用できますが、よく使われるのはdhcpcdです。もしインターネットに接続する必要があれば、インストールCDで起動し直して emerge -a dhcpcd を実行します。

インストールCDでシステムを復旧する方法はここに書かれています。

Can I dual boot with Windows or other operating systems?

Yes! Probably the fastest way to do so is to install GRUB2 with sys-boot/os-prober. Read about it in the GRUB2 article and specifically about dual booting with GRUB2 here.

GRUB LegacyやLILOからWindowsを起動しようとすると、真っ黒の画面しか表示されません。どうしたらいいですか?

それは GRUB LegacyLILO といった古いブートローダーによくある問題かもしれません。Windowsは最初のハードディスク以外からの起動を拒否し、真っ黒の画面を表示することがあります。この場合、Windowsが最初のハードディスクにインストールされているのだと、Windowsに思い込ませる必要があります。これにはブートローダーの設定を変更します。以下のサンプルではGentooが/dev/sda(一番目のディスク)に、Windowsが/dev/sdb(二番目)にインストールされているものとするので、適宜読み替えてください。

FILE /boot/grub/grub.confWindowsをデュアルブートするgrub.confの一節
title Windows XP
     map (hd1) (hd0)
     map (hd0) (hd1)
     rootnoverify (hd1,0)
     chainloader +1
Note
The above example is for GRUB Legacy bootloader, not GRUB2. For information on how to dual boot Windows with GRUB2 see the GRUB2 article.
FILE /etc/lilo.confWindowsをデュアルブートするlilo.confの一節
other=/dev/sdb1
     label=WindowsXP
     table=/dev/sdb
     map-drive = 0x80
     to = 0x81
     map-drive = 0x81
     to = 0x80

これでWindowsは自分が最初のドライブにインストールされていると信じ、正常に起動するはずです。さらなる情報はお使いのブートローダーに応じて、公式のGRUB ドキュメントman lilo.confで得ることができます。

Gentooをstage1やstage2のアーカイブからインストールするには?

The Gentoo Handbook only describes a Gentoo installation using a stage3 tarball. However, Gentoo still provides stage1 and stage2 tarballs. This is for development purposes (the Release Engineering team starts from a stage1 tarball to obtain a stage3) but should not be used by users: a stage3 tarball can very well be used to bootstrap the system. A working Internet connection is a requirement.

Bootstrapping means building the toolchain (the C library and compiler) for the system after which all core system packages are installed. To bootstrap the system, perform a stage3 installation. Before starting the chapter on Configuring the Kernel, it might be necessary to modify the bootstrap.sh script to match personal requirements:

root #cd /usr/portage/scripts
root #vi bootstrap.sh

変更した後は、スクリプトを実行しましょう。

root #./bootstrap.sh

Next, rebuild all core system packages with the newly built toolchain. We need to rebuild them since the stage3 tarball already offers them:

root #emerge -e system

Now continue with Configuring the Kernel.

パッケージ管理

パッケージはどのような形で保存されますか?

Packages are not "stored" per se. Instead, Gentoo provides a set of scripts which can resolve dependencies, fetch source code, and compile a version of the package tailored to the user's needs. Generally Gentoo only builds binaries for releases and snapshots. The Gentoo Developer Manual covers the contents of an ebuild script in detail.

For full ISO releases, a full suite of binary packages will be created using an enhanced .tbz2 format, which is .tar.bz2 compatible with meta-information attached to the end of the file. These can be used to install a working (though not fully optimized) version of the package quickly and efficiently.

It is possible to create RPMs (Red Hat package manager files) using Gentoo's Portage, but it is not currently possible to use existing RPMs to install packages.

自分で./configureを行うことはできますか?

Yes, but it is not trivial, nor is it recommended. Since the method to do this requires a good understanding of Portage internals and commands, it is instead recommended that the ebuild is patched to do whatever it is that the user wants and place it in a Portage overlay (that is why overlays exist). This is much better for maintainability, and usually easier. See the Gentoo Developer Manual for more information.

rsyncが使えないときはどうしたらいいですか?

もしポート873を使うrsyncの通信を通さないファイアウォールの手前にいるなら、一般的なHTTPでPortageスナップショットを取得するemerge-webrsyncを使うとよいでしょう。プロキシ経由でソースファイルやPortageスナップショットを取得する方法はこのセクションに書かれています。

自宅ではろくなインターネット回線が使えません。別の場所でソースをダウンロードしておいて使うことはできますか?

もちろん。まず、emerge --pretend package/atomでどのプログラムがインストールされようとしているかを確認します。これらのパッケージのソースをどこからダウンロードしたらいいかはemerge -fp package/atomで調べられます。ソースをダウンロードして適当なメディアで持ち帰ったら、そのファイルを/usr/portage/distfiles/に置き、あとはemerge packageを実行するだけです。念のため言っておくと、とても面倒な作業です。

ソースアーカイブが/usr/portage/distfiles/に溜まっていますが、これは削除しても大丈夫ですか?

Deleting these files will have no negative impact on day-to-day performance. However, it might be wise to keep the most recent version of the files; often several ebuilds will be released for the same version of a specific piece of software. If the archive is deleted and the software is upgraded or rebuilt it will be necessary to download them from the Internet again.

Use the eclean script from app-portage/gentoolkit to manage the contents of /usr/portage/distfiles/ and a few other locations. Please read man eclean to learn more about its usage, as well as the Gentoolkit article.

/var/tmp/portageにはなにが置かれるのですか?この中身を消しても大丈夫ですか?

During compilation, Gentoo saves the sources of the package in /var/tmp/portage. These files and folder are usually deleted upon a successful merge, but this sometimes fails. It is safe to clean out all contents of this directory if the emerge command is not running. Be sure to always pgrep emerge before cleaning out this directory.

使い方

どうすれば国際化キーボードレイアウトが使えますか?

Edit the keymap variable in /etc/conf.d/keymaps. To have console working correctly with extended characters in the keymap, it might be necessary to set up the variables consolefont and consoletransation in the /etc/conf.d/consolefont file (for further information on localizing the environment, refer to the localization guide). Then, issue a reboot, or restart the keymaps and consolefont scripts:

root #/etc/init.d/keymaps restart
root #/etc/init.d/consolefont restart

DNS name resolution works for root only

/etc/resolv.conf has the wrong permissions; chmod it as follows:

root #chmod 0644 /etc/resolv.conf

Why can't my user use their own crontab?

ユーザーをcronグループに追加してください。

root #gpasswd -a <username> cron

起動時に NumLock が自動でオンになるようにするには?

以下のコマンドは numlock サービスを default 欄レベルに追加し、起動時に NumLock を有効にします。

root #rc-update add numlock default
root #/etc/init.d/numlock start

Each GUI provides different tools for this sort of thing; please check the help section or online manuals for the GUI of choice for further assistance.

How do I have my terminal cleared when I log out?

To have the terminal cleared, add the clear command to the user's ~/.bash_logout script:

user $echo clear >> ~/.bash_logout

To have this happen automatically when adding a new user, do the same for the /etc/skel/.bash_logout file:

root #echo clear >> /etc/skel/.bash_logout

メンテナンス

ReiserFS and filesystem corruption issues - how to fix them, etc

If the ReiserFS partition is corrupt, try booting the Gentoo Install CD and run reiserfsck --rebuild-tree on the corrupted filesystem. This should make the filesystem consistent again, although there may be some lost files or directories due to the corruption.

開発

バグ報告の方法は?

Use the Bugzilla site to report bugs. Visit #gentoo on the Freenode IRC network and ask around if it is unclear whether an issue is really a bug or not.

How often are new releases made?

Gentoo's packages are usually updated shortly after the upstream authors release new code. As for when Gentoo itself makes new stage/profile/ISO releases, check the Release Engineering Project page. New releases are announced on the gentoo-announce mailing list. See this section for more information.

My speaker beeps like crazy. How do I disable console beeps?

Console beeps can be turned off using setterm, like this:

root #setterm -blength 0

To turn off the console beeps on boot, put the following command in the /etc/conf.d/local.start file. However, this only disables beeps for the current terminal. To disable beeps for other terminals, pipe the command output to the target terminal, like this:

root #setterm -blength 0 > /dev/vc/1

Replace /dev/vc/1 with the terminal for which console beeps need to be disabled.

資料

Where can I find more information about Gentoo Linux?

Much of the official Gentoo documentation can be found here on the Wiki.

Gentoo LinuxのCDを買うことができますか?

Users who are not able to download and burn installation CDs personally might find one through one of our licensed stores. However, most stores have dropped offering CDs and DVDs as these installation media quickly become obsolete.

The licensed stores are listed on the stores page.

このFAQには私の質問の答えがありません。どうすればいいですか?

A good first step is to browse through the relevant documentation, failing that, the various Gentoo Linux mailing lists listed here. If all else fails, or to just hang out with Gentoo folks, visit us on the #gentoo Freenode IRC channel.


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Daniel Robbins, Colin Morey, John P. Davis, Eric Stockbridge, Stoyan Zhekov, Carl Anderson, Jorge Paulo, Benny Chuang, Jonathan Smith, nightmorph
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.