使用命令时遇到问题:sudo dpkg-reconfigure $(dpkg -l | awk '{print $2}'|grep "^xserver"|tr '\n' ' ')

使用命令时遇到问题:sudo dpkg-reconfigure $(dpkg -l | awk '{print $2}'|grep "^xserver"|tr '\n' ' ')

我输入:

sudo dpkg-reconfigure $(dpkg -l | awk '{print $2}'|grep "^xserver"|tr '\n' ' ')

输出:

/usr/sbin/dpkg-reconfigure: xserver-xorg is broken or not fully installed

我输入:

sudo apt-get install xserver-xorg

它似乎有效。

我输入:

sudo dpkg-reconfigure $(dpkg -l | awk '{print $2}'|grep "^xserver"|tr '\n' ' ')

输出:

/usr/sbin/dpkg-reconfigure: xserver-common-lts-quantal is broken or not fully installed

我输入:

sudo apt-get install xserver-common-lts-quantal

这似乎也有效。

我输入:

sudo dpkg-reconfigure $(dpkg -l | awk '{print $2}'|grep "^xserver"|tr '\n' ' ')

输出:

/usr/sbin/dpkg-reconfigure: xserver-xorg is broken or not fully installed

有关我的系统以及我正在尝试做的事情的信息,请参考: Ubuntu 12.04 触摸板和键盘问题华硕 q500a

输出sudo dpkg -l | grep xserver-xorg-video::

ii  xserver-xorg-video-all                    1:7.6+12ubuntu2                             X.Org X server -- output driver metapackage
ii  xserver-xorg-video-ati                    1:6.14.99~git20111219.aacbd629-0ubuntu2     X.Org X server -- AMD/ATI display driver wrapper
ii  xserver-xorg-video-cirrus                 1:1.3.2-4build1                             X.Org X server -- Cirrus display driver
ii  xserver-xorg-video-fbdev                  1:0.4.2-4ubuntu2                            X.Org X server -- fbdev display driver
ii  xserver-xorg-video-intel                  2:2.17.0-1ubuntu4.4                         X.Org X server -- Intel i8xx, i9xx display driver
rc  xserver-xorg-video-intel-lts-quantal      2:2.20.9-0ubuntu2.2~precise1                X.Org X server -- Intel i8xx, i9xx display driver
ii  xserver-xorg-video-mach64                 6.9.0-1build2                               X.Org X server -- ATI Mach64 display driver
ii  xserver-xorg-video-mga                    1:1.4.13.dfsg-4build2                       X.Org X server -- MGA display driver
ii  xserver-xorg-video-neomagic               1:1.2.5-2build2                             X.Org X server -- Neomagic display driver
ii  xserver-xorg-video-nouveau                1:0.0.16+git20111201+b5534a1-1build3        X.Org X server -- Nouveau display driver
ii  xserver-xorg-video-openchrome             1:0.2.904+svn1050-1ubuntu0.1                X.Org X server -- VIA display driver
rc  xserver-xorg-video-openchrome-lts-quantal 1:0.3.1-0ubuntu1~precise3                   X.Org X server -- VIA display driver
ii  xserver-xorg-video-qxl                    0.0.16-2ubuntu0.1                           X.Org X server -- QXL display driver
ii  xserver-xorg-video-r128                   6.8.1-5build2                               X.Org X server -- ATI r128 display driver
ii  xserver-xorg-video-radeon                 1:6.14.99~git20111219.aacbd629-0ubuntu2     X.Org X server -- AMD/ATI Radeon display driver
ii  xserver-xorg-video-s3                     1:0.6.3-4build2                             X.Org X server -- legacy S3 display driver
ii  xserver-xorg-video-savage                 1:2.3.3-1ubuntu1                            X.Org X server -- Savage display driver
ii  xserver-xorg-video-siliconmotion          1:1.7.5-1build2                             X.Org X server -- SiliconMotion display driver
ii  xserver-xorg-video-sis                    1:0.10.3-3build2                            X.Org X server -- SiS display driver
ii  xserver-xorg-video-sisusb                 1:0.9.4-2build2                             X.Org X server -- SiS USB display driver
ii  xserver-xorg-video-tdfx                   1:1.4.3-4build2                             X.Org X server -- tdfx display driver
ii  xserver-xorg-video-trident                1:1.3.4-2build2                             X.Org X server -- Trident display driver
ii  xserver-xorg-video-vesa                   1:2.3.0-7build2                             X.Org X server -- VESA display driver
ii  xserver-xorg-video-vmware                 1:12.0.1-1ubuntu1.1                         X.Org X server -- VMware display driver
rc  xserver-xorg-video-vmware-lts-quantal     1:12.0.2+git.e5ac80d8-0ubuntu1~precise2     X.Org X server -- VMware display driver

seth@seth-Q500A:~$ sudo apt-get autoremove

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

seth@seth-Q500A:~$ sudo apt-get autoclean

Reading package lists... Done
Building dependency tree       
Reading state information... Done

seth@seth-Q500A:~$ sudo apt-get --purge remove

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

seth@seth-Q500A:~$ sudo dpkg-reconfigure $(dpkg -l | awk '{print $2}'|grep "^xserver"|tr '\n' ' ')

/usr/sbin/dpkg-reconfigure: xserver-common-lts-quantal is broken or not fully installed

seth@seth-Q500A:~$ sudo apt-get autoremove $(dpkg -l | awk '{print $2}'|grep "^xserver"| grep lts-quantal | tr '\n' ' ')

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package xserver-common-lts-quantal is not installed, so not removed
Package xserver-xorg-core-lts-quantal is not installed, so not removed
Package xserver-xorg-lts-quantal is not installed, so not removed
Package xserver-xorg-video-intel-lts-quantal is not installed, so not removed
Package xserver-xorg-video-openchrome-lts-quantal is not installed, so not removed
Package xserver-xorg-video-vmware-lts-quantal is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

答案1

您有残留包裹,可以通过以下方式删除:

  1. 打开Synaptic Package Manager并删除未安装或残留配置按照下列方法:

    • 你会得到一份清单剩余配置在窗格左侧。
    • 单击它可以获取右侧窗格中的所有残留包。
    • Ctrl通过+选择全部A,然后左键单击任意项check box并选择Mark for Complete Removal
    • 单击Apply顶部的按钮,移除后关闭synaptic并继续下一步。
  2. 在终端中执行以下命令:

    sudo apt-get update
    sudo apt-get autoremove
    sudo apt-get autoclean
    sudo apt-get --purge remove
    
  3. 现在尝试执行给出错误的原始命令,例如:

    sudo dpkg-reconfigure $(dpkg -l | awk '{print $2}'|grep "^xserver"|tr '\n' ' ')
    

    这次应该不会显示任何错误,您的所有问题都应该得到解决。如果仍然出现错误,请继续第四步。

  4. xserver::lts-quantal如果尚未删除,请执行此命令来删除软件包:

    sudo apt-get autoremove $(dpkg -l | awk '{print $2}'|grep "^xserver"| grep lts-quantal | tr '\n' ' ')
    

    该命令执行成功后,继续上面提到的所有3个步骤。

主命令这次应该可以成功执行。如果出现问题,请回复。

相关内容