DDEV (Linux/WSL2) I upgraded but I still see the old version - upgrade

My current DDEV installation on WSL2 Ubuntu 20.04 LTS is v1.16.7. Since I plan to start using Drupal 10, I need to upgrade -- for example, to 1.21.4. So I issued the commands to upgrade as indicated in the documentation and I get "ddev is already the newest version (1.21.4)", and nothing new is installed, and I still end up having v1.16.7. I tried the full "curl" command and all the normal update commands, but every time it tells me all is well, ddev is already the newest version ... and then I still have the same version as before. I'd like to avoid uninstalling everything, which seems like a drastic solution. Any ideas about what's going on?

You have more than one version of DDEV installed, and you'll have to sort it out. On Linux (WSL2) your $PATH determines where it looks for executable binaries. You can echo $PATH to see what the order is, and you can which ddev to find out which one it's using. (You don't have to do or understand the below once you understand that, but you can continue for more detail.)
On WSL2 you're likely to have
/home/linuxbrew/.linuxbrew/bin/ddev (If you installed with homebrew). That may or may not be in your $PATH; sometimes people don't get it into their $PATH properly.
/usr/local/bin/ddev (If you installed with install_ddev.sh). /usr/local/bin is almost always in the $PATH of a Linux system.
/usr/bin/ddev (If you installed with the newer apt install ddev technique, which is recommended).
All three of these work fine and are supported, but I recommend that you go with the newer apt install technique.
So you can do this:
brew uninstall ddev
sudo rm -f /home/linuxbrew/.linuxbrew/ddev /usr/local/bin/ddev
That will remove the other ones.
Then follow the Linux instructions in the docs and
curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null
echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list
sudo apt update && sudo apt install -y ddev
That should get you the ddev in /usr/bin/ddev which will certainly be in your $PATH.
On WSL2 with DDEV v1.21.4, you'll want to install DDEV on the Windows side as well, just for the odd case where you use a non-*.ddev.site hostname, and DDEV needs to update the hosts file on the Windows side. So in admin PowerShell, choco install -y ddev.

Related

Can't install powershell in Parallels Kali Linux Virtual Machine

I've been trying to install Powershell for a few hours now. I run this under root:
apt update && apt -y install powershell
This is what I end up getting after it runs through and seemingly downloads
Package powershell is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'powershell' has no installation candidate
When I try to run this same command outside of root using sudo, I get the following:
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
I have updated everything and tried a few different ways. I even downloaded a completely new Virtual Machine in Parallels to see if restarting would help out. I still run into the same problems. This is a Kali Linux VM on Parallels MacOS M1. Not sure if that matters or not. I think Parallels itself may possibly be using an apt process in the background, but when I do:
sudo killall apt apt-get
I end up getting
apt: no process found
apt-get: no process found
I've been trying everything. I'm on a new Mac so I don't have too many VM options. If someone could figure this out in Parallels, it would be a great help.
I've tried a lot. In the description above.
To install PowerShell in Kali Linux open the terminal and type:
sudo apt update
sudo apt install -y snapd # install daemon and tooling that enable snap packages
sudo systemctl enable --now snapd apparmor
Log out and back in again, and run the following command to install the powershell snap package.
sudo snap install powershell --classic

Install packages during uck Ubuntu customization

I am following the steps from this website to customize my Ubuntu image. After unpacking the clean .iso I add some files to the "remaster" and also I would like to install some apps (wireshark for example), so when the systems boots with the custom image, there is no need to install anything. I run the following script:
sudo uck-remaster-clean
sudo uck-remaster-unpack-iso my.iso
sudo uck-remaster-unpack-rootfs
// .. add desired files to the remaster
sudo apt-get install wireshark
sudo uck-remaster-pack-rootfs -c
sudo uck-remaster-pack-iso -g myNew.iso
However, wireshark is installed on the machine on which I am running the script, not in the remaster-root system. What do I need to modify to have the apps installed on the unpacked ISO? Is it even possible?
You skipped a step, you need to sudo uck-remaster-chroot-rootfs before.
Now you can install packages with apt-get and perform all kinds of customizations.

How to install earlier version of mongodb with homebrew?

I'm on osx6.8 and need to install an earlier version of Mongodb, how do I install an earlier version with HomeBrew?
The below didn't work :(
dream-2:app2 star$ brew install mongodb-2.6.10
Error: No available formula for mongodb-2.6.10
Searching formulae...
Searching taps...
dream-2:app2 star$
Edit:
I'm getting a message to explain how this post is unique compared to another one, well, the answer to the other question is super long and complex and it's specific to postgresql and doesn't really answer my question.
Note: In September 2019 mongodb was removed from homebrew core, so these instructions have been updated to use mongodb-community instead, installed from the external tap.
If your current installation is still the pre-September mongodb package then you will need to use that name when you unlink, stop, relink and start, on the lines marked with #*# below.
Another option is to simply upgrade away from the deprecated package now.
I already have the latest version of mongo installed, thanks to.
brew tap mongodb/brew
brew install mongodb-community
But I want to switch to the old version sometimes. First, install it:
brew search mongo
brew install mongodb-community#3.2
Let's stop the current mongodb, if it is running:
brew services stop mongodb/brew/mongodb-community #*#
# or if you had started it manually
killall mongod
Now I want 3.2 on my PATH instead of the latest:
brew unlink mongodb-community #*#
brew link --force mongodb-community#3.2
(Apparently it needs --force because it is keg-only.)
Now I have 3.2 on my PATH, I can start the test DB:
mongod --version
brew services start mongodb/brew/mongodb-community
# or start your own mongod from the command-line
When I am finished, I can do the reverse to switch back to the latest version:
brew services stop mongodb/brew/mongodb-community
brew unlink mongodb-community#3.2
brew link mongodb-community #*#
brew services start mongodb/brew/mongodb-community #*#
And restart again.
When trying to install old versions of something with homebrew, it's usually useful to start with brew search packagename, in this case, there's a 2.6 version available under homebrew/versions/mongodb26
So, to install that version:
brew install homebrew/versions/mongodb26
Edit
This answer has certainly become very dated. Take a look at the answer below for a valid way to accomplish this in 2021.
curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.12.tgz
tar -zxvf mongodb-osx-x86_64-3.2.12.tgz
mkdir -p mongodb
cp -R -n mongodb-osx-x86_64-3.2.12/ mongodb
export PATH=<mongodb-install-directory>/bin:$PATH #path to the dir created in step 3
mkdir -p /data/db
sudo chown -R $(whoami) /data/
mongod
Addition to the excellent answer of joeytwiddle :
if you don't want to link then unlink the old version of the software, you can just run it from the "cellar" (/usr/local/Cellar/), where brew installed it.
Use ls /usr/local/Cellar/ to find the exact path of the executable. For example in my case, to run mongo shell:
/usr/local/Cellar/mongodb#3.6/3.6.7/bin/mongo
Instead of using homebrew you can use docker to install as many versions of mongodb as you want. Each mongodb can then run on separate ports.
Install docker with brew cask install docker and then open Docker.app. After docker is running, go to Terminal and install your mongodb version by selecting an image from https://hub.docker.com/_/mongo/ like so: docker run -d -p 28017:27017 --name mongo4 mongo:latest
Verify that it's running with docker ps and you can connect to mongodb from your app using port 28017. Repeat the steps with a different name and port to install more versions. Enjoy!
I was able to install it using these instructions:
Installing MongoDB on OSX for local development
Over the last week, I’ve been building our MongoDB cluster on EC2 for
production. For development, however, we’ll still need to install
MongoDB locally. I’m running OSX 10.6.8, but these install
instructions should be the same on all modern OSX versions.
Installing on OSX is much more pleasant than on EC2 (actually it’s just as easy on EC2, but since it’s a simpler setup there’s n real configuration or
head scratching).
Download the latest binary:
curl -O http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.0.2.tgz
Note!: If
you don’t have wget installed, simply download the file above by
visiting the link in your web browser and move it into your home
directory.
We’re going to install everything under /usr/local/mongodb
to keep things organized.
Create the directories (switch 'youruser' with your home user name):
sudo mkdir /usr/local/mongodb
sudo mkdir /usr/local/mongodb/log
sudo mkdir/usr/local/mongodb/data
sudo chown youruser /usr/local/mongodb/log
sudo chown youruser /usr/local/mongodb/data
sudo chgrp staff /usr/local/mongodb/log
sudo chgrp staff /usr/local/mongodb/data
Un-tar the binaries and move them into the correct folder:
tar -xvzf ~/mongodb-osx-x86_64-2.0.2.tgz
sudo mv ~/mongodb-osx-x86_64-2.0.2/* /usr/local/mongodb/
Create a config file for mongod:
sudo vi /usr/local/mongodb/mongod.conf
Paste:
dbpath=/usr/local/mongodb/data
logpath=/usr/local/mongodb/log/mongod.log
logappend=false
bind_ip=127.0.0.1
Note: dbpath and logpath specify the path to their
respective files, logappend is set to overwrite the log file on each
start of the database server, bind_ip only allows local connections.
Create an alias so that issuing mongod always read the config file:
vi ~/.profile
Paste:
# MongoDB Alias'
alias mongod="/usr/local/mongodb/bin/mongod --config=/usr/local/mongodb/mongod.conf"
All done, you should be able to simply type mongod after you reload the shell to start MongoDB. I
preferred not to start mongod on boot, but there are other who prefer
to and there’s plenty of documentation online to show you how to set
that up with launchd and creating a .plist.
http://alexanderwong.me/post/15259867190/installing-mongodb-on-osx-for-local-development
If you want to install an earlier MongoDB version on mac. Go to the link https://docs.mongodb.com/v3.6/tutorial/install-mongodb-on-os-x/ and select the version which you want to install and its very easy to install, just give a try. There will be around 2-3 commands for installation.
For example if you want to install version 3.6
brew tap mongodb/brew
brew install mongodb-community#3.6
If you got some error
If you need to have mongodb-community#3.6 first in your PATH run:
echo 'export PATH="/usr/local/opt/mongodb-community#3.6/bin:$PATH"' >> ~/.bash_profile
Then run
export PATH="/usr/local/opt/mongodb-community#3.6/bin:$PATH"
To confirm if it successfully installed:
mongod -version

I'm trying to install PostgreSQL onto Ubuntu 14.04, but I am having difficulties after following a guide

I originally followed the guide at http://www.postgresql.org/docs/9.3/static/runtime.html. It instructed me to install postgres-xc, which is meant for making clusters of databases. On other sites, I was instructed to use the postgres-9.3 package (or 9.x) instead of the postgres-xc package. One inconsistency I noticed was that arguments such as --nodename were missing from the original guide, which led me to believe there was an issue with the original guide
I have uninstalled postgres-xc using both apt-get remove --purge postgres-xc and dpkg remove --purge postgres-xc, as advised by others, as well as following this solution, which involves changing postgres-xc.prerm so that it exits early on.
Additionally, I have uninstalled and reinstalled the postgresql-package many times and also run sudo apt-get install postgresql postgresql-contrib and sudo apt-get install postgresql-9.3 postgresql-contrib-9.3. I have done this after uninstalling other version. When I try running the postgres command in Bash, I get the following error:
The program 'postgres' is currently not installed. You can install it by typing:
sudo apt-get install postgres-xc
I've been trying to get this to work for a while, but nothing has worked so far. The only binary for PostgreSQL I can use is psql, which is just a dynamic session for it (and I want to set up a server).

Uninstall memcached and/or (force) install with Homebrew - Mac OS X

I need a memcached on my Mac (os X 10.8), and I began by installing memcached and libevent 'manually' (1).
Well, maybe I did this a bit too quickly, and now I'm figuring out that it would be better to install it 'cleanly' with Homebrew.
I think I should first uninstall 'cleanly' libevent and memcached. Should I ?
Or should I simply run brew install memcached , and use the function to delete the files Homebrew thinks are to be deleted ? (I mean brew link -f memcached after brew install memcached ; I'm wondering how 'clean' it will be , and if I won't encounter problems hard to solve later on ...)
Thanks for your help !
(1) how I installed libevent:
cd /tmp
wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz
tar zxvf libevent-1.4.13-stable.tar.gz
./configure
make
sudo make install
and memcached :
wget http://memcached.googlecode.com/files/memcached-1.4.1.tar.gz
tar xzvf memcached-1.4.1.tar.gz
cd memcached-1.4.1
./configure
make
make test
sudo make install
memcached -d -P pidfile -l 127.0.0.1
Both Memcached & libevent ship with a Makefile uninstall target-command. Assuming you still have your previously configured source files; else, you need to run ./configure before running any make commands.
cd memcached-1.4.1
sudo make uninstall
cd ../libevent-1.4.1-stable
sudo make uninstall
Afterward, you should be able to install everything cleanly with Homebrew.