(SOLVED) install cs50 library on linux mint

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
rsail
Level 1
Level 1
Posts: 16
Joined: Wed Oct 21, 2020 9:50 am

(SOLVED) install cs50 library on linux mint

Post by rsail »

I'm trying to setup my own linux environment and would like to install the cs50 library. When I run:

curl -s https://packagecloud.io/install/reposit ... ipt.deb.sh | sudo bash I get the following:

Code: Select all

Detected operating system as LinuxMint/ulyana.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
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=LinuxMint&dist=ulyana&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
so I set os=ubuntu and dist=focal and then reran the command and got: No such file or directory. Can someone help?

Here's the info on my installed distro:

Code: Select all

cat /etc/*release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=20
DISTRIB_CODENAME=ulyana
DISTRIB_DESCRIPTION="Linux Mint 20 Ulyana"
NAME="Linux Mint"
VERSION="20 (Ulyana)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 20"
VERSION_ID="20"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=ulyana
UBUNTU_CODENAME=focal
Last edited by rsail on Wed Oct 28, 2020 7:01 pm, edited 1 time in total.
Welcome
Level 5
Level 5
Posts: 576
Joined: Wed Aug 19, 2020 11:38 am

Re: install cs50 library on linux mint

Post by Welcome »

Is this for c or for python?

I see instructions here for c:
https://cs50.readthedocs.io/libraries/cs50/c/

And python:
https://cs50.readthedocs.io/libraries/cs50/python/

I see this is what you're trying. I checked the c version, and get similar problems.

Maybe better to download directly from GitHub.

For c:
https://github.com/cs50/libcs50/releases

Instructions:
https://github.com/cs50/libcs50#from-so ... ux-and-mac
rsail
Level 1
Level 1
Posts: 16
Joined: Wed Oct 21, 2020 9:50 am

Re: install cs50 library on linux mint

Post by rsail »

Thanks for the reply. It is for C. I'm a complete newbe, your link to github doesn't help as I don't know what to do with it. Can you provide more detailed instructions on how to install the C cs50 library?
Welcome
Level 5
Level 5
Posts: 576
Joined: Wed Aug 19, 2020 11:38 am

Re: install cs50 library on linux mint

Post by Welcome »

If you're a complete newbie, why do you want to use cs50? Seriously, I'm really interested. What does cs50 give you that you can't do with the standard libs?

Unless you know what you're doing, you probably shouldn't be doing this.
  • From the GitHub release page, click on Source code (tar.gz) for the latest release. In the pop-up box, select Save file.
  • Depending on how you've set up your browser, the downloaded file may be in your home directory or in your Downloads folder.
  • Find that file (it should be named libcs50-10.1.0.tar.gz).
  • There's a few ways to extract it. I sometimes double click on it so that it opens the Archive Manager, and then drag the folder libcs50-10.1.0 to a good place. Maybe your desktop?
  • Open that new folder libcs50-10.1.0, verify that it has some directories and files.
  • While your mouse is over that folder, right click and select Open in terminal.
  • Click on that terminal to acitvate it.
  • Enter this command in terminal:

Code: Select all

sudo make install
Quote from the install page:
By default, we install to /usr/local. If you'd like to change the installation location, run sudo DESTDIR=/path/to/install make install as desired.
By the way, this assumes you've already set up your system with gcc and build-essentials...

... and, don't forget to back up your system first!
rsail
Level 1
Level 1
Posts: 16
Joined: Wed Oct 21, 2020 9:50 am

Re: install cs50 library on linux mint

Post by rsail »

cs50 gives some commands like get_string(), get_int, get_float and some other useful stuff. You don't really need it but many of the beginning assignments require it. The course uses a cloud ide. I wanted to be able to run all my problem sets on my local machine and that's why I installed it.

Your instructions are great. concise, correct and easy to follow. thank you!
Welcome
Level 5
Level 5
Posts: 576
Joined: Wed Aug 19, 2020 11:38 am

Re: install cs50 library on linux mint

Post by Welcome »

Thanks for the kind words! It's nice to hear that everything worked out perfectly.

In case someone else runs into the same problem, please edit your first post's title to add the word [SOLVED]. This will help others to know to read your post for the solution.

Thanks again!
Post Reply

Return to “Software & Applications”