无法安装任何新软件包

无法安装任何新软件包

我一直在尝试安装 ruby​​ on rails,但总是失败。最后我进入了包管理器,它立即检测到一个问题并询问我是否要解决它。单击“是”后,它运行并给出了以下输出;再次失败。

我认为这与之前的 Wine 安装有关,因为我记得在“此”之后收到了关于无法升级的模糊警告。

有人能告诉我如何修复这个问题吗?除非摧毁整个系统。我花了很多时间让它恢复正常。我禁用了所有第三方存储库

ruby 安装日志:

christian@christian:~$ gem install rails
Fetching: nokogiri-1.6.7.2.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.1.0 directory.
christian@christian:~$ sudo gem install rails
[sudo] password for christian: 
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.1.0/gems/nokogiri-1.6.7.2/ext/nokogiri
/usr/bin/ruby2.1 -r ./siteconf20160303-13069-17ounbe.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.6.7.2/gem_make.out
christian@christian:~$ sudo apt-get install gcc mysql-devel ruby-devel rubygems
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'ruby' instead of 'rubygems'
E: Unable to locate package mysql-devel
E: Unable to locate package ruby-devel
christian@christian:~$ sudo apt-get install gcc ruby-dev rubygems
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'ruby' instead of 'rubygems'
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 gcc : Depends: cpp (>= 4:5.3.1-1ubuntu1) but 4:5.2.1-3ubuntu1 is to be installed
 kmod : Depends: libkmod2 (= 22-1ubuntu1) but 21-1ubuntu1 is to be installed
 ruby : Depends: ruby2.2 but it is not going to be installed
 ruby-dev : Depends: ruby2.2-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
christian@christian:~$ apt-get remove ruby
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
christian@christian:~$ sudo apt-get remove ruby
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 kmod : Depends: libkmod2 (= 22-1ubuntu1) but 21-1ubuntu1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
christian@christian:~$ uname -a
Linux christian 4.2.0-30-generic #36-Ubuntu SMP Fri Feb 26 00:58:07 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

软件包更新日志:

installArchives() failed: (Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 222876 files and directories currently installed.)
Removing linux-image-extra-3.19.0-53-generic (3.19.0-53.59) ...
depmod: FATAL: could not load /boot/System.map-3.19.0-53-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.19.0-53-generic /boot/vmlinuz-3.19.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.19.0-53-generic /boot/vmlinuz-3.19.0-53-generic
update-initramfs: Generating /boot/initrd.img-3.19.0-53-generic
WARNING: missing /lib/modules/3.19.0-53-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/3.19.0-53-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
sed: can't read /usr/share/plymouth/themes/ubuntu-text/ubuntu-text.plymouth: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 2.
update-initramfs: failed for /boot/initrd.img-3.19.0-53-generic with 2.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 2
dpkg: error processing package linux-image-extra-3.19.0-53-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
dpkg: dependency problems prevent configuration of kmod:
 kmod depends on libkmod2 (= 22-1ubuntu1); however:
  Version of libkmod2:amd64 on system is 21-1ubuntu1.

dpkg: error processing package kmod (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of initramfs-tools-core:
 initramfs-tools-core depends on kmod | module-init-tools; however:
  Package kmod is not configured yet.
  Package module-init-tools is not installed.

dpkg: error processing package initramfs-tools-core (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of initramfs-tools:
 initramfs-tools depends on initramfs-tools-core (= 0.122ubuntu3); however:
  Package initramfs-tools-core is not configured yet.

dpkg: error processing package initramfs-tools (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of plymouth:
 plymouth depends on initramfs-tools | dracut; however:
  Package initramfs-tools is not configured yet.
  Package dracut is not installed.

dpkg: error processing package plymouth (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-drivers-common:
 ubuntu-drivers-common depends on kmod | module-init-tools; however:
  Package kmod is not configured yet.

答案1

看看这个帖子:

https://askubuntu.com/a/647250/505633

它似乎解决了同样的问题。

相关内容