×

ubuntu10 04源 linux

ubuntu linux 如何换源?怎样安装syslinux

admin admin 发表于2022-07-19 05:39:07 浏览89 评论0

抢沙发发表评论

ubuntu linux 如何换源

Linux ubuntu apt-get替换源方法:Ubuntu的默认来源是美国,因此下载特别慢。以下方法将用vi和gedit替换为国内源。以/etc/apt/sources..list替换为cn.archive。通过这种方式,使用APT-GET下载将通过APT-GET的使用中使用。

怎样安装syslinux


自动完成安装
syslinux-install_update脚本将自动安装Syslinux, 复制COM32模块到/boot/syslinux, 设置启动标识,安装到MBR.可自动根据softraid处理MBR和 GPT磁盘。
下面是安装过程:
1. 安装Syslinux
pacman -S syslinux
2. 确认/boot是否已经加载
3. 运行脚本syslinux-install_update ,参数使用 -i (安装) -a (设可启动标识) -m (安装到mbr)
/usr/sbin/syslinux-install_update -i -a -m
4. 修改配置文件 /boot/syslinux/syslinux.cfg
Note: For this to work with GPT, the gptfdisk package is needed as the backend for setting the boot flag.
手工完成安装
Note: 若你不知你所使用的分区表是使用什么 (MBR or GPT), 默认一般使用的是MBR分区表。大部分情况下,GPT将使用整个磁盘创建一个特殊的MBR-类型的分区(type 0xEE) ,使用下面命令可显示:
# fdisk -l /dev/sda
或者可以这样:
# sgdisk -l /dev/sda
若其非GPT磁盘,将显示 “ GPT: not present“.
Note: If you are trying to rescue an installed system with a live CD, be sure to chroot into it before executing these commands. If you do not chroot first, you must prepend all file paths (not /dev/ paths) with the mount point.
Make sure you have the syslinux package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.
# mkdir /boot/syslinux
# extlinux --install /boot/syslinux #run on a mounted directory (not /dev/sdXY)
/boot/syslinux/ is device /dev/sda1
MBR分区表
需要标识启动分区为激活状态.可用这些工具实现:fdisk, cfdisk, sfdisk, (g)parted.最后结果看起来是这样:
# fdisk -l /dev/sda
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 104447 51200 83 Linux
/dev/sda2 104448 625142447 312519000 83 Linux
安装到主启动卷区:
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/mbr.bin of=/dev/sda
GUID Partition Table aka GPT
Main article GUID_Partition_Table
Bit 2 of the attributes for the /boot partition need to be set.
# sgdisk /dev/sda --attributes=1:set:2
This would toggle the attribute legacy BIOS bootable on partition 1
Verify:
# sgdisk /dev/sda --attributes=1:show
1:2:1 (legacy BIOS bootable)
安装主启动卷区:
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda
重启
如果此时重启,会有提示,以确认是自动启动还是给出一个启动菜单,此时需要创建一个配置文件。
配置 syslinux
syslinux的配置文件 syslinux.cfg 必须和syslinux放在同一个目录下,在我们的例子中,是 ’/boot/syslinux/’
启动器将自动寻找这两个配置文件:syslinux.cfg (优先) 或者 extlinux.conf
补充:
Instead of LINUX, the keyword KERNEL can also be used. KERNEL tries to detect the type of the file, while LINUX always expects a Linux kernel.
TIMEOUT 的值是1/10秒,也就是50代表5秒
示例
比较简单的 Syslinux 配置
这是一个非常简单的配置,有启动提示,并且在5秒后自动启动第一个系统。
配置文件:
PROMPT 1
TIMEOUT 50
DEFAULT arch
LABEL arch
LINUX ../vmlinuz-linux
APPEND root=/dev/sda2 ro
INITRD ../initramfs-linux.img
LABEL archfallback
LINUX ../vmlinuz-linux
APPEND root=/dev/sda2 ro
INITRD ../initramfs-linux-fallback.img
若不想看到提示,设置PROMPT(显示时间)为0.
文本的启动菜单
把模块menu COM32复制到syslinux目录中,即可使用文本菜单:
# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/
若没有给/boot单独分区,且和/usr同一分区,那么,也可以仅使用一个软链接:
# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/
配置:
UI menu.c32
PROMPT 0
MENU TITLE Boot Menu
TIMEOUT 50
DEFAULT arch
LABEL arch
MENU LABEL Arch Linux
LINUX ../vmlinuz-linux
APPEND root=/dev/sda2 ro
INITRD ../initramfs-linux.img
LABEL archfallback
MENU LABEL Arch Linux Fallback
LINUX /vmlinuz-linux
APPEND root=/dev/sda2 ro
INITRD /initramfs-linux-fallback.img
p=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt.
图形化的启动菜单
把vesamenu COM32移入到syslinux目录中,可使用图形启动界面:
# cp /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/
若没有给/boot单独分区,且和/usr同一分区,那么,也可以仅使用一个软链接: :
# ln -s /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/
This config uses the same menu design as the Arch Install CD: syslinux.cfg
The background file can be found here: splash.png
Config:
UI vesamenu.c32
DEFAULT arch
PROMPT 0
MENU TITLE Boot Menu
MENU BACKGROUND splash.png
TIMEOUT 50
MENU WIDTH 78
MENU MARGIN 4
MENU ROWS 5
MENU VSHIFT 10
MENU TIMEOUTROW 13
MENU TABMSGROW 11
MENU CMDLINEROW 11
MENU HELPMSGROW 16
MENU HELPMSGENDROW 29
# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
MENU COLOR border 30;44 #40ffffff #a0000000 std
MENU COLOR title 1;36;44 #9033ccff #a0000000 std
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
MENU COLOR unsel 37;44 #50ffffff #a0000000 std
MENU COLOR help 37;40 #c0ffffff #a0000000 std
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
MENU COLOR msg07 37;40 #90ffffff #a0000000 std
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
LABEL arch
MENU LABEL Arch Linux
LINUX ../vmlinuz-linux
APPEND root=/dev/sda2 ro
INITRD ../initramfs-linux.img
LABEL archfallback
MENU LABEL Arch Linux Fallback
LINUX ../vmlinuz-linux
APPEND root=/dev/sda2 ro
INITRD ../initramfs-linux-fallback.img
Since Syslinux 3.84 vesamenu.c32 supports the “MENU RESOLUTION $WIDTH $HEIGHT“ directive.To use it, insert “MENU RESOLUTION 1440 900“ into your config for a 1440x900 resolution.The background picture has to have exactly the right resolution however as syslinux will otherwise refuse to load the menu.
Chainloading
If you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) thechain.c32 module to the syslinux folder (for details, see the instructions in the previous section). Then, create a section in the configuration file:
LABEL windows
MENU LABEL Windows
COM32 chain.c32
APPEND hd0 3
hd0 3 is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. For more details about chainloading, see .
If you have grub2 installed in your boot partition, you can chainload it by using:
LABEL grub2
MENU LABEL Grub2
COM32 chain.c32
append file=../grub/boot.img
This maybe required for booting from iso images.
使用内存测试 memtest
使用下面的 LABEL章节部分,可加载(需要安装软件包:memtest86+,否则不起作用):
LABEL memtest
MENU LABEL Memtest86+
LINUX ../memtest86+/memtest.bin
使用硬件探测工具HDT
HDT (Hardware Detection Tool) displays hardware information. Like before, the .c32 file has to be copied or symlinked from /boot/syslinux/.For pci info either copy or symlink /usr/share/hwdata/pci.ids to /boot/syslinux/pci.ids
LABEL hdt
MENU LABEL Hardware Info
COM32 hdt.c32
重启和关闭电源
Use the following sections to reboot or power off your machine.
LABEL reboot
MENU LABEL Reboot
COM32 reboot.c32
LABEL poweroff
MENU LABEL Power Off
COMBOOT poweroff.com

两个月能不能入门Linux找到运维工作

Linux在当前市场上有很好的发展前景。市场应用率很高。该公司的85%正在使用Linux系统。对于Linux学习,根据每个人的学习能力,进入时间也有所不同。总的来说,有适当的学习计划并制定适当的学习时间。仍然有可能在两个月内开始,但是很难确定您是否可以找到工作。学习时间太短。Learning Linux不仅了解Linux系统,而且还需要掌握更多知识。如果您想通过学习Linux操作和维护来找到工作,建议您参加培训,并开始在五个月内精通培训。Save时间和精力。-Linux