Ubuntu 17.04 Mate环境下无法通过APT/GDebi安装openssh-server
Hey there, let's sort out this OpenSSH server issue you're facing. The root problem here is that Ubuntu 17.04 (Zesty Zapus) is no longer supported—it reached end-of-life (EOL) back in January 2018, so the default package repositories are no longer hosted on the main Ubuntu servers. That's why you're getting the "no installation candidate" error and can't find the 7.4p1 .deb files.
Here's how to get it working:
Step 1: Switch to Ubuntu's Old Releases Repository
First, we need to point your system to the archive for outdated Ubuntu versions:
- Back up your current sources list (just in case):
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak - Open the sources list file with a text editor:
sudo nano /etc/apt/sources.list - Replace every instance of
archive.ubuntu.comandsecurity.ubuntu.comwithold-releases.ubuntu.com. For example, change lines like:deb http://archive.ubuntu.com/ubuntu zesty main restricted
to
deb http://old-releases.ubuntu.com/ubuntu zesty main restricted - Save the file (press
Ctrl+O, hit Enter, thenCtrl+Xto exit nano) - Update your package index:
sudo apt update
Step 2: Install OpenSSH Server (Matching Your Client Version)
Now that your system can access the old packages, you can install the exact 7.4p1-10 version of openssh-server:
sudo apt install openssh-server=1:7.4p1-10
If you'd rather update both the client and server to the latest compatible version available for 17.04, just run:
sudo apt install openssh-server openssh-client
This will automatically pull in matching, supported versions for your EOL system.
Step 3: Verify and Set Up the Service
Once installed, make sure the SSH server is running and set to start on boot:
- Start the service:
sudo systemctl start ssh - Enable auto-start at boot:
sudo systemctl enable ssh - Check if it's running properly:
sudo systemctl status ssh
You should see a "active (running)" status if everything worked.
A Quick Note on Security
Since Ubuntu 17.04 is EOL, it won't receive any security patches—including critical updates for OpenSSH. If possible, consider upgrading your system to a supported LTS version like Ubuntu 20.04 or 22.04 to keep your machine secure long-term.
内容的提问来源于stack exchange,提问作者speedstyle

