0

I use selenium on Python 2.7 and it only works if using version 2.53.6 associated with firefox 45.0.2. Any other versions, returns this error or similar:

selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /tmp/tmpaQkqJv If you specified a log_file in the FirefoxBinary constructor, check it for details.

Every day there is at least one Firefox update, and I tried many solutions to avoid this, but I still need to run

sudo apt-get install firefox=45.0.2+build1-0ubuntu1

I created a cron job to do it for me, but for some reason, it just doesn't work.

Here is the shell file

#!/bin/bash
PATH=/opt/someApp/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin 

sudo apt-get install --allow-downgrades -y  firefox=45.0.2+build1-0ubuntu1 >> logs2.txt

Here are some of the cron jobs I tried (from crontab -e):

32 * * * * root (apt-get install --allow-downgrades -y  firefox=45.0.2+build1-0ubuntu1)
32 * * * * /home/stefanolinux/firefox_update.sh >> firefox_update_works.txt

as root:

@hourly apt-get install firefox=45.0.2+build1-0ubuntu1
32 * * * * apt-get install --allow-downgrades -y  firefox=45.0.2+build1-0ubuntu1

more frustrating is to see that the same script works without any downgrade needed (both for firefox and selenium) when running from Windows. Any suggestion?

user270911
  • 91
  • 1
  • 13

2 Answers2

0

You can stop the updates. Choose options from the menu

enter image description here select "Advanced" -> "Update" tab -> "Never check for update"

enter image description here And downgrade FireFox one last time.

Guy
  • 46,488
  • 10
  • 44
  • 88
  • unfortunately I already tried that solution, but it didn't work. In any case, it wouldn't solve the problem when I run the script remotely and I need to work through terminal – user270911 Dec 09 '16 at 08:53
0

solved using sudo apt-mark hold firefox

user270911
  • 91
  • 1
  • 13