在 Ubuntu 12.04 中安裝更新或從軟體中心安裝更新時,出現錯誤訊息

在 Ubuntu 12.04 中安裝更新或從軟體中心安裝更新時,出現錯誤訊息

我有一台新電腦,有足夠的磁碟空間。有一個固態啟動磁碟機和一個用於放置檔案的普通磁碟。

因此,發生的主要事情是,在過去的幾周里,每當我嘗試安裝更新或從軟體中心下載時,我都會收到更新,對於軟體

有人知道這個問題是怎麼回事嗎?

我最近確實使用 My Unity 更改了顯示屏上的一些設置,幾週前我終於弄清楚如何通過執行sudo chown user /mnt/data0.我還禁用了全域選單。這可能是導致問題的原因嗎?順便說一句,我也遇到了一些問題,顯示卡無法保存我的設置,因此每次打開計算機時我都必須重置它們,即使它們在前幾週已保存。

$ sudo dpkg --configure -a 

Setting up initramfs-tools (0.99ubuntu13.1) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.2.0-39-generic (3.2.0-39.62) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-39-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-39-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-39-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-39-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-39-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-39-generic; however:
  Package linux-image-3.2.0-39-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.39.47); however:
  Package linux-image-generic is not configured yet.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-38-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-38-generic with 1.
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-3.2.0-39-generic
 linux-image-generic
 linux-generic
 initramfs-tools

此時我們看到一個彈出窗口,上面寫著:

Low Disk Space
The volume "boot" has only 0 bytes disk space remaining.  You can free up disk space by removing unused programs or files, or by moving files to another disk or partition.

這對我們來說確實沒有意義。當我們查看文件系統時,我們很難確定我們正在查看哪個驅動器,但是當我們查看標記為書籤的驅動器/我們認為是固態驅動器然後進入啟動時,我們會看到不是很多文件都不是很大——當然不值得120 GB。

關於驅動器:當我們大約一個月前購買電腦時,我們讓公司安裝了 Ubuntu。他們根據我們的要求將 120 GB 固態硬碟用作啟動磁碟機。 3 T 驅動器似乎已安裝,但安裝 Ubuntu 的人並沒有讓我們看到 3 TB 驅動器,並且我們被拒絕查看它,直到我使用了上面原始訊息中提到的修復程序,以便能夠保存到驅動器。 (不過,我似乎仍然被拒絕查看“Lost and Found”資料夾。)然後,我將固態硬碟上保存的檔案複製到 3T 驅動器,並刪除了從固態硬碟保存的檔案。固態硬碟上仍然有很大的空間(當然另一個硬碟也是如此)。

據我們所知,收到錯誤訊息的軟體和更新似乎實際上正在安裝(我不知道是否正確),但每次都會產生很長的錯誤訊息。它是否嘗試安裝到兩個磁碟或類似的東西並產生錯誤訊息,因為 3 T 磁碟機未正確安裝/安裝?

對於我們所表現出的任何無知,我們深表歉意。我正在嘗試學習所有這些,但仍然不太了解檔案系統,而且我當然是 Ubuntu 新手。

2013 年 4 月 12 日更新:嗨,Nikki。非常感謝您嘗試幫助我們。好吧,我們最終能夠嘗試實施這些步驟,但失敗了。我們得到以下內容(我必須刪除其中一些內容才能使其適合此訊息):

user@ubuntu:~$ sudo apt-get clean && sudo apt-get autoremove
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:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is installed
E: Unmet dependencies. Try using -f.
user@ubuntu:~$ uname -r
3.2.0-38-generic
user@ubuntu:~$ dpkg --list | grep linux-image
ii  linux-image-3.2.0-29-generic           3.2.0-29.46                             Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-37-generic           3.2.0-37.58                             Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-38-generic           3.2.0-38.61                             Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF  linux-image-3.2.0-39-generic           3.2.0-39.62                             Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF  linux-image-3.2.0-40-generic           3.2.0-40.64                             Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iU  linux-image-generic                    3.2.0.39.47                             Generic Linux kernel image
user@ubuntu:~$ sudo apt-get purge linux-image-3.2.0.29-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'linux-image-3.2.0-29-generic' for regex 'linux-image-3.2.0.29-generic'
Note, selecting 'linux-image-3.2.0-29-generic-pae' for regex 'linux-image-3.2.0.29-generic'
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
user@ubuntu:~$ sudo apt-get purge linux-image-3.2.0.37-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'linux-image-3.2.0-37-generic' for regex 'linux-image-3.2.0.37-generic'
Note, selecting 'linux-image-3.2.0-37-generic-pae' for regex 'linux-image-3.2.0.37-generic'
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
user@ubuntu:~$ sudo apt-get purge linux-image-3.2.0.39-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'linux-image-3.2.0-39-generic' for regex 'linux-image-3.2.0.39-generic'
Note, selecting 'linux-image-3.2.0-39-generic-pae' for regex 'linux-image-3.2.0.39-generic'
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed
 linux-image-generic : Depends: linux-image-3.2.0-39-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
user@ubuntu:~$ sudo apt-get purge linux-image-3.2.0.40-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'linux-image-3.2.0-40-generic' for regex 'linux-image-3.2.0.40-generic'
Note, selecting 'linux-image-3.2.0-40-generic-pae' for regex 'linux-image-3.2.0.40-generic'
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
user@ubuntu:~$ sudo apt-get purge linux-image-generic
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:
 linux-generic : Depends: linux-image-generic (= 3.2.0.39.47) but it is not going to be installed
                 Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
user@ubuntu:~$ sudo update-grub2
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-40-generic
Found linux image: /boot/vmlinuz-3.2.0-39-generic
Found linux image: /boot/vmlinuz-3.2.0-38-generic
Found initrd image: /boot/initrd.img-3.2.0-38-generic
Found linux image: /boot/vmlinuz-3.2.0-37-generic
Found initrd image: /boot/initrd.img-3.2.0-37-generic
Found linux image: /boot/vmlinuz-3.2.0-29-generic
Found initrd image: /boot/initrd.img-3.2.0-29-generic
done
user@ubuntu:~$ sudo dpkg --configure -a
Setting up initramfs-tools (0.99ubuntu13.1) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.2.0-40-generic (3.2.0-40.64) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-39-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-40-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-40-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-40-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-40-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-headers-generic (= 3.2.0.39.47); however:
  Version of linux-headers-generic on system is 3.2.0.40.48.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
Setting up linux-image-3.2.0-39-generic (3.2.0-39.62) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-40-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-39-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-39-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-39-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-39-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-39-generic; however:
  Package linux-image-3.2.0-39-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-38-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-38-generic with 1.
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-3.2.0-40-generic
 linux-generic
 linux-image-3.2.0-39-generic
 linux-image-generic
 initramfs-tools
user@ubuntu:~$ 

NIKKI: DF 指令和您的最後一個指令的輸出:

user@ubuntu:~$ df
Filesystem      1K-blocks      Used  Available Use% Mounted on
/dev/sda2        19222656   5545404   12700716  31% /
devtmpfs         16425020         8   16425012   1% /dev
none              3291972       996    3290976   1% /run
none                 5120         0       5120   0% /run/lock
none             16459852       736   16459116   1% /run/shm
/dev/sda1           90195     89356          0 100% /boot
/dev/sda5        88370448  33795068   50086420  41% /home
/dev/sdb1      2884283608 184345072 2553425284   7% /mnt/data0
/dev/sdc1       488145616 404062976   84082640  83% /media/KAREN_~1DRI
user@ubuntu:~$ dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
[sudo] password for user: 
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:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

答案1

在你的貼箱中我注意到它說

軟體包 linux-image-generic 尚未配置。

嘗試這樣做,然後升級

sudo dpkg --configure -a

sudo apt-get install -f

sudo apt-get 更新 && sudo apt-get 升級

繼續:

看來您的空間已用完。你有嘗試過跑步嗎

sudo apt-get clean && sudo apt-get autoremove

然後我建議您通過執行來檢查現在正在運行哪個內核

uname -r

記住它,然後檢查你安裝的所有內核

dpkg --list | grep linux-image 

然後刪除除您現在正在運行的核心之外的所有其他核心。

sudo apt-get purge linux-image-x.x.x.x-generic

刪除所有運行後

sudo update-grub2 

最後但並非最不重要的一點是重複上述步驟配置內核

更新 2013 年 4 月 13 日

您好,不用擔心,我們仍然有很多方法可以嘗試解決這個問題。你能給我df終端命令的輸出嗎?另請嘗試在終端機中運行此命令,看看它是否能夠刪除“不需要的內核”

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

答案2

我在筆記本上解決這個問題的方法:

  1. 使用先前的核心映像 linux-image-3.2.0-39 啟動筆記型電腦
  2. 卸載最新核心:sudo apt-get purge linux-image-3.2.0-40-generic
  3. 卸載舊核心:鏡像sudo apt-get purge linux-image-3.2.0-35-generic
  4. 更新您的系統:sudo apt-get update && sudo apt-get upgrade
  5. 更新引導程式:update-grub2

相關內容