3

I was deleting wine package and somehow apt-get was deleted along wine. Now if I try to use apt-get I see message that apt-get isn't installed/exists.

I already install aptitude, but when I use it I have error says that I haven't driver for /usr/lib/apt/methods/https

so here's the question: how can I install apt-get back?

  • 1
    did you try another package manager like synaptic package manager or ubuntu software center to install the apt package? – Nil Aug 29 '13 at 0:50
  • nope. it's graphical. i need manager for terminal. – Alexander Aug 29 '13 at 1:01
  • Sorry, you're correct, Synaptic is the front end for apt, it depends on apt. The same is true for Software Center. – Nil Aug 29 '13 at 1:09
  • problem solved. i've collected apt-get from pieces. thx to all who have answered. – Alexander Aug 29 '13 at 1:12
6

apt-get is a kind of "frontend" for dpkg which is in an ultimate instance, who do all operations. You can easily recover your apt-get if you download the package from the repository and install it yourself:

(this is a illustrative example, I'm using the latest version of apt i386 from precise-updates repository, you should download the one that fits you, for a complete list of versions check: Ubuntu apt package list or Launchpad apt package list. You should check your installed version using apt-cache policy apt)

wget http://mirrors.us.kernel.org/ubuntu/pool/main/a/apt/apt_0.8.16~exp12ubuntu10.12_i386.deb http://mirrors.us.kernel.org/ubuntu/pool/main/a/apt/apt-transport-https_0.8.16%7Eexp12ubuntu10.12_i386.deb
sudo dpkg --unpack apt_0.8.16~exp12ubuntu10.12_i386.deb apt-transport-https_0.8.16%7Eexp12ubuntu10.12_i386.deb
sudo dpkg --configure -a
sudo apt-get update

Now you have your apt-get working again.

Why not use --install instead of separated --unpack and --configure?

The --install switch executes tasks that are not necessary (prerm, preinst, postrm) for recovering apt binaries, and might run into problems later due the sorry state of the installation. For such reason, --unpack to get the binaries set in place and --configure to restore any lost configuration file are just necessary.

| improve this answer | |
0

I have get apt package from this link. Run

wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/.. #As you selected add here

In my select package is below:

wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.2.29ubuntu0.1_amd64.deb

Then run

sudo dpkg --unpack apt_1.2.29ubuntu0.1_amd64.deb
sudo dpkg --configure -a
sudo apt-get update

Hope it works

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.