golang-migrate / migrate

Database migrations. CLI and Golang library.
Other
14.48k stars 1.34k forks source link

Install on Ubuntu with apt #1075

Open konstantin83 opened 2 months ago

konstantin83 commented 2 months ago

Here https://github.com/golang-migrate/migrate/blob/master/cmd/migrate/README.md#linux-deb-package lays the code to install migrate on Ubuntu.

  1. It's being copied with "$ " prefix included in each line. Which obviously leads to errors in console. So first it must be cleaned somewhere with hands, which is strange. PLease remove the $ prefixes
  2. It can't add migrate repo, here's the error:
    
    ❯ sudo echo "deb https://packagecloud.io/golang-migrate/migrate/ubuntu/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/migrate.list

zsh: permission denied: /etc/apt/sources.list.d/migrate.list

I needed to manually add this line `deb https://packagecloud.io/golang-migrate/migrate/ubuntu/ mantic main` to above file under sudo. Still don't understand why this happened
3. Then `sudo apt-get update` leads to this error:

Err:17 https://packagecloud.io/golang-migrate/migrate/ubuntu mantic Release 404 Not Found [IP: 2600:1f1c:2e5:6901:f199:7554:a898:73b6 443] Reading package lists... Done E: The repository 'https://packagecloud.io/golang-migrate/migrate/ubuntu mantic Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.


4. So migrate can't be installed this way.

Can you please update the installation process for those who just start to get to know this software?
glenatron commented 2 months ago

Apparently the trick is to download the .deb package directly: https://github.com/golang-migrate/migrate/issues/818#issuecomment-1270444615