Jump to content

Recommended Posts

Posted

I'm getting the following errors when running "apt-get upgrade" by banana pi:

 

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... The following package was automatically installed and is no longer required:
  python-dialog
Use 'apt-get autoremove' to remove it.
Done
The following packages will be upgraded:
  certbot linux-image-next-sunxi python-acme python-certbot
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 15.9 MB/16.1 MB of archives.
After this operation, 1,021 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://apt.armbian.com/ jessie/main linux-image-next-sunxi armhf 5.27.170427 [15.9 MB]
Fetched 15.9 MB in 14s (1,102 kB/s)
(Reading database ... 56352 files and directories currently installed.)
Preparing to unpack .../linux-image-next-sunxi_5.27.170427_armhf.deb ...
Removing obsolete file 4.9.12-sunxi
Removing obsolete file uInitrd-4.9.12-sunxi
Unpacking linux-image-next-sunxi (5.27.170427) over (5.26) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-next-sunxi_5.27.170427_armhf.deb (--unpack):
 unable to create `/lib/modules/4.10.12-sunxi/kernel/drivers/media/rc/keymaps/rc-cinergy-1400.ko.dpkg-new' (while processing `./lib/modules/4.10.12-sunxi/kernel/drivers/media/rc/keymaps/rc-cinergy-1400.ko'): Read-only file system
dpkg: error while cleaning up:
 unable to remove newly-extracted version of `/lib/modules/4.10.12-sunxi/kernel/drivers/media/rc/keymaps/rc-cinergy-1400.ko': Read-only file system

This is followed by a few thousand lines of cleanup errors, followed by:

dpkg: error while cleaning up:
 unable to remove newly-extracted version of `/usr/lib/linux-image-next-sunxi/overlay/sun4i-a10-uart7.dtbo': Read-only file system
dpkg: error while cleaning up:
 unable E: Sub-process /usr/bin/dpkg returned an error code (2)
E: Failed to write temporary StateFile /var/lib/apt/extended_states.tmp

If I reboot it recovers, but if I try to run the upgrade again I get:

 

$ sudo apt-get upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
$ sudo dpkg --configure -a
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... The following package was automatically installed and is no longer required:
  python-dialog
Use 'apt-get autoremove' to remove it.
Done
The following packages will be upgraded:
  certbot linux-image-next-sunxi python-acme python-certbot
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/16.1 MB of archives.
After this operation, 1,021 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
(Reading database ... 56352 files and directories currently installed.)
Preparing to unpack .../linux-image-next-sunxi_5.27.170427_armhf.deb ...
Removing obsolete file 4.9.12-sunxi
Removing obsolete file uInitrd-4.9.12-sunxi
Unpacking linux-image-next-sunxi (5.27.170427) over (5.26) ...
dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/linux-image-next-sunxi_5.27.170427_armhf.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-image-next-sunxi_5.27.170427_armhf.deb (--unpack):
 cannot copy extracted data for './lib/modules/4.10.12-sunxi/kernel/drivers/net/usb/r8152.ko' to '/lib/modules/4.10.12-sunxi/kernel/drivers/net/usb/r8152.ko.dpkg-new': unexpected end of file or stream
run-parts: failed to open directory /etc/kernel/postrm.d: Input/output error
dpkg: error while cleaning up:
 subprocess new post-removal script returned error exit status 1
dpkg: error processing archive /var/cache/apt/archives/certbot_0.10.2-1~bpo8+1_all.deb (--unpack):
 unable to sync file '/var/lib/dpkg/tmp.ci//postinst': Input/output error
dpkg: error processing archive /var/cache/apt/archives/python-certbot_0.10.2-1~bpo8+1_all.deb (--unpack):
 unable to sync file '/var/lib/dpkg/tmp.ci//postinst': Input/output error
dpkg: error processing archive /var/cache/apt/archives/python-acme_0.10.2-1~bpo8+1_all.deb (--unpack):
 unable to sync file '/var/lib/dpkg/tmp.ci//postinst': Input/output error
dpkg: error: unable to sync new file '/var/lib/dpkg/status-new': Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

How can I fix this?

 

Thanks!

 

Rob

 

 

Posted
33 minutes ago, robnielsen said:

Read-only file system


There is something wrong with your file system - it looks like failed SD card.

Posted

I was able to get the other packages updated, and the unneeded ones removed, so the SD card is definitely not bad. Now I'm just stuck with a half-installed linux-image-next-sunxi package. If try and update I get the below errors. Is there any way to uninstall the half installed package?

$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0 B/15.6 MB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: error processing package linux-image-next-sunxi (--configure):
 package linux-image-next-sunxi is not ready for configuration
 cannot configure (current status `half-installed')
Errors were encountered while processing:
 linux-image-next-sunxi
E: Sub-process /usr/bin/dpkg returned an error code (1)

 

Posted

Your first log shows clearly that it was in readonly mode until you rebooted.

Once rebooted, system has done an fsck to recover it, but probably there are tons of files that are not recovered to their original state...

It is suggested to try a new SD installed from scratch !

Posted
33 minutes ago, robnielsen said:

so the SD card is definitely not bad

 

Nice, so since you were able to rule out hardware issues now you just need to find the reason why your OS decided to turn your filesystem into read-only (that usually happens if filesystem errors are too severe to be corrected on the fly). Anyone ever dealt more than once with this situation will suggest the same: your SD card is most probably the culprit, so better get a new one, test it thoroughly as outlined in the documentation with either F3 or H2testw use the latest backup from before the upgrade and try it again.

Posted

I created a /forcefsck and rebooted to force a fsck of / and it completed with no errors.  Running tune2fs even shows that the filesystem state is clean:

 

$ sudo tune2fs -l /dev/mmcblk0p1
tune2fs 1.42.12 (29-Aug-2014)
Filesystem volume name:   <none>
Last mounted on:          /
Filesystem UUID:          213dcf34-ef86-404d-953f-1c5ff176493f
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    journal_data_writeback user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              954720
Block count:              3811488
Reserved block count:     41349
Free blocks:              3388064
Free inodes:              892869
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      79
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8160
Inode blocks per group:   510
Flex block group size:    16
Filesystem created:       Sun Feb  5 14:55:01 2017
Last mount time:          Mon May  1 11:44:53 2017
Last write time:          Wed Dec 31 18:00:05 1969
Mount count:              23
Maximum mount count:      -1
Last checked:             Sun Feb  5 14:55:01 2017
Check interval:           0 (<none>)
Lifetime writes:          4046 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      b5982d4f-1ead-45ee-a7b1-848a58aca1e7
Journal backup:           inode blocks

 

Posted

Just to follow up on this. I replaced the SD card and then checked out the card that gave me errors. After reformatting the SD card and running H2testw it came back with the following:

Test finished without errors.
You can now delete the test files *.h2w or verify them again.
Writing speed: 32.2 MByte/s
Reading speed: 69.4 MByte/s
H2testw v1.4

So as I suspected, the SD card was not failing.

 

Rob

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines