Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

SOLVED tmpfs for apt

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
korakios
Posts: 4
Joined: 2017-10-27 09:19

SOLVED tmpfs for apt

#1 Post by korakios »

Hi,
could anyone help me to use my RAM for apt cache?
I did many attempts , now my paranoid last configuration is
fstab

Code: Select all

tmpfs /var/cache/apt/partial tmpfs defaults,noatime,nodiratime 0 0
tmpfs /var/cache/apt/archives/ tmpfs defaults,noatime,nodiratime 0 0
tmpfs /var/cache/apt/archives/partial tmpfs defaults,noatime,nodiratime 0 0
rc.local

Code: Select all

mkdir -p /var/cache/apt/partial &
mkdir -p /var/cache/apt/archives &
mkdir -p /var/cache/apt/archives/partial &
but intalling packages fail , eg:

Code: Select all

Failed to fetch https://netcologne.dl.sourceforge.net/project/ubuntuzilla/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_56.0.2-0ubuntu1_amd64.deb  rename failed, Invalid cross-device link (/var/cache/apt/archives/partial/firefox-mozilla-build_56.0.2-0ubuntu1_amd64.deb -> /var/cache/apt/archives/firefox-mozilla-build_56.0.2-0ubuntu1_amd64.deb).
Last edited by korakios on 2017-10-28 09:25, edited 1 time in total.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: tmpfs for apt

#2 Post by p.H »

It seems that apt expects /var/cache/apt/archives and /var/cache/apt/archives/partial to be in the same filesystem, so that downloaded files can be moved from one to the other without copying the data.
Last edited by p.H on 2017-10-27 11:34, edited 1 time in total.

korakios
Posts: 4
Joined: 2017-10-27 09:19

Re: tmpfs for apt

#3 Post by korakios »

p.H wrote:It seems that apt expects var/cache/apt/archives and /var/cache/apt/archives/partial to be in the same filesystem.
Thanks @p.H,
Any workarounds?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: tmpfs for apt

#4 Post by p.H »

Don't mount /var/cache/apt/archives/partial as a separate tmpfs.

PS : Why do you set noatime and nodiratime on a tmpfs ? These options are mostly used with SSDs to reduce writes, but this is irrelevant with a tmpfs.

korakios
Posts: 4
Joined: 2017-10-27 09:19

Re: tmpfs for apt

#5 Post by korakios »

So , with

Code: Select all

tmpfs /var/cache/apt/archives/ tmpfs defaults  0 0
and

Code: Select all

mkdir -p /var/cache/apt/archives/partial &
I am ok?

PS. For noatime,nodiratime I was copy pasting from the net !

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: tmpfs for apt

#6 Post by p.H »

I guess so.
I don't know what /var/cache/apt/partial is used for though. Didn't even notice it existed.

Edit : I just checked that there is no such directory on my Debian system.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: tmpfs for apt

#7 Post by debiman »

putting archives in volatile storage seems illogical.

i need to ask, why do you want all this?

korakios
Posts: 4
Joined: 2017-10-27 09:19

Re: tmpfs for apt

#8 Post by korakios »

It works now as @p.H. suggested :)
I do it because I install uninstall many packages and I have an ssd.
Also it helps (10x faster) on Raspberry Pi using RAM instead of the sd card

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: tmpfs for apt

#9 Post by debiman »

please mark your thread SOLVED by editing the first post.

Post Reply