输入 Y 时我的命令被中止

输入 Y 时我的命令被中止

大家好,我对这些都很陌生,所以请耐心等待。我尝试了从 y 到 Y、yes、Yes 到 YES 的所有方法。重试没有用,因为我试了 30 次。

jan@Jan-Network:~$ sudo apt-get install linux-headers-generic build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  dpkg-dev fakeroot g++ g++-7 gcc gcc-7 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libc-dev-bin
  libc6-dev libcilkrts5 libfakeroot libgcc-7-dev libitm1 libmpx2 libquadmath0 libstdc++-7-dev libubsan0 linux-generic
  linux-headers-4.15.0-124 linux-headers-4.15.0-124-generic linux-image-4.15.0-124-generic linux-image-generic linux-libc-dev
  linux-modules-4.15.0-124-generic linux-modules-extra-4.15.0-124-generic make manpages-dev
Suggested packages:
  debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg gcc-multilib autoconf automake libtool flex bison gcc-doc
  gcc-7-multilib gcc-7-locales libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg
  libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg glibc-doc libstdc++-7-doc fdutils linux-doc-4.15.0 | linux-source-4.15.0 linux-tools make-doc
Recommended packages:
  thermald
The following NEW packages will be installed:
  build-essential dpkg-dev fakeroot g++ g++-7 gcc gcc-7 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4
  libc-dev-bin libc6-dev libcilkrts5 libfakeroot libgcc-7-dev libitm1 libmpx2 libquadmath0 libstdc++-7-dev libubsan0
  linux-headers-4.15.0-124 linux-headers-4.15.0-124-generic linux-image-4.15.0-124-generic linux-libc-dev linux-modules-4.15.0-124-generic
  linux-modules-extra-4.15.0-124-generic make manpages-dev
The following packages will be upgraded:
  linux-generic linux-headers-generic linux-image-generic
3 upgraded, 29 newly installed, 0 to remove and 43 not upgraded.
Need to get 89.1 MB of archives.
After this operation, 363 MB of additional disk space will be used.
Do you want to continue? [Y/n] yes
Abort.
jan@Jan-Network:~$ 

还有这里

jan@Jan-Network:~$ sudo apt-get install build-essential linux-headers-$(uname -r) git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-4.15.0-123-generic is already the newest version (4.15.0-123.126).
linux-headers-4.15.0-123-generic set to manually installed.
The following additional packages will be installed:
  dpkg-dev fakeroot g++ g++-7 gcc gcc-7 git-man libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4
  libc-dev-bin libc6-dev libcilkrts5 liberror-perl libfakeroot libgcc-7-dev libitm1 libmpx2 libquadmath0 libstdc++-7-dev libubsan0
  linux-libc-dev make manpages-dev
Suggested packages:
  debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg gcc-multilib autoconf automake libtool flex bison gcc-doc
  gcc-7-multilib gcc-7-locales libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg
  libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs
  git-mediawiki git-svn glibc-doc libstdc++-7-doc make-doc
The following NEW packages will be installed:
  build-essential dpkg-dev fakeroot g++ g++-7 gcc gcc-7 git git-man libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
  libasan4 libc-dev-bin libc6-dev libcilkrts5 liberror-perl libfakeroot libgcc-7-dev libitm1 libmpx2 libquadmath0 libstdc++-7-dev libubsan0
  linux-libc-dev make manpages-dev
0 upgraded, 27 newly installed, 0 to remove and 46 not upgraded.
Need to get 31.8 MB of archives.
After this operation, 148 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Abort.

答案1

尝试这个。

sudo apt-get install <package> -y

-y 标志表示是。

相关内容