mikeizbicki / cmc-csci181-languages

3 stars 4 forks source link

Unable to install dependencies of fulltext: libpoppler118, poppler-utils #2

Closed abizermamnoon closed 1 month ago

abizermamnoon commented 1 month ago

I was trying to input a pdf file into groq:

(venv) amamnoon@abizer:~/cs_181/proj/docsum$ python3 docsum.py docs/'Abizer Mamnoon Resume.pdf'
Traceback (most recent call last):
  File "/home/amamnoon/cs_181/proj/docsum/venv/lib/python3.10/site-packages/fulltext/util.py", line 70, in run
    pipe = subprocess.Popen(
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pdftotext'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/amamnoon/cs_181/proj/docsum/docsum.py", line 14, in <module>
    text = fulltext.get(args.filename)
  File "/home/amamnoon/cs_181/proj/docsum/venv/lib/python3.10/site-packages/fulltext/__init__.py", line 153, in get
    text = _get_path(
  File "/home/amamnoon/cs_181/proj/docsum/venv/lib/python3.10/site-packages/fulltext/__init__.py", line 84, in _get_path
    return backend._get_path(path, **kwargs)
  File "/home/amamnoon/cs_181/proj/docsum/venv/lib/python3.10/site-packages/fulltext/backends/__pdf.py", line 34, in _get_path
    return run(*_cmd(path, **kwargs)).decode('utf-8')
  File "/home/amamnoon/cs_181/proj/docsum/venv/lib/python3.10/site-packages/fulltext/util.py", line 79, in run
    raise MissingCommandException(cmd[0])
fulltext.MissingCommandException: pdftotext

So I tried downloading the dependencies:

(venv) amamnoon@abizer:~/cs_181/proj/docsum$ sudo apt-get install libpoppler118 poppler-utils                                   Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libpoppler118 poppler-utils
0 upgraded, 2 newly installed, 0 to remove and 63 not upgraded.
Need to get 1257 kB of archives.
After this operation, 4307 kB of additional disk space will be used.
Err:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpoppler118 amd64 22.02.0-2ubuntu0.4
  404  Not Found [IP: 185.125.190.81 80]
Err:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 poppler-utils amd64 22.02.0-2ubuntu0.4
  404  Not Found [IP: 185.125.190.81 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/poppler/libpoppler118_22.02.0-2ubuntu0.4_amd64.deb  404  Not Found [IP: 185.125.190.81 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/poppler/poppler-utils_22.02.0-2ubuntu0.4_amd64.deb  404  Not Found [IP: 185.125.190.81 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I then did the following:

(venv) amamnoon@abizer:~/cs_181/proj/docsum$ sudo apt-get install --fix-missing libpoppler118 poppler-utils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libpoppler118 poppler-utils
0 upgraded, 2 newly installed, 0 to remove and 63 not upgraded.
Need to get 1257 kB of archives.
After this operation, 4307 kB of additional disk space will be used.
Err:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpoppler118 amd64 22.02.0-2ubuntu0.4
  404  Not Found [IP: 185.125.190.82 80]
Err:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 poppler-utils amd64 22.02.0-2ubuntu0.4
  404  Not Found [IP: 185.125.190.82 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/poppler/libpoppler118_22.02.0-2ubuntu0.4_amd64.deb  404  Not Found [IP: 185.125.190.82 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/poppler/poppler-utils_22.02.0-2ubuntu0.4_amd64.deb  404  Not Found [IP: 185.125.190.82 80]
E: Internal Error, ordering was unable to handle the media swap
(venv) amamnoon@abizer:~/cs_181/proj/docsum$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
Hit:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
E: Release file for http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 3h 0min 4s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 2h 45min 13s). Updates for this repository will not be applied.
finnless commented 1 month ago

Did you try to apt-get update first?

NOTE: Flagging that there was a deleted comment in this thread with a link to a file with malware. Other repo's on github are being targeted too, described here: https://github.com/comfyanonymous/ComfyUI/issues/4616. If you ran the linked executable file, you may want to apply a power drill to your storage media. Here is a VirusTotal scan for the curious.

abizermamnoon commented 1 month ago

I got this error:

(venv) amamnoon@abizer:~/cs_181/proj/docsum$ sudo apt-get update
[sudo] password for amamnoon:
Sorry, try again.
[sudo] password for amamnoon:
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:5 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Reading package lists... Done
E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 7h 25min 24s). Updates for this repository will not be applied.
E: Release file for http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 7h 44min 3s). Updates for this repository will not be applied.

So I asked chatGPT, and this is what it told me to do and it worked: The error you are seeing indicates that your system clock is out of sync with the repository's timestamp. This can happen if your system's date and time settings are incorrect, which prevents apt from correctly verifying the release files.

To fix this issue, you need to synchronize your system clock with an accurate time source.

  1. Synchronize the System Clock If you have ntp or systemd-timesyncd installed, you can use these tools to synchronize the system clock.

Using timedatectl:

If you're using systemd-timesyncd (default on many modern Ubuntu systems), you can run:

$ sudo timedatectl set-ntp true

This command will enable automatic time synchronization.

You can verify the current status with:

$ timedatectl status

Using ntpdate:

If you prefer to use ntpdate, you can install it and sync your clock manually:

$ sudo apt-get install ntpdate
$ sudo ntpdate time.nist.gov

This will synchronize your system clock with the NIST time server.

  1. Check Your Current Date and Time After syncing the clock, check if the date and time are correct:
$ date

Make sure it is aligned with the correct current time for your time zone.

  1. Retry the Update Once your system clock is synchronized, try running the update command again:
$ sudo apt-get update
mikeizbicki commented 1 month ago

Closing because it looks like this is resolved.