解决Gentoo各种问题

最近一直在玩Gentoo,现将各类问题解决方法集锦如下:

## 注释 (## 后的内容是注释)

# 命令  (# 或 $ 后的内容是命令)


一.以普通用户无法su root

$ su root
Password:         #正确输入密码
su:  Permission denied

Gentoo 要求wheel组用户才能su root ,解决方法为编辑/etc/group, 添加username至wheel组:

命令:# usermod -a -G wheel  用户名

wheel::10:root,username

二.本地化 后导致无法安装软件

中国用户推荐 /etc/locale.gen 内容:

zh_CN.UTF-8 UTF-8


系统级别的配置在:/etc/env.d/02locale; 用户级别的配置在:~/.bashrc

export LANG="zh_CN.UTF-8"



然后运行:

# locale-gen
# env-update && source /etc/profile

但是安装过程中本地化以后又出现一些严重的问题:

1.无法 emerge vim , 会卡死的 ...

2.运行 emerge gnome 会出现:

Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: GB18030
/bin/sh: line 1: 23213 Aborted                 LD_LIBRARY_PATH=/var/tmp/portage/dev-lang/python-3.1.4-r3/work/Python-3.1.4: CC='x86_64-pc-linux-gnu-gcc -pthread' LDSHARED='x86_64-pc-linux-gnu-gcc -pthread -shared' LDFLAGS='-Wl,-O1 -Wl,--as-needed -L.' CFLAGS=' -O2 -pipe -fwrapv -DNDEBUG  ' ./python -E ./setup.py build
make: *** [sharedmods] Error 134
emake failed

ERROR: dev-lang/python-3.1.4-r3 failed (compile phase):
emake failed


我的解决办法就是不要急着本地化,去掉 /etc/locale.gen中zh_CN相关内容,然后运行:

# locale-gen
# env-update && source /etc/profile


三. Windos系统中访问当前硬盘Linux分区( ext2, ext3 and ext4)

目前我知道的就只有:ext2explore 了 



四. 分辨率问题

在 grub.conf 中配置 vga=***:

title Gentoo Gnome
root (hd0,0)
kernel (hd0,0)/vmlinuz-3.0.6-gentoo vga=771 

启动后出现类似如下信息:

Undefined video mode number:303
mode:	Resolution	Type
0 F00	80x25		VGA
...
5 F06	80x34		VGA
6 F07	80x60		VGA

明显,这是显卡驱动原因,解决办法:

重新配置内核(make menuconfig)

Device Drivers --->
  Input device support --->
  <*>  Event interface

...
Device Drivers --->
  Graphics support --->
    Support for frame buffer devices --->
    ## 关闭这里的所有驱动, 包括 VGA, Intel, nVidia, and ATI

    ## 接着激活 basic console support. KMS 要使用
    Console display driver support --->
      <*>  Framebuffer Console Support


接着 intel 显卡要如下配置:

Device Drivers --->
  Graphics support --->
    /dev/agpgart (AGP Support) --->
    <*>  Intel 440LX/BX/GX, I8xx and E7x05 chipset support
    Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
    <*>  Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver)
         i915 driver
    [*]    Enable modesetting on intel by default

nvidia 显卡要如下配置

( 激活 DRM )
Device Drivers --->
  Graphics support --->
  <*>  Direct Rendering Manager --->

(Nouveau is currently in the Staging drivers section)
Device Drivers --->
  Staging drivers --->
  [ ]  Exclude Staging drivers from being built
  <*>    Nouveau (nVidia) cards

AMD/ATI显卡需要 emerge  radeon-ucode  或  linux-firmware 然后如下配置

(设置kernel 使用 radeon-ucode 固件)
Device Drivers --->
  Generic Driver Options --->
  [*]  Include in-kernel firmware blobs in kernel binary
  
  External firmware blobs (radeon/R600_rlc.bin radeon/R700_rlc.bin) ## RadeonHD 2000, 3000, and 4000系列的选择:
  
  External firmware blobs(radeon/CEDAR_me.bin radeon/CEDAR_pfp.bin radeon/CEDAR_rlc.bin
                          radeon/CYPRESS_me.bin radeon/CYPRESS_pfp.bin radeon/CYPRESS_rlc.bin
                          radeon/JUNIPER_me.bin radeon/JUNIPER_pfp.bin radeon/JUNIPER_rlc.bin
                          radeon/REDWOOD_me.bin radeon/REDWOOD_pfp.bin radeon/REDWOOD_rlc.bin) ##RadeonHD 5000系列的选择
  
  External firmware blobs(radeon/PALM_me.bin radeon/PALM_pfp.bin radeon/SUMO2_me.bin radeon/SUMO2_pfp.bin radeon/SUMO_me.bin 
                          radeon/SUMO_pfp.bin radeon/SUMO_rlc.bin)  ## Radeon HD 6000 系列 Fusion APUs:
  
  External firmware blobs(radeon/BARTS_mc.bin radeon/BARTS_me.bin radeon/BARTS_pfp.bin radeon/BTC_rlc.bin radeon/CAICOS_mc.bin 
                          radeon/CAICOS_me.bin radeon/CAICOS_pfp.bin radeon/CAYMAN_mc.bin radeon/CAYMAN_me.bin radeon/CAYMAN_pfp.bin 
                          radeon/CAYMAN_rlc.bin radeon/TURKS_mc.bin radeon/TURKS_me.bin radeon/TURKS_pfp.bin) ##RadeonHD 6400-6900系列的选择
   
  Firmware blobs root directory(/lib/firmware/)  ## emerge radeon-ucode 安装目录


## 激活 Radeon KMS 支持
Device Drivers --->
  Graphics support --->
  <*>  Direct Rendering Manager --->
  <*>    ATI Radeon
  [*]      Enable modesetting on radeon by default

完成后,重新编译内核



五. 更新配置文件
安装软件包后,可能会类似出现如下信息:

 * IMPORTANT: config file '/etc/pam.d/system-login' needs updating.
 * See the CONFIGURATION FILES section of the emerge
 * man page to learn how to update config files.


这是Gentoo的一种保护机制,为了不让新的配置文件覆盖原有的配置文件。
新的配置文件会以._cfg0000_**** 存在于与旧配置文件相同目录,可以运行:etc-update 解决此问题。
 # etc-update
Scanning Configuration files...
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
1) /etc/pam.d/system-login (1)
Please select a file to edit by entering the corresponding number.
              (don't use -3, -5, -7 or -9 if you're unsure what to do)
              (-1 to exit) (-3 to auto merge all remaining files)  ##以新配置文件替换旧配置文件,有提示
                           (-5 to auto-merge AND not use 'mv -i')  ##以新配置文件替换旧配置文件,没有提示
                           (-7 to discard all updates)
                           (-9 to discard all updates AND not use 'rm -i'): -3  ## -3 会以新配置文件覆盖旧文件
Replacing /etc/pam.d/system-login with /etc/pam.d/._cfg0000_system-login
mv: overwrite `/etc/pam.d/system-login'? y
Exiting: Nothing left to do; exiting. :)



六.  音乐播放器 Decibel

Linux音乐播放器应该挺多的,我选择了Decibel, 以下是我的安装方法:

1. 编辑/etc/make.conf , 添加USE变量

##记着,是追加哦

USE=“gnome gnome-keyring ffmpeg flac mp3”


2. 安装

# emerge decible


七. 汉化

由于安装过程中本地化失败,所以在安装完成后汉化

1.编辑 /etc/loclale.gen ,内容如下:

en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GB18030
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
zh_CN.UTF-8 UTF-8

2.编辑 /etc/env.d/02locale, 内容如下:

export LANG="en_US"
export LC_CTYPE="zh_CN"

3.激活1,2配置:

# locale-gen
# env-update
# source /etc/profile

4.安装中文字体:

# emerge wqy-bitmapfont

5.激活字体(运行eselect fontconfig list查看可用字体)

eselect fontconfig enable 85-wqy-bitmapsong.conf

6.安装中文输入法ibus

# emerge app-i18n/ibus
# emerge app-i18n/ibus-pinyin

安装完成后出现如下提示:

 * To use ibus, you should:
 * 1. Get input engines from sunrise overlay.
 *    Run "emerge -s ibus-" in your favorite terminal
 *    for a list of packages we already have.
 * 
 * 2. Setup ibus:
 * 
 *    $ ibus-setup
 * 
 * 3. Set the following in your user startup scripts
 *    such as .xinitrc, .xsession or .xprofile:
 * 
 *    export XMODIFIERS="@im=ibus"
 *    export GTK_IM_MODULE="ibus"
 *    export QT_IM_MODULE="xim"
 *    ibus-daemon -d -x

我运行 ibus-setup 后出现如下错误,当时ibus不可用但没理会,后来重启后居然可以用了

	(ibus-daemon:12132): IBUS-CRITICAL **: 07:58:53.508740: 	ibus_write_address: assertion `pf != NULL' failed


八. 安装浏览器:firefox

1. 看看有啥可以安装的

~ # emerge -s firefox
Searching...    
[ Results for search key : firefox ]
[ Applications found : 2 ]

*  www-client/firefox
      Latest version available: 8.0
      Latest version installed: 8.0
      Size of files: 88,446 kB                            ## 体积如此大
      Homepage:      http://www.mozilla.com/firefox
      Description:   Firefox Web Browser
      License:       || ( MPL-1.1 GPL-2 LGPL-2.1 )

*  www-client/firefox-bin
      Latest version available: 8.0                      
      Latest version installed: [ Not Installed ]
      Size of files: 53,052 kB                           ## 这个也不小,而且fire-bin是何方神圣?
      Homepage:      http://www.mozilla.com/firefox
      Description:   Firefox Web Browser
      License:       || ( MPL-1.1 GPL-2 LGPL-2.1 )


2. 安装 firefox (我大概编译了一个小时之久)

www-client/firefox


3. 安装Adobe flash player , 参考方法

~ # emerge -s adobe-flash            ## 先查查
Searching...    
[ Results for search key : adobe-flash ]
[ Applications found : 1 ]

*  www-plugins/adobe-flash
      Latest version available: 11.1.102.55
      Latest version installed: 11.1.102.55
      Size of files: 13,468 kB
      Homepage:      http://www.adobe.com/products/flashplayer.html
      Description:   Adobe Flash Player
      License:       AdobeFlash-10.3


~ # emerge www-plugins/adobe-flash   ##再安装

九. waiting ... ...













   

你可能感兴趣的:(manager,list,search,Adobe,firefox,browser)