ubuntu中安装DB2

1.在VM中安装Ubuntu 12.04
2.设置和本机相同段的IP,ping通。
windows主机和ubuntu虚拟机如果能通信,要求在同一网段上,而ubuntu是动态加载,需要手动更改成二者在同一网段上。网上好多更改网址的方法,经过验证,以下的方法是最好的
1. 配置静态ip地址
$sudo vi /etc/network/interfaces
原有内容只有如下两行:
auto loiface lo
 inet loopback

auto eth0  iface
eth0 inet static
address 192.168.0.33
gateway 192.168.0.1
netmask 255.255.255.0
手动设置DNS服务器:# vim /etc/resolv.conf添加如下内容(这点所有Linux发行版都通用):
nameserver 192.168.80.2
nameserver  8.8.8.8保存退出。注意:重启Ubuntu后发现又不能上网了,问题出在/etc/resolv.conf。重启后,此文件配置的dns又被自动修改为默认值。所以需要永久性修改DNS。方法如下:
# sudo vi  /etc/resolvconf/resolv.conf.d/base
nameserver 192.168.80.2
nameserver 8.8.8.8

重启networking服务使其生效:
# /etc/init.d/networking restart这样网络配置就永久生效。


开启SSHServer服务。
查看 service --status-all
开启:sudo apt-get install openssh-server
出现错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package openssh-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
解决方案:
sudo apt-get update
sudo apt-get install ssh-server
Success!

ps -e |grep ssh
如果看到sshd那说明ssh-server已经启动了。
如果没则可以这样启动:sudo /etc/init.d/ssh start
ssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。
然后重启SSH服务:
sudo /etc/init.d/ssh stop
sudo /etc/init.d/ssh start

今天在ubuntu进行ssh安装的时候,出现如下错误。
 
Reading package lists... Done
Building dependency tree... Done
Package ssh is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

 
这个问题的原因是ubuntu的/etc/apt/source.list中的源比较旧了,需要更新一下,更新方法:
$ sudo apt-get -y update
更新完毕之后,在使用apt-get就没有问题了。

参考地址:http://icesquare.com/wordpress/package-ssh-is-not-available-but-is-referred-to-by-another-package-this-may-mean-that-the-package-is-missing-has-been-obsoleted-or-is-only-available-from-another-source/

4.用SSH客户端将DB2文件上传到Ubutu上。
安装DB2

# cd /tmp
# tar zxvf  db2_v101_linuxx64_expc.tar.gz  

#cd  expc

# ./db2_install

安装时若提示找不到libaio.so  及libstdc++.so,则先下载安装相应的软件包。

正常的话 等待 几分钟 你就可以看到

Successfully 的信息了
5.继续安装。如果出现问题:
#strings /etc/hosts
The program 'strings' can be found in the following packages:
* binutils
* binutils-multiarch
Try: apt-get install <selected package> ==还是有错误,找不到binutils和binutils-multiarch
#apt-get install binutils
root@ubuntu:/tmp/expc# apt-get install binutils     ====安装binutils
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Suggested packages:
binutils-doc
The following NEW packages will be installed:
binutils
0 upgraded, 1 newly installed, 0 to remove and 58 not upgraded.
Need to get 2,643 kB of archives.
After this operation, 8,770 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main binutils amd64 2.22-6ubuntu1 [2,643 kB]
Fetched 2,643 kB in 12s (218 kB/s)                                             
Selecting previously unselected package binutils.
(Reading database ... 50079 files and directories currently installed.)
Unpacking binutils (from .../binutils_2.22-6ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up binutils (2.22-6ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
#apt-get install binutiks-multiarch                            =======安装binutiks-multiarch
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following NEW packages will be installed:
binutils-multiarch
0 upgraded, 1 newly installed, 0 to remove and 58 not upgraded.
Need to get 2,242 kB of archives.
After this operation, 7,520 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe binutils-multiarch amd64 2.22-6ubuntu1 [2,242 kB]
Fetched 2,242 kB in 6s (355 kB/s)                                             
Selecting previously unselected package binutils-multiarch.
(Reading database ... 50216 files and directories currently installed.)
Unpacking binutils-multiarch (from .../binutils-multiarch_2.22-6ubuntu1_amd64.deb) ...
Adding 'diversion of /usr/bin/nm to /usr/bin/nm.single by binutils-multiarch'
Adding 'diversion of /usr/bin/objdump to /usr/bin/objdump.single by binutils-multiarch'
Adding 'diversion of /usr/bin/objcopy to /usr/bin/objcopy.single by binutils-multiarch'
Adding 'diversion of /usr/bin/strings to /usr/bin/strings.single by binutils-multiarch'
Adding 'diversion of /usr/bin/strip to /usr/bin/strip.single by binutils-multiarch'
Adding 'diversion of /usr/bin/size to /usr/bin/size.single by binutils-multiarch'
Adding 'diversion of /usr/bin/ar to /usr/bin/ar.single by binutils-multiarch'
Adding 'diversion of /usr/bin/ranlib to /usr/bin/ranlib.single by binutils-multiarch'
Adding 'diversion of /usr/bin/addr2line to /usr/bin/addr2line.single by binutils-multiarch'
Adding 'diversion of /usr/bin/gprof to /usr/bin/gprof.single by binutils-multiarch'
Adding 'diversion of /usr/bin/readelf to /usr/bin/readelf.single by binutils-multiarch'
Setting up binutils-multiarch (2.22-6ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
# strings /etc/hosts                =======再一次执行strings
127.0.0.1       localhost
127.0.1.1       ubuntu
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
#./db2_install                        ============再一次尝试 安装DB2
Requirement not matched for DB2 database "Server" "". Version: "db10.1.0.2".
Summary of prerequisites that are not met on the current system:
DBT3514W  The db2prereqcheck utility failed to find the following 32-bit library file: "/dblibbpam.so*".


DBI1324W  Support of the db2_install command is deprecated. For
more information, see the DB2 Information Center.



Default directory for installation of products - /opt/ibmlib2/V10.1

***********************************************************
Install into default directory (/opt/ibmdb2/V10.1) ? [yes]
yes                        ================输入yes
等待安装。安装成功。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值