Install and use gentoo

Source: Internet
Author: User
Tags sleep function
After a thrilling upgrade of gentoo installation and usage for nearly one day (fortunately, the system has not been suspended and it feels faster ), finally, I want to calm down and write down the installation, configuration, and upgrade of gentoo over the past week. I want to remember it, and maybe I want to use gentoo for others...
After a thrilling upgrade of gentoo installation and usage for nearly one day (fortunately, the system is not suspended and it feels faster ), finally, I want to calm down and write down the installation, configuration, and upgrade of gentoo for a week. first, I want to commemorate it, in addition, it may be helpful to other friends who want to use gentoo. Linux is not very long. I used ubuntu for about one and a half years and archlinux for one year. Some people often talk about gentoo when they visit the forum in archlinux. it seems that gentoo is a master. At that time, I felt ridiculous. Were there any major differences between different releases? I encountered some problems when I used ubuntu to switch to archlinux, that is, the graphics card driver. others were quite smooth, where can gentoo go? In addition, the installation software of gentoo must be compiled, and my current performance is not good. I want to consider it if I change it later. so I thought about it several times, but I definitely did not try. One week ago (2010, March 4), I updated both mplayer and ffmpeg manually and found that the compilation was a bit tangled. mplayer needed the ffmpeg source code, but ffmpeg had to be compiled and translated separately, later, after the mplayer was upgraded to ffmpeg with the so of ffmpeg, the mplayer crashed and re-edited several times to complete the problem. Several packages in the system are compiled by themselves, mainly to remove unnecessary dependencies, but manual maintenance is too troublesome, so I thought of gentoo again. At that time, it was more than 10 o'clock, so I wanted to start the next day. Nonsense. The hard disk partition before www.2cto.com is like this: /dev/sda1 ext4 6g/dev/sda2 2g not used/dev/sda3 ntfs 30g/dev/sda4 jfs 66g/home where/dev/sda2 is previous swap, however, if you don't need the sleep function, you don't need it because swap doesn't mean much. The remaining three partitions are all important and cannot be moved. how can this problem be installed. If you want to try sda2, you can try sda2 first. if you cannot install sda2, it will be okay. So I converted sda2 into reiserfs (someone said this format is good, but I have never used it, just to try it out ). Download the stage3-i686-20110301.tar.bz2 and portage-latest.tar. xz. (The previous file was updated on Monday) (I used 32-bit) domestic images include: http://mirrors.163.com/gentoo/ http://mirrors.sohu.com/gentoo/ http://mirror.bjtu.edu.cn/gentoo/ http://mirrors.xmu.edu.cn/gentoo/ You can find these two files. Mount sda2 on/media/z and put the file in: sudo mount/dev/sda2/media/z sudo tar xvpf stage3-i686-20110301.tar.bz2-C/media/z sudo tar xvpf portage-latest.tar.xz-C/media/z/usr prepare the chroot environment: sudo mount-t proc none/media/z/proc sudo mount-vt devpts/media/z/dev/pts sudo chroot/media/z // bin/bash now chroot in, subsequent operations, if not specifically, are performed in this environment. Initialize the environment variable www.2cto.com: env-update; source/etc/profile modify/etc/make. conf, this is very important. it is best to change it to the correct position first, otherwise you will get it later (I am, don't want to get it, change multiple times, and re-compile various things after the change): add to the source: GENTOO_MIRRORS =" http://mirror.bjtu.edu.cn/gentoo/ "SYNC =" rsync: // developer.bjtu.edu.cn/gentoo-portage "the above four websites have instructions on how to write this. MAKEOPTS = "-j3" #-jn, n is the kernel Shujia 1, used for multi-thread compilation, if this parameter is not set, USE INPUT_DEVICES = "keyboard mouse synaptics" # keyboard, mouse, and touchpad # The following is an important USE. you can USE only USE = "X gtk" at the beginning ", but it was easy to write before, or it will be troublesome in the future. USE = "-pppd-alsa-fortran sse sse2 ssse3 mmx sdl v4l v4l2 oss oss4 X gtk unicode truetype jpeg png gif cairo zsh-completion fontconfig video opengl" VIDEO_CARDS = "radeon" # This important, the graphics card driver type. for details, refer to the official wiki. my name is ati x2300 and I can only use this open-source driver. # CCEPT_KEYWORDS = "~ X86 "# Note: If you want to use the latest software, you can add this line. However, if it is the first installation, it is strongly not recommended to add it. Otherwise, it will increase the installation difficulty and change it first. Modify/etc/locale. gen, plus (write as needed) en_US.UTF-8 UTF-8 zh_CN.UTF-8 UTF-8 zh_CN.GB2312 GB2312 zh_CN.GBK GBK run locale-gen cp/usr/share/zoneinfo/Asia/Shanghai/etc/localtime modify/etc/conf. d/clock CLOCK = "local" TIMEZONE = "Asia/Shanghai" change/etc/resolv. conf, put the local/etc/resolv. write the conf content into it, otherwise it will not be accessible to the Internet. Change/etc/fstab. This can also be written after the kernel is installed. Invalid. xz can skip this step, but it is best to run it): emerge -- sync to install the kernel source code: emerge gentoo-sources and then start to compile the kernel, if you have experience in manual kernel configuration, we strongly recommend that you manually configure and compile: cd/usr/src/linux make menuconfig make; make modules_install cp arch/x86/boot/bzImage/boot, otherwise, it is best to use genkernel: emerge genkernel cd/usr/src/linux/genkernel -- menuconfig all. for details about how to configure the kernel, go online and query it by yourself. if the following method is not available, it can also be started. The compilation time is related to many factors, ranging from dozens of minutes to hours. User-related: (osily is the user name you want to create) passwd useradd-m-G audio, cdrom, portage, usb, video, wheel, users-s/bin/bash osily passwd osily if fstab has not been changed before, you must change it now, and then change the/boot/grub/menu of your system. lst. The official wiki is clearly written here. we recommend that you check it. Www.2cto.com can continue to install other software, such as xorg-server, but it is best to restart it to see if it can be entered. If not, it may be the kernel (especially the self-compiled kernel). if there is no problem with the kernel, check whether/boot/grub/menu. lst is faulty. change it several times. If it works properly, you can continue compilation directly here, but it is best to return the original system to continue. You can write a script like this :#! /Bin/bash sudo mount/dev/sda2/media/z/sudo mount-t proc none/media/z/proc sudo mount-vt devpts/media/z/dev/ pts sudo chroot/media/z // bin/bash can be run in the chroot environment, if the environment variable is not running properly: env-update; source/etc/profile, then install the required things, mainly depending on yourself, such as dhcpcd, sudo, vim ......, General tools can be used directly in emerge xxx. check the specific usage of emerge online. If you want a desktop environment, follow these steps: install the basic tool and install xorg-server directly. Note the prerequisites:/etc/make. the video card and input device variables in conf must be correct. It will take more than an hour to install many things. please wait. After installation :( xorg-x11 and driver related, please view the relevant part of the official website wiki, this seems to be omitted, do not remember) www.2cto.com eselect opengl set xorg-x11 if installed, you can restart the first try, after entering, run startx. this is a very exciting moment. if it shows that no xterm can be found, congratulations, the graphics driver is basically normal, naturally, there will be a variety of strange problems &...... & × ...... &...... % × &, Congratulations, you will have a deep and thorough understanding of the installation of the video card driver and the writing of xorg. conf in the next time. If it is the former, you can go back and install other things, such as xterm (it is better to restart after installation to see if it is normal. if it is not normal, then you can go back and handle the problem of the graphics card driver), openbox or even gnome and kde. Later. If the resolution of the latter or the xterm is incorrect, and the mouse and keyboard touchpad are not available, you have to wait for a while, although it is not difficult for you to install the kernel before, it is likely to make enough tangle or even give up. This is also the most confusing part of my installation process, and I can't recall it clearly, because I have reinstalled it four times in succession (for the first time, due to insufficient space for 2 GB, 2 and 3 times because of the X segment error, it is very tangled), and it is similar to the back-to-back graphics card driver, and the re-compilation is performed multiple times. If it is an X-segment error, check whether the error message is loaded with an so error. if so is an error, move the so to another location and try again. If it is not a segment error, it may be xorg. if the conf file has a problem, some drivers do not need this problem. by default, it does not exist. if you try to delete the file first, use X-configure to generate a new one and then use X-config xorg. conf. if new cannot be tried, it is likely that the kernel is not configured. this is often troublesome. you can read the wiki on the official website carefully. if not, go to the linuxsir and other forums to find or ask. After re-compiling the kernel, it is best to re-compile the X-related packages (there are many ......). Another possibility is that the driver you choose does not support your graphics card. for example, many old ati graphics cards cannot use the current closed source driver. In this way, you can try other methods, change/etc/make. conf, and then re-compile the related packages. There are other possibilities ...... If xterm can be entered, but the mouse and keyboard cannot be used, ensure/etc/make. if conf is correct, install the xf86-input-evdev if the xf86-input-keyboard xf86-input-mouse xf86-input-synaptics does not. conf is not correctly written. these packages may not be easy to use when installed. you may need to re-compile more packages. This problem should be well solved. If the resolution is not normal, first of all to confirm that the use of the xf86-video-vesa is not the driver (according to my process will not install to this package), if it is OK, the resolution is not normal. Then there is still a problem with the installation of the graphics card driver, and there is xorg. conf. find more on the Internet. If the problem of the video card driver cannot be solved for a while, it may take a long time or even wait until you give up, or you are willing to skip the graphic interface. Www.2cto.com if the above are normal, gentoo is very close to you. Next, we mainly deploy the desktop environment. we recommend lightweight ones (such as openbox, fluxbox, fvwm, dwm, and awesome) that can work with panels (such as tint2, bmp anel, and pypanel ), otherwise it will take a long time to compile. After installation, configure as needed. There are still no major problems involved: Drivers of sound cards, NICs, cameras, and other devices, as well as abnormal touchpad. If the TouchPad does not respond with a finger but the finger moves, try synclient TapButton1 = 1 if horizontal scrolling is not available: synclient HorizEdgeScroll = 1 for other issues, please query synclient usage. put the preceding command in the startup script, for example. xinitrc to ensure that it can be called before entering X. Sound Card Problems. if alsa is used, the kernel compiled by genkernel by default contains the alsa driver, which should be used normally. if it is not included, it will be a little troublesome. If the kernel contains an oss driver (an earlier version), it may also work normally, but the effect should be poor. if you can bear it, forget it. If none of www.2cto.com is available, you can choose to install the alsa or oss driver if the sound card supported by the kernel is enabled (alsa and oss are included in the menuconfig, and the previous layer should be selected, I personally recommend using oss4, which has a good sound quality and consumes less resources (I tried to reduce the cpu usage by half when using the kernel alsa than when using the mplayer mp3 ). However, it is not easy to install oss4 because it is not in the portage. you must use layman to connect to a foreign network. Alsa has not been installed. the wiki on the official website provides detailed instructions. If you want to install oss4 now, you can: emerge layman-a oss-overlay and then/etc/make. add "source/var/lib/layman/make" to the conf file. conf and then emerge oss or emerge oss-devel should be installed normally if the network is okay. Make sure that/usr/src/linux points to the current kernel and then/etc/init. d/oss start. it usually takes a few minutes to compile the kernel module. if it succeeds, you can use it. you can try osstest. if it fails, the problem will be troublesome, you may need to re-compile the kernel.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.