Saturday, December 29, 2018

apt - local package repository on custom server can't be authenticated


I successfully setup a local package repository on custom server with the following steps


sudo apt-get install apache2
cd /var/www/html
mkdir debian
cp /path/to/mydeb.deb /var/www/html/debian
dpkg-scanpackages debian /dev/null | gzip -9c > debian/Packages.gz

while on the client


vim /etc/apt/sources.list

add deb http://54.68.121.138 debian/to the end of the file


sudo apt-get update

There shows the below warning message



W: The repository 'http://54.68.121.138 debian/ Release' does not have a
Release file. N: Data from such a repository can't be authenticated
and is therefore potentially dangerous to use. N: See apt-secure(8)
manpage for repository creation and user configuration details.



If I install it by sudo apt-get install mydeb, I will get prompted with



Install these packages without verification? [y/N]



If I enter y I can still successfully install mydeb on the client, but what should I do on the server to make the client thinks the repository is authenticated and verified?



Just in case anyone is interested. The solution to this problem is put deb [arch=amd64 trusted=yes] http://54.68.121.138 debian/ in the end of /etc/apt/sources.list instead of just deb http://54.68.121.138 debian/


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...