由于工作换了,之前一直使用的是RH系列的Linux,新的工作里比较少用到Linux,并且用的也是Debian系列。总的来说,shell都基本是相通的,然后还是安装一个Webmin开始。
由于安装Debian是采用网络http的方式安装,只安装了基本的软件。在安装Webmin时遇到些小问题,如下是过程记录。
首先最简化安装,它连wget和sudo都是没有安装的,并且第一个账户也是低权限,连sudo都用不了,只能切换到root了。
这里我建立的账户是sysadmin ,主机暂且用HOSTNAME表示吧。
sysadmin@HOSTNAME:~$ su root //输入密码后进入# root用户
root@HOSTNAME:# apt-get install wget sudo vim //分别安装wget,sudo和我最爱的vim编辑器
root@HOSTNAME:# vim /etc/sudoer //修改sudoers的配置文件允許sysadmin使用sudo
# User privilege specification root ALL=(ALL:ALL) ALL sysadmin ALL=(ALL:ALL) ALL
如上添加 sysadmin ALL=(ALL:ALL) ALL 使sysadmin可以使用sudo的所有命令,注意保证安全哈!
保存好,退出root回到sysadmin用户。
搞定好后,就开始安装wemin,去官网下载deb包。
sudo dpkg --install webmin-current.deb
然后发现如下类似错误:
sysadmin@HOSTNAME:~$ dpkg --install webmin-current.deb
Selecting previously unselected package webmin.
(Reading database ... 22186 files and directories currently installed.)
Unpacking webmin (from webmin-current.deb) ...
dpkg: dependency problems prevent configuration of webmin:
webmin depends on libnet-ssleay-perl; however:
Package libnet-ssleay-perl is not installed.
webmin depends on libauthen-pam-perl; however:
Package libauthen-pam-perl is not installed.
webmin depends on libio-pty-perl; however:
Package libio-pty-perl is not installed.
webmin depends on apt-show-versions; however:
Package apt-show-versions is not installed.dpkg: error processing webmin (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
webmin
官网给出的方案是,手动运行以下命令,但依然会出错。如下命令安装依赖:
sysadmin@HOSTNAME:~$ sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpam-runtime is already the newest version.
perl is already the newest version.
python is already the newest version.
openssl is already the newest version.
openssl set to manually installed.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
apt-show-versions : Depends: libapt-pkg-perl (>= 0.1.21) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
不死心,运行 apt-get -f install apt-show-versions 强制安装,依旧出错。
然后,没辙。
爬文,很快就发现了网上朋友的解决方法,我也就是顺手一保留了!哈哈。
sysadmin@HOSTNAME:~$ sudo /etc/apt/sources.list
编辑sources.list文件,在最末尾添加以下内容:
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
保存后,需要安装webmin的GPG密钥,安装时请切换到root账户。
root@HOSTNAME:~# cd /root root@HOSTNAME:~# wget http://www.webmin.com/jcameron-key.asc root@HOSTNAME:~# apt-key add jcameron-key.asc
安装后就OK了。然后:
sysadmin@HOSTNAME:~$ sudo apt-get update sysadmin@HOSTNAME:~$ sudo apt-get install webmin
所有的依赖会自动解决。
搞定收工。