sudo apt-get install apache2

sudo apt-get install apache2

我尝试使用以下方式安装 apache2

sudo apt-get install apache2

我为什么会看到这个

E: Type 'gpg' is not known on line 1 in source list /etc/apt/sources.list.d/sublime-text.list
E: Type 'gpg' is not known on line 1 in source list /etc/apt/sources.list.d/sublime-text.list

答案1

/etc/apt/sources.list.d/sublime-text.list用单行替换文件内容deb https://download.sublimetext.com/ apt/stable/- 只需执行即可:

echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

接下来执行 apt 更新和升级:

sudo apt update
sudo apt upgrade

最后安装 Apache:

sudo apt install apache2

答案2

文件 /etc/apt/source.list.d/sublime-text.list 第一行的内容不正确。

cp /etc/apt/sources.list.d/sublime-text.list /etc/apt/sources.list.d/sublime-text.list.backup
sed 1d -i /etc/apt/sources.list.d/sublime-text.list

相关内容