我有一个奇怪的情况:我只能访问远程Ubuntu主机上的Jupyter Notebook,不能使用SSH,但是我想使用Jupyter中的bash执行来解决g ++安装的一些问题。因此,我遇到了以下问题:我正在运行以下命令:
! echo "password" |sudo -S sh -c "dpkg -i --auto-deconfigure libc6_2.30-0ubuntu2_amd64.deb"
但是dpkg必须配置一些东西,并且我得到一个交互式窗口,例如:
dpkg: yes, will deconfigure locales (broken by libc6:amd64)
(Reading database ... 71896 files and directories currently installed.)
Preparing to unpack libc6_2.30-0ubuntu2_amd64.deb ...
De-configuring locales (2.27-0ubuntu2) ...
Checking for services that may need to be restarted...
Checking init scripts...
Checking for services that may need to be restarted...
Checking init scripts...
7 Package configuration(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqu(B Configuring libc6 (0tqqqqqqqqqqqqqqqqqqqqqqqqqqqkx(B (0x(B (0x(B There are services installed on your system which need to be restarted (0x(B (0x(B when certain libraries, such as libpam, libc, and libssl, are upgraded. (0x(B (0x(B Since these restarts may cause interruptions of service for the system, (0x(B (0x(B you will normally be prompted on each upgrade for the list of services (0x(B (0x(B you wish to restart. You can choose this option to avoid being (0x(B (0x(B prompted; instead, all necessary restarts will be done for you (0x(B (0x(B automatically so you can avoid being asked questions on each library (0x(B (0x(B upgrade. (0x(B (0x(B (0x(B (0x(B Restart services during package upgrades without asking? (0x(B (0x(B (0x(B (0x(B <Yes> <No> (0x(B (0x(B (0x(B (0mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj(B
。
我想选择“是”,但我不知道如何。有没有办法在非交互状态下选择“是”,或者运行此命令而不获取交互窗口?