This is a static archive of the old Zorin Forum.

The information below may be outdated. Visit the new Zorin Forum here ›

If you have registered on the old forum, you will need to create an account on the new forum.

[SOLVED] Something wrong with package list? What's going on?

wombat140

Tue Apr 30, 2019 12:02:36 am

My new-a-few-weeks-ago laptop (HP Pavilion 15 running Zorin Lite OS 12.4) broke down rather spectacularly. It started to put up error messages about being unable to check for updates because it couldn't read its package list, or something like that - it's hard to remember the exact words of something you couldn't understand. Within a few days, it was unable to run any package-related commands at all (e.g. apt-get update or install), and then stopped booting at all.
I managed at length to get it running again by using a live USB to run a manual "fsck" check. (The check turned up literally dozens or errors, Is this normal for "fsck" or is it a Very Bad Sign?) But something's still not right. It put up the error message about being unable to check for updates again a couple of times. That's apparently stopped now, but when I try to start Synaptic Package Manager it says
Code:
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (21: Is a directory)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
E: _cache->open() failed, please report.

(I would report but I don't know who to)
and when I try to run "apt-get update" it says
Code:
Reading package lists... Done
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)


What is this, and is it treatable? Any help or information would be much appreciated, I'm worried that it's going to break down again any time!

Swarfendor437

Tue Apr 30, 2019 8:55:56 pm

There's a bit in here about checking error logs if at all possible while you still have a running system:

https://serverfault.com/questions/78664 ... -dangerous


First of all, you need to understand that with modern (journalized) filesystems, a system crash will not corrupt the filesystem and no fsck will be required at boot time.

Ext3, Ext4, ZFS, btrfs, xfs and all modern FS are 100% consistent after a crash or system reset.

Non journalized FS like ext2 or vfat are a big NOGO for a system rootfs.

Now, if your system requires a fsck at boot time, you should ask yourself: what was the reason for this in the first place?

You should investigate your kernel logs afterwards to find out, when and what did happen. You should also go back in time in the logs to find since when the error did start. You should check your disks with smartctl. Etc... If you need a fsck on a journalized fs, it is virtually certain that your hardware is failing, assuming the fs was not damaged by an admin (with block-level tools like dd) or by a bug.

So it is silly to use fsck to "fix" the problem without investigating and fixing the root cause (by replacing/upgrading the faulty hardware/firmware/software).

Doing a fsck, completing the boot and being happy is naive to say the least. Stating "I've had fsck work a greater percentage of the time than what you quote" is making me wondering what you mean with "fsck work". fsck may have brought back your fs to a consistent state by loosing some files and data in the process... Did you compare with a backup? Many people loose files or get file data corruption without noticing...

wombat140

Tue Apr 30, 2019 10:35:24 pm

Ah, now that's helpful information, thanks. (And I did suspect that something like that would be the case with fsck, that just running it again if something broke again would just chew up the system more.) But I'm not a very expert Linux user and don't know where to find the error logs or what to make of them if I did, can you point me to any instructions?

wombat140

Wed May 01, 2019 1:21:35 am

Actually, I've just realised that that terminal output I copied was with me forgetting to say sudo. The latest manifestations I get now, and remembering to use sudo, are:

sudo apt-get install produces this: https://pastebin.com/YE3RE47N

sudo apt-get install stretchly produces this:
Code:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package stretchly is not available, but is referred to by another package.  This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'stretchly' has no installation candidate

(Maybe that program really has been taken off the list since I last saw it - I was just using it as a test because it's small.)

sudo apt-get install uget produced this:
Code:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  fonts-lato libgdome2-0 liblockfile-bin liblockfile1 libtimezonemap-data
  libtimezonemap1
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed
  uget
0 to upgrade, 1 to newly install, 0 to remove and 154 not to upgrade.
Need to get 317 kB of archives.
After this operation, 1,313 kB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu xenial/universe amd64 uget amd64 2.0.2-1ubuntu1 [317 kB]
Fetched 317 kB in 1s (201 kB/s)
Selecting previously unselected package uget.
dpkg: unrecoverable fatal error, aborting:
files list file for package 'libpolkit-backend-1-0:amd64' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

Swarfendor437

Wed May 01, 2019 4:59:06 pm

Hi wombat140, I would take the opportunity now to make a backup of all your critical data. If you need to backup your settings remember to open home folder and press Ctrl+H to see all hidden files which includes settings for your apps. My best advice to you at this stage is to do a backup and do a fresh install. Stuff happens - I don't want to ban myself by mis-spelling Grit! :lol:

wombat140

Sat May 11, 2019 1:43:17 pm

For anyone else who has this problem for whatever reason, I'm posting to say that after a bit of searching the Web I managed to fix it using the instructions on this page https://ubuntuforums.org/showthread.php?t=1319791 It's a Python program that goes through all the package files and deliberately adds the dang newline characters at the end, so that Zorin will then recognise them. It sounds as if it shouldn't work, but it seems to. Had no further trouble at all with installing anything since then.

Sounds very difficult, but it actually isn't at all, yuo just copy and paste one set of magic words and save them as a text file with hte extension ".py", and then copy and paste the other set of magic words into the terminal to run it. I don't speak Python and didn't attempt to and I managed it.

It's still freezing occasionally, though (that was the other thing it was doing), and I have backed up, just to be on the safe side, thanks Swarfendor. (I just copied the entire "home" folder, hidden files and all, to a .tar.gz file intending to pick through it if and when anything goes wrong - I hope that'll cover it. Thanks for telling me that was where the program settings were kept, Swarfendor - that certainly makes backing up nice and straightforward, anyway, everything in one place.)