centos 6.5 apt centos安装dpkg
CentOS6.5安装的UEFI-GPT回退为MBR引导详解
我自己在服务器上装了centos 6.5系统,默认用的就是UEFI,没有注意可以只用GRUB,接着问题就出现了,我在服务器内安装了另外一块带grub启动系统的硬盘,
这个硬盘启动系统后,如果去掉此块硬盘,再重新启动,总是识别不出来centos 6.5的UEFI,这个可以通过启动主板的UEFI,然后用UEFI的命令:
mount fs0
fs0:
cd EFI
cd redhat
grub.efi
文件夹名称可能不准,大概是这样就可以手动启动系统了,另外还可以通过插入系统盘,upgrade一下就可以了,不用每次手动,也不会丢失数据,但是总觉得
这样不是很好。所以我就有了将UEFI-GPT回退为MBR的想法。
谷歌总是很牛x,所以我得到的结果是用gdisk,我启动另一个系统,挂载上centos 6.5的硬盘,然后按照google上的步骤:
1
Click Applications. Point to Accessories, then click Terminal. Input the following into Terminal: sudo fdisk-l
2
Press Enter to see the disk devices connected to the computer. The device with the asterisk next to it is the boot device. Write down the filename(for example,/dev/sda) assigned to the disk.
3
Input the following into Terminal: sudo apt-get install gdisk. Press Enter to install the partitioning tool to Ubuntu.
4
Input sudo gdisk into Terminal, then press Enter to run gdisk as a superuser. Input the name assigned to the boot device, then press Enter again.
5
Press r, then hit Enter, to switch to the recovery and transformation options. Press g, then press Enter, to select the option to convert GPT to MBR on Linux.
6
Press w, then press Enter, to convert GPT to MBR on the primary partitions. Press y, then Enter, to finalize and exit.
操作完成后,重启发现系统起不来,手动引导UEFI也不行了。
人类一思考,上帝就发笑,可是俺思考后发现还是能拯救的,
先提前说明,centos 6.5安装的时候,是分了三个区的,sda1-- UEFI所在区,是fat32,sda2--在fdisk-l下显示是NTFS(但实际上是ext4)的存储实际系统和数据的分区,
sda3-- swap分区。
我进入U盘启动的系统后,把sda1分区挂载到mnt目录内,发现在efi-redhat目录内,存在一个文件grub.conf,相比经常把玩系统的人都知道这个是干嘛的。就是有了这个,我才有了希望。
下面就是拯救的具体步骤:
1、mount上sda1,然后拷贝出grub.conf留作后用,切忌!然后umount
2、使用fdisk将sda1修改为83-linux,sda2也修改为83-linux,并且把sda1设置为启动分区。
大致命令流程如下: fdisk/dev/sda t 1 83 t 2 83 a 1
3、将sda1做成ext3,因为他是fat32
命令:mkfs.ext3/dev/sda1
4、mount上sda1和sda2,我这里sda1在/mnt,sda2在/sda2,给sda1安装grub,grub-install--root-directory=/mnt/dev/sda,这样grub就装好了
5、把备份的grub.conf拷贝到/mnt/boot/grub目录下,并且做一个软连接,menu.lst指向grub.conf,命令是:ln-s grub.conf menu.lst
6、将/sda2/boot/目录下在grub.conf内用到的文件,一个是kernel会用到的,一个是initrd会用到的,拷贝到/mnt/boot目录下
7、修改/mnt/boot/grub/grub.conf,把root(hd0, 1)这个改为root(hd0,0)
8、保存,sync,umount,卸载硬盘,重新启动就可以了。
CentOS65安装的UEFI
我自己在服务器上装了centos 6.5系统,默认用的就是UEFI,没有注意可以只用GRUB,接着问题就出现了,我在服务器内安装了另外一块带grub启动系统的硬盘,
这个硬盘启动系统后,如果去掉此块硬盘,再重新启动,总是识别不出来centos 6.5的UEFI,这个可以通过启动主板的UEFI,然后用UEFI的命令:
mount fs0
fs0:
cd EFI
cd redhat
grub.efi
文件夹名称可能不准,大概是这样就可以手动启动系统了,另外还可以通过插入系统盘,upgrade一下就可以了,不用每次手动,也不会丢失数据,但是总觉得
这样不是很好。所以我就有了将UEFI-GPT回退为MBR的想法。
谷歌总是很牛x,所以我得到的结果是用gdisk,我启动另一个系统,挂载上centos 6.5的硬盘,然后按照google上的步骤:
1
Click"Applications." Point to"Accessories," then click"Terminal." Input the following into Terminal: sudo fdisk-l
2
Press"Enter" to see the disk devices connected to the computer. The device with the asterisk next to it is the boot device. Write down the filename(for example,/dev/sda) assigned to the disk.
3
Input the following into Terminal: sudo apt-get install gdisk. Press"Enter" to install the partitioning tool to Ubuntu.
4
Input"sudo gdisk" into Terminal, then press"Enter" to run gdisk as a superuser. Input the name assigned to the boot device, then press"Enter" again.
5
Press"r," then hit"Enter," to switch to the recovery and transformation options. Press"g," then press"Enter," to select the option to convert GPT to MBR on Linux.
6
Press"w," then press"Enter," to convert GPT to MBR on the primary partitions. Press"y," then"Enter," to finalize and exit.
操作完成后,重启发现系统起不来,手动引导UEFI也不行了。
人类一思考,上帝就发笑,可是俺思考后发现还是能拯救的,
先提前说明,centos 6.5安装的时候,是分了三个区的,sda1-- UEFI所在区,是fat32,sda2--在fdisk-l下显示是NTFS(但实际上是ext4)的存储实际系统和数据的分区,
sda3-- swap分区。
我进入U盘启动的系统后,把sda1分区挂载到mnt目录内,发现在efi->redhat目录内,存在一个文件grub.conf,相比经常把玩系统的人都知道这个是干嘛的。就是有了这个,我才有了希望。
下面就是拯救的具体步骤:
1、mount上sda1,然后拷贝出grub.conf留作后用,切忌!然后umount
2、使用fdisk将sda1修改为83-linux,sda2也修改为83-linux,并且把sda1设置为启动分区。
大致命令流程如下: fdisk/dev/sda t 1 83 t 2 83 a 1
3、将sda1做成ext3,因为他是fat32
命令:mkfs.ext3/dev/sda1
4、mount上sda1和sda2,我这里sda1在/mnt,sda2在/sda2,给sda1安装grub,grub-install--root-directory=/mnt/dev/sda,这样grub就装好了
5、把备份的grub.conf拷贝到/mnt/boot/grub目录下,并且做一个软连接,menu.lst指向grub.conf,命令是:ln-s grub.conf menu.lst
6、将/sda2/boot/目录下在grub.conf内用到的文件,一个是kernel会用到的,一个是initrd会用到的,拷贝到/mnt/boot目录下
7、修改/mnt/boot/grub/grub.conf,把root(hd0, 1)这个改为root(hd0,0)
8、保存,sync,umount,卸载硬盘,重新启动就可以了。
如何在Ubuntu / CentOS 6.x上安装Bugzilla 4.4
1.安装依赖程序
安装Bugzilla相当简单。这篇文章特别针对Ubuntu 14.04和CentOS 6.5两个版本(不过也适用于更老的版本)。
为了获取并能在Ubuntu或CentOS系统中运行Bugzilla,我们要安装Apache网络服务器(启用SSL),MySQL数据库服务器和一些需要来安装并配置Bugzilla的工具。
要在你的服务器上安装使用Bugzilla,你需要安装好以下程序:
Perl(5.8.1或以上)
MySQL
Apache2
Bugzilla
Perl模块
使用apache的Bugzilla
正如我们所提到的本文会阐述Ubuntu 14.04和CentOS 6.5/7两种发行版的安装过程,为此我们会分成两部分来表示。
以下就是在你的Ubuntu 14.04 LTS和CentOS 7机器安装Bugzilla的步骤:
准备所需的依赖包:
你需要运行以下命令来安装些必要的包:
Ubuntu版本:
$ sudo apt-get install apache2 mysql-server libapache2-mod-perl2 libapache2-mod-perl2-dev libapache2-mod-perl2-doc perl postfix make gcc g++
CentOS版本:
$ sudo yum install httpd mod_ssl mysql-server mysql php-mysql gcc perl* mod_perl-devel
注意:请在shell或者终端下运行所有的命令并且确保你用root用户(sudo)操作机器。
2.启动Apache服务
你已经按照以上步骤安装好了apache服务,那么我们现在需要配置apache服务并运行它。我们需要用sodo或root来敲命令去完成它,我们先切换到root连接。
$ sudo-s
我们需要在防火墙中打开80端口并保存改动。
# iptables-I INPUT-p tcp--dport 80-j ACCEPT
# service iptables save
现在,我们需要启动服务:
CentOS版本:
# service httpd start
我们来确保Apache会在每次你重启机器的时候一并启动起来:
#/sbin/chkconfig httpd on
Ubuntu版本:
# service apache2 start
现在,由于我们已经启动了我们apache的http服务,我们就能在默认的127.0.0.1地址下打开apache服务了。
3.配置MySQL服务器
现在我们需要启动我们的MySQL服务:
CentOS版本:
# chkconfig mysqld on
# service start mysqld
Ubuntu版本:
# service mysql-server start
用root用户登录连接MySQL并给Bugzilla创建一个数据库,把你的mysql密码更改成你想要的,稍后配置Bugzilla的时候会用到它。
CentOS 6.5和Ubuntu 14.04 Trusty两个版本:
# mysql-u root-p
# password:(You'll need to enter your password)
# mysql> create database bugs;
# mysql> grant all on bugs.* to root@localhost identified by"mypassword";
#mysql> quit
注意:请记住数据库名和mysql的密码,我们稍后会用到它们。
4.安装并配置Bugzilla
现在,我们所有需要的包已经设置完毕并运行起来了,我们就要配置我们的Bugzilla。
那么,首先我们要下载最新版的Bugzilla包,这里我下载的是4.5.2版本。
使用wget工具在shell或终端上下载:
wget/pub/mozilla.org/webtools/bugzilla-4.5.2.tar.gz
你也可以从官方网站进行下载。
从下载下来的bugzilla压缩包中提取文件并重命名:
# tar zxvf bugzilla-4.5.2.tar.gz-C/var/www/html/
# mv-v bugzilla-4.5.2 bugzilla
注意:这里,/var/w/html/bugzilla/就是Bugzilla主目录.
现在,我们来配置buzilla:
# cd/var//html/bugzilla/
./checksetup.pl--check-modules
检查完成之后,我们会发现缺少了一些组件,我们需要安装它们,用以下命令即可实现:
# cd/var/www/html/bugzilla
# perl install-module.pl--all
这一步会花掉一点时间去下载安装所有依赖程序,然后再次运行checksetup.pl--check-modules命令来验证有没有漏装什么。
现在我们需要运行以下这条命令,它会在/var/www/html/bugzilla路径下自动生成一个名为localconfig的文件。
#./checksetup.pl
确认一下你刚才在localconfig文件中所输入的数据库名、用户和密码是否正确。
# nano./localconfig
# checksetup.pl
如果一切正常,checksetup.pl现在应该就成功地配置Bugzilla了。
现在我们需要添加Bugzilla至我们的Apache配置文件中。那么,我们需要用文本编辑器打开/etc/httpd/conf/httpd.conf文件(CentOS版本)或者/etc/apache2/apache2.conf文件(Ubuntu版本):
CentOS版本:
# nano/etc/httpd/conf/httpd.conf
Ubuntu版本:
# nano etc/apache2/apache2.conf
现在,我们需要配置Apache服务器,我们要把以下配置添加到配置文件里:
<VirtualHost*:80>
DocumentRoot/var/www/html/bugzilla/
</VirtualHost>
<Directory/var/www/html/bugzilla>
AddHandler cgi-script.cgi
Options+Indexes+ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes
</Directory>
接着,我们需要编辑.htaccess文件并用“#”注释掉顶部“Options-Indexes”这一行。
让我们重启我们的apache服务并测试下我们的安装情况。
CentOS版本:
# service httpd restart
Ubuntu版本:
# service apache2 restart
这样,我们的Bugzilla就准备好在我们的Ubuntu 14.04 LTS和CentOS 6.5上获取bug报告了,你就可以通过本地回环地址或你网页浏览器上的IP地址来浏览bugzilla了。