0

I am using Ubuntu 16.04 and use sudo apt-get upgrade. After that, I use sudo apt-get -f install and I got the error below. Could you tell me how should I fix it? Thanks

Do you want to continue? [Y/n] y
dpkg: warning: files list file for package 'apport-symptoms' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apport' missing; assuming package has no files currently installed
(Reading database ... 290080 files and directories currently installed.)
Preparing to unpack .../python3-apport_2.20.1-0ubuntu2.14_all.deb ...
/var/lib/dpkg/info/python3-apport.prerm: 6: /var/lib/dpkg/info/python3-apport.prerm: py3clean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/python3-apport_2.20.1-0ubuntu2.14_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
Errors were encountered while processing:
 /var/cache/apt/archives/python3-apport_2.20.1-0ubuntu2.14_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Update: This is error when run the first command of Starnet

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:
 apport : Depends: python3-apport (>= 2.20.1-0ubuntu2.14) but 2.20.1-0ubuntu2.13 is to be installed
 apport-gtk : Depends: python3-apport (>= 2.20.1-0ubuntu2.14) but 2.20.1-0ubuntu2.13 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Then I run sudo apt-get -f install

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  python3-apport
Suggested packages:
  python3-launchpadlib
The following packages will be upgraded:
  python3-apport
1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
4 not fully installed or removed.
Need to get 0 B/79.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 

When I select yes, it still show the error as above

KimHee
  • 101

1 Answers1

1

Reinstalling python3-minimal, which supplies py3clean, may allow the process to complete. dist-upgrade may be needed if problems persist after the first four commands. See Why use apt-get upgrade instead of apt-get dist-upgrade?

sudo apt-get install --reinstall python3-minimal
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -f install

Given additional persistent errors a somewhat more aggressive fix may be warranted. Use either apt-get's mirror: method, or Command-line foo using netselect to change to another mirror. The LANET mirror is a likely candidate, but see the Official Archive Mirrors for Ubuntu for additional options. The mv command will move your current apt lists and current sources to /tmp where they can be restored if something goes wrong in following steps. apt-get clean command will clear any downloaded package archives. apt-get update will repopulate your apt lists based on your sources files. apt-get dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages.

mkdir -p /tmp/apt/lists
mkdir -p /tmp/etc/apt/source.list.d
sudo mv /var/lib/apt/lists/* /tmp/apt/lists/
cp /etc/apt/source.list.d/* /tmp/etc/apt/source.list.d/
cp /etc/apt/source.list /tmp/etc/apt/
# change mirrors with one of the method mentioned above then continue.
sudo apt-get clean
sudo apt-get update
sudo apt-get dist-upgrade
J. Starnes
  • 1,969
  • Very quick answer. Thanks. However, I got the error when run your first command and it still show above error as the update question – KimHee Jan 03 '18 at 09:19
  • Try to force installation with sudo dpkg -i --force-all /var/cache/apt/archives/python3-apport_2.20.1-0ubuntu2.14_all.deb and start over. – N0rbert Jan 03 '18 at 10:33
  • thanks. but i got error dpkg: error processing archive /var/cache/apt/archives/python3-apport_2.20.1-0ubuntu2.14_al‌​l.deb (--install): cannot access archive: No such file or directory Errors were encountered while processing: /var/cache/apt/archives/python3-apport_2.20.1-0ubuntu2.14_al‌​l.deb – KimHee Jan 03 '18 at 10:40
  • Hi J. Starnes. I did as your updated but I still have same error. The full error can be found at https://gist.github.com/John1231983/6c4c7f87fea6aa23bb4924a9c6b7aede – KimHee Jan 04 '18 at 02:16