I can't install new packages and can't update and upgrade
2,083
Run the following:
fuser /var/lib/dpkg/lock /var/lib/apt/lists/lock
ls -l /var/lib/dpkg/lock /var/lib/apt/lists/lock
If there are processes running, and any of the 2 files exist, then run:
fuser -k /var/lib/dpkg/lock /var/lib/apt/lists/lock
Then fuser
will send a SIGKILL
signal to each process. That should resolve the issue.
If the above does not work for you, then you may want to take a look at this:
Author by
DewSql
Updated on September 18, 2022Comments
-
DewSql over 1 year
I have a Xml File below that I am trying to load in to visual studio then append another entry for D100 to the file then write or append it 1000 times.
The code below saves the document but nothing gets appended.
<flp:Tab xmlns:flp="http://www.w3.org/2001/XMLSchema" Title="Testing"> <flp:Form Number="0" id="1005" /> <flp:Rev Time="2013-01-21T15:08:00"> <flp:Author Name="Brad" Aid="15" /> </flp:Rev> <flp:Designs Id="D100"> <flp:D100 Number="1"> <flp:Code>A</flp:Code> <flp:Documented>true</flp:Documented> <flp:Note>In Process</flp:Note> <flp:Testers> <flp:Tester Name="David"> <flp:Titles> <flp:Title Number="0" Name="Entry 1"> <flp:Start>Begin</flp:Start> <flp:Finish>End</flp:Finish> </flp:Title> </flp:Titles> </flp:Tester> </flp:Testers> <flp:TestGivers> <flp:TestGiver Name="James" /> </flp:TestGivers> <flp:IsRequired>true</flp:IsRequired> <flp:IsOptional>false</flp:IsOptional> </flp:D100> </flp:Designs> </flp:Tab>
I am trying to append and write out the information 1000 times in the Xml File
Here is my C# code
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Xml; namespace AppendXml { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Button_Click_1(object sender, RoutedEventArgs e) { XmlDocument doc = new XmlDocument(); doc.Load("C:\\Desktop\\Temp.xml"); //XmlElement root = doc.CreateElement("Tab"); XmlElement D100 = doc.CreateElement("D100"); D100.SetAttribute("Number", "2"); XmlElement Code = doc.CreateElement("Code"); Code.InnerText = "B"; XmlElement Documented = doc.CreateElement("Documented"); Documented.InnerText = "false"; XmlElement Note = doc.CreateElement("Note"); Note.InnerText = "Complete"; XmlElement Tester = doc.CreateElement("Tester"); Tester.SetAttribute("Name", "John"); XmlElement Title = doc.CreateElement("Title"); Title.SetAttribute("Number", "0"); Title.SetAttribute("Name", "Ronald"); XmlElement Start = doc.CreateElement("Start"); Start.InnerText = "Begin"; XmlElement Finish = doc.CreateElement("Finish"); Finish.InnerText = "End"; XmlElement TestGiver = doc.CreateElement("TestGiver"); TestGiver.SetAttribute("Name", "Jeremy"); XmlElement IsRequired = doc.CreateElement("IsRequired"); IsRequired.InnerText = "true"; XmlElement IsOptional = doc.CreateElement("IsOptional"); IsOptional.InnerText = "false"; D100.AppendChild(IsOptional); D100.AppendChild(IsRequired); D100.AppendChild(TestGiver); D100.AppendChild(Finish); D100.AppendChild(Start); D100.AppendChild(Title); D100.AppendChild(Tester); D100.AppendChild(Note); D100.AppendChild(Documented); D100.AppendChild(Code); //root.AppendChild(D100); //doc.AppendChild(root); doc.Save("test13.xml"); } } }
The document saves but noting appends. What am I leaving out?
-
MethodMan over 11 yearshave you thought about using
XPATH
to do this instead? also how are you writing this 1000 times when you don't have any of your code in a Loop.. show code that is relevant should that for loop be un commented..? -
DewSql over 11 yearsI commented out the for loop to try later. No I have not thought about XPath, I will look into that now. Thanks!
-
John Saunders over 11 yearsFYI, you should not use
new XmlTextWriter()
. It has been deprecated since .NET 2.0. UseXmlWriter.Create()
instead. -
jimm-cl almost 10 yearsWhat was the exact package name you tried to install, and the actual command you used?
-
ArCiGo almost 10 yearsWireshark, but it happens with any package.
sudo apt-get install vlc
(for example) -
Alen Milakovic almost 10 yearsCheck for existing processes.
ps aux | grep apt
orps aux | grep dpkg
.
-
-
ArCiGo almost 10 yearsOk. I used it and apparently it worked, but the Dropbox is still downloading. I tried to remove Dropbox via Ubuntu Software Center and the software center show me this:
Waiting to dpkg to exit
. The link that you provided me I had already used and I can't solve my problem. -
ArCiGo almost 10 yearsMy solution: reinstall Ubuntu
-
jimm-cl almost 10 yearswell, that's always an option :p