我经常发现自己这样做::~$ sudo apt install php7.4 mysql-server git composer curl apache2 --yes
我有时会得到这样的回应:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mysql-server' has no installation candidate
我怎样才能避免这种情况?我尝试重定向 stderr 但没有运气。我用谷歌搜索无济于事,但似乎没有人遇到这种情况。
基本上,我想抛出 apt install 一堆我想安装的包,如果我弄错了,我希望程序继续安装其余的包。
提前谢谢了!
apt-get
(andapt
) 可以-m
选择忽略丢失的包。来自man apt-get
: