Unable to download or install vim-runtime_8.2.3995-1ubuntu2.16_all.deb using apt or directly from ubuntu packages site

Asked by Stephen Lanning

I am unable to install vim-runtime on my Ubuntu 22.04 LTS machine:

#sudo apt install vim-runtime
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  vim-runtime
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0 B/6835 kB of archives.
After this operation, 33.6 MB of additional disk space will be used.
(Reading database ... 92197 files and directories currently installed.)
Preparing to unpack .../vim-runtime_2%3a8.2.3995-1ubuntu2.16_all.deb ...
Adding 'diversion of /usr/share/vim/vim82/doc/help.txt to /usr/share/vim/vim82/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim82/doc/tags to /usr/share/vim/vim82/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.2.3995-1ubuntu2.16) ...
dpkg: error processing archive /var/cache/apt/archives/vim-runtime_2%3a8.2.3995-1ubuntu2.16_all.deb (--unpack):
 unable to install new version of '/usr/share/vim/vim82/compiler/rhino.vim': Permission denied
Removing 'diversion of /usr/share/vim/vim82/doc/help.txt to /usr/share/vim/vim82/doc/help.txt.vim-tiny by vim-runtime'
Removing 'diversion of /usr/share/vim/vim82/doc/tags to /usr/share/vim/vim82/doc/tags.vim-tiny by vim-runtime'
Errors were encountered while processing:
 /var/cache/apt/archives/vim-runtime_2%3a8.2.3995-1ubuntu2.16_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
# cd /var/cache/apt/archives/
# ls
libsodium23_1.0.18-1build2_amd64.deb linux-libc-dev_5.15.0-101.111_amd64.deb lock partial vim-runtime_2%3a8.2.3995-1ubuntu2.16_all.deb vim_2%3a8.2.3995-1ubuntu2.16_amd64.deb
root@7XVL6G3:/var/cache/apt/archives# sudo dpkg -i vim-runtime_2%3a8.2.3995-1ubuntu2.16_all.deb
(Reading database ... 92197 files and directories currently installed.)
Preparing to unpack vim-runtime_2%3a8.2.3995-1ubuntu2.16_all.deb ...
Adding 'diversion of /usr/share/vim/vim82/doc/help.txt to /usr/share/vim/vim82/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim82/doc/tags to /usr/share/vim/vim82/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.2.3995-1ubuntu2.16) ...
dpkg: error processing archive vim-runtime_2%3a8.2.3995-1ubuntu2.16_all.deb (--install):
 unable to open '/usr/share/vim/vim82/compiler/msbuild.vim.dpkg-new': Permission denied
Removing 'diversion of /usr/share/vim/vim82/doc/help.txt to /usr/share/vim/vim82/doc/help.txt.vim-tiny by vim-runtime'
Removing 'diversion of /usr/share/vim/vim82/doc/tags to /usr/share/vim/vim82/doc/tags.vim-tiny by vim-runtime'
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 vim-runtime_2%3a8.2.3995-1ubuntu2.16_all.deb

I get the same error when trying to install directly from http://security.ubuntu.com/ubuntu/pool/main/v/vim/vim-runtime_8.2.3995-1ubuntu2.16_all.deb:

# sudo dpkg -i vim-runtime_8.2.3995-1ubuntu2.16_all.deb
(Reading database ... 92197 files and directories currently installed.)
Preparing to unpack vim-runtime_8.2.3995-1ubuntu2.16_all.deb ...
Adding 'diversion of /usr/share/vim/vim82/doc/help.txt to /usr/share/vim/vim82/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim82/doc/tags to /usr/share/vim/vim82/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.2.3995-1ubuntu2.16) ...
dpkg: error processing archive vim-runtime_8.2.3995-1ubuntu2.16_all.deb (--install):
 unable to install new version of '/usr/share/vim/vim82/compiler/pyunit.vim': Permission denied
Removing 'diversion of /usr/share/vim/vim82/doc/help.txt to /usr/share/vim/vim82/doc/help.txt.vim-tiny by vim-runtime'
Removing 'diversion of /usr/share/vim/vim82/doc/tags to /usr/share/vim/vim82/doc/tags.vim-tiny by vim-runtime'
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 vim-runtime_8.2.3995-1ubuntu2.16_all.deb

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu vim Edit question
Assignee:
No assignee Edit question
Solved by:
Stephen Lanning
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Strange, especially the fact, that the failing file differs with each new attempt puzzles me.

What output do you receive for the commands

uname -a
lsb_release -crid
ls -ld /usr/share/vim/vim82/ /usr/share/vim/vim82/compiler/

Revision history for this message
Stephen Lanning (lannings) said :
#2

uname -a
Linux 7XVL6G3 4.4.0-19041-Microsoft #3996-Microsoft Thu Jan 18 16:36:00 PST 2024 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy

sudo ls -ld /usr/share/vim/vim82/ /usr/share/vim/vim82/compiler/
ls: cannot access '/usr/share/vim/vim82/': No such file or directory
ls: cannot access '/usr/share/vim/vim82/compiler/': No such file or directory

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Is this a WSL installation?

What output do you receive for the command

ls -ld /usr/share/vim

Revision history for this message
Stephen Lanning (lannings) said :
#4

It is wsl - I'm going to install Ubuntu 22.04 on my personal laptop and check for the existence of the /usr/share/vim folder.

Revision history for this message
Stephen Lanning (lannings) said :
#5

I seemed to have resolved the issue by the following:

apt remove vim
apt clean

I then installed vim-runtime first:

root@xxxxxx:/mnt/c/WINDOWS/system32# apt install vim-runtime
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libpython3.10 libsodium23 vim vim-common xxd
Suggested packages:
  ctags vim-doc vim-scripts
The following NEW packages will be installed:
  libpython3.10 libsodium23 vim vim-common vim-runtime xxd
0 upgraded, 6 newly installed, 0 to remove and 3 not upgraded.
Need to get 137 kB/10.8 MB of archives.
After this operation, 44.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 xxd amd64 2:8.2.3995-1ubuntu2.16 [55.0 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 vim-common all 2:8.2.3995-1ubuntu2.16 [81.5 kB]
Fetched 137 kB in 1s (209 kB/s)
Selecting previously unselected package xxd.
(Reading database ... 90195 files and directories currently installed.)
Preparing to unpack .../0-xxd_2%3a8.2.3995-1ubuntu2.16_amd64.deb ...
Unpacking xxd (2:8.2.3995-1ubuntu2.16) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../1-vim-common_2%3a8.2.3995-1ubuntu2.16_all.deb ...
Unpacking vim-common (2:8.2.3995-1ubuntu2.16) ...
Selecting previously unselected package libpython3.10:amd64.
Preparing to unpack .../2-libpython3.10_3.10.12-1~22.04.3_amd64.deb ...
Unpacking libpython3.10:amd64 (3.10.12-1~22.04.3) ...
Selecting previously unselected package libsodium23:amd64.
Preparing to unpack .../3-libsodium23_1.0.18-1build2_amd64.deb ...
Unpacking libsodium23:amd64 (1.0.18-1build2) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../4-vim-runtime_2%3a8.2.3995-1ubuntu2.16_all.deb ...
Adding 'diversion of /usr/share/vim/vim82/doc/help.txt to /usr/share/vim/vim82/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim82/doc/tags to /usr/share/vim/vim82/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.2.3995-1ubuntu2.16) ...
Selecting previously unselected package vim.
Preparing to unpack .../5-vim_2%3a8.2.3995-1ubuntu2.16_amd64.deb ...
Unpacking vim (2:8.2.3995-1ubuntu2.16) ...
Setting up libpython3.10:amd64 (3.10.12-1~22.04.3) ...
Setting up libsodium23:amd64 (1.0.18-1build2) ...
Setting up xxd (2:8.2.3995-1ubuntu2.16) ...
Setting up vim-common (2:8.2.3995-1ubuntu2.16) ...
Setting up vim-runtime (2:8.2.3995-1ubuntu2.16) ...
Setting up vim (2:8.2.3995-1ubuntu2.16) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
root@7XVL6G3:/mnt/c/WINDOWS/system32# apt get update
E: Invalid operation get
root@7XVL6G3:/mnt/c/WINDOWS/system32# apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.canonical.com/ubuntu jammy InRelease
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1562 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1075 kB]
Fetched 2865 kB in 3s (884 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

Revision history for this message
Stephen Lanning (lannings) said :
#6

I was pointed to the potential solution by the following old article which suggested installing the dependency package first:

https://bugs.launchpad.net/ubuntu/+source/vim/+bug/296324