ubuntu离线安装技巧

因某些原因,开发用的电脑不能联网,如果要离线在ubuntu上安装软件包,经常会因不清楚依赖关系而不知要下哪些包,但如果另有台可联网的电脑,用的ubuntu版本也和离线机一致,则可用如下方法解决:

比如离线ubuntu上报错:bison: Command not found

显然是没安装bison,在联网ubuntu上先:

$sudo apt-get autoremove bison

卸载掉之前已安装的bison,然后再:

$sudo apt-get install bison

自动安装bison,下载的deb包(bison_1%3a2.5.dfsg-2.1_i386.deb)存放在/var/cache/apt/archives下,将其copy到离线机,安装:

$sudo dpkg -i bison_1%3a2.5.dfsg-2.1_i386.deb

结果报错:

Selecting previously unselected package bison.
(Reading database ... 215538 files and directories currently installed.)
Unpacking bison (from bison_1%3a2.5.dfsg-2.1_i386.deb) ...
dpkg: dependency problems prevent configuration of bison:
 bison depends on libbison-dev (= 1:2.5.dfsg-2.1); however:
  Package libbison-dev is not installed.
dpkg: error processing bison (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db ...
Errors were encountered while processing:
 bison

提示没有安装libbison-dev,再在联网机上:

$sudo apt-get autoremove libbison-dev

$sudo apt-get install libbison-dev

同样在/var/cache/apt/archives下获得libbison-dev_1%3a2.5.dfsg-2.1_i386.deb,将其copy到离线机,安装:

$sudo dpkg -i libbison-dev_1%3a2.5.dfsg-2.1_i386.deb

然后再安装bison_1%3a2.5.dfsg-2.1_i386.deb即能成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值