How to make apt-get accept new config files in an unattended install of debian from Repo
Clash Royale CLAN TAG#URR8PPP
up vote
16
down vote
favorite
I am writing a script for a unattended install of a package that is in our repo, it is a software package with one of Debian's marked config files.
Is there any option that I can pass to apt-get
/aptitude
so that it accepts the new config files?
Basically I need an apt
/aptitude
equivalent of dpkg --force-confnew
I need to answer the following question posed while apt-get
is installing with a Y
Configuration file ``/opt/application/conf/XXX.conf`'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
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 : background this process to examine the
The default action is to keep your current version.
Additional Info:
Also, I am passing the sudo
password in a pipe to execute the command
echo "mysudopass"|sudo -S apt-get mypackage
This is flagging an error in installation when the installation is at the config interactive phase.
I am on Ubuntu 10.04
apt version: apt 0.7.25.3
Why I cannot use dpkg
: These Debians are to be installed from Repo and I don't have local Debians on my machine
software-installation apt aptitude
add a comment |Â
up vote
16
down vote
favorite
I am writing a script for a unattended install of a package that is in our repo, it is a software package with one of Debian's marked config files.
Is there any option that I can pass to apt-get
/aptitude
so that it accepts the new config files?
Basically I need an apt
/aptitude
equivalent of dpkg --force-confnew
I need to answer the following question posed while apt-get
is installing with a Y
Configuration file ``/opt/application/conf/XXX.conf`'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
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 : background this process to examine the
The default action is to keep your current version.
Additional Info:
Also, I am passing the sudo
password in a pipe to execute the command
echo "mysudopass"|sudo -S apt-get mypackage
This is flagging an error in installation when the installation is at the config interactive phase.
I am on Ubuntu 10.04
apt version: apt 0.7.25.3
Why I cannot use dpkg
: These Debians are to be installed from Repo and I don't have local Debians on my machine
software-installation apt aptitude
serverfault.com/questions/48724/â¦
â Alastair Irvine
Mar 2 '16 at 6:59
add a comment |Â
up vote
16
down vote
favorite
up vote
16
down vote
favorite
I am writing a script for a unattended install of a package that is in our repo, it is a software package with one of Debian's marked config files.
Is there any option that I can pass to apt-get
/aptitude
so that it accepts the new config files?
Basically I need an apt
/aptitude
equivalent of dpkg --force-confnew
I need to answer the following question posed while apt-get
is installing with a Y
Configuration file ``/opt/application/conf/XXX.conf`'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
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 : background this process to examine the
The default action is to keep your current version.
Additional Info:
Also, I am passing the sudo
password in a pipe to execute the command
echo "mysudopass"|sudo -S apt-get mypackage
This is flagging an error in installation when the installation is at the config interactive phase.
I am on Ubuntu 10.04
apt version: apt 0.7.25.3
Why I cannot use dpkg
: These Debians are to be installed from Repo and I don't have local Debians on my machine
software-installation apt aptitude
I am writing a script for a unattended install of a package that is in our repo, it is a software package with one of Debian's marked config files.
Is there any option that I can pass to apt-get
/aptitude
so that it accepts the new config files?
Basically I need an apt
/aptitude
equivalent of dpkg --force-confnew
I need to answer the following question posed while apt-get
is installing with a Y
Configuration file ``/opt/application/conf/XXX.conf`'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
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 : background this process to examine the
The default action is to keep your current version.
Additional Info:
Also, I am passing the sudo
password in a pipe to execute the command
echo "mysudopass"|sudo -S apt-get mypackage
This is flagging an error in installation when the installation is at the config interactive phase.
I am on Ubuntu 10.04
apt version: apt 0.7.25.3
Why I cannot use dpkg
: These Debians are to be installed from Repo and I don't have local Debians on my machine
software-installation apt aptitude
software-installation apt aptitude
edited Sep 3 '16 at 21:44
Jeff Schaller
34.6k952115
34.6k952115
asked Oct 18 '11 at 2:23
Raman
18114
18114
serverfault.com/questions/48724/â¦
â Alastair Irvine
Mar 2 '16 at 6:59
add a comment |Â
serverfault.com/questions/48724/â¦
â Alastair Irvine
Mar 2 '16 at 6:59
serverfault.com/questions/48724/â¦
â Alastair Irvine
Mar 2 '16 at 6:59
serverfault.com/questions/48724/â¦
â Alastair Irvine
Mar 2 '16 at 6:59
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
19
down vote
You can pass dpkg
parameters to apt-get
like this
apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install pkgname1 pkgname2 ...
With --force-confdef
if old config files still exist, they won't get overridden. So you probably won't use it, I'm just documenting it for others.
sudo
will not ask for a password if you negate the authenticate option for the user or add the NOPASSWD
tag in the specific entry. e.g.
someuser ALL = NOPASSWD: /usr/bin/apt-get
add a comment |Â
up vote
6
down vote
You could try the following:
export DEBIAN_FRONTEND=noninteractive
apt-get -q -y install whatever-2
But note that this has implications, like empty default passwords (maybe you'd like some deployment/config tool like puppet, chef, fabric...?).
See sudoers(5) about how to allow password-less sudo
invocations.
add a comment |Â
up vote
1
down vote
Alternatively to what forcefsck suggested I suggest you add this into APT settings so you are not required to add these hard-to-write options all the time. Also, this would be helpful for unattended upgrades if you have these setup.
Create /etc/apt/apt.conf.d/71debconf
file to have the following content:
Dpkg::Options
"--force-confnew";
;
This may be a good option, however it's important to note that this would be a GLOBAL change. If you have other packages on the system that you want to get unattended upgrades but have also configured, this would not be the appropriate solution.
â Geoff
Oct 17 at 1:45
add a comment |Â
up vote
0
down vote
In addition to the other answers, you may also have to set the environment UCF_FORCE_CONFFNEW=1.
E.g. openssh in debian stretch uses ucf (not debconf) in it's openssh-server/openssh-7.4p1/debian/openssh-server.postinst
to ask about the config file. (You can see the openssh-server.postinst
by using dget
against http://security.debian.org/debian-security/pool/updates/main/o/openssh/openssh_7.4p1-10+deb9u4.dsc)
We've had to use all the tricks on this page in addition to being liberal users of debconf preseeding.
We did however stop just short of export DEBIAN_FRONTEND=noninteractive
because we want to know if we missed something (that could be important). Our use case is an operator starting the operation. The upgrade is expected to be non-interactive, but the operator is present if something goes wrong and a dialog presents itself. Your situation may be different.
But export DEBIAN_FRONTEND=noninteractive
is your proverbial sledgehammer.
Just beware: Setting -o Dpkg::Options::=--force-confnew
and/or UCF_FORCE_CONFFNEW=1
means that all config files from installed packages revert to the upstream ones. So e.g. in the case of openssh-server
, your /etc/ssh/sshd_config
will be reset to factory settings. And e.g. PermitRootLogin=yes
will be removed. But of course you don't use that, so you'll be fine! ;-)
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
19
down vote
You can pass dpkg
parameters to apt-get
like this
apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install pkgname1 pkgname2 ...
With --force-confdef
if old config files still exist, they won't get overridden. So you probably won't use it, I'm just documenting it for others.
sudo
will not ask for a password if you negate the authenticate option for the user or add the NOPASSWD
tag in the specific entry. e.g.
someuser ALL = NOPASSWD: /usr/bin/apt-get
add a comment |Â
up vote
19
down vote
You can pass dpkg
parameters to apt-get
like this
apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install pkgname1 pkgname2 ...
With --force-confdef
if old config files still exist, they won't get overridden. So you probably won't use it, I'm just documenting it for others.
sudo
will not ask for a password if you negate the authenticate option for the user or add the NOPASSWD
tag in the specific entry. e.g.
someuser ALL = NOPASSWD: /usr/bin/apt-get
add a comment |Â
up vote
19
down vote
up vote
19
down vote
You can pass dpkg
parameters to apt-get
like this
apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install pkgname1 pkgname2 ...
With --force-confdef
if old config files still exist, they won't get overridden. So you probably won't use it, I'm just documenting it for others.
sudo
will not ask for a password if you negate the authenticate option for the user or add the NOPASSWD
tag in the specific entry. e.g.
someuser ALL = NOPASSWD: /usr/bin/apt-get
You can pass dpkg
parameters to apt-get
like this
apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install pkgname1 pkgname2 ...
With --force-confdef
if old config files still exist, they won't get overridden. So you probably won't use it, I'm just documenting it for others.
sudo
will not ask for a password if you negate the authenticate option for the user or add the NOPASSWD
tag in the specific entry. e.g.
someuser ALL = NOPASSWD: /usr/bin/apt-get
edited Dec 18 '11 at 1:22
Kevin
26.4k106098
26.4k106098
answered Oct 18 '11 at 20:34
forcefsck
5,5461931
5,5461931
add a comment |Â
add a comment |Â
up vote
6
down vote
You could try the following:
export DEBIAN_FRONTEND=noninteractive
apt-get -q -y install whatever-2
But note that this has implications, like empty default passwords (maybe you'd like some deployment/config tool like puppet, chef, fabric...?).
See sudoers(5) about how to allow password-less sudo
invocations.
add a comment |Â
up vote
6
down vote
You could try the following:
export DEBIAN_FRONTEND=noninteractive
apt-get -q -y install whatever-2
But note that this has implications, like empty default passwords (maybe you'd like some deployment/config tool like puppet, chef, fabric...?).
See sudoers(5) about how to allow password-less sudo
invocations.
add a comment |Â
up vote
6
down vote
up vote
6
down vote
You could try the following:
export DEBIAN_FRONTEND=noninteractive
apt-get -q -y install whatever-2
But note that this has implications, like empty default passwords (maybe you'd like some deployment/config tool like puppet, chef, fabric...?).
See sudoers(5) about how to allow password-less sudo
invocations.
You could try the following:
export DEBIAN_FRONTEND=noninteractive
apt-get -q -y install whatever-2
But note that this has implications, like empty default passwords (maybe you'd like some deployment/config tool like puppet, chef, fabric...?).
See sudoers(5) about how to allow password-less sudo
invocations.
answered Oct 18 '11 at 8:08
sr_
12.8k3142
12.8k3142
add a comment |Â
add a comment |Â
up vote
1
down vote
Alternatively to what forcefsck suggested I suggest you add this into APT settings so you are not required to add these hard-to-write options all the time. Also, this would be helpful for unattended upgrades if you have these setup.
Create /etc/apt/apt.conf.d/71debconf
file to have the following content:
Dpkg::Options
"--force-confnew";
;
This may be a good option, however it's important to note that this would be a GLOBAL change. If you have other packages on the system that you want to get unattended upgrades but have also configured, this would not be the appropriate solution.
â Geoff
Oct 17 at 1:45
add a comment |Â
up vote
1
down vote
Alternatively to what forcefsck suggested I suggest you add this into APT settings so you are not required to add these hard-to-write options all the time. Also, this would be helpful for unattended upgrades if you have these setup.
Create /etc/apt/apt.conf.d/71debconf
file to have the following content:
Dpkg::Options
"--force-confnew";
;
This may be a good option, however it's important to note that this would be a GLOBAL change. If you have other packages on the system that you want to get unattended upgrades but have also configured, this would not be the appropriate solution.
â Geoff
Oct 17 at 1:45
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Alternatively to what forcefsck suggested I suggest you add this into APT settings so you are not required to add these hard-to-write options all the time. Also, this would be helpful for unattended upgrades if you have these setup.
Create /etc/apt/apt.conf.d/71debconf
file to have the following content:
Dpkg::Options
"--force-confnew";
;
Alternatively to what forcefsck suggested I suggest you add this into APT settings so you are not required to add these hard-to-write options all the time. Also, this would be helpful for unattended upgrades if you have these setup.
Create /etc/apt/apt.conf.d/71debconf
file to have the following content:
Dpkg::Options
"--force-confnew";
;
edited Jan 10 at 14:37
answered Jan 10 at 14:32
Te Ri
1245
1245
This may be a good option, however it's important to note that this would be a GLOBAL change. If you have other packages on the system that you want to get unattended upgrades but have also configured, this would not be the appropriate solution.
â Geoff
Oct 17 at 1:45
add a comment |Â
This may be a good option, however it's important to note that this would be a GLOBAL change. If you have other packages on the system that you want to get unattended upgrades but have also configured, this would not be the appropriate solution.
â Geoff
Oct 17 at 1:45
This may be a good option, however it's important to note that this would be a GLOBAL change. If you have other packages on the system that you want to get unattended upgrades but have also configured, this would not be the appropriate solution.
â Geoff
Oct 17 at 1:45
This may be a good option, however it's important to note that this would be a GLOBAL change. If you have other packages on the system that you want to get unattended upgrades but have also configured, this would not be the appropriate solution.
â Geoff
Oct 17 at 1:45
add a comment |Â
up vote
0
down vote
In addition to the other answers, you may also have to set the environment UCF_FORCE_CONFFNEW=1.
E.g. openssh in debian stretch uses ucf (not debconf) in it's openssh-server/openssh-7.4p1/debian/openssh-server.postinst
to ask about the config file. (You can see the openssh-server.postinst
by using dget
against http://security.debian.org/debian-security/pool/updates/main/o/openssh/openssh_7.4p1-10+deb9u4.dsc)
We've had to use all the tricks on this page in addition to being liberal users of debconf preseeding.
We did however stop just short of export DEBIAN_FRONTEND=noninteractive
because we want to know if we missed something (that could be important). Our use case is an operator starting the operation. The upgrade is expected to be non-interactive, but the operator is present if something goes wrong and a dialog presents itself. Your situation may be different.
But export DEBIAN_FRONTEND=noninteractive
is your proverbial sledgehammer.
Just beware: Setting -o Dpkg::Options::=--force-confnew
and/or UCF_FORCE_CONFFNEW=1
means that all config files from installed packages revert to the upstream ones. So e.g. in the case of openssh-server
, your /etc/ssh/sshd_config
will be reset to factory settings. And e.g. PermitRootLogin=yes
will be removed. But of course you don't use that, so you'll be fine! ;-)
add a comment |Â
up vote
0
down vote
In addition to the other answers, you may also have to set the environment UCF_FORCE_CONFFNEW=1.
E.g. openssh in debian stretch uses ucf (not debconf) in it's openssh-server/openssh-7.4p1/debian/openssh-server.postinst
to ask about the config file. (You can see the openssh-server.postinst
by using dget
against http://security.debian.org/debian-security/pool/updates/main/o/openssh/openssh_7.4p1-10+deb9u4.dsc)
We've had to use all the tricks on this page in addition to being liberal users of debconf preseeding.
We did however stop just short of export DEBIAN_FRONTEND=noninteractive
because we want to know if we missed something (that could be important). Our use case is an operator starting the operation. The upgrade is expected to be non-interactive, but the operator is present if something goes wrong and a dialog presents itself. Your situation may be different.
But export DEBIAN_FRONTEND=noninteractive
is your proverbial sledgehammer.
Just beware: Setting -o Dpkg::Options::=--force-confnew
and/or UCF_FORCE_CONFFNEW=1
means that all config files from installed packages revert to the upstream ones. So e.g. in the case of openssh-server
, your /etc/ssh/sshd_config
will be reset to factory settings. And e.g. PermitRootLogin=yes
will be removed. But of course you don't use that, so you'll be fine! ;-)
add a comment |Â
up vote
0
down vote
up vote
0
down vote
In addition to the other answers, you may also have to set the environment UCF_FORCE_CONFFNEW=1.
E.g. openssh in debian stretch uses ucf (not debconf) in it's openssh-server/openssh-7.4p1/debian/openssh-server.postinst
to ask about the config file. (You can see the openssh-server.postinst
by using dget
against http://security.debian.org/debian-security/pool/updates/main/o/openssh/openssh_7.4p1-10+deb9u4.dsc)
We've had to use all the tricks on this page in addition to being liberal users of debconf preseeding.
We did however stop just short of export DEBIAN_FRONTEND=noninteractive
because we want to know if we missed something (that could be important). Our use case is an operator starting the operation. The upgrade is expected to be non-interactive, but the operator is present if something goes wrong and a dialog presents itself. Your situation may be different.
But export DEBIAN_FRONTEND=noninteractive
is your proverbial sledgehammer.
Just beware: Setting -o Dpkg::Options::=--force-confnew
and/or UCF_FORCE_CONFFNEW=1
means that all config files from installed packages revert to the upstream ones. So e.g. in the case of openssh-server
, your /etc/ssh/sshd_config
will be reset to factory settings. And e.g. PermitRootLogin=yes
will be removed. But of course you don't use that, so you'll be fine! ;-)
In addition to the other answers, you may also have to set the environment UCF_FORCE_CONFFNEW=1.
E.g. openssh in debian stretch uses ucf (not debconf) in it's openssh-server/openssh-7.4p1/debian/openssh-server.postinst
to ask about the config file. (You can see the openssh-server.postinst
by using dget
against http://security.debian.org/debian-security/pool/updates/main/o/openssh/openssh_7.4p1-10+deb9u4.dsc)
We've had to use all the tricks on this page in addition to being liberal users of debconf preseeding.
We did however stop just short of export DEBIAN_FRONTEND=noninteractive
because we want to know if we missed something (that could be important). Our use case is an operator starting the operation. The upgrade is expected to be non-interactive, but the operator is present if something goes wrong and a dialog presents itself. Your situation may be different.
But export DEBIAN_FRONTEND=noninteractive
is your proverbial sledgehammer.
Just beware: Setting -o Dpkg::Options::=--force-confnew
and/or UCF_FORCE_CONFFNEW=1
means that all config files from installed packages revert to the upstream ones. So e.g. in the case of openssh-server
, your /etc/ssh/sshd_config
will be reset to factory settings. And e.g. PermitRootLogin=yes
will be removed. But of course you don't use that, so you'll be fine! ;-)
answered 31 mins ago
Peter V. Mørch
26515
26515
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f22820%2fhow-to-make-apt-get-accept-new-config-files-in-an-unattended-install-of-debian-f%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
serverfault.com/questions/48724/â¦
â Alastair Irvine
Mar 2 '16 at 6:59