1

I am using Xubuntu 16.04 LTS.

When I run sudo apt-get dist-upgrade in the Terminal there isn't any problem.

After that, I want to copy the .deb file in /var/cache/apt/archives/ using Thunar file manager, but it doesn't exist.

See screenshot below:

enter image description here

But the locate command finds it:

enter image description here

The summary, file .deb is there in /var/cache/apt/archives/

I am confused, what’s wrong with my system? Could you help about this problem, please?

Hasan
  • 11
  • 1
    I think this is a permissions issue. Kindly edit your question and include the result of ll /var/cache/apt/archives/ – Parto Jun 27 '16 at 05:49
  • I can't add one image again, because my reputation is less of 10. I added the result of ls in my web on this link : http://feraproject.wc.lt/arsip/ls.png – Hasan Jun 27 '16 at 05:59
  • It was ll not ls - kindly try again and provide a link – Parto Jun 27 '16 at 06:13
  • I'am sorry for before. This is screenshot result of ll command : http://feraproject.wc.lt/arsip/ll.png – Hasan Jun 27 '16 at 06:22
  • Okay. Kindly run sudo updatedb then try the locate command again and tell me what you find. The updatedb commands clears the cache for the locate command. – Parto Jun 27 '16 at 06:32
  • 1
    yes. it works, the result of the locate command isn't same like before. Parto, the locate issue is solved. But, where is the deb file from sudo apt dist-upgrade exactly ? – Hasan Jun 27 '16 at 06:37
  • Did you run any other command between sudo apt-get dist upgrade and locate *.deb | grep "/var/cache/"? – Parto Jun 27 '16 at 06:45
  • Will write it as an answer then you can accept it. Let's fix the deb file issue first. – Parto Jun 27 '16 at 06:46

1 Answers1

2

The reason why you can't find the .deb file in the /var/cache/apt/archives/ directory is because it isn't there anymore.

The locate command finds it because locate does not look at the actual directory contents but works from a cache.

From man locate:

locate reads one or more databases prepared by updatedb(8) and writes file names matching at least one of the PATTERNs to standard output, one per line.

By default, locate does not check whether files found in database still exist (but it does require all parent directories to exist if the database was built with --require-visibility no). locate can never report files created after the most recent update of the relevant data‐base.

To update the database cache, run this command:

sudo updatedb

updatedb creates or updates a database used by locate(1). If the database already exists, its data is reused to avoid rereading directories that have not changed.

This should sort out the locate command finding files that no longer exist.


EDIT

For the /var/cache/apt/archives/ files not existing, maybe you run a clean command after running the sudo apt-get dist upgrade command.

Any of these commands will automatically clean out the /var/cache/apt/archives/ directory.

sudo apt-get clean
sudo apt-get autoclean

Source: Cleaning out var/cache/apt

Parto
  • 15,325
  • 24
  • 86
  • 117
  • @Hasan Thank you too. Kindly accept the answer by clicking on the check mark to mark this question as answered. You can also up vote it by clicking the up arrow. – Parto Jun 27 '16 at 12:06