My ubuntu couldn’t update because of linux-header missing. Ubuntu 16.04 LTS.
To tell the result first, “sudo apt-get clean, update, upgrade” solved this problem.
upgrade called grub install prompt, so perhaps avoiding this is better,
because grub configuration potentially makes boot error problem.
Below is just a memo about what happened while getting to solve the package broken error.
Check if you are using third party repositories. If so disable them, since they are a common source of problems.
Furthermore run the following command in a Terminal: apt-get install -f
Transaction failed: The package system is broken
The following packages have unmet dependencies:
linux-headers-4.4.0-139-generic: Depends: linux-headers-4.4.0-139 but it is not installed
linux-headers-4.4.0-139-lowlatency: Depends: linux-headers-4.4.0-139 but it is not installed
Below sentences are about -f option of apt-get install .( apt -f, –fix-broken option)
Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution. If packages are specified, these have to completely correct the problem. The option is sometimes necessary when running
APT for the first time; APT itself does not allow broken package dependencies to exist on a system. It is possible that a system’s dependency structure can be so corrupt as to require manual intervention (which usually means using dpkg –remove to eliminate some of the offending packages). Use of this option together with -m may produce an error in some situations. Configuration Item:
Is linux-header api of c?
error message of desktop icon:
Broken count > 0.
Error message of “sudo apt-get install linux-headers-4.4.0-139”
This situation needed “sudo apt-get clean” command.
masa@em-p:~$ sai linux-headers-4.4.0-139
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
linux-headers-4.15.0-34 linux-headers-4.15.0-34-generic linux-headers-4.4.0-137 linux-headers-4.4.0-137-lowlatency
linux-headers-4.4.0-138-generic linux-image-4.15.0-34-generic linux-image-4.4.0-137-lowlatency
Use ‘sudo apt autoremove’ to remove them.
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
42 not fully installed or removed.
Need to get 0 B/10.1 MB of archives.
After this operation, 71.0 MB of additional disk space will be used.
(Reading database … 486606 files and directories currently installed.)
Preparing to unpack …/linux-headers-4.4.0-139_4.4.0-139.165_all.deb …
Unpacking linux-headers-4.4.0-139 (4.4.0-139.165) …
dpkg-deb (subprocess): cannot copy archive member from ‘/var/cache/apt/archives/linux-headers-4.4.0-139_4.4.0-139.165_all.deb’ to decompressor pipe: failed to read (Input/output error)
dpkg-deb (subprocess): decompressing archive member: lzma error: unexpected end of input
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/linux-headers-4.4.0-139_4.4.0-139.165_all.deb (–unpack):
cannot copy extracted data for ‘./usr/src/linux-headers-4.4.0-139/arch/mips/include/asm/octeon/cvmx-npi-defs.h’ to ‘/usr/src/linux-headers-4.4.0-139/arch/mips/include/asm/octeon/cvmx-npi-defs.h.dpkg-new’: unexpected end of file or stream
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
I tried these commands as I wrote first,
“sudo apt-get clean” (clear cache)
“sudo apt-get update” and “sudo apt-get upgrade”
These operations resolved Ubuntu 16.04: Package broken error this time.
apt, apt-get, and aptitude commands are very frequently used commands (also dpkg), but it takes time to accustom with. These are similar but different commands.
APT is an acronym for Advanced Package Tool.
apt-get’s design is different from apt, but their are using same library libapt-pkg as their base.
aptitude is a GUI project of APT.
In natural English language, aptitude means “natural ability or skill, especially in learning” by longman modern English-english dictionary.
Maybe using apt rather than apt-get is better.