更新软件
更新软件包
sudo apt update
升级所有可升级的软件包
sudo apt upgrade
sudo apt dist-upgrade
sudo systemctl restart sshd
假如遇到wget:未找到命令,输入以下命令
sudo apt-get update
sudo apt-get install wget
解释:
- 这个错误表明
wget
命令在你的系统中不存在 - 通过包管理器安装
wget
遇到:没有可用的软件包 wget,但是它被其它的软件包引用了。 这可能意味着这个缺失的软件
更新软件包列表并重新安装 wget
sudo apt update
sudo apt install wget
如果仍然无法安装,检查 sources.list 文件,确保有合适的源。你可以通过以下命令查看 sources.list:
cat /etc/apt/sources.list
假如输出以下这段,表明缺少主要的 Debian 源。你可以添加以下两行到文件中,以便从官方源获取软件包:
# deb cdrom:[Official Debian GNU/Linux Live 10.2.0 gnome 2019-11-16T10:36]/ buster main
#deb cdrom:[Official Debian GNU/Linux Live 10.2.0 gnome 2019-11-16T10:36]/ buster main
deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main
# buster-updates, previously known as ‘volatile’
# A network mirror was not selected during install. The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://deb.debian.org/debian/ buster-updates main
# deb-src http://deb.debian.org/debian/ buster-updates main
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching “deb cdrom”
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
输入:
sudo nano /etc/apt/sources.list
进入文件后,使用上下键,在文件底部输入以下两行
deb http://deb.debian.org/debian/ buster main
deb-src http://deb.debian.org/debian/ buster main
Ctrl + X
,然后按 Y
和 Enter
再输入:
sudo apt update
sudo apt install wget