PowerShell Core added to Microsoft repository

Feb 2, 2017 10:05 GMT  ·  By

Microsoft has just announced that installing PowerShell Core on Linux systems is now a lot easier, as the package was published in the company’s own repository available at https://packages.microsoft.com.

Previously, all releases were posted on the GitHub repository, but with this change, installation of PowerShell Core can be initiated using the existing Linux package management tools, including apt-get and yum. The latest version published on Microsoft’s new repository is PowerShell Core 6.0 alpha 15.

The firm says that, in the future, all new releases will be posted at the same time on both repositories, so you can continue using any of them (although most users are likely to stick with Terminal commands).

“After registering the Microsoft repository once as superuser, from then on, you just need to use either sudo apt-get install powershell or sudo yum update powershell (depending on which distro you are using) to update it,” the software giant explains.

Below are the installation instructions for PowerShell Core on Ubuntu 14.04, Ubuntu 16.04, and CentOS, along with a short description of each command:

code
Ubuntu 14.04

# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
# Update apt-get
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
powershell
code
Ubuntu 16.04

# Import the public repository GPG keys
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
# Update apt-get
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
powershell
code

CentOS



# Enter superuser mode
sudo su
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/microsoft.repo
# Exit superuser mode
exit
# Install PowerShell
sudo yum install -y powershell
# Start PowerShell
powershell

Calling for support from the open source community

PowerShell was posted on GitHub in mid-2016 as part of the company’s efforts to move closer to the open source community, making the project available not only on Windows but also on Linux and macOS.

Just like it does with some other projects, Microsoft says that in order to improve PowerShell on Linux, it needs to work close with the community, so it’s calling for Linux users to try it out and then provide feedback on how to improve it in future releases.

“As we move forward, we will work closely with the community to learn and improve our approach to make PowerShell the best tool to manage anything from anywhere. While PowerShell will have been shipping for 10 years on November 14th, in many ways this is the start of a new journey. Your contributions, thoughts and experiences are welcomed and needed,” the firm said last year when releasing PowerShell on GitHub.