Crunch Bang上安装Google-chrome手记

背景

本来Crunch Bang安装完成后,提供了一个安装google-chrome的脚本,可以顺利完成chrom的安装,但是这次装完后,运行脚本安装Google-chrome,一直报错,一开始以为是地址被墙了或地址失败下载不到包,于是改为手动下载安装包安装,安装信息如下:

janl@janl-studio:~$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb
--2015-07-15 14:47:02--  https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb
Resolving dl.google.com (dl.google.com)... 203.208.49.168, 203.208.49.160, 203.208.49.163, ...
Connecting to dl.google.com (dl.google.com)|203.208.49.168|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 46750820 (45M) [application/x-debian-package]
Saving to: `google-chrome-stable_current_i386.deb'
100%[======================================>] 46,750,820   947K/s   in 48s     
2015-07-15 14:47:55 (958 KB/s) - `google-chrome-stable_current_i386.deb' saved [46750820/46750820]

下载完成,开如安装:

janl@janl-studio:~/tools$ sudo dpkg -i ./google-chrome-stable_current_i386.deb 
[sudo] password for janl: 
(Reading database ... 87769 files and directories currently installed.)
Unpacking google-chrome-stable (from .../google-chrome-stable_current_i386.deb) ...
dpkg: error processing ./google-chrome-stable_current_i386.deb (--install):
 cannot copy extracted data for './opt/google/chrome/chrome' to '/opt/google/chrome/chrome.dpkg-new': failed to write (No space left on device)
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for desktop-file-utils ...
Processing triggers for man-db ...
Processing triggers for menu ...
Errors were encountered while processing:
 ./google-chrome-stable_current_i386.deb

仔细看了一下错误信息原来是/opt空间不够, 汗。。。。

看来是受安装服务器的引响,把/挂载点留的空间太少了。。。。。。

然后就想,是不是脚本安装没有显示错误信息是不是也是这个原因啊,查看安装脚本,脚本找了半天才找到,原来在这:

  1. 先找到主菜单的定义文件:

janl@janl-studio:/etc/skel/.config/openbox$ ls
autostart  menu.xml  rc.xml

 menu.xml文件就是主菜单的定义文件了。(百度了半天才找到)

看看它的内容,找找安装脚本在哪里:整个wwwbrowsers的子菜单指向了一个叫cb-x-www-browser-pipemenu

<menu id="network" label="Network">
                    <menu execute="cb-x-www-browser-pipemenu" id="wwwbrowsers" label="WWW Browsers"/>

这是个可执行文件,在/usr/bin下。

看看它怎么写的

 if ! sudo apt-get install -y google-chrome-stable; then
            clear
            echo ""
            echo "  There was a problem installing Google Chrome."
            echo ""
            echo "  Hit any key to try again, or \"q\" to quit..."
            read -n1 a
            if [ "$a" = "q" ] || [ "$a" = "Q" ]; then
                clear
                exit 0
            else
                cb-x-www-browser-pipemenu --install-google-chrome
                exit 0
            fi
        else
            clear
            echo ""
            echo "  Google Chrome has been installed successfully."
            echo ""
            echo "  Hit any key to exit..."
            read -n1 a
            exit 0
        fi

前面还有一部分代码是验证网络和添加apt源的,关键就是一句:

sudo apt-get install -y google-chrome-stable

执行后,结果一样,原来google-chrome要安装在/opt下,/挂载点分的空间太少了,但是/usr下空间有很多。那就装在/usr下吧。

janl@janl-studio:~/tools$ sudo dpkg -i --instdir=/usr/local/chrome ./google-chrome-stable_current_i386.deb 
(Reading database ... 87769 files and directories currently installed.)
Unpacking google-chrome-stable (from .../google-chrome-stable_current_i386.deb) ...
dpkg: error processing ./google-chrome-stable_current_i386.deb (--install):
 error creating directory `.': No such file or directory
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: error while cleaning up:
 subprocess new post-removal script returned error exit status 2
Errors were encountered while processing:
 ./google-chrome-stable_current_i386.deb
janl@janl-studio:~/tools$ sudo dpkg -i --instdir=/usr/local/chrome google-chrome-stable_current_i386.deb 
(Reading database ... 87769 files and directories currently installed.)
Preparing to replace google-chrome-stable 43.0.2357.134-1 (using google-chrome-stable_current_i386.deb) ...
Unpacking replacement google-chrome-stable ...
dpkg: error processing google-chrome-stable_current_i386.deb (--install):
 error creating directory `.': No such file or directory
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: error while cleaning up:
 subprocess new post-removal script returned error exit status 2
Errors were encountered while processing:
 google-chrome-stable_current_i386.deb
janl@janl-studio:~/tools$ sudo dpkg -i --instdir=/usr/local/chrome google-chrome-stable_current_i386.deb
(Reading database ... 87769 files and directories currently installed.)
Preparing to replace google-chrome-stable 43.0.2357.134-1 (using google-chrome-stable_current_i386.deb) ...
Unpacking replacement google-chrome-stable ...
Setting up google-chrome-stable (43.0.2357.134-1) ...
dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: error processing google-chrome-stable (--install):
 subprocess installed post-installation script returned error exit status 2
Processing triggers for desktop-file-utils ...
dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: error processing desktop-file-utils (--install):
 subprocess installed post-installation script returned error exit status 2
Processing triggers for man-db ...
dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: error processing man-db (--install):
 subprocess installed post-installation script returned error exit status 2
Processing triggers for menu ...
dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: error processing menu (--install):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 google-chrome-stable
 desktop-file-utils
 man-db
 menu

报了很多错误,要求指定admindir,这个我没指定,先不管了,试试能不能用。

试了一下可以运行,这样把可执行文件做个连接放到/usr/bin就行了。

janl@janl-studio:/usr/local/chrome/opt/google$ sudo ln -s /usr/local/chrome/opt/google/chrome/google-chrome /usr/bin/

这样试一下,菜单变过来了,可以运行了。终于可以运行了。

补充一下:

安装的时候遇到:libxss.so.1 找不到的问题,是参照下面的方法解决的。

$ sudo dpkg -i google-chrome-stable_current_amd64.deb

不出意外会出现类似以下的错误提示,原因是因为依赖包的问题:

4、找到问题是因为没有安装这个libxss1的依赖包,我们可以用很简单的命令安装这个依赖包:

$ sudo apt-get install -f

5、完成上述操作,提示安装的时候输入y,回车继续安装,会出现下面这样的提示,Chome就应该安装好啦!

需要注意的是,安装软件之前确保你已经做过更新和升级如果没有更新到最新请参考以下更新:

$ sudo apt-get update

# 然后:

$ sudo apt-get upgrade


转载于:https://my.oschina.net/janl/blog/478990

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值