Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SaltStack state to install .deb package file and dependencies

I have a salt formula. On server I am using wkhtmltopdf tools. Ubuntu repo has this tool but it has an older version. I want to use the latest version.

I am doing the following to get it installed on minions manually.

$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
$ sudo apt-get install fontconfig libfontenc1 libjpeg-turbo8 libxfont1 x11-common xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils libxrender1
$ sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb

I can do cmd.run for all these commands. Is there any better way of doing any of these steps?

like image 459
bitkot Avatar asked Jul 22 '15 11:07

bitkot


People also ask

How do I install .deb packages?

Simply go to the folder where you downloaded the . deb file (usually the Downloads folder) and double-click on the file. It will open the software center, where you should see the option to install the software. All you have to do is to hit the install button and enter your login password.

What tool should you use to install .deb package file?

Install deb Files Using the GDebi Package Installer GDebi is a simple tool for installing local deb packages. Apart from installing the specified file, it also identifies all the required dependencies and automatically downloads and installs them using apt. Now you can use GDebi for installing deb packages.

Can dpkg install dependencies?

dpkg checks dependencies and will refuse to install a package whose dependencies aren't met, but it won't help you find and install those dependencies. You need a higher-level tool (e.g. aptitude, apt-get or dselect) for that.


1 Answers

You can specify a remote sources option in a Salt pkg state. You could try something like this

cat stuff.sls

my_pkgs:
  - pkg.installed:
    - pkgs:
      - fontconfig
      - libfontenc1
      - libjpeg-turbo8 
      - libxfont1
      - x11-common
      - xfonts-75dpi
      - xfonts-base
      - xfonts-encodings
      - xfonts-utils
      - libxrender1

install_wkhtmltox:
  pkg.installed:
    - sources:
      - wkhtmltox: http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
like image 78
Utah_Dave Avatar answered Oct 03 '22 04:10

Utah_Dave