SOLVED tmpfs for apt

Kernels & Hardware, configuring network, installing services

SOLVED tmpfs for apt

Postby korakios » 2017-10-27 09:51

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.
korakios
 
Posts: 4
Joined: 2017-10-27 09:19

Re: tmpfs for apt

Postby p.H » 2017-10-27 11:31

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.
p.H
 
Posts: 160
Joined: 2017-09-17 07:12

Re: tmpfs for apt

Postby korakios » 2017-10-27 11:34

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?
korakios
 
Posts: 4
Joined: 2017-10-27 09:19

Re: tmpfs for apt

Postby p.H » 2017-10-27 11:43

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.
p.H
 
Posts: 160
Joined: 2017-09-17 07:12

Re: tmpfs for apt

Postby korakios » 2017-10-27 11:50

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 !
korakios
 
Posts: 4
Joined: 2017-10-27 09:19

Re: tmpfs for apt

Postby p.H » 2017-10-27 11:52

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.
p.H
 
Posts: 160
Joined: 2017-09-17 07:12

Re: tmpfs for apt

Postby debiman » 2017-10-28 08:54

putting archives in volatile storage seems illogical.

i need to ask, why do you want all this?
User avatar
debiman
 
Posts: 1539
Joined: 2013-03-12 07:18

Re: tmpfs for apt

Postby korakios » 2017-10-28 09:12

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
korakios
 
Posts: 4
Joined: 2017-10-27 09:19

Re: tmpfs for apt

Postby debiman » 2017-10-28 09:17

please mark your thread SOLVED by editing the first post.
User avatar
debiman
 
Posts: 1539
Joined: 2013-03-12 07:18


Return to System configuration

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable