Restore firefox saving downloads to /tmp
Asked Answered
S

5

7

As the result of upgrading to the 22.04 LTS, the behavior of ff's downloading has changed. I've read a few posts about this, but haven't seen anything relevant to solving my problem. Specifically, I want ff to download all files to /tmp/. In the Settings tab using the Browse method, I select /tmp/, but it the setting then shows /run/user/1000/doc/fa9c1cc2/tmp⁩. If I try using this set up, the downloads fail. If I use ~/Downloads, it works, but that's not what I want.

Can someone tell me how to ff to download files to /tmp/? Below is a screen shot of my about:config settings: screenshot of advanced settings

Shumway answered 19/8, 2022 at 13:16 Comment(0)
S
0

My solution was to switch to using a .deb rather than a snap. I did this by creating the file /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list with the code deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ jammy main and then downloading the priority of snaps over .debs following the instructions here: https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04

Shumway answered 26/12, 2023 at 5:35 Comment(1)
This no longer works! (nor does @dpeng's solution)Shumway
Z
6

I successfully achieved this by setting the following property in about:config :

browser.download.start_downloads_in_tmp_dir = true
Zhukov answered 19/11, 2022 at 8:16 Comment(2)
How did configure the download dir? When I do that and configure browser.download.dir manually (in about:config) to /tmp, the files seem to end up in nirvana: I can find them neither in /tmp nor in my home; I've no idea where they get saved to now.Rubbery
I didn't. browser.download.dir is default (click trash icon). What I wanted to go to /tmp is the multiple PDF files I read each day, but don't want to keep. Firefox saves them in /tmp and opens them with Okular. For others downloads, I configured Firefox to ask me what to do. It selects the last used directory, then ask me to confirm.Zhukov
B
2

There seems to be no "good" way to do this; this is a moderately fundamental limitation of snaps, and firefox has been repackaged as a snap in Jammy. However, two hack solutions from https://askubuntu.com/questions/1263843/how-to-allow-snap-applications-to-access-tmp-folder are:

  1. Bind-mount your tmp folder into your home directory:
mkdir /home/you/.tmp
sudo mount --bind /tmp /home/you/.tmp/

(can be made permanent via fstab)

  1. Auto-clear your downloads folder on startup: sudo crontab -e followed by adding @reboot rm -rf /home/you/downloads/* to the crontab.

Both of these solutions entail having an extra directory in your home folder :( It seems this is the design trend being followed by Ubuntu with the move to snaps and Wayland, trying to confine things and bring more security guarantees at the cost of flexibility. Such is life!

Brashy answered 20/8, 2022 at 18:48 Comment(4)
Thanks for the info. While when I first upgraded I was using a snap for firefox, but I actually removed that and installed via .deb. I will try your bind approach, nonetheless.Shumway
The firefox deb seems to just be a stub which pulls down the snap :(Brashy
Thanks for the heads up on that. I've removed the snap again and given it low priority using these OMGU instructionsShumway
From what I can tell, flatpak Firefox also has this problem, so unfortunately the issue is not restricted to snaps. :-/Schroth
L
1

For me, the simple way to solve this problem encountered on my new kubuntu 22.04 fresh install (packed with Firefox 110.0) was to enter about:config and change the original setting browser.download.lastDir to /home/x___y___z/Downloads, and then set to "true" the option browser.download.useDownloadDir, as show in the next image: browser-download-setting

Loralyn answered 2/8, 2023 at 0:3 Comment(2)
i am so sorry to report that the initial solution exposed in my comment is gone. machine reboot, Firefox reload, and again.. and again... same problem: all downloads directly goes to /run/user/1000/doc/.... pfff... and another problem detected: if you try to save the files to another location, and next, try to delete that "image" that appears (decide you or not) inside /run/user/1000/doc/... both files were gone... Amazing! Please remove, not only firefox. Remove ALL SNAP things! debugpoint.com/remove-snap-ubuntuLoralyn
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Kitchenmaid
S
0

In addition to Audrey's answer, I found an acceptable workaround by setting the downloads folder to /var/tmp instead.

Schroth answered 7/3, 2023 at 13:44 Comment(0)
S
0

My solution was to switch to using a .deb rather than a snap. I did this by creating the file /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list with the code deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ jammy main and then downloading the priority of snaps over .debs following the instructions here: https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04

Shumway answered 26/12, 2023 at 5:35 Comment(1)
This no longer works! (nor does @dpeng's solution)Shumway

© 2022 - 2024 — McMap. All rights reserved.