this post was submitted on 26 Nov 2023
9 points (100.0% liked)

Web Development

3430 readers
40 users here now

Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development

What is web development?

Web development is the process of creating websites or web applications

Rules/Guidelines

Related Communities

Wormhole

Some webdev blogsNot sure what to post in here? Want some web development related things to read?

Heres a couple blogs that have web development related content

CreditsIcon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 1 year ago
MODERATORS
 

PostgreSQL says it’s included in Ubuntu related operating systems, but I’m not sure. I’m unable to start the service, or set up new servers in PgAdmin. I’ve tried to install the repositories but I’m either getting “1831” architecture errors, or no release file errors. I’ve tried fixing the list file, but it doesn’t seem to help. If anyone can help i would really appreciate it

The course I’m taking provides download links for an installer for windows, and Mac. After this and another problem I’ve had on Mac back in the day I’m thinking of switching to windows. Maybe the development software works better there.

top 14 comments
sorted by: hot top controversial new old
[–] [email protected] 8 points 1 year ago* (last edited 1 year ago) (1 children)

This whole question is extremely confusing, and the fact that you would consider switching to windows makes me think this is just trolling.

sudo apt-get install postgres is literally all you need to do. Then systemctl start postgresql.service

But you should probably be using docker anyway.

docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres

Like, you're editing sources list files? Where did you read that that's a thing you should be doing?

[–] Creatortray 3 points 1 year ago* (last edited 1 year ago)

Not trolling. I used the repo link on the site that it gave for apt distros. Got a terminal error. That’s what i was told when i looked up the terminal error. I have absolutely no experience with docker, so i haven’t tried it.

UPDATE just saw the terminal code you shared. I’ll try that. The command i found to start the service was slightly different. Really appreciate your response.

[–] [email protected] 4 points 1 year ago (1 children)

Start up a fresh VM in the distro you're using and follow instructions on how to initialize it there. If you do this and it works on the VM, you'll know it's some sort of system config error instead of a user error. I have no other ideas bc I've never done that before but best of luck :)

[–] Creatortray 1 points 1 year ago (1 children)

Unfortunately I’ve had the same problem in two separate distros. Thanks for the advice though!

[–] [email protected] 2 points 1 year ago (1 children)

If it’s happened on multiple distros the problem is likely in the commands you are entering / instructions you are following. The top comment on this post has the right install commands, follow that or do some googling for how to install postgresql on Ubuntu. I’d imagine digital ocean or someone else has made a good detailed guide that will help you.

Sometimes it’s just a matter of finding the right, up to date instructions for how to do the thing

Otherwise, in the future posting the full error you are getting and the full commands you are running will help us debug your specific situation in a more concrete way. With the little information we have we can only guess at the issue and point you towards the right way to install Postgres.

[–] Creatortray 1 points 1 year ago

Thank you for the information! I’ll definitely include the errors from now on. I should have come here way sooner.

[–] [email protected] 4 points 1 year ago (1 children)

I had issues with setting a postres user, or adding my user to the postgres user group... It's confusing because there are Linux users and Postgres users, you can mix and match.. make it work. I did, but forgot how. Switched to docker (setting postgres user and password in docker compose) and moved ahead... Simpler, cleaner, manageable.

[–] Creatortray -1 points 1 year ago (2 children)

I actually got it working thanks to @[email protected] i learned two things. First i need to be more careful about what questions I’m asking. The second thing is to use ChatGPT wisely.

[–] [email protected] 3 points 1 year ago

The second thing is to use ChatGPT wisely.

Yikes

[–] [email protected] 2 points 1 year ago (1 children)

Cool. Good luck deploying on new server(s) when the time comes ;)

[–] Creatortray 1 points 1 year ago

I’ve got so much to learn. Looking forward to it!

[–] [email protected] 2 points 1 year ago (1 children)

I know you've solved the problem. I would still like to suggest using the asdf version manager. It's a good idea to switch to it because different problems tend to crop up when installing different tooling. Usually these are unique to each tool and sometimes hard to find the right solution.

Instead, I use asdf to manage it all for me. You get the added benefit of being able to install different versions of the same tool. Sometimes a project is built using a different version to the one you have in your package manager. It's nice to be able to use different versions locally while still having a global default.

[–] Creatortray 1 points 1 year ago (1 children)

I will 100% look into that. Thanks a ton!

[–] [email protected] 2 points 1 year ago
asdf plugin add postgres
asdf install postgres latest
asdf global postgres latest
pg_ctl start