I was trying to upgrade from Ubuntu 16.04 to Ubuntu 18.04 and ran into the following error:
Failed to lock /var/cache/apt/archives/lock
I searched google/askubuntu/ubuntu subreddits for any previous troubleshooting steps, and everything has failed so far (as a start, on Ask Ubuntu, this thread leads to a lot of different solutions that unfortunately didn't work.
Has anyone run into this problem going from 16.04 to 18.04,and have been able to resolve it?
My output after running the system upgrader is as such:
Fetching
Could not download the upgrades
The upgrade has aborted. Please check your Internet connection or
installation media and try again. All files downloaded so far have
been kept.
Failed to lock /var/cache/apt/archives/lock
Traceback (most recent call last):
File "/tmp/ubuntu-release-upgrader-6o5gq951/bionic", line 8, in <module>
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeMain.py", line 238, in main
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeController.py", line 1949, in run
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeController.py", line 1905, in fullUpgrade
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeController.py", line 1201, in doDistUpgradeFetching
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeController.py", line 1450, in abort
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/sourceslist.py", line 366, in restore_backup
File "/usr/lib/python3.5/shutil.py", line 236, in copy
copymode(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.5/shutil.py", line 138, in copymode
chmod_func(dst, stat.S_IMODE(st.st_mode))
PermissionError: [Errno 1] Operation not permitted: '/etc/apt/sources.list'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 109, in apport_excepthook
pr.add_proc_info(extraenv=['PYTHONPATH', 'PYTHONHOME'])
File "/usr/lib/python3/dist-packages/apport/report.py", line 544, in add_proc_info
self['ExecutableTimestamp'] = str(int(os.stat(self['ExecutablePath']).st_mtime))
PermissionError: [Errno 13] Permission denied: '/tmp/ubuntu-release-upgrader-6o5gq951/bionic'
Original exception was:
Traceback (most recent call last):
File "/tmp/ubuntu-release-upgrader-6o5gq951/bionic", line 8, in <module>
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeMain.py", line 238, in main
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeController.py", line 1949, in run
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeController.py", line 1905, in fullUpgrade
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeController.py", line 1201, in doDistUpgradeFetching
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/DistUpgradeController.py", line 1450, in abort
File "/tmp/ubuntu-release-upgrader-6o5gq951/DistUpgrade/sourceslist.py", line 366, in restore_backup
File "/usr/lib/python3.5/shutil.py", line 236, in copy
copymode(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.5/shutil.py", line 138, in copymode
chmod_func(dst, stat.S_IMODE(st.st_mode))
PermissionError: [Errno 1] Operation not permitted: '/etc/apt/sources.list'