1

I do the following on one Ubuntu machine (Ubuntu 16.04.3 LTS)

sudo apt-get install libsqlite3-dev

it shows

E: Unable to locate package libsqlite3-dev

But if I perform the same command on the other one (Ubuntu 16.04.3 LTS too), it shows the following and the package is installed successfully

After this operation, 1,699 kB of additional disk space will be used.
Get:1 http://sg.archive.ubuntu.com/ubuntu xenial/main amd64 libsqlite3-dev amd64 3.11.0-1ubuntu1 [508 kB]     
Fetched 508 kB in 1s (383 kB/s)           
Selecting previously unselected package libsqlite3-dev:amd64.

I suspect the repository:

http://sg.archive.ubuntu.com/ubuntu xenial/main amd64 

is not in the first machine repository list. How should I add it?

Zanna
  • 70,465

2 Answers2

0

Some mirrors may be out of sync.

Try to select other mirror:

  1. open Software & Updates (software-properties-gtk)
  2. on Ubuntu Software tab select other server (for example Main Server) from Download from drop-down menu.
  3. if you planning to compile something check Source code

Software & Updates - Ubuntu Software

  1. confirm reloading lists

Then try to install you program again with:

sudo apt-get install libsqlite3-dev
N0rbert
  • 99,918
-1

First, try updating your sources:

    sudo apt-get update

Check for any error messages here, and try installing again.

If you still have errors, you can check your active repositories with the following command:

    sudo nano /etc/apt/sources.list

The line you are looking for should be the first active source in this file. The format should read:

    deb http://sg.archive.ubuntu.com/ubuntu/ xenial main restricted

Inactive sources will have "#" at the beginning of the line. Remove this to activate them. Additionally, you can add your own sources at the end of this file.

After editing your sources file, you will want to update apt again:

    sudo apt-get update
Rich Knepp
  • 73
  • 1
  • 1
  • 7