« first day    last day (15 days later) » 

7:34 AM
when i try recovery mode and i write into drop shell sript chown root:root /usr/bin/pkexec it gives me error changing ownership of /usr/bin/pkexec:read only file system
 
 
8 hours later…
3:25 PM
@KaliyaMitesh You have to run mount -o remount,rw / first (step 2 in the 6-step procedure in my answer). That remounts the filesystem so it is no longer read-only.
 
3:49 PM
@EliahKagan i run mount -o remount,rw / first.then i try to run chown root:root /usr/bin/pkexec it gives error changing permission of '/usr/bin/pkexec':Read only file system
 
Is there any output from mount -o remount,rw /? If it doesn't succeed at remounting the filesystem readwrite, it should give an error.
 
yes it gives some output
 
What does it say?
 
how i can send picture of this output?
 
Do you see an upload... button to the right of the send button, next to the text box in chat?
Assuming you have that, you can use it to attach an image file in the chat.
If not, you can use any image-hosting website, such as postimage.io, and post a link.
Or are you asking how to capture the image initially?
 
3:56 PM
lots of thanks you give me answer give your time
 
No problem -- I'm glad to help.
Do you have the picture you want to attach? Or are you asking how to take a screenshot in recovery mode? (As far as I know, there is no really good way to take a screenshot in recovery mode.)
 
i uploaded picture on your given link
 
Oh.
When you upload there, it gives you a link. I can't see what you've uploaded until you provide that link.
 
okey
sorry.it is too small i will send another image in few seconds
 
Sorry, I had to quit my browser briefly for an unrelated reason. I'm back now though. Thanks for the image.
 
4:08 PM
ok no problem.
when i try to run apt-get install sudo it gives lots of error
 
That text is visible. That's the help for mount. It is shown when mount does not understand the syntax you have given it. Are you sure that you have entered exactly:
mount -o remount,rw /
There must be a space between mount and -o, another between -o and remount, but there must be no spaces in remount,rw.
Then there must be a space between remount,rw and /.
/ should be the last character.
(I cannot verify the exact command you ran by looking at that image, because the output is longer than the screen height.)
 
yes it run mount -o remount,rw /
it not gives any output and run properly
but when i run apt install sudo it gives error
 
This is after mount -o remount,rw / ran successfully and produced no output?
 
yes there is no output
 
Okay. Even though apt is not working, you should still be able to fix pkexec. If that succeeds, then you can boot into the system and fix other things, which should be easier.
 
4:22 PM
 
What happens when you run
chown root:root /usr/bin/pkexec
?
Do you still get an error message, or does that work this time? (If it produces no output, it worked.)
 
yes it produce no output
 
Okay, good. Now please also run:
chmod 4755 /usr/bin/pkexec
 
yes .it run and produce no output
 
Okay. At least the specific error about pkexec not being setuid root should be fixed. Hopefully pkexec will work now. If it does, then you can use it to fix everything else while booted normally into the system. (One of the reasons that will be easier is that you will be able to connect to the Internet, open a web browser, copy and paste text between a terminal and the web browser, etc.)
To test this, leave recovery mode and boot normally. One way to do this is just to run exit, which will let you boot the rest of the way. Another way is to run the reboot command and not select recovery mode when it reboots.
Once you've booted normally, log in, open a Terminal window (Ctrl+Alt+T), and try to run a command with pkexec -- for example:
pkexec echo success
That will print success if pkexec worked, and an error message otherwise.
It will be easier to fix sudo and (if it is broken) APT if you don't have to do everything in recovery mode. So please let me know what happens when you try leaving recovery mode and testing pkexec (or let me know if you're unable to do so).
 
4:30 PM
please wait few second i try it
 
Okay.
 
yes it print success
 
Great! Now let's find out if there is still a problem with APT. Please run:
pkexec apt update
 
yes it works
 
By the way, now that you're booted into a graphical session on that machine, if you want you can log in to Ask Ubuntu from there. Then you will be able to copy and paste text. Whether or not you prefer that is totally up to you. You can also continue uploading images if that's more convenient.
Okay, since you were able to successfully run apt update with pkexec, now run:
pkexec apt --reinstall install sudo
 
4:39 PM
it gives some error code(100)
 
What is the output of
ls -l /usr/bin/dpkg
?
 
ls:cannot access 'usr/bin/dpkg':no such file or directory
 
Did you put in the / at the beginning? (I'm asking because it's not in the error message you're showing.)
That is, did you run ls -l /usr/bin/dpkg or ls -l usr/bin/dpkg?
 
sorrt,yes i put /
 
So, it looks like sudo wasn't the only thing that was deleted. It looks like dpkg is gone, too. Before proceeding, it would be a good idea to get a sense of what has happened. Do you know how sudo was deleted?
 
4:48 PM
yes,i acidenttly deleted sudo file by my mistack
 
But dpkg is also deleted, and the ownership or permissions on pkexec were changed. Do you have any idea how these things may have occurred?
 
no i have no idea
 
The reason I'm asking is that, depending on the extent of the damage to your system, it may be faster and easier for you to offload all your documents and important files and reinstall the operating system.
 
what i should foe further process?
 
dpkg is harder to fix because you cannot use the package manager to put it back (basically, it is the package manager -- it's what APT uses to install and remove packages). But it's not too hard to put back, you just have to do it manually.
But if the extent of the damage is effectively unlimited, then manually fixing each part of your system that is broken could take a very long time, and you might never be sure that you had gotten it all fixed.
 
4:51 PM
ok i reinstall the operating system
lots of thanks
 
This is your choice.
If you want to try a few more things first, you certainly can. I'll definitely show you how to manually reinstall dpkg, if you want.
 
you take lots of effort for me.
yes i want
 
But if you don't know what has happened to the system to break all this stuff in it (or what else might be broken), and your goal is to get a fully working Ubuntu system as soon as possible, then reinstalling may be faster.
So it's up to you.
So, if you want to keep working on it, please tell me: does the Internet connection work in your Ubuntu system?
 
yes it work properly
can i download dpkg file?
 
What is the output of
lsb_release -r
?
 
4:55 PM
It gives outpu:Release 16.04
 
And that's correct, right? It's a 16.04 system?
 
What's the output of
type -a wget
?
 
can you give me whatsapp number?
it gives output:wget is /usr/bin/wget
 
Do you mean for voice chat? I'm actually not available for that right now -- I am working on other tasks at the same time as I am working with you on this. I also don't have whatsapp. You can friend me on Skype if you like, but I would still not often be available to voice chat. Instant messaging is usually best for me.
Okay good, you have wget.
I was worried way more things in /usr/bin might have been missing. And that might still be the case, but at you have the things you need to reinstall dpkg easily.
 
4:58 PM
okey .no problem
 
What's the output of: uname -m
 
x86_64
 
Okay, do you have an empty folder where it is convenient to download things? Is your Downloads folder currently empty, for example?
I mean on the Ubuntu system.
 
yes i have space
it is empty
 
If you're on a separate machine right now, you might want to switch to the Ubuntu system, log in to Ask Ubuntu, and join this chat room from there. The next command to run is just:
cd ~/Downloads
But the next command after that, to download the package for dpkg, is:
It would probably be inconvenient for you to type that in exactly, by hand. And, depending on what happens, there may be other commands that are inconvenient to type in, too.
However, if you don't want to switch over to the Ubuntu machine, that is okay. In that case, I can give you a different way to download the file that may be easier than typing that. You can let me know.
 
5:09 PM
 
You didn't type the full URL. It looks like you stopped before the first _. I don't recommend typing that by hand though. If you cannot chat from the Ubuntu system itself, then it will be easier to find the URL the same way I did.
 
it gives error 404 not found
 
Are you just talking about the 404 error shown in your most recently attached image? Or something after that?
The 404 error in your most recently attached image appears to be due to an incorrectly typed URL.
You see to have typed something like wget https://launchpad.net/ubuntu/+archive/primary/+files/dpkg, when you really needed wget https://launchpad.net/ubuntu/+archive/primary/+files/dpkg_1.18.4ubuntu1.1_amd64.‌​deb.
However, you can just go to Launchpad, find the file, and download it, and then you don't need to run that command at all.
 
ok .i login in my machine
 
Okay. Please let me know when you've done so.
 
5:16 PM
it installing
 
Installing?
I'm not sure I understand. What is installing?
 
your given link there is something downloading and try to install it
 
Well it's just downloading. It doesn't install anything. We have to do that part manually.
When it finishes downloading, or if there are any error messages, please let me know.
 
ok.it downloaded
dpkg_1.18.4 ubuntu1.1amd64.deb
 
Normally you can install .deb files with dpkg -i, but dpkg is the program you're missing, which is why it is necessary to do this manually.
So, first extract the archive:
ar x dpkg_1.18.4ubuntu1.1_amd64.deb
You can copy and paste that command, or you can type just ar x and press tab. (If there's nothing else in this folder, the shell will automatically complete the command to that filename.)
If the ar command produces no output, it succeeded. In that case, run:
tar xf data.tar.gz
Has all that worked?
 
5:25 PM
when i extract this there are two control.tar.gz and data.tar.gz and one debian-binary
files
 
Yes. That's good. When you run tar xf data.tar.gz, it extracts that file.
I am hoping we will not need to install all package file for dpkg, but just the executable itself. (If this works, we will of course tell APT to reinstall dpkg properly afterwards.)
Did tar xf data.tar.gz produce no errors?
 
is run in terminal?
 
Yes. If you have just run the command ar x dpkg_1.18.4ubuntu1.1_amd64.deb, then you should next run the command: tar xf data.tar.gz
Did that succeed? Or did something go wrong?
(If it produces no output, it succeeded. It will create a few folders.)
 
5:40 PM
yes it create some folders
sorry for late reply
 
No problem.
Good. The dpkg executable has been extracted. Now copy it to where it's supposed to be in your system, set its ownership and permissions correctly, and test it (these commands do all that):
pkexec cp -n usr/bin/dpkg /usr/bin
pkexec chown root:root /usr/bin/dpkg
pkexec chmod 755 /usr/bin/dpkg
dpkg --version
 
only dpkg file copy and paste or all this folder?
 
I don't understand the question.
But, if you are asking me to clarify what I am recommending to do.
All you need to do is run those four commands.
 
Whatever the output is, please copy it from the terminal and paste it into this chat conversation. (If it fails, there should be error messages. If it works, the final command will produce output.)
 
5:50 PM
where i can join these chat room in machine
 
I had thought you had already switched to the Ubuntu machine and joined this chat.
If you haven't, you would do it the same way as you did it from whatever machine you are using. That is, you would go into a web browser, log in to Ask Ubuntu, and enter chat.
When you log in, you'll be able to find your question on your profile. One way to get to this chat room is to follow the link posted in comments under my answer to your question.
There should be faster ways to get here, too, but I am not sure I would be able to describe them clearly -- they would depend on what notifications you have received.
Basically, however you got here before, you can do the same thing from the Ubuntu machine once you've logged in to Ask Ubuntu.
 
when i run first command it gives error:/bin/cp:cannot stat 'usr/bin/dpkg': no such file or directory
 
Are you in the same directory you were in when you ran tar xf data.tar.gz ?
 
yes
there is four folders created
 
Are you on the Ubuntu machine now, in chat? Can you copy text from the terminal and paste it here so I can see exactly what has happened?
 
6:03 PM
no .i login in my mobile
in my machine it work very slowly
 
The Ubuntu machine slows down when you try to go to Ask Ubuntu in a web browser on it?
 
Did it used to do that? Or is this slowdown recent?
 
machine could not load this properly
 
But in general you are able to access website from the Ubuntu machine, yes?
 
6:05 PM
if you have any task or work then you will guide tommorrow
 
If your web browser in Ubuntu works, just not for opening up chat, then you should copy all the text from the terminal and paste it at paste.ubuntu.com, then provide the link you are given here.
I will then be able to look at it and see what has happened.
 
yes i access website but there is some connection problem in machine
 
I understand. Does the connection problem prevent you from pasting the contents of the terminal at paste.ubuntu.com ?
If it is severe, that might not work either. But most problems with unreliable connections will not prevent that from working.
 
can you wait 5 minutes i manage connction problem?
 
Yes.
If you post in chat and it seems like I might not be here, you can ping me by including @EliahKagan in your message. This will ensure that I am notified of your message, even if I am absent when it arrives or otherwise don't notice it.
 
6:21 PM
$ pkexec cp -n usr/bin/dpkg /usr/bin
/bin/cp: cannot stat 'usr/bin/dpkg': No such file or directory
 
There is more in the terminal from before that though, right?
 
right
 
Are you on the Ubuntu system now, or are you still on your phone?
 
yes i am in ubuntu system
 
Please select the entire contents of the terminal, copy it to the clipboard, and paste it here.
Depending on how much that is, chat might not let you send it all
If it does let you, great.
If it doesn't, then you can paste it all at paste.ubuntu.com
(If you do use paste.ubuntu.com, then you'll need to provide a link to it.)
 
6:26 PM
there is nothing in terminal
i restart it
i restart the machine so when i run first command
$ pkexec cp -n usr/bin/dpkg /usr/bin
/bin/cp: cannot stat 'usr/bin/dpkg': No such file or directory
 
If you restarted it, you are probably no longer in the same directory where you ran tar xf data.tar.gz. That would explain why the copy is not succeeding.
What is the output of
pwd
?
 
mitesh@mitesh-Inspiron-N5010:~/Downloads$ pkexec cp -n usr/bin/dpkg /usr/bin
/bin/cp: cannot stat 'usr/bin/dpkg': No such file or directory
mitesh@mitesh-Inspiron-N5010:~/Downloads$
 
Huh.
What's the output of
ls -l
?
 
mitesh@mitesh-Inspiron-N5010:~/Downloads$ ls -l
total 4100
-rw-r--r-- 1 mitesh mitesh 8492 Jan 23 23:10 control.tar.gz
-rw-r--r-- 1 mitesh mitesh 2074440 Jan 23 23:10 data.tar.gz
-rw-r--r-- 1 mitesh mitesh 4 Jan 23 23:10 debian-binary
drwxrwxr-x 3 mitesh mitesh 4096 Jan 23 22:59 dpkg_1.18.4ubuntu1.1_amd64
-rw-rw-r-- 1 mitesh mitesh 2083124 Jan 23 22:45 dpkg_1.18.4ubuntu1.1_amd64.deb
drwxr-xr-x 6 mitesh mitesh 4096 May 12 2016 etc
drwxr-xr-x 2 mitesh mitesh 4096 May 12 2016 sbin
 
What is the output of:
ls -l usr/bin
?
 
6:30 PM
mitesh@mitesh-Inspiron-N5010:~/Downloads$ ls -l usr/bin
total 992
-rwxr-xr-x 1 mitesh mitesh 278264 May 12 2016 dpkg
-rwxr-xr-x 1 mitesh mitesh 134520 May 12 2016 dpkg-deb
-rwxr-xr-x 1 mitesh mitesh 138648 May 12 2016 dpkg-divert
-rwxr-xr-x 1 mitesh mitesh 17765 May 12 2016 dpkg-maintscript-helper
-rwxr-xr-x 1 mitesh mitesh 146872 May 12 2016 dpkg-query
-rwxr-xr-x 1 mitesh mitesh 109712 May 12 2016 dpkg-split
-rwxr-xr-x 1 mitesh mitesh 60496 May 12 2016 dpkg-statoverride
-rwxr-xr-x 1 mitesh mitesh 72672 May 12 2016 dpkg-trigger
 
Try this now:
pkexec cp -n usr/bin/dpkg /usr/bin/
Do you get the same error?
 
mitesh@mitesh-Inspiron-N5010:~/Downloads$ ls -l usr/bin
total 992
-rwxr-xr-x 1 mitesh mitesh 278264 May 12 2016 dpkg
-rwxr-xr-x 1 mitesh mitesh 134520 May 12 2016 dpkg-deb
-rwxr-xr-x 1 mitesh mitesh 138648 May 12 2016 dpkg-divert
-rwxr-xr-x 1 mitesh mitesh 17765 May 12 2016 dpkg-maintscript-helper
-rwxr-xr-x 1 mitesh mitesh 146872 May 12 2016 dpkg-query
-rwxr-xr-x 1 mitesh mitesh 109712 May 12 2016 dpkg-split
-rwxr-xr-x 1 mitesh mitesh 60496 May 12 2016 dpkg-statoverride
-rwxr-xr-x 1 mitesh mitesh 72672 May 12 2016 dpkg-trigger
yes
i get same error
 
Interesting. This is apparently specific to pkexec. Let me figure out why.
pkexec does not automatically work with relative paths as sudo does. I have learned something! Anyway, sorry for the confusion. If you use this command instead, it should work:
pkexec cp -n "$(pwd)/usr/bin/dpkg" /usr/bin/
 
great! it works
 
Okay, now run these commands:
pkexec chown root:root /usr/bin/dpkg
pkexec chmod 755 /usr/bin/dpkg
dpkg --version
 
6:42 PM
mitesh@mitesh-Inspiron-N5010:~/Downloads$ pkexec cp -n "$(pwd)/usr/bin/dpkg" /usr/bin/
mitesh@mitesh-Inspiron-N5010:~/Downloads$ pkexec chown root:root /usr/bin/dpkg
mitesh@mitesh-Inspiron-N5010:~/Downloads$ pkexec chmod 755 /usr/bin/dpkg
mitesh@mitesh-Inspiron-N5010:~/Downloads$ dpkg --version
Debian 'dpkg' package management program version 1.18.4 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
mitesh@mitesh-Inspiron-N5010:~/Downloads$
 
That is good.
 
what should i do further
??
 
First, let's see if we can properly reinstall the dpkg package now, using the manually extracted dpkg executable:
pkexec dpkg -i "$(pwd)/dpkg_1.18.4ubuntu1.1_amd64.deb"
If /usr/bin/dpkg was the only broken file from that package, then this should work.
Otherwise, it may or may not work.
 
it works
mitesh@mitesh-Inspiron-N5010:~/Downloads$ pkexec dpkg -i "$(pwd)/dpkg_1.18.4ubuntu1.1_amd64.deb"
(Reading database ... 266217 files and directories currently installed.)
Preparing to unpack .../dpkg_1.18.4ubuntu1.1_amd64.deb ...
Unpacking dpkg (1.18.4ubuntu1.1) over (1.18.4ubuntu1.1) ...
Setting up dpkg (1.18.4ubuntu1.1) ...
Processing triggers for man-db (2.7.5-1) ...
mitesh@mitesh-Inspiron-N5010:~/Downloads$
 
Excellent!
Now that dpkg is fixed, let's see if APT works:
 
6:47 PM
then?
 
pkexec apt --reinstall install sudo
 
mitesh@mitesh-Inspiron-N5010:~/Downloads$ pkexec apt --reinstall install sudo
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
apport
The following packages will be upgraded:
 
Well, the problem that happened before did not happen this time. A different problem has happened this time.
What's the output of:
apt list sudo
?
 
mitesh@mitesh-Inspiron-N5010:~$ apt list sudo
Listing... Done
sudo/xenial-updates,now 1.8.16-0ubuntu1.2 amd64 [installed]
N: There is 1 additional version. Please use the '-a' switch to see it
mitesh@mitesh-Inspiron-N5010:~$
 
apt-cache policy sudo
 
6:51 PM
mitesh@mitesh-Inspiron-N5010:~$ apt-cache policy sudo
sudo:
Installed: 1.8.16-0ubuntu1.2
Candidate: 1.8.16-0ubuntu1.2
Version table:
*** 1.8.16-0ubuntu1.2 500
500 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
100 /var/lib/dpkg/status
1.8.16-0ubuntu1 500
500 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
mitesh@mitesh-Inspiron-N5010:~$
 
Run:
pkexec dpkg --configure -a
 
mitesh@mitesh-Inspiron-N5010:~$ pkexec dpkg --configure -a
Setting up sudo (1.8.16-0ubuntu1.2) ...
Setting up python-mysqldb (1.3.7-1build2) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-mysqldb (--configure):
 
ls -l /usr/bin/sudo
 
mitesh@mitesh-Inspiron-N5010:~$ ls -l /usr/bin/sudo
-rwsr-xr-x 1 root root 136808 Aug 17 18:50 /usr/bin/sudo
mitesh@mitesh-Inspiron-N5010:~$
 
sudo echo success
 
6:56 PM
mitesh@mitesh-Inspiron-N5010:~$ sudo echo success
[sudo] password for mitesh:
success
mitesh@mitesh-Inspiron-N5010:~$
 
Congratulations -- sudo works now!
Let's fix the other APT error if we can.
 
thank you so much sir.
 
You're welcome -- it's quite satisfying that the main goal has been achieved! :)
So, to fix that other error:
sudo apt -f install
 
how remove this?
 
That might work by itself, but if not, its output may reveal what to do.
 
6:58 PM
Errors were encountered while processing:
python-mysqldb
apport
apport-gtk
 
Was that the full output?
 
itesh@mitesh-Inspiron-N5010:~$ sudo apt -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
apport
The following packages will be upgraded:
apport
1 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
 
sudo apt update && sudo apt --purge --reinstall install apport
(I expect that to produce lots of output. If possible, please paste it all.)
 
yes it works
 
No errors?
 
7:10 PM
its downloading
 
Ah. When it finishes, please show me the output.
 
mitesh@mitesh-Inspiron-N5010:~$ sudo apt update && sudo apt --purge --reinstall install apport
[sudo] password for mitesh:
Sorry, try again.
[sudo] password for mitesh:
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:2 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [202 kB]
Hit:5 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease
 
Have you ever deliberately changed the way Python was installed on this system?
 
how to remove or uninstall python?
python is corrupted
no deliberately changed
 
Besides the output you've just seen on the terminal, do you have further reason to think Python is corrupted? Is this something you had noticed before?
 
7:23 PM
yes, when i try repair packages in recovery mode it gives message me your python is corrupted.
 
What is the output of:
head -n1 /usr/bin/pyclean
?
 
mitesh@mitesh-Inspiron-N5010:~$ head -n1 /usr/bin/pyclean
#! /usr/bin/python
 
/usr/bin/python -V
 
mitesh@mitesh-Inspiron-N5010:~$ /usr/bin/python -V
Python 3.5.2
 
You appear to have the same problem with Python as in this question:
1
Q: "except (IOError, OSError), e: SyntaxError: invalid syntax" when configuring python-lockfile

ZodEnIXI am having trouble installing any new packages in Ubuntu because of python. I tried sudo apt-get install python3 python3-dev but I am getting the following output :: dpkg: error processing python-lockfile (--configure): Package is in a very bad inconsistent state - you should reinstall it b...

/usr/bin/python should be Python 2 but it is Python 3 instead.
What is the output of:
ls -l /usr/bin/python*
?
 
7:28 PM
mitesh@mitesh-Inspiron-N5010:~$ ls -l /usr/bin/python*
lrwxrwxrwx 1 root root 16 Jan 18 17:58 /usr/bin/python -> /usr/bin/python3
lrwxrwxrwx 1 root root 9 Jan 5 17:07 /usr/bin/python2 -> python2.7
-rwxrwxrwx 1 root root 3546104 Nov 19 15:05 /usr/bin/python2.7
-rwxrwxrwx 1 root root 151 Nov 23 2015 /usr/bin/python2-pbr
lrwxrwxrwx 1 root root 9 Jan 5 17:07 /usr/bin/python3 -> python3.5
-rwxrwxrwx 2 root root 4460336 Nov 18 00:53 /usr/bin/python3.5
lrwxrwxrwx 1 root root 33 Nov 18 00:53 /usr/bin/python3.5-config -> x86_64-linux-gnu-python3.5-config
 
It looks like you may be able to fix this just by making the /usr/bin/python symlink point to python2 instead of python3.
 
okey how to remove this all?
 
To do that:
cd /usr/bin
sudo rm python
ln -s python2 python
sorry
The last command needs sudo too.
cd /usr/bin
sudo rm python
sudo ln -s python2 python
 
it runs
there is no any output
 
type -a python
python -V
(Those two commands don't change anything; I just want to check their output to make sure that /usr/bin/python is set up correctly now.)
 
7:38 PM
mitesh@mitesh-Inspiron-N5010:/usr/bin$ python -V
Python 2.7.12
 
What was the output of type -a python ?
 
python is /usr/bin/python
 
Good.
Let's see if your package manager is able to use Python properly now.
sudo dpkg --configure -a
 
mitesh@mitesh-Inspiron-N5010:/usr/bin$ sudo dpkg --configure -a
Setting up bsdutils (1:2.27.1-6ubuntu3.2) ...
Setting up python-mysqldb (1.3.7-1build2) ...
dpkg: error processing package apport (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of apport-gtk:
apport-gtk depends on apport (>= 0.41); however:
Package apport is not configured yet.

dpkg: error processing package apport-gtk (--configure):
 
That's expected, no problem yet.
sudo apt --purge --reinstall install apport
 
7:42 PM
mitesh@mitesh-Inspiron-N5010:/usr/bin$ sudo apt --purge --reinstall install apport
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
apport
1 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
 
That looks to have succeeded.
 
all is done?
 
I suggest attempting to install updates and remove unneeded packages. If that works, that suggests your package manager is in a working state.
You've run sudo apt update very recently so, to install whatever updates are available, you can run:
sudo apt upgrade
(Sometimes that doesn't install all available updates, but it will tell you.)
(This doesn't upgrade you to a later Ubuntu release, it just updates the packages you currently have installed.)
 
ok this done
 
It ended with 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.?
 
7:49 PM
yes
mitesh@mitesh-Inspiron-N5010:/usr/bin$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
mitesh@mitesh-Inspiron-N5010:/usr/bin$
 
sudo apt autoremove
 
thank you so much sir.thanks for giving your valuable time.
mitesh@mitesh-Inspiron-N5010:/usr/bin$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 295 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 266216 files and directories currently installed.)
 
Excellent.
And you're welcome!
So, I believe that all the problems you or I noticed with your system are now fixed.
 
yes sir
 
However, I still don't know what caused all these problems, so I cannot know whether or not there is still something wrong with it.
I recommend that, as always (even if your system never gave you any trouble), that you keep current backups of all your documents and important files, in case something does go wrong and you have to reinstall on short notice or even lose data.
 
7:54 PM
ok.no problem
thanks
 
What you've shown me on your system does not especially look like faulty RAM a failing hard disk or anything, but since I unfortunately have no idea what caused these several different problems, I can't really conclude it's not something like that either.
 
Anyway, if you have more problems with the system on that machine, feel free to ping me in chat -- though you can of course also post new questions on Ask Ubuntu.
If we haven't talked in this room in several days and you want to contact me, then pinging me in Ask Ubuntu's main chat will be more effective. There's no guarantee that I'll be available to help, but if I am, I will. (To ping me you would write a message that has @EliahKagan in it, or just reply to any of my chat messages.)
I had been hoping that, during the course of working on this, we would discover a root cause of your various problems on that system. I was curious about that. But if the system is working well without further problems, and you have good backups, then I think you are okay.
I have also benefited from this, actually -- this specific approach to fixing a broken dpkg is not one that I have used before and I was quite interested to be able to put it into action, and furthermore, I have filled a gap in my knowledge of pkexec -- I either did not know or had long forgotten that, unlike sudo, pkexec does not run commands in the current directory where pkexec itself is invoked.
Sometime in the next day or so, I'll add a summary of what we've done here to my answer. Once I've added that, if you haven't had any more related problems on the machine, then I suggest accepting my answer by clicking the check mark to the left of it. (You are not obligated to accept my answer, however. You should do so only if you feel it has solved your problem. Either way, if you have more problems on this machine, I'll be interested to hear about it.)
 

« first day    last day (15 days later) »