200字
Deepin 安装 CS50 Library for C
2025-11-06
2025-12-19

问题

按照官方教程安装CS50 Library时会报错提示:

worable@deepin:~$ curl -s https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh | sudo bash
请输入密码
验证成功
Detected operating system as Deepin/beige.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Detected apt version as 2.8.0
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/cs50_repo.list...curl: (22) The requested URL returned error: 404


Unable to download repo config from: https://packagecloud.io/install/repositories/cs50/repo/config_file.list?os=Deepin&dist=beige&source=script

This usually happens if your operating system is not supported by 
packagecloud.io, or this script's OS detection failed.

You can override the OS detection by setting os= and dist= prior to running this script.
You can find a list of supported OSes and distributions on our website: https://packagecloud.io/docs#os_distro_version

For example, to force Ubuntu Trusty: os=ubuntu dist=trusty ./script.sh

If you are running a supported OS, contact the owner of this repository/package for further support.

注意最后一句For example, to force Ubuntu Trusty: os=ubuntu dist=trusty ./script.sh,它让我们伪装成Ubuntu再安装,那么我们输入:

su

进入root账户后再输入:

curl -s https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh | os=ubuntu dist=focal bash

然后就安装成功了!!

root@deepin:/home/worable/Documents/code# curl -s https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh | os=ubuntu dist=focal bash
Detected operating system as ubuntu/focal.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Detected apt version as 2.8.0
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/cs50_repo.list...done.
Importing packagecloud gpg key... Packagecloud gpg key imported to /etc/apt/keyrings/cs50_repo-archive-keyring.gpg
done.
Running apt-get update... done.

The repository is setup! You can now install packages.

希望能帮到更多人~

评论