91

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. 
    
muru
  • 207,228
sqp_125
  • 1,091

7 Answers7

150

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.

muru
  • 207,228
103

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

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

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
0

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.

0

Thanks for help. I followed the step and uninstall texlive-full. Instead of it, I installed texlive using the link https://www.tug.org/texlive/quickinstall.html

cd /tmp wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz

zcat < install-tl-unx.tar.gz | tar xf -

cd install-tl-*

perl ./install-tl --no-interaction # as root

set my path as PATH=/usr/local/texlive/2024/bin/x86_64-linux:$PATH; export PATH MANPATH=/usr/local/texlive/2024/texmf-dist/doc/man:$MANPATH; export MANPATH INFOPATH=/usr/local/texlive/2024/texmf-dist/doc/info:$INFOPATH; export INFOPATH

0

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)