I did the command
sudo apt-get purge and all my
apt- commands and my software center are no longer installed.
when ever i do 'sudo apt-get update' even, i get 'sudo: apt-get: command not found'
You don't have APT installed, so you can't automatically download and install any packages. That includes the packages you need to put APT back. Therefore, you must manually install them.
The best place to get them is probably here on Launchpad, since the interface is easy to use and the downloads are encrypted over HTTPS (which means you're far less likely to get corrupted files).
On the page for the
apt source package on Launchpad, find your release. There may be more than one entry under it that can be expanded. Expand the entry that says updates if there is one. If not, expand the entry that says security if there is one. If not, expand the entry that says release.
In this case, the entry to expand is (therefore)
0.9.7.5ubuntu5.4, which says
updates, security (main) next to it.
Then download all the
.deb files for your architecture:
- Get all files whose names end in
- If you have a PC or Intel Mac with a 32-bit processor, get all files whose names end in
- If you have a PC or Intel Mac with a 64-bit processor (even if it is an Intel processor), get all files whose names end in
Download the files to a folder that has no other files in it. You'll probably make a new folder for this purpose.
You can actually skip the
libapt-pkg-doc packages if you like, as it provides documentation that's not necessary for running APT. I recommend going ahead and getting them, though.
The following is for your convenience (and that of others with this problem who are running Ubuntu 12.10, as many people currently are). Following the above instructions will work fine. If you like, you can download the packages using the links below, which are taken directly from that Launchpad page.
If you want
apt-pkg-doc, download them here:
On a 32-bit system (but not if you're running the 64-bit version of Ubuntu), get these files:
- https://launchpad.net/ubuntu/+archive/primary/+files/libapt-pkg-dev_0.9.7.5ubuntu5.4_i386.deb (often optional, but no reason not to get it)
On a 64-bit system (but not if you're running the 32-bit version of Ubuntu), get these files:
- https://launchpad.net/ubuntu/+archive/primary/+files/libapt-pkg-dev_0.9.7.5ubuntu5.4_amd64.deb (often optional, but no reason not to get it)
With all the downloaded
.deb files in one folder, go into the folder in the Terminal.
For example, if you put them in a folder called
debs in your home directory, you'd open a Terminal window (Ctrl+Alt+T) and run:
This would put you in your
debs folder. (
~ represents your home folder.)
If the folder is elsewhere, you'll have to specify where. For example, if you put it inside the
Downloads folder in your home folder:
If you prefer, you can simply type
cd (with the space at the end), don't press Enter yet, but drag the folder from Nautilus (the file browser) into the Terminal. This will paste its full path. Then you can press Enter to go there.
Once you are in the folder that contains the
.deb files you downloaded, run this command:
sudo dpkg -i *
That will install them all. That should restore APT and you should be able to install packages in the usual way again. (If you are accustomed to using the Software Center, and that's also uninstalled, then you can get that back with
sudo apt-get update && sudo apt-get install software-center.)
If you get errors when you run that
dpkg command, please post a comment and also update your question with all the text from the Terminal. If it says there are unsatisfied dependencies, you might try to find those yourself on Launchpad, but feel free to ask for help.
Assuming this works, you should reinstall
libusb-0.1-4 followed by
ubuntu-desktop (assuming this is a vanilla Ubuntu system and not, say, Kubuntu, Xubuntu, or Lubuntu).
libusb-0.1-4 (assuming you've already run
sudo apt-get update):
sudo apt-get install libusb-0.1-4
Then to install
ubuntu-desktop (to restore other packages that got removed):
sudo apt-get install ubuntu-desktop