Installing apt-get

273,850

Solution 1

of course you can do that, although it is strange that you missed that package/command ... Anyway, a manual way to do it is to download the package and to install it with dpkg, as follows:

  1. grab the package from the web

     wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.17_amd64.deb -O apt.deb
    

Edit: Check for the latest source at http://security.ubuntu.com/ubuntu/pool/main/a/apt/?C=M;O=D

  1. install it with dpkg

     sudo dpkg -i apt.deb
    

2 (other). Alternative use of dkpg without sudo - I didn't know about these, included after comments-

pkexec dpkg -i apt.deb

if everything goes right, that should be enough.

Probably you may find that some dependencies are not satisfied, to deal with that you may need to create a folder (something like "apt-installer") and drop all the dependencies of the apt package there. The list of dependencies required will be shown by the dpkg output and the download process is similar to the one explained above. Last, if you don't feel confident of what you are doing, my suggestion is that you may want to do a fresh install of your system.

Cheers.

Solution 2

Now...

wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_2.1.10ubuntu0.2_amd64.deb -O apt.deb

In the future this will likely 404 error as well, so remove the file name apt_2.1.10ubuntu0.2_amd64.deb -O apt.deb

and enter just the http://security.ubuntu.com/ubuntu/pool/main/a/apt/ part into a browser. Look for the most current version of the file, and change the path to it.

Share:
273,850

Related videos on Youtube

user3078335
Author by

user3078335

Updated on September 18, 2022

Comments

  • user3078335
    user3078335 over 1 year

    The apt-get command and the sudo command does not work for me. which apt-get returns nothing. I checked by bin folder to make sure, and there is no aptget. I however have wget. Can I install apt-get with wget? If not, how can I install it?

  • Nonny Moose
    Nonny Moose over 7 years
    Good one, but remember he said sudo didn't work either.
  • Byte Commander
    Byte Commander over 7 years
    If only sudo does not work (which should get fixed as soon as possible!), you can try to replace it with pkexec for the moment, i.e. pkexec dpkg -i apt.deb
  • Rho
    Rho over 7 years
    Oh dear! it is true! haha... without the sudo package everything is supposed to have the admin level, right? if that's so the only easy way that comes to my mind is to uncompress the .deb file and locate the new files and folders manually in their destination, with their proper permissions... but I'm only guessing here, at this point my "real life" solution is a fresh install. :) Thanks Byte! I didn't know about pkexec. Editing.
  • Emre Tapcı
    Emre Tapcı about 4 years
    If the above wget command gets a 404 error, try wget http://ftp.us.debian.org/debian/pool/main/a/apt/apt_1.8.2_am‌​d64.deb -O apt.deb
  • AverageHelper
    AverageHelper over 3 years
    @EmreTapcı This one's also a 404
  • Admin
    Admin over 3 years
    I see what you’re trying to say, but can you clean the answer up with a chronological, step-by-step process for people who have a similar problem in the future? 👍🏻
  • Y-B Cause
    Y-B Cause about 3 years
    Sounds clear enough
  • Gulzar
    Gulzar over 2 years
    Where should this be installed into?