Disable Firefox Updates Ubuntu Server - selenium

Ok so we downgraded Firefox 47 to previous stable version. BUT firefox keeps updating everyday to 47! Is there any way to completely stop firefox updates in Ubuntu server 14.04 (without GUI,only terminal) ?
We need versions <47 because Selenium has issues with Firefox version 47
Already Tried:
nano /usr/lib/firefox/defaults/pref/channel-prefs.js
nano /usr/lib/firefox/browser/defaults/preferences/nano syspref.js
nano /usr/lib/firefox/browser/defaults/preferences/user.js
commented out this: //pref("app.update.channel", "release"); and entered the following: pref("app.update.enabled", false); pref("app.update.silent", false);
I also created a profile folder in ~/.mozilla and added a text files with these: // turn off application updates: user_pref("app.update.enabled", false);
I also tried to block mozilla.org from iptables but that didn't help either.

To Hold firefox:
$ dpkg --get-selections | grep firefox
firefox install
firefox-locale-en install
firefox-locale-es install
unity-scope-firefoxbookmarks install
[13:17:03][root#robert]
[~]
$ echo firefox hold | sudo dpkg --set-selections
[13:17:20][root#robert]
[~]
$ dpkg --get-selections | grep firefox
firefox hold
firefox-locale-en install
firefox-locale-es install
unity-scope-firefoxbookmarks install
And to unhold:
[13:17:24][root#robert]
[~]
$ sudo apt-mark unhold firefox
Canceled hold on firefox.
[13:17:34][root#robert]
[~]
$ dpkg --get-selections | grep firefox
firefox install
firefox-locale-en install
firefox-locale-es install
unity-scope-firefoxbookmarks install

If your firefox is installed via dpkg or apt, you can do this:
echo "firefox hold" | sudo dpkg --set-selections
then verify the hold with :
dpkg --get-selections
And then you can try to update firefox with apt, normally it won't.

Related

How to downgrade chrome to version 87.0.4280.88 on Ubuntu 20.04?

I tried to find the package for above said version for chrome from this link but i'm unable to find it. Where can i find the said package and what would be the steps to downgrade chrome on my Ubuntu 20.04 machine ?
First of all uninstall your current version of Chrome
$ sudo apt-get purge google-chrome-stable
$ mv ~/.config/google-chrome/ ~/.config/google-chrome.bak/
Then install the preferred version choosing from here and replacing the ${CHROME_VERSION} on the code below with the version you need (in this case 87.0.4280.88-1 )
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb \
&& apt install -y /tmp/chrome.deb \
&& rm /tmp/chrome.deb

How do I install NPM on a Chromebook?

I installed NodeJS (via Linux terminal) but it doesn't seem to come bundled with NPM:
:~$ sudo apt-get install -y nodejs
:~$ node -v
:~$ v10.23.1
:~$ npm -v
:~$ -bash: npm: command not found
I have an Acer Chromebook R 13 with an ARM processor.
Installing NodeJs
sudo apt-get install curl gnupg -y
curl -sl https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get install -y nodejs
In my case I didn't have the install script for npm, so got it externally
curl -L https://npmjs.org/install.sh | sudo sh
nvm is recommended on the npmjs.com install page, and nvm has installation instructions of using an install script.
Open the Terminal app on Chromebook.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm install node
npm is now ready.
Due to trying to answer in comments i will attempt to give a complete answer here.
You need to first aquire the correct package for your architecture. As you have noted you are using the Acer Chromebook R13. This uses the MediaTek MT8173C processsor which utilizes ARMv8 instruction set.
following these commands should get you up and running.
#first, download the proper package for your architecture
mkdir myNodeJS
cd myNodeJS
wget https://nodejs.org/dist/v14.15.5/node-v14.15.5-linux-arm64.tar.xz
tar -xf node-v14.15.5-linux-arm64.tar.xz
cd node-v14.15.5-linux-arm64
cd bin
sudo cp node /usr/local/bin
cd ..
cd /lib/node_modules/npm/scripts
./install.sh
That should be it, if you have problems, you can resort to the first link that i sent for install instructions

Issues while implementing jenkins docker image+chrome+ruby unknown error: Chrome failed to start: crashed (Selenium::WebDriver::Error::UnknownError)

I am trying to setup jenkins using the official jenkins docker image.
Dockerfile
FROM jenkins/jenkins:lts
USER root
RUN apt-get update && apt install -y ruby-full
RUN apt-get install -y curl
RUN apt -y autoremove
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs
RUN apt-get install -y build-essential
RUN apt install -y wget
RUN gem install --no-ri --no-rdoc --format-executable rake
RUN gem install selenium-webdriver
RUN gem install bundler
RUN npm install -g node-mongo-seeds
#Permissions granted to jenkins user to do a gem install
RUN chown -R jenkins:jenkins /var/lib/gems
RUN apt-get install -y patch ruby-dev zlib1g-dev liblzma-dev
RUN chown -R jenkins:jenkins /usr/local/bin
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver
RUN apt-get install -y wget xvfb unzip
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
# Update the package list and install chrome
RUN apt-get update -y
RUN apt-get install -y google-chrome-stable
# Set up Chromedriver Environment variables
ENV CHROMEDRIVER_VERSION 2.35
ENV CHROMEDRIVER_DIR /chromedriver
RUN mkdir $CHROMEDRIVER_DIR
# Download and install Chromedriver
RUN wget -q --continue -P $CHROMEDRIVER_DIR "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip"
RUN unzip $CHROMEDRIVER_DIR/chromedriver* -d $CHROMEDRIVER_DIR
# Put Chromedriver into the PATH
ENV PATH $CHROMEDRIVER_DIR:$PATH
USER jenkins
While running the job the browser won't open and hit the localhost.
I tried hitting 'google.com' as well
google-chrome --headless --no-sandbox 'https://www.google.com'
still no success
Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"
[0531/130727.949511:ERROR:browser_process_sub_thread.cc(217)] Waited 17 ms for network service
I am not able understand why jenkins user not able to open the browser.
Google Chrome 74.0.3729.169
ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881)
ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
Jenkins 2.164.3
This error message...
unknown error: Chrome failed to start: crashed (Selenium::WebDriver::Error::UnknownError)
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.35
Release Notes of chromedriver=2.35 clearly mentions the following :
Supports Chrome v62-64
You are using chrome=74.0
Release Notes of ChromeDriver v74.0 clearly mentions the following :
Supports Chrome v74
So there is a clear mismatch between ChromeDriver v2.35 and the Chrome Browser v74.0
Solution
Upgrade ChromeDriver to current ChromeDriver v74.0 level.
Keep Chrome version at Chrome v74 level. (as per ChromeDriver v2.46 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Execute your #Test.
So as per #DebanjanB comment it resolved the driver issues but as per the new issue of chrome crashing I resolved it by just adding
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument('--no-sandbox')
d = Selenium::WebDriver.for :chrome, options: options

running selenium chrome browser in docker container

I am trying to use selenium chrome driver with docker. Unfortunately I can't get it working. When I do docker-compose up to launch the container it crashes with a
"container_name exited with code 1" error.
Using docker logs -t -f I was able to get the below error.
selenium.common.exceptions.WebDriverException:
Message: unknown error: Chrome failed to start: exited abnormally
I know that there have been other stack overflow posts about this issue, but all the solutions involve adding chrome options. I have already tried adding various chrome driver options without any luck. See code below.
options = webdriver.ChromeOptions()
options.add_argument('--proxy-server=socks5://localhost:9050')
options.add_argument('disable-infobars')
options.add_argument('--disable-extensions')
options.add_argument('--no-sandbox')
options.add_argument('--disable-setuid-sandbox')
options.add_argument('--headless')
options.add_argument('--start-maximized')
options.add_argument('window-size=1200x800')
options.add_argument('--disable-gpu')
driver = webdriver.Chrome(options=options, desired_capabilities=caps)
I have tried various combinations of the above code with no luck. I also tried commenting out the 'proxy=server' option and running the container, but I get the same error. When I run the normal python code it works without any errors.
Below is the relevant portion of my Dockerfile.
# Extra suff chrome driver needs
RUN apt-get install -y libglib2.0-0=2.50.3-2 \
libnss3=2:3.26.2-1.1+deb9u1 \
libgconf-2-4=3.2.6-4+b1 \
libfontconfig1=2.11.0-6.7+b1
# need this for chrome driver, not just ui
RUN apt-get install -y wget xvfb unzip
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
# Update the package list and install chrome
RUN apt-get update -y
RUN apt-get install -y google-chrome-stable
# Set up Chromedriver Environment variables
ENV CHROMEDRIVER_VERSION 2.19
ENV CHROMEDRIVER_DIR /chromedriver
RUN mkdir $CHROMEDRIVER_DIR
# Download and install Chromedriver
RUN wget -q --continue -P $CHROMEDRIVER_DIR "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip"
RUN unzip $CHROMEDRIVER_DIR/chromedriver* -d $CHROMEDRIVER_DIR
# Put Chromedriver into the PATH
ENV PATH $CHROMEDRIVER_DIR:$PATH
You're facing an incompatibility between the chromedriver and chrome browser versions being used.
Here are the two lines in question:
RUN apt-get install -y google-chrome-stable
The above means that you'll download the latest chrome browser.
ENV CHROMEDRIVER_VERSION 2.19
However, over here you're specifically using ChromeDriver v2.19, which is a really old version.
You'll need to use compatible versions, which can generally be found in the release notes:
http://chromedriver.chromium.org/downloads

Unable to find Wkhtmltopdf on this system. The report will be shown in html

When I try to print report of any invoice this error pops up so i downloaded wkhtmltopdf from this link,http://wkhtmltopdf.org/downloads.html
After that in settings->system parameter I created a key called wkhtmltopdf and its value as C:\Program Files (x86)\wkhtmltopdf but still I am not able to print reports in pdf format as this error is not going. (I am on windows and this is the image)
Try to set the key as 'webkit_path' and also check the version of the 'wkhtmltopdf', it should '0.12.2.1'.
If you are using the config file to run Odoo, then try to provide a parameter 'bin_path' and the value as the path to your 'wkhtmltopdf' file.
To install wkhtmltopdf in linux/unix operating system,
sudo wget https://downloads.wkhtmltopdf.org/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin
Finally restart odoo server
On windows platform. Try to add the following parameter in .conf file of your odoo version.
bin_path = C:/Program Files/wkhtmltopdf/bin
Don't forget to restart your odoo afterwards.
It works for me.
If some one is looking for the answer in ubuntu 20.04 then here is it:
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
If you get issue missing library libpng12-0:
sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt install libpng12-0
If you get issue missing library libssl1.0.0:
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.7_amd64.deb
sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.7_amd64.deb
then re-run this command:
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
Hope this helped.