1

I am trying to install a python version on linux. But I am getting the following error:

Archives directory /var/cache/apt/archives/partial is missing

I have tried to create the file by :

mkdir -p /var/cache/apt/archives/partial

But i am getting the following:

mkdir: cannot create directory ‘/var/cache/apt’: File exists

Edit:

ls -l /var/cache/apt
lrwxrwxrwx 1 root root 32 Apr 17 20:00 /var/cache/apt -> /media/{dir_of_mounted_disc}/apt

How can I solve this?? Thank you!

Raffa
  • 32,237
  • Please add the output of ls -l /var/cache/apt ... It appears to be a symlink to a directory which is not normal ... What have you done? :-) – Raffa Apr 17 '23 at 21:27
  • @Raffa I edited as you request. – user357693 Apr 17 '23 at 21:29
  • 1
    It's indeed a symlink ... Remove it with sudo rm /var/cache/apt ... Then recreate the directory structure with sudo mkdir -p /var/cache/apt/archives/partial ... And see if that works ... However "I am trying to install a python version on linux" worries me that this is the least of your proplems – Raffa Apr 17 '23 at 21:31
  • seems like it worked!! thank you so much!! @Raffa – user357693 Apr 17 '23 at 21:33

1 Answers1

1

It appears that /var/cache/apt is a symlink to a directory ... Which is not normal ... Remove it with:

sudo rm /var/cache/apt

Then recreate the directory structure with:

sudo mkdir -p /var/cache/apt/archives/partial

However:

"I am trying to install a python version on linux"

worries me that this is the least of your problems ... Please be careful not to change/remove system python version ... See for example:

Terminal and other apps suddenly won't open

Raffa
  • 32,237