How to recover ubuntu back to normal after interrupting the update?
You'll need to get a console some way, and type dpkg --configure -a
as root.
This command will configure already installed packages.
After it is finished try to boot back to the system and upgrade it the way you like.
In the worst case one can do it by using a livecd and chrooting to the original system.
Related videos on Youtube
![spencer741](https://i.stack.imgur.com/Xdxrd.jpg?s=256&g=1)
spencer741
Updated on September 18, 2022Comments
-
spencer741 almost 2 years
I am attempting to use ANTLR (v4) to create a parser generator for a asterisk-delimited list encapsulated by START and END markers.
START**na**na**aa*aa*a*asdfaaa*aaDDFdasa*aaaffdda*aa*aassda*ataaaaaaaaa*a*a*aEND
Where a normal input string would be something like:
START*na*na*aa*aa*a*asdfaaa*aaDDFdasa*aaaffdda*aa*aassda*ataaaaaaaaa*a*a*aEND
I would still need to be able to allow spaces, tabs, null/empty fields (basically any character except
START, END, *
between the asterisks.that includes things like
**
* *
*asdf fdsa*
* asdf *
Here is my grammar so far:
parseIt: ENTRY ; ENTRY : 'START*' FIELD_SET 'END' ; fragment Delim : '*' ; fragment Data : (ANY | WS)* ; fragment FIELD_SET : Data (Delim Data|Delim)* ;
I can recognize simple input (like the first example I gave), but am having trouble recognizing tokens that have spaces or special characters between the asterisks.
-
Mike Lischke almost 3 yearsIn fact, there is a way to handle any input with a trailing END:
Data: ~[*]+ { !$text.endsWith("END")};
. Using that semantic predicate, you can reject a match when it ends with "END". -
Mike Cargal almost 3 years@MikeLischke: I had a feeling I was going to regret "not a way" :). That said, I wasn't able to use the $text attribute in a lexer semantic predicate, but got this (Data : ~[*]+ {!getText().endsWith("END")}?;) to compile. However that just results in an "aEN" token followed by a "D" token. Not sure I'll find time, but maybe can use _input.LA() to look ahead (a quick shot at it didn't work, but I'm out of time right now)
-
Mike Lischke almost 3 yearsNo worries :-) I didn't test my idea, only remembered having used something similar in the past. Keep in mind that your predicate is triggered for each letter that is scanned.
-
Mike Cargal almost 3 yearsOK, it's tortured, but I beat the predicate into submission. Updating answer.
-
Mike Cargal almost 3 years@MikeLischke... no comments about how UGLY the solution is... you set me on that path ;). (Of course, would be really interested in a simpler way)
-
spencer741 almost 3 yearsI appreciate your help. My requirement unfortunately requires no delimiter between the the last data terminal and the end terminal
END
. Wasn't able to get the more complex predicate working.... I end up withDATA aEND
instead ofDATA a
andEND
as separate tokens. -
Mike Cargal almost 3 yearsYou didn't mention what language you are targeting. Semantic predicates are target-language specific. That predicate is for Java and does separate
a
andEND
. I'll append my answer with some more thoughts that might help.