zoukankan      html  css  js  c++  java
  • vagrant Ubuntu server 12.04 dpkg: dependency problems prevent configuration of python-gi

    Ubuntu server 12.04因为尝试安装过xfce,导致sudo apt-get install xxx 都会返回,如:

     1 vagrant@precise32:~$ sudo apt-get install phpunit
     2 Reading package lists... Done
     3 Building dependency tree       
     4 Reading state information... Done
     5 phpunit is already the newest version.
     6 The following packages were automatically installed and are no longer required:
     7   libclass-isa-perl libswitch-perl
     8 Use 'apt-get autoremove' to remove them.
     9 0 upgraded, 0 newly installed, 0 to remove and 336 not upgraded.
    10 1 not fully installed or removed.
    11 After this operation, 0 B of additional disk space will be used.
    12 Do you want to continue [Y/n]? y
    13 dpkg: dependency problems prevent configuration of python-gi:
    14  python-gi depends on python:any (>= 2.7.1-0ubuntu2).
    15 
    16 dpkg: error processing package python-gi (--configure):
    17  dependency problems - leaving unconfigured
    18 No apport report written because MaxReports is reached already
    19                                                               Errors were encountered while processing:
    20  python-gi
    21 E: Sub-process /usr/bin/dpkg returned an error code (1)

    的错误信息,而且安装不到xxx软件,参考 Error 'Depends: python:any. Unmet dependencies' after installing python 2.7.5 之后,运行了

    sudo apt-get install --reinstall python

    解决了这个问题。

    原来我已经安装了ant,phpunit的最新版本,总以为是没安装到,我才觉得我必须更新系统版本才能用,才出现了Ubuntu server 12.04升级到Ubuntu server 14.04.4 之后,出现vagnrat up之后,不能自动登录tty和virtualbox没有共享windows目录的问题,最终还是解决了,YES!

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    目前还是安装不到任何软件,我运行

    1 sudo apt-get dist-upgrade

    进行更新。

     ,运行之后,既然升级到14.04了。

    在重启vagrant之后,因为重写了/etc/sudoers,启动时,会显示

    因为看到最后的一句,我觉得是vagrant用户没有自动登录tty

    在参考

    1. ubuntu的sudo操作出现下面提示,怎么办?

    2. vagrant up : The following SSH command responded with a non-zero exit status. #1659

    3. Ubuntu新添加用户无法sudo问题的解决:修改sudoers

    4. Linux/Ubuntu sudo不用输入密码的方法 
    5. Win7在命令提示符(cmd.exe)中如何进行复制、粘贴工作

    我修改了 /etc/sudoers

    vagrant@precise32:~$ sudo su -
    [sudo] password for vagrant: 
    root@precise32:~# chmod a+w /etc/sudoers
    root@precise32:~# vi /etc/sudoers
    root@precise32:~# chmod a-w /etc/sudoers
    root@precise32:~# sudo shutdown -h now

    我将/etc/sudoers中的root下添加了vagrant ,将%admin ALL=(ALL) ALL,%sudo ALL=(ALL) ALL

    root    ALL=(ALL:ALL) ALL
    vagrant ALL=(ALL) NOPASSWD: ALL
    Defaults:vagrant !requiretty
    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) NOPASSWD: NOPASSWD: ALL
    
    # Allow members of group sudo to execute any command
    %sudo   ALL=(ALL) NOPASSWD: NOPASSWD: ALL

    重新vagrant up显示

     1 Failed to mount folders in Linux guest. This is usually because
     2 the "vboxsf" file system is not available. Please verify that
     3 the guest additions are properly installed in the guest and
     4 can work properly. The command attempted was:
     5 
     6 mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant |
     7 vagrant /vagrant
     8 mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant
     9 
    10 The error output from the last command was:
    11 
    12 stdin: is not a tty
    13 /sbin/mount.vboxsf: mounting failed with the error: No such device

    参考了:

    Vagrant can't mount shared folder in VirtualBox 4.3.10 #3341

    进行更新Ubuntu 14.04的linux-headers,linux-headers更新参考了:UBUNTU内核升级后,kernel headers问题的解决

    1 sudo apt-get install
    2 cd /usr/src
    3 apt-cache search linux-headers-$(uname -r)
    4 sudo apt-get install linux-headers-$(uname -r)

    然后关闭ubuntu 14.04, sudo shutdown -h now

    在运行vagrant up,就可以看到virtualbox 更新Virtualbox的增强组件了,欧耶!!

    参考链接:

    1. dpkg-reconfigure 重置Ubuntu包依赖

  • 相关阅读:
    ASP.net:Literal控件用法
    css如何自动换行对于div,p等块级元素(转)
    java ftp操作类
    java文件操作类
    geoserver图层显示
    java csv读取
    geoserver 源码编译(转)
    ArcGIS Engine 空间运算
    ArcMap操作技巧
    geoserver开发资料收集
  • 原文地址:https://www.cnblogs.com/fsong/p/5249527.html
Copyright © 2011-2022 走看看