Package docker-ce is not available, but is referred to by another package.
时间: 2023-09-26 09:11:13 浏览: 52
This error message typically occurs when you try to install Docker on a system that does not have the Docker repository added to its list of package sources. To resolve this issue, you need to add the Docker repository to your package sources by following the steps below:
1. Open a terminal window on your system.
2. Run the following command to add the Docker GPG key:
```
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```
This will download the Docker GPG key and add it to your system's keyring.
3. Next, add the Docker repository to your system's package sources by running the following command:
```
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
```
This command will add the Docker repository to your system's package sources.
4. Update your system's package list by running the following command:
```
$ sudo apt-get update
```
This will update your system's package list with the latest packages from the Docker repository.
5. Finally, install Docker by running the following command:
```
$ sudo apt-get install docker-ce
```
This will install Docker on your system.
After following these steps, you should be able to use Docker on your system without encountering the "Package docker-ce is not available" error message.