29

Hey there I tried to install latex using the follwing commands in ubuntu 16.04:

sudo apt-get install texlive-full texstudio

Then I finally came to the point with the following output:

Setting up thunderbird-locale-en (1:52.3.0+build1-0ubuntu0.16.04.1) ... 
Setting up thunderbird-locale-en-us (1:52.3.0+build1-0ubuntu0.16.04.1) ... 
Setting up context (2015.05.18.20150601-2) ... 
Running mtxrun --generate. This may take some time... done. 
Pregenerating ConTeXt MarkIV format. This may take some time...

And after waiting for 5 hours I closed the process. Unfortunately now my certain packages seem to be broken. e.g when I try to install a new package or try sudo apt-get dist-upgrade I get the following error:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure
-a' to correct the problem.

And If I try

sudo dpkg --configure -a

I came again to the endless waiting point....

Any Ideas what I can do?

Notes:

  • I also have installed Miktex before does that cause some troubles?
  • I unfortunately cannot remove any package cause I also get:

     sudo apt-get remove tex-common
     E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
    
1
  • 1
    Same here, installing TexLive-full broke my dpkg on Linux Mint. I had MikTex installed too, because all I wanted was access to the csquotes package. Now I can't work at all since dpkg doesn't do anything any more. Rebooting does nothing, I don't even want to figure out how to reinstall a deeply embedded package like dpkg.
    – G_V
    Sep 20, 2017 at 12:12

7 Answers 7

44

The issue is still here. Hitting Enter in console doe the job.

The point is that the script luatex --ini --lua=/usr/share/texmf/tex/context/base/mkiv/luat-cod.lua ... tries to read something from 0th fd which is opened for /dev/pts/1. Maybe it tries to ask some question and waits for an answer in interactive manner. I just pressed Enter and it sufficed.

6
  • 9
    This needs to be reported as a bug. There are proper mechanisms for asking for input during package installation.
    – muru
    Nov 21, 2022 at 15:26
  • 27
    I had to hit enter multiple times !
    – Liris
    Mar 22 at 17:24
  • 1
    Damn, this nearly broke my upgrade to Ubuntu 22.04. Thank you all
    – marnix
    Mar 31 at 12:36
  • 1
    pressing enter does nothing I can see. The thing hangs forever
    – Dov
    Apr 3 at 21:01
  • 3
    @Dov You need keep the pressure on the "enter" key until you see "done." Release the pressure, and you would see the following (in fact they should be out simultaneously when "done" was out). "Setting up context-modules (20210301-1) ..." "Setting up texlive-full (2021.20220204-1) ..." "Processing triggers for tex-common (6.17) ..." "Building format(s) --all. This may take some time... " and then you wait. I waited for another 30s or ish, and I got "done." and it was really done. Apr 14 at 21:50
22

Whenever at any step. Just press Enter and keep holding it until it gets unstuck. It did work out for me. Try this method first before moving to any harsh steps like other answers are mentioning.

Cheers 🍻

2
  • 3
    This is an insanely good solution. I don't understand why it worked but it worked~! Apr 14 at 21:52
  • 3
    I cannot believe this worked... But it did. Apr 27 at 14:50
5

I have also faced the similar issue. What have I done is :

  1. Run sudo dpkg --configure -a
  2. Got the following response and it stuck for a long time.

    Setting up context (2018.04.04.20180416-1~18.04.york1)...
    Running mtxrun --generate. This may take some time...`

  3. I entered ctr-c
  4. Got the following response.

    Errors were encountered while processing:
    context
    context-modules
    texlive-full

  5. removed these packages using dpkg -r.

    sudo dpkg -r context-modules.
    sudo dpkg -r context.
    sudo dpkg -r texlive-full.

  6. Now again I run dpkg --configure -a
  7. This time it does not get stuck .
1
  • This worked for me (Ubuntu 20), but I had to restart and run sudo dpkg -r context separately.
    – Marra
    May 25, 2020 at 14:44
2

I came across the same problem on Ubuntu 22.04. None of the previous answers seemed to help: sudo dpkg -r did not work, nor did pressing Enter, and the tex-common and texlive-base did not contain all the packages I required.

What did help was to use

sudo apt-mark hold context
sudo apt-mark hold context-modules

Then run

dpkg --configure -a
1
  • 4
    To get it unstuck, you have to press <Enter> many times, not just once and then wait for a few minutes. There is no need for any dpkg -r
    – akhmed
    Mar 28 at 16:45
2

Just to start with, some motivation on why I wanted to install LaTex. I have a University document which was written with the ".tex" extension, and I want to view it. I found this nice article, "How to Install LaTeX on Ubuntu for Efficient Document Preparation?" to take steps to complete the installation on Ubuntu 22.02.04 LTS. I took the steps from the link above and got a working LaTex installation that was able to read and process the ".tex" file, that after pressing the Enter key several times also.

Using the scraps from the processed ".tex" file, I was able to find online the corresponding ".pdf" file without errors, "COMPLEX ANALYSIS: LECTURE 27".

I appreciate the advice on handling "Pregenerating ConTeXt MarkIV format. This may take some time...". I waited overnight and that did not resolve the issues.

I tried entering "Enter" and that did not resolve the issue.

Indeed I had to press the "Enter" key probably at least 10 times if not more to get the script going.

I recommend do not stop the process that seems stuck. Also, do not shut down the computer or logout.

After the few enter key presses everything completed fine.

My output (for reference on how many Enter key presses and the installation steps) is below:

Pregenerating ConTeXt MarkIV format. This may take some time... 









done.

The installation steps I used were as follows:

stephen@stephen-All-Series:~$ sudo apt-get update
[sudo] password for stephen: 
Hit:1 http://dl.winehq.org/wine-builds/ubuntu artful InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:3 http://il.archive.ubuntu.com/ubuntu jammy InRelease                     
Hit:4 https://ppa.launchpadcontent.net/apandada1/up-clock/ubuntu jammy InRelease
Get:5 http://il.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]     
Hit:6 https://ppa.launchpadcontent.net/saiarcot895/flightgear/ubuntu jammy InRelease
Hit:7 http://il.archive.ubuntu.com/ubuntu jammy-backports InRelease            
Fetched 229 kB in 1s (171 kB/s)
Reading package lists... Done
W: http://dl.winehq.org/wine-builds/ubuntu/dists/artful/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: Skipping acquire of configured file 'main./binary-amd64/Packages' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./binary-all/Packages' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./binary-i386/Packages' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./i18n/Translation-en' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./i18n/Translation-en_IL' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./dep11/Components-all.yml' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./dep11/Components-amd64.yml' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./dep11/icons-48x48.tar' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./dep11/icons-64x64.tar' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./dep11/[email protected]' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./cnf/Commands-amd64' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'main./cnf/Commands-all' as repository 'http://dl.winehq.org/wine-builds/ubuntu artful InRelease' doesn't have the component 'main.' (component misspelt in sources.list?)
stephen@stephen-All-Series:~$ sudo apt-get install texlive-full
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
...
1

I am new to linux (only few days and I crashed it 4 times already :D)... I faced the same problem while installing texlive-full - apt-get install, purge and so on didn't worked and sudo dpkg --configure -a couldn't finish. I don't know which step helped the most, but after searching on the internet I found the solution how to 'repair' damages.

  1. open second terminal and type sudo killall dpkg
  2. I opened sudo nano /var/lib/dpkg/status and deleted the whole section for Package: context (2015.05.18.20150601-2) (you can easily search it by pressing ctrl+W) and saved it. That didn't solved problem yet (I also removed 'tex-common' since that was problematic for me, too).
  3. I tried to remove problematic package with dpkg: sudo dpkg -r context but dependency error occurred (texlive-full and context-modules depends on context) and processing triggered for 'tex-common'. So I try to remove tex-common but there were even more dependencies I didn't try to remove other packages.
  4. I tried to run sudo dpkg --configure -a and an error occured -> thats good because it stopped working and I could try apt-get.
  5. I typed sudo apt-get purge texlive* to remove everything from problematic package and it worked, than I also purged miktex.
  6. The last step was about repairing apt-get: sudo apt-get -f install

I think I was just lucky but after this you can try installing tex again (find some not bugged package)

1

I have faced a similar issue with my texlive-*full and terminal got stuck for more than 12hrs. Finally I have decided to quit the upgrade. I have used following steps to resolve my problem through trial and error and a comprehensive search over Google.

  1. Open the dpkg status file situated at /var/lib/dpkg/status and delete all the block information which contains the status unpacked or not-installed or half-installed(Only choose those packages which are installed during Texlive, don't forget to remove context).
  2. Remove the dpkg lock using sudo fuser -vki /var/lib/dpkg/lock to kill the process.
  3. Use sudo dpkg -r <packagename> to remove installed package..
  4. Use sudo dpkg --configure -a to configure all packages.
  5. Most probably, now you can able to update or upgrade the apt.
  6. Remove all the files related to texlive by using sudo apt purge texlive-*.
  7. Use sudo apt autoremove to uninstall unwanted or leftover files.

I have also reinstalled the tex-common and texlive-base and now my system is working fine. You might need to use steps 1 to 4 recursively until your problem has been resolved. I have also restarted my PC after step 4.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .