Running apt get in non interactive manner - ansible

I've a custom Debian package that has couple of questions like do I overwrite the config file?. I want to run the apt get command with all prompts being answered yes or y automatically. I can't find such an option for apt. Is this possible or do I need to change the Debian file's way of working?
Thanks in advance!!

you can try with expect module.

Related

Check if Chocolatey Package is Install or Upgrade

Is there any way, within the chocolateyinstall.ps1 file, to check if the process was triggered with the Upgrade command versus the Install command?
I tried using things like "choco list --lo" and "choco outdated", but those kept bringing up the package currently being installed - even if it hadn't yet been fully installed. I was hoping there was some sort of environment variable or something easy that I've overlooked.
Thanks!

Installing Sage on a Linux machine that has Anaconda causes an error, but would like to have both

So I ran into the same problem as this question asker's: https://ask.sagemath.org/question/35132/how-do-i-solve-this-installation-problem/
The solution seems to be effectively to delete the line
export PATH="/home/addem/anaconda3/bin:$PATH"
from the .bashrc file, but then I won't be able to use Anaconda. Is there any way to have access to both softwares on the same computer? This question seems to have been asked in a couple places but never with an answer.
One way to solve this problem would be to install SageMath via Conda.
Install instructions: https://wiki.sagemath.org/Conda
Or, instead of including the line
export PATH="/home/addem/anaconda3/bin:$PATH"
in your .bashrc, you could include this line
alias condapath='export PATH="/home/addem/anaconda3/bin:$PATH"'
and run condapath to change the PATH only when you want to use conda.
Or use an alias to set a conda-less PATH, to run before running Sage.

How can I check for daily updates for Ubuntu 16.04 via command line?

I do not know how to check for this via command line. I do know that you can do this for through the GUI; however, I want to implement this in my script. Anyone know how to do this? (I haven't found anything about this).
Ubuntu updates are managed through the apt package manager.
If you're looking to run daily updates you'll want to do something like:
sudo apt update # updates apt packages index
sudo apt upgrade # runs upgrades on all packages

Output a custom message during a dpkg package installation

I am trying to install create a simple .deb dpkg package.
I have seen multiple packages where, during installation, they output custom messages like Reboot after installation! or Clearing caches or (in the case of iOS) Thanks to [developer]!.
I can't seem to find any way to replicate this myself during installation of my package.
How do I output a custom message to the terminal while dpkg is installing my package?
You can do this by providing a postinst script to the package.
See section 7.6 What is a Debian preinst, postinst, prerm, and postrm script?

apt-get not working in Cygwin

I'm something of a Cygwin newbie, so that might be the problem, but I'm trying to install a package using apt-get and it's telling me there's no such command. I installed it on Windows 7.
The best I got from searching other questions here and across the net was that you need to install something specific (or run the setup file to update) when initially installing, but it's not clear to me what I need to install or run or whatever.
How do I install or update my cygwin to be able to use apt-get or, alternatively, how would I install packages with the basic, default installation of Cygwin that I already have?
Thank you.
You can use this : apt-cyg
It works just like apt-get in terms of command line arguments, but you will be using apt-cyg instead.
Refer https://github.com/transcode-open/apt-cyg It did helped me.
To install apt-cyg package.
Cygwin's official installer is setup.exe. This is the "proper" way to install Cygwin packages. There's a project called cyg-apt but it's not officially part of Cygwin.

Resources