I'm trying to autoinstall libpam-ldap with a script, but its not working properly. As now I have
apt-get install libpam-ldap -y
That's alright, but then it goes into another window after answering Y to a continue question, and inside there I have to fill out IPs and other stuff. How can I skip through this? How can I echo "Enter" so I can skip through this?
Please try following
sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq libpam-ldap
However using -qq is discouraged (check man apt-get) so try with '-q'
Anyways important for you is DEBIAN_FRONTEND=noninteractive
Related
I am writing bash script for vps server. I got this problem:
I need to install the build-essential package by script.
Command using in script:
eval 'apt-get install build-essential'
I coped with the problem (yes / no), found the -y switch for apt-get.
eval 'apt-get -y install build-essential'
But how to get around the second problem?:
(Enter the items or ranges you want to select, separated by spaces.)
Which services should be restarted?
I don't have to choose anything. A simple press of Enter would solve the problem!
So, any
echo, echo "\r", yes | apt-get -y install build-essential
does not working and my ideas are over!
I figured out how to solve this problem! The reboot service selection menu pops up on Ubuntu 22.04. I installed 20.04 and
and there is no menu. Might be useful for someone!
I'm trying to install wine on Ubuntu 16.04
but it gives me this error:
\E: Command line option --install-recommends is not understood in combination with the other options
could anyone tell me what to do to make this work?
the code is:
sudo apt-get --install-recommends winehq-devel
I think, you forgot the 'install' parameter.
What you wrote:
sudo apt-get --install-recommends winehq-devel
What you should've written (per apts syntax):
sudo apt-get install --install-recommends winehq-devel
Though I think apt still defaults to your wanted behavior.
So omitting the --install-recommends would've been fine:
sudo apt-get install winehq-devel
So, when running:
sudo apt-get install krb5-user
You are asked to enter the AD/LDAP domain. The problem is that I want this to be able to be run as a startup script for my machines. Is there any way to either pass the domain in as a parameter or disable the interaction and set up krb5-user after?
Thanks
For an unattended installation try setting DEBIAN_FRONTEND variable to noninteractive with:
export DEBIAN_FRONTEND=noninteractive
And pass the -y flag to apt-get:
apt-get install -y krb5-user
sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install [packagename]
This worked for me without updating the /etc/krb5.conf on Ubuntu 18.04.
I have a node.js application that I'm dockerizing, and it has a system dependency magicgraph. I cannot seem to be able to install it, I've tried apt-get in the Dockerfile like so RUN apt-get install --force-yes -y graphicsmagick and a few variations, but I keep getting the error The command '/bin/sh -c apt-get install --force-yes -y graphicsmagick' returned a non-zero code: 100.
Not sure how to fix this, is there a step tutorial on how to install gz files with the http://www.graphicsmagick.org/INSTALL-unix.html url maybe?
You need update list of available packages before install new one.
replace RUN apt-get install --force-yes -y graphicsmagick
to
RUN apt-get update && apt-get install -y graphicsmagick
if it don`t fix the issue show logs please
I am trying run a specific version of couchdb on travis-ci I do this by following the offical apt-get instructions from couchdb
Part of the installation is a prompt for what to do with an old configuration file. See the following:
Installing new version of config file /etc/logrotate.d/couchdb ...
Configuration file `/etc/couchdb/local.ini'
==> Deleted (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** local.ini (Y/I/N/O/D/Z) [default=N] ?
This causes travis-ci to hang and the build to fail.
Here is the travis-ci i have tried with and without the sudo rm and a handful of otherthings.
language: python
php:
- 2.7
install: "pip install -r requirements.txt"
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sudo apt-get install python-software-properties -y
- sudo add-apt-repository ppa:couchdb/stable -y
- sudo apt-get update -yq
- sudo apt-get remove couchdb couchdb-bin couchdb-common -yf
- sudo rm /etc/couchdb/local.ini
- sudo apt-get install -Vy couchdb
- sudo service couchdb start
before_script:
- curl -X PUT localhost:5984/njb_tests
script: python run-tests.py
You can see the different things i have tried by looking at my commit history:
https://github.com/Victory/notice-javascript-bugs/commits/master/.travis.yml
Hello my Frind its quite easy
I believe this command will do the trick
The 100% Working way no excuse no mercy!!
sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install couchdb
The Softer way probally working
export DEBIAN_FRONTEND=noninteractive
apt-get -o Dpkg::Options::="--force-confnew" install -y
The Right way
on shell or in code do
export DEBIAN_FRONTEND=noninteractive
then
sudo apt-get -q -y install couchdb
It will assume “yes” to everything (and do it quietly)
you need to watch Debconf is the name of the tool. That page should help you get going with everything you want to know. debconf man page
The expect script method
you get asked for package maintainer or a password you should set on apt-get do here a simple example from a server that asks to set password on apt-get install
To keep your existing password, leave this blank.
Password for SYSDBA:
then you run it with this script below to do the input
#!/usr/bin/expect
spawn dpkg-reconfigure firebird2.5-superclassic -freadline
expect "Enable Firebird server?"
send "Y\r"
expect "Password for SYSDBA:"
send "newpwd\r"
# done
expect eof
Working example for your case is
- /usr/bin/expect 'spawn sudo apt-get install -Vy couchdb \n expect "*** local.ini (Y/I/N/O/D/Z) [default=N] ?" \n send "Y\r"